linux/drivers/ata
Vincent Pelletier e771451c0a libata: make ata_exec_internal_sg honor DMADIR
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 <csaba.halasz@gmail.com> on linux-ide:
http://marc.info/?l=linux-ide&m=136121147832295&w=2

tj: minor formatting changes.

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org
2013-05-22 08:31:48 +09:00
..
acard-ahci.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
ahci_platform.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
ahci.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
ahci.h libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
ata_generic.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
ata_piix.c ata_piix: add PCI IDs for Intel BayTail 2013-05-16 11:06:29 -07:00
Kconfig [libata] Avoid specialized TLA's in ZPODD's Kconfig 2013-03-04 17:12:46 -05:00
libahci.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
libata-acpi.c ACPI/libata: Restore libata.noacpi support 2013-04-30 18:02:53 -04:00
libata-core.c libata: make ata_exec_internal_sg honor DMADIR 2013-05-22 08:31:48 +09:00
libata-eh.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
libata-pmp.c libata: migrate ACPI code over to new bindings 2012-06-29 11:38:11 -04:00
libata-scsi.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
libata-sff.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
libata-transport.c Revert "libata: export host controller number thru /sys" 2013-01-25 15:30:23 -05:00
libata-transport.h [libata] Add ATA transport class 2010-10-21 20:21:03 -04:00
libata-zpodd.c [libata] fix smatch warning for zpodd_wake_dev 2013-02-20 17:14:03 -05:00
libata.h libata: handle power transition of ODD 2013-01-21 15:41:56 -05:00
Makefile libata: add R-Car SATA driver 2013-02-20 17:10:53 -05:00
pata_acpi.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_ali.c pata_ali: fix "Satelite" typo 2011-10-14 13:10:42 -04:00
pata_amd.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_arasan_cf.c ata: arasan: remove the need for platform_data 2013-04-19 22:25:51 +02:00
pata_artop.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_at32.c pata_at32: use module_platform_driver_probe() 2013-04-03 19:52:10 -04:00
pata_at91.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_atiixp.c pata_atiixp: override cable detection on MSI E350DM-E33 2012-08-17 13:26:51 -04:00
pata_atp867x.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_bf54x.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_cmd64x.c ata: Convert dev_printk(KERN_<LEVEL> to dev_<level>( 2012-11-28 12:40:15 -05:00
pata_cmd640.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_cs5520.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_cs5530.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_cs5535.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_cs5536.c pata_cs5536: add quirk for broken udma 2012-11-28 12:38:41 -05:00
pata_cypress.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_efar.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_ep93xx.c [libata] Convert to devm_ioremap_resource() 2013-02-20 17:13:10 -05:00
pata_hpt3x2n.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_hpt3x3.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_hpt37x.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_hpt366.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_icside.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_imx.c pata_imx: add devicetree support 2013-04-11 19:38:00 -04:00
pata_isapnp.c
pata_it821x.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_it8213.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_ixp4xx_cf.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_jmicron.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_legacy.c pata_legacy: bogus clock in opti82c46x_set_piomode() 2013-04-03 19:53:10 -04:00
pata_macio.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_marvell.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_mpc52xx.c Merge remote-tracking branch 'agust/next' into next 2013-02-20 11:39:05 +11:00
pata_mpiix.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_netcell.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_ninja32.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_ns87410.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_ns87415.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_octeon_cf.c pata_octeon_cf: Use resource_size function 2013-04-03 19:53:30 -04:00
pata_of_platform.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_oldpiix.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_opti.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_optidma.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_palmld.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_pcmcia.c drivers/ata: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:26:03 -07:00
pata_pdc202xx_old.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_pdc2027x.c pata_pdc2027x: Fix compiler warning 2013-04-12 15:24:12 +02:00
pata_piccolo.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_platform.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_pxa.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_radisys.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_rb532_cf.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_rdc.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_rz1000.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_samsung_cf.c pata_samsung_cf: use module_platform_driver_probe() 2013-03-04 17:12:52 -05:00
pata_sc1200.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_scc.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_sch.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_serverworks.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_sil680.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pata_sis.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_sl82c105.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_triflex.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pata_via.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
pdc_adma.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
sata_dwc_460ex.c sata_dwc_460ex: remove file exec bit (chmod 0755 -> 0644) 2012-12-14 09:43:39 -05:00
sata_fsl.c 1) More ACPI fixes, cleanups 2013-04-30 16:13:36 -07:00
sata_highbank.c sata_highbank: Rename proc_name to the module name 2013-04-30 18:02:56 -04:00
sata_inic162x.c sata_inic162x: remove unused variable in inic_scr_read() 2012-11-28 12:39:09 -05:00
sata_mv.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
sata_nv.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
sata_promise.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
sata_promise.h
sata_qstor.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
sata_rcar.c sata_rcar: Convert to devm_ioremap_resource() 2013-04-11 19:34:48 -04:00
sata_sil.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
sata_sil24.c sata_sil24: remove unused variable from sata_sil24.c 2012-11-28 12:39:20 -05:00
sata_sis.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
sata_svw.c sata_svw: switch to ->show_info() 2013-04-09 14:13:28 -04:00
sata_sx4.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
sata_uli.c ata: use module_pci_driver 2012-07-25 15:12:11 -04:00
sata_via.c libata: update "Maintained by:" tags 2013-05-14 11:13:04 -07:00
sata_vsc.c Drivers: ata: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
sis.h