Skip to content

Commit cdc5ffc

Browse files
committed
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
2 parents 3b99107 + 120357e commit cdc5ffc

File tree

9 files changed

+51
-15
lines changed

9 files changed

+51
-15
lines changed

drivers/ata/acard-ahci.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ static int acard_ahci_port_start(struct ata_port *ap)
344344
mem = dmam_alloc_coherent(dev, dma_sz, &mem_dma, GFP_KERNEL);
345345
if (!mem)
346346
return -ENOMEM;
347-
memset(mem, 0, dma_sz);
348347

349348
/*
350349
* First item in chunk of DMA memory: 32-slot command table,

drivers/ata/ahci_sunxi.c

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,51 @@ static void ahci_sunxi_start_engine(struct ata_port *ap)
149149
void __iomem *port_mmio = ahci_port_base(ap);
150150
struct ahci_host_priv *hpriv = ap->host->private_data;
151151

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);
154197

155198
/* Start DMA */
156199
sunxi_setbits(port_mmio + PORT_CMD, PORT_CMD_START);

drivers/ata/libahci.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,6 @@ static int ahci_port_start(struct ata_port *ap)
23652365
mem = dmam_alloc_coherent(dev, dma_sz, &mem_dma, GFP_KERNEL);
23662366
if (!mem)
23672367
return -ENOMEM;
2368-
memset(mem, 0, dma_sz);
23692368

23702369
/*
23712370
* First item in chunk of DMA memory: 32-slot command table,

drivers/ata/libata-core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4462,9 +4462,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
44624462

44634463
/* drives which fail FPDMA_AA activation (some may freeze afterwards)
44644464
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 |
44684466
ATA_HORKAGE_NOLPM, },
44694467
{ "VB0250EAVER", "HPG7", ATA_HORKAGE_BROKEN_FPDMA_AA },
44704468

drivers/ata/libata-eh.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ static int ata_eh_read_log_10h(struct ata_device *dev,
14691469
tf->hob_lbah = buf[10];
14701470
tf->nsect = buf[12];
14711471
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))
14731473
tf->auxiliary = buf[14] << 16 | buf[15] << 8 | buf[16];
14741474

14751475
return 0;
@@ -1716,7 +1716,8 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
17161716
memcpy(&qc->result_tf, &tf, sizeof(tf));
17171717
qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48;
17181718
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)) {
17201721
char sense_key, asc, ascq;
17211722

17221723
sense_key = (qc->result_tf.auxiliary >> 16) & 0xff;
@@ -1770,10 +1771,11 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
17701771
}
17711772

17721773
switch (qc->dev->class) {
1773-
case ATA_DEV_ATA:
17741774
case ATA_DEV_ZAC:
17751775
if (stat & ATA_SENSE)
17761776
ata_eh_request_sense(qc, qc->scsicmd);
1777+
/* fall through */
1778+
case ATA_DEV_ATA:
17771779
if (err & ATA_ICRC)
17781780
qc->err_mask |= AC_ERR_ATA_BUS;
17791781
if (err & (ATA_UNC | ATA_AMNF))

drivers/ata/pdc_adma.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,6 @@ static int adma_port_start(struct ata_port *ap)
550550
(u32)pp->pkt_dma);
551551
return -ENOMEM;
552552
}
553-
memset(pp->pkt, 0, ADMA_PKT_BYTES);
554553
ap->private_data = pp;
555554
adma_reinit_engine(ap);
556555
return 0;

drivers/ata/sata_nv.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,6 @@ static int nv_adma_port_start(struct ata_port *ap)
11361136
&mem_dma, GFP_KERNEL);
11371137
if (!mem)
11381138
return -ENOMEM;
1139-
memset(mem, 0, NV_ADMA_PORT_PRIV_DMA_SZ);
11401139

11411140
/*
11421141
* First item in chunk of DMA memory:
@@ -1946,7 +1945,6 @@ static int nv_swncq_port_start(struct ata_port *ap)
19461945
&pp->prd_dma, GFP_KERNEL);
19471946
if (!pp->prd)
19481947
return -ENOMEM;
1949-
memset(pp->prd, 0, ATA_PRD_TBL_SZ * ATA_MAX_QUEUE);
19501948

19511949
ap->private_data = pp;
19521950
pp->sactive_block = ap->ioaddr.scr_addr + 4 * SCR_ACTIVE;

drivers/ata/sata_qstor.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ static int qs_port_start(struct ata_port *ap)
477477
GFP_KERNEL);
478478
if (!pp->pkt)
479479
return -ENOMEM;
480-
memset(pp->pkt, 0, QS_PKT_BYTES);
481480
ap->private_data = pp;
482481

483482
qs_enter_reg_mode(ap);

drivers/ata/sata_sil24.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,6 @@ static int sil24_port_start(struct ata_port *ap)
12021202
cb = dmam_alloc_coherent(dev, cb_size, &cb_dma, GFP_KERNEL);
12031203
if (!cb)
12041204
return -ENOMEM;
1205-
memset(cb, 0, cb_size);
12061205

12071206
pp->cmd_block = cb;
12081207
pp->cmd_block_dma = cb_dma;

0 commit comments

Comments
 (0)