Skip to content

Commit 3a5879d

Browse files
committed
Merge tag 'ata-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux
Pull ata updates from Niklas Cassel: - Fix an incorrect link_power_management_policy sysfs attribute value. We were previously using the same attribute value for two different LPM policies (me) - Add a ASMedia ASM1166 quirk. The SATA host controller always reports that it has 32 ports, even though it only has six ports. Add a quirk that overrides the value reported by the controller (Conrad) - Add a ASMedia ASM1061 quirk. The SATA host controller completely ignores the upper 21 bits of the DMA address. This causes IOMMU error events when a (valid) DMA address actually has any of the upper 21 bits set. Add a quirk that limits the dma_mask to 43-bits (Lennert) * tag 'ata-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux: ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers ahci: asm1166: correct count of reported ports ata: libata-sata: improve sysfs description for ATA_LPM_UNKNOWN
2 parents 914e170 + 20730e9 commit 3a5879d

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

drivers/ata/ahci.c

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ enum {
4848
enum board_ids {
4949
/* board IDs by feature in alphabetical order */
5050
board_ahci,
51+
board_ahci_43bit_dma,
5152
board_ahci_ign_iferr,
5253
board_ahci_low_power,
5354
board_ahci_no_debounce_delay,
@@ -128,6 +129,13 @@ static const struct ata_port_info ahci_port_info[] = {
128129
.udma_mask = ATA_UDMA6,
129130
.port_ops = &ahci_ops,
130131
},
132+
[board_ahci_43bit_dma] = {
133+
AHCI_HFLAGS (AHCI_HFLAG_43BIT_ONLY),
134+
.flags = AHCI_FLAG_COMMON,
135+
.pio_mask = ATA_PIO4,
136+
.udma_mask = ATA_UDMA6,
137+
.port_ops = &ahci_ops,
138+
},
131139
[board_ahci_ign_iferr] = {
132140
AHCI_HFLAGS (AHCI_HFLAG_IGN_IRQ_IF_ERR),
133141
.flags = AHCI_FLAG_COMMON,
@@ -597,11 +605,11 @@ static const struct pci_device_id ahci_pci_tbl[] = {
597605
{ PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */
598606
{ PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */
599607

600-
/* Asmedia */
608+
/* ASMedia */
601609
{ PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */
602610
{ PCI_VDEVICE(ASMEDIA, 0x0602), board_ahci }, /* ASM1060 */
603-
{ PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */
604-
{ PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */
611+
{ PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci_43bit_dma }, /* ASM1061 */
612+
{ PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci_43bit_dma }, /* ASM1061/1062 */
605613
{ PCI_VDEVICE(ASMEDIA, 0x0621), board_ahci }, /* ASM1061R */
606614
{ PCI_VDEVICE(ASMEDIA, 0x0622), board_ahci }, /* ASM1062R */
607615
{ PCI_VDEVICE(ASMEDIA, 0x0624), board_ahci }, /* ASM1062+JMB575 */
@@ -663,6 +671,11 @@ MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets");
663671
static void ahci_pci_save_initial_config(struct pci_dev *pdev,
664672
struct ahci_host_priv *hpriv)
665673
{
674+
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && pdev->device == 0x1166) {
675+
dev_info(&pdev->dev, "ASM1166 has only six ports\n");
676+
hpriv->saved_port_map = 0x3f;
677+
}
678+
666679
if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) {
667680
dev_info(&pdev->dev, "JMB361 has only one port\n");
668681
hpriv->saved_port_map = 1;
@@ -949,11 +962,20 @@ static int ahci_pci_device_resume(struct device *dev)
949962

950963
#endif /* CONFIG_PM */
951964

952-
static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
965+
static int ahci_configure_dma_masks(struct pci_dev *pdev,
966+
struct ahci_host_priv *hpriv)
953967
{
954-
const int dma_bits = using_dac ? 64 : 32;
968+
int dma_bits;
955969
int rc;
956970

971+
if (hpriv->cap & HOST_CAP_64) {
972+
dma_bits = 64;
973+
if (hpriv->flags & AHCI_HFLAG_43BIT_ONLY)
974+
dma_bits = 43;
975+
} else {
976+
dma_bits = 32;
977+
}
978+
957979
/*
958980
* If the device fixup already set the dma_mask to some non-standard
959981
* value, don't extend it here. This happens on STA2X11, for example.
@@ -1926,7 +1948,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
19261948
ahci_gtf_filter_workaround(host);
19271949

19281950
/* initialize adapter */
1929-
rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64);
1951+
rc = ahci_configure_dma_masks(pdev, hpriv);
19301952
if (rc)
19311953
return rc;
19321954

drivers/ata/ahci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ enum {
247247
AHCI_HFLAG_SUSPEND_PHYS = BIT(26), /* handle PHYs during
248248
suspend/resume */
249249
AHCI_HFLAG_NO_SXS = BIT(28), /* SXS not supported */
250+
AHCI_HFLAG_43BIT_ONLY = BIT(29), /* 43bit DMA addr limit */
250251

251252
/* ap->flags bits */
252253

drivers/ata/libata-sata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ bool sata_lpm_ignore_phy_events(struct ata_link *link)
784784
EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events);
785785

786786
static const char *ata_lpm_policy_names[] = {
787-
[ATA_LPM_UNKNOWN] = "max_performance",
787+
[ATA_LPM_UNKNOWN] = "keep_firmware_settings",
788788
[ATA_LPM_MAX_POWER] = "max_performance",
789789
[ATA_LPM_MED_POWER] = "medium_power",
790790
[ATA_LPM_MED_POWER_WITH_DIPM] = "med_power_with_dipm",

include/linux/libata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ enum ata_completion_errors {
471471

472472
/*
473473
* Link power management policy: If you alter this, you also need to
474-
* alter libata-scsi.c (for the ascii descriptions)
474+
* alter libata-sata.c (for the ascii descriptions)
475475
*/
476476
enum ata_lpm_policy {
477477
ATA_LPM_UNKNOWN,

0 commit comments

Comments
 (0)