From: Greg Kroah-Hartman Date: Tue, 4 Jun 2013 04:42:55 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.81~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=82526d5410d5189f5590c6c7bd7fbd57fbf39ce0;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: libata-make-ata_exec_internal_sg-honor-dmadir.patch --- diff --git a/queue-3.0/libata-make-ata_exec_internal_sg-honor-dmadir.patch b/queue-3.0/libata-make-ata_exec_internal_sg-honor-dmadir.patch new file mode 100644 index 00000000000..7ed03e5aaea --- /dev/null +++ b/queue-3.0/libata-make-ata_exec_internal_sg-honor-dmadir.patch @@ -0,0 +1,90 @@ +From e771451c0a831d96a7c14b0ca8a8ec671d98567b Mon Sep 17 00:00:00 2001 +From: Vincent Pelletier +Date: Sat, 18 May 2013 18:44:04 +0200 +Subject: libata: make ata_exec_internal_sg honor DMADIR + +From: Vincent Pelletier + +commit e771451c0a831d96a7c14b0ca8a8ec671d98567b upstream. + +libata honors DMADIR for regular commands, but not for internal commands +used (among other) during device initialisation. + +This makes SATA-host-to-PATA-device bridges based on Silicon Image SiL3611 +(such as "Abit Serillel 2") end up disabled when used with an ATAPI device +after a few tries. + +Log output of the bridge being hot-plugged with an ATAPI drive: + + [ 9631.212901] ata1: exception Emask 0x10 SAct 0x0 SErr 0x40c0000 action 0xe frozen + [ 9631.212913] ata1: irq_stat 0x00000040, connection status changed + [ 9631.212923] ata1: SError: { CommWake 10B8B DevExch } + [ 9631.212939] ata1: hard resetting link + [ 9632.104962] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300) + [ 9632.106393] ata1.00: ATAPI: PIONEER DVD-RW DVR-115, 1.06, max UDMA/33 + [ 9632.106407] ata1.00: applying bridge limits + [ 9632.108151] ata1.00: configured for UDMA/33 + [ 9637.105303] ata1.00: qc timeout (cmd 0xa0) + [ 9637.105324] ata1.00: failed to clear UNIT ATTENTION (err_mask=0x5) + [ 9637.105335] ata1: hard resetting link + [ 9638.044599] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300) + [ 9638.047878] ata1.00: configured for UDMA/33 + [ 9643.044933] ata1.00: qc timeout (cmd 0xa0) + [ 9643.044953] ata1.00: failed to clear UNIT ATTENTION (err_mask=0x5) + [ 9643.044963] ata1: limiting SATA link speed to 1.5 Gbps + [ 9643.044971] ata1.00: limiting speed to UDMA/33:PIO3 + [ 9643.044979] ata1: hard resetting link + [ 9643.984225] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310) + [ 9643.987471] ata1.00: configured for UDMA/33 + [ 9648.984591] ata1.00: qc timeout (cmd 0xa0) + [ 9648.984612] ata1.00: failed to clear UNIT ATTENTION (err_mask=0x5) + [ 9648.984619] ata1.00: disabled + [ 9649.000593] ata1: hard resetting link + [ 9649.939902] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310) + [ 9649.955864] ata1: EH complete + +With this patch, the drive enumerates correctly when libata is loaded with +atapi_dmadir=1: + + [ 9891.810863] ata1: exception Emask 0x10 SAct 0x0 SErr 0x40c0000 action 0xe frozen + [ 9891.810874] ata1: irq_stat 0x00000040, connection status changed + [ 9891.810884] ata1: SError: { CommWake 10B8B DevExch } + [ 9891.810900] ata1: hard resetting link + [ 9892.762105] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300) + [ 9892.763544] ata1.00: ATAPI: PIONEER DVD-RW DVR-115, 1.06, max UDMA/33, DMADIR + [ 9892.763558] ata1.00: applying bridge limits + [ 9892.765393] ata1.00: configured for UDMA/33 + [ 9892.786063] ata1: EH complete + [ 9892.792062] scsi 0:0:0:0: CD-ROM PIONEER DVD-RW DVR-115 1.06 PQ: 0 ANSI: 5 + [ 9892.798455] sr2: scsi3-mmc drive: 12x/12x writer dvd-ram cd/rw xa/form2 cdda tray + [ 9892.798837] sr 0:0:0:0: Attached scsi CD-ROM sr2 + [ 9892.799109] sr 0:0:0:0: Attached scsi generic sg6 type 5 + +Based on a patch by Csaba Halász on linux-ide: +http://marc.info/?l=linux-ide&m=136121147832295&w=2 + +tj: minor formatting changes. + +Signed-off-by: Vincent Pelletier +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-core.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/ata/libata-core.c ++++ b/drivers/ata/libata-core.c +@@ -1599,6 +1599,12 @@ unsigned ata_exec_internal_sg(struct ata + qc->tf = *tf; + if (cdb) + memcpy(qc->cdb, cdb, ATAPI_CDB_LEN); ++ ++ /* some SATA bridges need us to indicate data xfer direction */ ++ if (tf->protocol == ATAPI_PROT_DMA && (dev->flags & ATA_DFLAG_DMADIR) && ++ dma_dir == DMA_FROM_DEVICE) ++ qc->tf.feature |= ATAPI_DMADIR; ++ + qc->flags |= ATA_QCFLAG_RESULT_TF; + qc->dma_dir = dma_dir; + if (dma_dir != DMA_NONE) { diff --git a/queue-3.0/series b/queue-3.0/series index c84587e6f51..7582d646236 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -24,3 +24,4 @@ um-serve-io_remap_pfn_range.patch drm-radeon-fix-card_posted-check-for-newer-asics.patch cifs-fix-potential-buffer-overrun-when-composing-a-new-options-string.patch usb-io_ti-fix-null-dereference-in-chase_port.patch +libata-make-ata_exec_internal_sg-honor-dmadir.patch