Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-5.3/libata-20190708' of git://git.kernel.dk/linux-block

Pull libata updates from Jens Axboe:
"These are the changes that are reviewed, tested, and queued up for
this merge window. This contains:

- Removal of redundant memset after dmam_alloc_coherent (Fuqian)

- Expand blacklist check for ST1000LM024, making it independent of
firmware version (Hans)

- Request sense fix (Tejun)

- ahci_sunxi FIFO fix (Uenal)"

* tag 'for-5.3/libata-20190708' of git://git.kernel.dk/linux-block:
drivers: ata: ahci_sunxi: Increased SATA/AHCI DMA TX/RX FIFOs
libata: Drop firmware version check from the ST1000LM024 quirk
ata: sata_sil24: Remove call to memset after dmam_alloc_coherent
ata:sata_qstor: Remove call to memset after dmam_alloc_coherent
ata: sata_nv: Remove call to memset after dmam_alloc_coherent
ata: pdc_adma: Remove call to memset after dmam_alloc_coherent
ata: libahci: Remove call to memset after dmam_alloc_coherent
ata: acard-ahci: Remove call to memset after dmam_alloc_coherent
libata: don't request sense data on !ZAC ATA devices

+51 -15
-1
drivers/ata/acard-ahci.c
··· 344 344 mem = dmam_alloc_coherent(dev, dma_sz, &mem_dma, GFP_KERNEL); 345 345 if (!mem) 346 346 return -ENOMEM; 347 - memset(mem, 0, dma_sz); 348 347 349 348 /* 350 349 * First item in chunk of DMA memory: 32-slot command table,
+45 -2
drivers/ata/ahci_sunxi.c
··· 149 149 void __iomem *port_mmio = ahci_port_base(ap); 150 150 struct ahci_host_priv *hpriv = ap->host->private_data; 151 151 152 - /* Setup DMA before DMA start */ 153 - sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ff00, 0x00004400); 152 + /* Setup DMA before DMA start 153 + * 154 + * NOTE: A similar SoC with SATA/AHCI by Texas Instruments documents 155 + * this Vendor Specific Port (P0DMACR, aka PxDMACR) in its 156 + * User's Guide document (TMS320C674x/OMAP-L1x Processor 157 + * Serial ATA (SATA) Controller, Literature Number: SPRUGJ8C, 158 + * March 2011, Chapter 4.33 Port DMA Control Register (P0DMACR), 159 + * p.68, https://www.ti.com/lit/ug/sprugj8c/sprugj8c.pdf) 160 + * as equivalent to the following struct: 161 + * 162 + * struct AHCI_P0DMACR_t 163 + * { 164 + * unsigned TXTS : 4; 165 + * unsigned RXTS : 4; 166 + * unsigned TXABL : 4; 167 + * unsigned RXABL : 4; 168 + * unsigned Reserved : 16; 169 + * }; 170 + * 171 + * TXTS: Transmit Transaction Size (TX_TRANSACTION_SIZE). 172 + * This field defines the DMA transaction size in DWORDs for 173 + * transmit (system bus read, device write) operation. [...] 174 + * 175 + * RXTS: Receive Transaction Size (RX_TRANSACTION_SIZE). 176 + * This field defines the Port DMA transaction size in DWORDs 177 + * for receive (system bus write, device read) operation. [...] 178 + * 179 + * TXABL: Transmit Burst Limit. 180 + * This field allows software to limit the VBUSP master read 181 + * burst size. [...] 182 + * 183 + * RXABL: Receive Burst Limit. 184 + * Allows software to limit the VBUSP master write burst 185 + * size. [...] 186 + * 187 + * Reserved: Reserved. 188 + * 189 + * 190 + * NOTE: According to the above document, the following alternative 191 + * to the code below could perhaps be a better option 192 + * (or preparation) for possible further improvements later: 193 + * sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ffff, 194 + * 0x00000033); 195 + */ 196 + sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ffff, 0x00004433); 154 197 155 198 /* Start DMA */ 156 199 sunxi_setbits(port_mmio + PORT_CMD, PORT_CMD_START);
-1
drivers/ata/libahci.c
··· 2365 2365 mem = dmam_alloc_coherent(dev, dma_sz, &mem_dma, GFP_KERNEL); 2366 2366 if (!mem) 2367 2367 return -ENOMEM; 2368 - memset(mem, 0, dma_sz); 2369 2368 2370 2369 /* 2371 2370 * First item in chunk of DMA memory: 32-slot command table,
+1 -3
drivers/ata/libata-core.c
··· 4462 4462 4463 4463 /* drives which fail FPDMA_AA activation (some may freeze afterwards) 4464 4464 the ST disks also have LPM issues */ 4465 - { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA | 4466 - ATA_HORKAGE_NOLPM, }, 4467 - { "ST1000LM024 HN-M101MBB", "2BA30001", ATA_HORKAGE_BROKEN_FPDMA_AA | 4465 + { "ST1000LM024 HN-M101MBB", NULL, ATA_HORKAGE_BROKEN_FPDMA_AA | 4468 4466 ATA_HORKAGE_NOLPM, }, 4469 4467 { "VB0250EAVER", "HPG7", ATA_HORKAGE_BROKEN_FPDMA_AA }, 4470 4468
+5 -3
drivers/ata/libata-eh.c
··· 1469 1469 tf->hob_lbah = buf[10]; 1470 1470 tf->nsect = buf[12]; 1471 1471 tf->hob_nsect = buf[13]; 1472 - if (ata_id_has_ncq_autosense(dev->id)) 1472 + if (dev->class == ATA_DEV_ZAC && ata_id_has_ncq_autosense(dev->id)) 1473 1473 tf->auxiliary = buf[14] << 16 | buf[15] << 8 | buf[16]; 1474 1474 1475 1475 return 0; ··· 1716 1716 memcpy(&qc->result_tf, &tf, sizeof(tf)); 1717 1717 qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48; 1718 1718 qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ; 1719 - if ((qc->result_tf.command & ATA_SENSE) || qc->result_tf.auxiliary) { 1719 + if (dev->class == ATA_DEV_ZAC && 1720 + ((qc->result_tf.command & ATA_SENSE) || qc->result_tf.auxiliary)) { 1720 1721 char sense_key, asc, ascq; 1721 1722 1722 1723 sense_key = (qc->result_tf.auxiliary >> 16) & 0xff; ··· 1771 1770 } 1772 1771 1773 1772 switch (qc->dev->class) { 1774 - case ATA_DEV_ATA: 1775 1773 case ATA_DEV_ZAC: 1776 1774 if (stat & ATA_SENSE) 1777 1775 ata_eh_request_sense(qc, qc->scsicmd); 1776 + /* fall through */ 1777 + case ATA_DEV_ATA: 1778 1778 if (err & ATA_ICRC) 1779 1779 qc->err_mask |= AC_ERR_ATA_BUS; 1780 1780 if (err & (ATA_UNC | ATA_AMNF))
-1
drivers/ata/pdc_adma.c
··· 550 550 (u32)pp->pkt_dma); 551 551 return -ENOMEM; 552 552 } 553 - memset(pp->pkt, 0, ADMA_PKT_BYTES); 554 553 ap->private_data = pp; 555 554 adma_reinit_engine(ap); 556 555 return 0;
-2
drivers/ata/sata_nv.c
··· 1136 1136 &mem_dma, GFP_KERNEL); 1137 1137 if (!mem) 1138 1138 return -ENOMEM; 1139 - memset(mem, 0, NV_ADMA_PORT_PRIV_DMA_SZ); 1140 1139 1141 1140 /* 1142 1141 * First item in chunk of DMA memory: ··· 1945 1946 &pp->prd_dma, GFP_KERNEL); 1946 1947 if (!pp->prd) 1947 1948 return -ENOMEM; 1948 - memset(pp->prd, 0, ATA_PRD_TBL_SZ * ATA_MAX_QUEUE); 1949 1949 1950 1950 ap->private_data = pp; 1951 1951 pp->sactive_block = ap->ioaddr.scr_addr + 4 * SCR_ACTIVE;
-1
drivers/ata/sata_qstor.c
··· 477 477 GFP_KERNEL); 478 478 if (!pp->pkt) 479 479 return -ENOMEM; 480 - memset(pp->pkt, 0, QS_PKT_BYTES); 481 480 ap->private_data = pp; 482 481 483 482 qs_enter_reg_mode(ap);
-1
drivers/ata/sata_sil24.c
··· 1202 1202 cb = dmam_alloc_coherent(dev, cb_size, &cb_dma, GFP_KERNEL); 1203 1203 if (!cb) 1204 1204 return -ENOMEM; 1205 - memset(cb, 0, cb_size); 1206 1205 1207 1206 pp->cmd_block = cb; 1208 1207 pp->cmd_block_dma = cb_dma;