History

Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: libata: implement dump_id force param libata: disable ATAPI AN by default libata-sff: make BMDMA optional libata-sff: kill dummy BMDMA ops from sata_qstor and pata_octeon_cf libata-sff: separate out BMDMA init libata-sff: separate out BMDMA irq handler libata-sff: ata_sff_irq_clear() is BMDMA specific sata_mv: drop unncessary EH callback resetting

Linus Torvalds committed 16 years ago

Commit aa36c7b2 parents 9dda696 43c9c5962 files · +720 −519Browse files

Unified · Split

62 files
  1. Documentation/kernel-parameters.txt +2 −0
  2. drivers/ata/Kconfig +268 −243
  3. drivers/ata/Makefile +46 −37
  4. drivers/ata/ata_generic.c +1 −1
  5. drivers/ata/ata_piix.c +2 −2
  6. drivers/ata/libata-core.c +15 −1
  7. drivers/ata/libata-sff.c +288 −128
  8. drivers/ata/pata_acpi.c +1 −1
  9. drivers/ata/pata_ali.c +4 −1
  10. drivers/ata/pata_amd.c +1 −1
  11. drivers/ata/pata_artop.c +1 −1
  12. drivers/ata/pata_atiixp.c +2 −2
  13. drivers/ata/pata_atp867x.c +1 −1
  14. drivers/ata/pata_bf54x.c +1 −1
  15. drivers/ata/pata_cmd64x.c +1 −1
  16. drivers/ata/pata_cs5520.c +1 −1
  17. drivers/ata/pata_cs5530.c +1 −1
  18. drivers/ata/pata_cs5535.c +1 −1
  19. drivers/ata/pata_cs5536.c +1 −1
  20. drivers/ata/pata_cypress.c +1 −1
  21. drivers/ata/pata_efar.c +2 −2
  22. drivers/ata/pata_hpt366.c +1 −1
  23. drivers/ata/pata_hpt37x.c +1 −1
  24. drivers/ata/pata_hpt3x2n.c +1 −1
  25. drivers/ata/pata_hpt3x3.c +1 −1
  26. drivers/ata/pata_icside.c +1 −1
  27. drivers/ata/pata_it8213.c +1 −1
  28. drivers/ata/pata_it821x.c +1 −1
  29. drivers/ata/pata_jmicron.c +1 −1
  30. drivers/ata/pata_macio.c +1 −1
  31. drivers/ata/pata_marvell.c +1 −1
  32. drivers/ata/pata_mpc52xx.c +1 −1
  33. drivers/ata/pata_netcell.c +1 −1
  34. drivers/ata/pata_ninja32.c +1 −1
  35. drivers/ata/pata_ns87415.c +1 −1
  36. drivers/ata/pata_octeon_cf.c +0 −18
  37. drivers/ata/pata_oldpiix.c +1 −1
  38. drivers/ata/pata_optidma.c +1 −1
  39. drivers/ata/pata_pdc2027x.c +1 −1
  40. drivers/ata/pata_pdc202xx_old.c +1 −1
  41. drivers/ata/pata_piccolo.c +1 −1
  42. drivers/ata/pata_radisys.c +1 −1
  43. drivers/ata/pata_rdc.c +2 −2
  44. drivers/ata/pata_sc1200.c +1 −1
  45. drivers/ata/pata_scc.c +2 −2
  46. drivers/ata/pata_sch.c +1 −1
  47. drivers/ata/pata_serverworks.c +1 −1
  48. drivers/ata/pata_sil680.c +2 −2
  49. drivers/ata/pata_sis.c +1 −1
  50. drivers/ata/pata_sl82c105.c +1 −1
  51. drivers/ata/pata_triflex.c +1 −1
  52. drivers/ata/pata_via.c +1 −1
  53. drivers/ata/sata_mv.c +1 −3
  54. drivers/ata/sata_nv.c +4 −4
  55. drivers/ata/sata_qstor.c +1 −15
  56. drivers/ata/sata_sil.c +2 −2
  57. drivers/ata/sata_sis.c +2 −2
  58. drivers/ata/sata_svw.c +1 −1
  59. drivers/ata/sata_uli.c +1 −1
  60. drivers/ata/sata_via.c +4 −4
  61. drivers/ata/sata_vsc.c +1 −1
  62. include/linux/libata.h +29 −7
Documentation/kernel-parameters.txt+2−0
@@ -1252,6 +1252,8 @@ and is between 256 and 4096 characters. It is defined in the file · 1251 unmodified lines
12521252 * nohrst, nosrst, norst: suppress hard, soft
12531253 and both resets.
12541254
1255+ * dump_id: dump IDENTIFY data.
1256+
12551257 If there are multiple matching configurations changing
12561258 the same attribute, the last one is used.
12571259
drivers/ata/Kconfig+268−243
@@ -57,6 +57,8 @@ config SATA_PMP · 56 unmodified lines
5757 This option adds support for SATA Port Multipliers
5858 (the SATA version of an ethernet hub, or SAS expander).
5959
60+comment "Controllers with non-SFF native interface"
61+
6062 config SATA_AHCI
6163 tristate "AHCI SATA support"
6264 depends on PCI
@@ -73,11 +75,12 @@ config SATA_AHCI_PLATFORM · 10 unmodified lines
7375
7476 If unsure, say N.
7577
76−config SATA_SIL24
77− tristate "Silicon Image 3124/3132 SATA support"
78− depends on PCI
78+config SATA_FSL
79+ tristate "Freescale 3.0Gbps SATA support"
80+ depends on FSL_SOC
7981 help
80− This option enables support for Silicon Image 3124/3132 Serial ATA.
82+ This option enables support for Freescale 3.0Gbps SATA controller.
83+ It can be found on MPC837x and MPC8315.
8184
8285 If unsure, say N.
8386
@@ -87,12 +90,11 @@ config SATA_INIC162X · 3 unmodified lines
8790 help
8891 This option enables support for Initio 162x Serial ATA.
8992
90−config SATA_FSL
91− tristate "Freescale 3.0Gbps SATA support"
92− depends on FSL_SOC
93+config SATA_SIL24
94+ tristate "Silicon Image 3124/3132 SATA support"
95+ depends on PCI
9396 help
94− This option enables support for Freescale 3.0Gbps SATA controller.
95− It can be found on MPC837x and MPC8315.
97+ This option enables support for Silicon Image 3124/3132 Serial ATA.
9698
9799 If unsure, say N.
98100
@@ -116,15 +118,65 @@ config ATA_SFF · 17 unmodified lines
116118
117119 if ATA_SFF
118120
119−config SATA_SVW
120− tristate "ServerWorks Frodo / Apple K2 SATA support"
121+comment "SFF controllers with custom DMA interface"
122+
123+config PDC_ADMA
124+ tristate "Pacific Digital ADMA support"
121125 depends on PCI
122126 help
123− This option enables support for Broadcom/Serverworks/Apple K2
124− SATA support.
127+ This option enables support for Pacific Digital ADMA controllers
128+
129+ If unsure, say N.
130+
131+config PATA_MPC52xx
132+ tristate "Freescale MPC52xx SoC internal IDE"
133+ depends on PPC_MPC52xx && PPC_BESTCOMM
134+ select PPC_BESTCOMM_ATA
135+ help
136+ This option enables support for integrated IDE controller
137+ of the Freescale MPC52xx SoC.
138+
139+ If unsure, say N.
140+
141+config PATA_OCTEON_CF
142+ tristate "OCTEON Boot Bus Compact Flash support"
143+ depends on CPU_CAVIUM_OCTEON
144+ help
145+ This option enables a polled compact flash driver for use with
146+ compact flash cards attached to the OCTEON boot bus.
147+
148+ If unsure, say N.
149+
150+config SATA_QSTOR
151+ tristate "Pacific Digital SATA QStor support"
152+ depends on PCI
153+ help
154+ This option enables support for Pacific Digital Serial ATA QStor.
155+
156+ If unsure, say N.
157+
158+config SATA_SX4
159+ tristate "Promise SATA SX4 support (Experimental)"
160+ depends on PCI && EXPERIMENTAL
161+ help
162+ This option enables support for Promise Serial ATA SX4.
125163
126164 If unsure, say N.
127165
166+config ATA_BMDMA
167+ bool "ATA BMDMA support"
168+ default y
169+ help
170+ This option adds support for SFF ATA controllers with BMDMA
171+ capability. BMDMA stands for bus-master DMA and the
172+ de-facto DMA interface for SFF controllers.
173+
174+ If unuser, say Y.
175+
176+if ATA_BMDMA
177+
178+comment "SATA SFF controllers with BMDMA"
179+
128180 config ATA_PIIX
129181 tristate "Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support"
130182 depends on PCI
@@ -152,22 +204,6 @@ config SATA_NV · 21 unmodified lines
152204
153205 If unsure, say N.
154206
155−config PDC_ADMA
156− tristate "Pacific Digital ADMA support"
157− depends on PCI
158− help
159− This option enables support for Pacific Digital ADMA controllers
160−
161− If unsure, say N.
162−
163−config SATA_QSTOR
164− tristate "Pacific Digital SATA QStor support"
165− depends on PCI
166− help
167− This option enables support for Pacific Digital Serial ATA QStor.
168−
169− If unsure, say N.
170−
171207 config SATA_PROMISE
172208 tristate "Promise SATA TX2/TX4 support"
173209 depends on PCI
@@ -176,14 +212,6 @@ config SATA_PROMISE · 2 unmodified lines
176212
177213 If unsure, say N.
178214
179−config SATA_SX4
180− tristate "Promise SATA SX4 support (Experimental)"
181− depends on PCI && EXPERIMENTAL
182− help
183− This option enables support for Promise Serial ATA SX4.
184−
185− If unsure, say N.
186−
187215 config SATA_SIL
188216 tristate "Silicon Image SATA support"
189217 depends on PCI
@@ -203,6 +231,15 @@ config SATA_SIS · 13 unmodified lines
203231 enable the PATA_SIS driver in the config.
204232 If unsure, say N.
205233
234+config SATA_SVW
235+ tristate "ServerWorks Frodo / Apple K2 SATA support"
236+ depends on PCI
237+ help
238+ This option enables support for Broadcom/Serverworks/Apple K2
239+ SATA support.
240+
241+ If unsure, say N.
242+
206243 config SATA_ULI
207244 tristate "ULi Electronics SATA support"
208245 depends on PCI
@@ -227,14 +264,7 @@ config SATA_VITESSE · 18 unmodified lines
227264
228265 If unsure, say N.
229266
230−config PATA_ACPI
231− tristate "ACPI firmware driver for PATA"
232− depends on ATA_ACPI
233− help
234− This option enables an ACPI method driver which drives
235− motherboard PATA controller interfaces through the ACPI
236− firmware in the BIOS. This driver can sometimes handle
237− otherwise unsupported hardware.
267+comment "PATA SFF controllers with BMDMA"
238268
239269 config PATA_ALI
240270 tristate "ALi PATA support"
@@ -262,40 +292,30 @@ config PATA_ARTOP · 21 unmodified lines
262292
263293 If unsure, say N.
264294
265−config PATA_ATP867X
266− tristate "ARTOP/Acard ATP867X PATA support"
295+config PATA_ATIIXP
296+ tristate "ATI PATA support"
267297 depends on PCI
268298 help
269− This option enables support for ARTOP/Acard ATP867X PATA
270− controllers.
271−
272− If unsure, say N.
273−
274−config PATA_AT32
275− tristate "Atmel AVR32 PATA support (Experimental)"
276− depends on AVR32 && PLATFORM_AT32AP && EXPERIMENTAL
277− help
278− This option enables support for the IDE devices on the
279− Atmel AT32AP platform.
299+ This option enables support for the ATI ATA interfaces
300+ found on the many ATI chipsets.
280301
281302 If unsure, say N.
282303
283−config PATA_ATIIXP
284− tristate "ATI PATA support"
304+config PATA_ATP867X
305+ tristate "ARTOP/Acard ATP867X PATA support"
285306 depends on PCI
286307 help
287− This option enables support for the ATI ATA interfaces
288− found on the many ATI chipsets.
308+ This option enables support for ARTOP/Acard ATP867X PATA
309+ controllers.
289310
290311 If unsure, say N.
291312
292−config PATA_CMD640_PCI
293− tristate "CMD640 PCI PATA support (Experimental)"
294− depends on PCI && EXPERIMENTAL
313+config PATA_BF54X
314+ tristate "Blackfin 54x ATAPI support"
315+ depends on BF542 || BF548 || BF549
295316 help
296− This option enables support for the CMD640 PCI IDE
297− interface chip. Only the primary channel is currently
298− supported.
317+ This option enables support for the built-in ATAPI controller on
318+ Blackfin 54x family chips.
299319
300320 If unsure, say N.
301321
@@ -362,15 +382,6 @@ config PATA_EFAR · 60 unmodified lines
362382
363383 If unsure, say N.
364384
365−config ATA_GENERIC
366− tristate "Generic ATA support"
367− depends on PCI
368− help
369− This option enables support for generic BIOS configured
370− ATA controllers via the new ATA layer
371−
372− If unsure, say N.
373−
374385 config PATA_HPT366
375386 tristate "HPT 366/368 PATA support"
376387 depends on PCI
@@ -415,12 +426,20 @@ config PATA_HPT3X3_DMA · 38 unmodified lines
415426 controllers. Enable with care as there are still some
416427 problems with DMA on this chipset.
417428
418−config PATA_ISAPNP
419− tristate "ISA Plug and Play PATA support"
420− depends on ISAPNP
429+config PATA_ICSIDE
430+ tristate "Acorn ICS PATA support"
431+ depends on ARM && ARCH_ACORN
421432 help
422− This option enables support for ISA plug & play ATA
423− controllers such as those found on old soundcards.
433+ On Acorn systems, say Y here if you wish to use the ICS PATA
434+ interface card. This is not required for ICS partition support.
435+ If you are unsure, say N to this.
436+
437+config PATA_IT8213
438+ tristate "IT8213 PATA support (Experimental)"
439+ depends on PCI && EXPERIMENTAL
440+ help
441+ This option enables support for the ITE 821 PATA
442+ controllers via the new ATA layer.
424443
425444 If unsure, say N.
426445
@@ -434,15 +453,6 @@ config PATA_IT821X · 7 unmodified lines
434453
435454 If unsure, say N.
436455
437−config PATA_IT8213
438− tristate "IT8213 PATA support (Experimental)"
439− depends on PCI && EXPERIMENTAL
440− help
441− This option enables support for the ITE 821 PATA
442− controllers via the new ATA layer.
443−
444− If unsure, say N.
445−
446456 config PATA_JMICRON
447457 tristate "JMicron PATA support"
448458 depends on PCI
@@ -452,23 +462,14 @@ config PATA_JMICRON · 3 unmodified lines
452462
453463 If unsure, say N.
454464
455−config PATA_LEGACY
456− tristate "Legacy ISA PATA support (Experimental)"
457− depends on (ISA || PCI) && EXPERIMENTAL
458− help
459− This option enables support for ISA/VLB/PCI bus legacy PATA
460− ports and allows them to be accessed via the new ATA layer.
461−
462− If unsure, say N.
463−
464−config PATA_TRIFLEX
465− tristate "Compaq Triflex PATA support"
466− depends on PCI
465+config PATA_MACIO
466+ tristate "Apple PowerMac/PowerBook internal 'MacIO' IDE"
467+ depends on PPC_PMAC
467468 help
468− Enable support for the Compaq 'Triflex' IDE controller as found
469− on many Compaq Pentium-Pro systems, via the new ATA layer.
470−
471− If unsure, say N.
469+ Most IDE capable PowerMacs have IDE busses driven by a variant
470+ of this controller which is part of the Apple chipset used on
471+ most PowerMac models. Some models have multiple busses using
472+ different chipsets, though generally, MacIO is one of them.
472473
473474 config PATA_MARVELL
474475 tristate "Marvell PATA support via legacy mode"
@@ -481,32 +482,6 @@ config PATA_MARVELL · 6 unmodified lines
481482
482483 If unsure, say N.
483484
484−config PATA_MPC52xx
485− tristate "Freescale MPC52xx SoC internal IDE"
486− depends on PPC_MPC52xx && PPC_BESTCOMM
487− select PPC_BESTCOMM_ATA
488− help
489− This option enables support for integrated IDE controller
490− of the Freescale MPC52xx SoC.
491−
492− If unsure, say N.
493−
494−config PATA_MPIIX
495− tristate "Intel PATA MPIIX support"
496− depends on PCI
497− help
498− This option enables support for MPIIX PATA support.
499−
500− If unsure, say N.
501−
502−config PATA_OLDPIIX
503− tristate "Intel PATA old PIIX support"
504− depends on PCI
505− help
506− This option enables support for early PIIX PATA support.
507−
508− If unsure, say N.
509−
510485 config PATA_NETCELL
511486 tristate "NETCELL Revolution RAID support"
512487 depends on PCI
@@ -525,15 +500,6 @@ config PATA_NINJA32 · 12 unmodified lines
525500
526501 If unsure, say N.
527502
528−config PATA_NS87410
529− tristate "Nat Semi NS87410 PATA support"
530− depends on PCI
531− help
532− This option enables support for the National Semiconductor
533− NS87410 PCI-IDE controller.
534−
535− If unsure, say N.
536−
537503 config PATA_NS87415
538504 tristate "Nat Semi NS87415 PATA support"
539505 depends on PCI
@@ -543,12 +509,11 @@ config PATA_NS87415 · 3 unmodified lines
543509
544510 If unsure, say N.
545511
546−config PATA_OPTI
547− tristate "OPTI621/6215 PATA support (Very Experimental)"
548− depends on PCI && EXPERIMENTAL
512+config PATA_OLDPIIX
513+ tristate "Intel PATA old PIIX support"
514+ depends on PCI
549515 help
550− This option enables full PIO support for the early Opti ATA
551− controllers found on some old motherboards.
516+ This option enables support for early PIIX PATA support.
552517
553518 If unsure, say N.
554519
@@ -562,24 +527,6 @@ config PATA_OPTIDMA · 7 unmodified lines
562527
563528 If unsure, say N.
564529
565−config PATA_PALMLD
566− tristate "Palm LifeDrive PATA support"
567− depends on MACH_PALMLD
568− help
569− This option enables support for Palm LifeDrive's internal ATA
570− port via the new ATA layer.
571−
572− If unsure, say N.
573−
574−config PATA_PCMCIA
575− tristate "PCMCIA PATA support"
576− depends on PCMCIA
577− help
578− This option enables support for PCMCIA ATA interfaces, including
579− compact flash card adapters via the new ATA layer.
580−
581− If unsure, say N.
582−
583530 config PATA_PDC2027X
584531 tristate "Promise PATA 2027x support"
585532 depends on PCI
@@ -597,12 +544,6 @@ config PATA_PDC_OLD · 11 unmodified lines
597544
598545 If unsure, say N.
599546
600−config PATA_QDI
601− tristate "QDI VLB PATA support"
602− depends on ISA
603− help
604− Support for QDI 6500 and 6580 PATA controllers on VESA local bus.
605−
606547 config PATA_RADISYS
607548 tristate "RADISYS 82600 PATA support (Experimental)"
608549 depends on PCI && EXPERIMENTAL
@@ -612,15 +553,6 @@ config PATA_RADISYS · 3 unmodified lines
612553
613554 If unsure, say N.
614555
615−config PATA_RB532
616− tristate "RouterBoard 532 PATA CompactFlash support"
617− depends on MIKROTIK_RB532
618− help
619− This option enables support for the RouterBoard 532
620− PATA CompactFlash controller.
621−
622− If unsure, say N.
623−
624556 config PATA_RDC
625557 tristate "RDC PATA support"
626558 depends on PCI
@@ -631,21 +563,30 @@ config PATA_RDC · 4 unmodified lines
631563
632564 If unsure, say N.
633565
634−config PATA_RZ1000
635− tristate "PC Tech RZ1000 PATA support"
566+config PATA_SC1200
567+ tristate "SC1200 PATA support"
636568 depends on PCI
637569 help
638− This option enables basic support for the PC Tech RZ1000/1
639− PATA controllers via the new ATA layer
570+ This option enables support for the NatSemi/AMD SC1200 SoC
571+ companion chip used with the Geode processor family.
640572
641573 If unsure, say N.
642574
643−config PATA_SC1200
644− tristate "SC1200 PATA support"
575+config PATA_SCC
576+ tristate "Toshiba's Cell Reference Set IDE support"
577+ depends on PCI && PPC_CELLEB
578+ help
579+ This option enables support for the built-in IDE controller on
580+ Toshiba Cell Reference Board.
581+
582+ If unsure, say N.
583+
584+config PATA_SCH
585+ tristate "Intel SCH PATA support"
645586 depends on PCI
646587 help
647− This option enables support for the NatSemi/AMD SC1200 SoC
648− companion chip used with the Geode processor family.
588+ This option enables support for Intel SCH PATA on the Intel
589+ SCH (US15W, US15L, UL11L) series host controllers.
649590
650591 If unsure, say N.
651592
@@ -683,6 +624,15 @@ config PATA_TOSHIBA · 31 unmodified lines
683624
684625 If unsure, say N.
685626
627+config PATA_TRIFLEX
628+ tristate "Compaq Triflex PATA support"
629+ depends on PCI
630+ help
631+ Enable support for the Compaq 'Triflex' IDE controller as found
632+ on many Compaq Pentium-Pro systems, via the new ATA layer.
633+
634+ If unsure, say N.
635+
686636 config PATA_VIA
687637 tristate "VIA PATA support"
688638 depends on PCI
@@ -701,12 +651,99 @@ config PATA_WINBOND · 12 unmodified lines
701651
702652 If unsure, say N.
703653
704−config PATA_WINBOND_VLB
705− tristate "Winbond W83759A VLB PATA support (Experimental)"
706− depends on ISA && EXPERIMENTAL
654+endif # ATA_BMDMA
655+
656+comment "PIO-only SFF controllers"
657+
658+config PATA_AT32
659+ tristate "Atmel AVR32 PATA support (Experimental)"
660+ depends on AVR32 && PLATFORM_AT32AP && EXPERIMENTAL
707661 help
708− Support for the Winbond W83759A controller on Vesa Local Bus
709− systems.
662+ This option enables support for the IDE devices on the
663+ Atmel AT32AP platform.
664+
665+ If unsure, say N.
666+
667+config PATA_AT91
668+ tristate "PATA support for AT91SAM9260"
669+ depends on ARM && ARCH_AT91
670+ help
671+ This option enables support for IDE devices on the Atmel AT91SAM9260 SoC.
672+
673+ If unsure, say N.
674+
675+config PATA_CMD640_PCI
676+ tristate "CMD640 PCI PATA support (Experimental)"
677+ depends on PCI && EXPERIMENTAL
678+ help
679+ This option enables support for the CMD640 PCI IDE
680+ interface chip. Only the primary channel is currently
681+ supported.
682+
683+ If unsure, say N.
684+
685+config PATA_ISAPNP
686+ tristate "ISA Plug and Play PATA support"
687+ depends on ISAPNP
688+ help
689+ This option enables support for ISA plug & play ATA
690+ controllers such as those found on old soundcards.
691+
692+ If unsure, say N.
693+
694+config PATA_IXP4XX_CF
695+ tristate "IXP4XX Compact Flash support"
696+ depends on ARCH_IXP4XX
697+ help
698+ This option enables support for a Compact Flash connected on
699+ the ixp4xx expansion bus. This driver had been written for
700+ Loft/Avila boards in mind but can work with others.
701+
702+ If unsure, say N.
703+
704+config PATA_MPIIX
705+ tristate "Intel PATA MPIIX support"
706+ depends on PCI
707+ help
708+ This option enables support for MPIIX PATA support.
709+
710+ If unsure, say N.
711+
712+config PATA_NS87410
713+ tristate "Nat Semi NS87410 PATA support"
714+ depends on PCI
715+ help
716+ This option enables support for the National Semiconductor
717+ NS87410 PCI-IDE controller.
718+
719+ If unsure, say N.
720+
721+config PATA_OPTI
722+ tristate "OPTI621/6215 PATA support (Very Experimental)"
723+ depends on PCI && EXPERIMENTAL
724+ help
725+ This option enables full PIO support for the early Opti ATA
726+ controllers found on some old motherboards.
727+
728+ If unsure, say N.
729+
730+config PATA_PALMLD
731+ tristate "Palm LifeDrive PATA support"
732+ depends on MACH_PALMLD
733+ help
734+ This option enables support for Palm LifeDrive's internal ATA
735+ port via the new ATA layer.
736+
737+ If unsure, say N.
738+
739+config PATA_PCMCIA
740+ tristate "PCMCIA PATA support"
741+ depends on PCMCIA
742+ help
743+ This option enables support for PCMCIA ATA interfaces, including
744+ compact flash card adapters via the new ATA layer.
745+
746+ If unsure, say N.
710747
711748 config HAVE_PATA_PLATFORM
712749 bool
@@ -725,14 +762,6 @@ config PATA_PLATFORM · 12 unmodified lines
725762
726763 If unsure, say N.
727764
728−config PATA_AT91
729− tristate "PATA support for AT91SAM9260"
730− depends on ARM && ARCH_AT91
731− help
732− This option enables support for IDE devices on the Atmel AT91SAM9260 SoC.
733−
734− If unsure, say N.
735−
736765 config PATA_OF_PLATFORM
737766 tristate "OpenFirmware platform device PATA support"
738767 depends on PATA_PLATFORM && PPC_OF
@@ -743,69 +772,65 @@ config PATA_OF_PLATFORM · 4 unmodified lines
743772
744773 If unsure, say N.
745774
746−config PATA_ICSIDE
747− tristate "Acorn ICS PATA support"
748− depends on ARM && ARCH_ACORN
775+config PATA_QDI
776+ tristate "QDI VLB PATA support"
777+ depends on ISA
749778 help
750− On Acorn systems, say Y here if you wish to use the ICS PATA
751− interface card. This is not required for ICS partition support.
752− If you are unsure, say N to this.
779+ Support for QDI 6500 and 6580 PATA controllers on VESA local bus.
753780
754−config PATA_IXP4XX_CF
755− tristate "IXP4XX Compact Flash support"
756− depends on ARCH_IXP4XX
781+config PATA_RB532
782+ tristate "RouterBoard 532 PATA CompactFlash support"
783+ depends on MIKROTIK_RB532
757784 help
758− This option enables support for a Compact Flash connected on
759− the ixp4xx expansion bus. This driver had been written for
760− Loft/Avila boards in mind but can work with others.
785+ This option enables support for the RouterBoard 532
786+ PATA CompactFlash controller.
761787
762788 If unsure, say N.
763789
764−config PATA_OCTEON_CF
765− tristate "OCTEON Boot Bus Compact Flash support"
766− depends on CPU_CAVIUM_OCTEON
790+config PATA_RZ1000
791+ tristate "PC Tech RZ1000 PATA support"
792+ depends on PCI
767793 help
768− This option enables a polled compact flash driver for use with
769− compact flash cards attached to the OCTEON boot bus.
794+ This option enables basic support for the PC Tech RZ1000/1
795+ PATA controllers via the new ATA layer
770796
771797 If unsure, say N.
772798
773−config PATA_SCC
774− tristate "Toshiba's Cell Reference Set IDE support"
775− depends on PCI && PPC_CELLEB
799+config PATA_WINBOND_VLB
800+ tristate "Winbond W83759A VLB PATA support (Experimental)"
801+ depends on ISA && EXPERIMENTAL
776802 help
777− This option enables support for the built-in IDE controller on
778− Toshiba Cell Reference Board.
803+ Support for the Winbond W83759A controller on Vesa Local Bus
804+ systems.
779805
780− If unsure, say N.
806+comment "Generic fallback / legacy drivers"
781807
782−config PATA_SCH
783− tristate "Intel SCH PATA support"
784− depends on PCI
808+config PATA_ACPI
809+ tristate "ACPI firmware driver for PATA"
810+ depends on ATA_ACPI && ATA_BMDMA
785811 help
786− This option enables support for Intel SCH PATA on the Intel
787− SCH (US15W, US15L, UL11L) series host controllers.
788−
789− If unsure, say N.
812+ This option enables an ACPI method driver which drives
813+ motherboard PATA controller interfaces through the ACPI
814+ firmware in the BIOS. This driver can sometimes handle
815+ otherwise unsupported hardware.
790816
791−config PATA_BF54X
792− tristate "Blackfin 54x ATAPI support"
793− depends on BF542 || BF548 || BF549
817+config ATA_GENERIC
818+ tristate "Generic ATA support"
819+ depends on PCI && ATA_BMDMA
794820 help
795− This option enables support for the built-in ATAPI controller on
796− Blackfin 54x family chips.
821+ This option enables support for generic BIOS configured
822+ ATA controllers via the new ATA layer
797823
798824 If unsure, say N.
799825
800−config PATA_MACIO
801− tristate "Apple PowerMac/PowerBook internal 'MacIO' IDE"
802− depends on PPC_PMAC
826+config PATA_LEGACY
827+ tristate "Legacy ISA PATA support (Experimental)"
828+ depends on (ISA || PCI) && EXPERIMENTAL
803829 help
804− Most IDE capable PowerMacs have IDE busses driven by a variant
805− of this controller which is part of the Apple chipset used on
806− most PowerMac models. Some models have multiple busses using
807− different chipsets, though generally, MacIO is one of them.
830+ This option enables support for ISA/VLB/PCI bus legacy PATA
831+ ports and allows them to be accessed via the new ATA layer.
808832
833+ If unsure, say N.
809834
810835 endif # ATA_SFF
811836 endif # ATA
drivers/ata/Makefile+46−37
@@ -1,33 +1,39 @@
11
22 obj-$(CONFIG_ATA) += libata.o
33
4+# non-SFF interface
45 obj-$(CONFIG_SATA_AHCI) += ahci.o libahci.o
56 obj-$(CONFIG_SATA_AHCI_PLATFORM) += ahci_platform.o libahci.o
6−obj-$(CONFIG_SATA_SVW) += sata_svw.o
7+obj-$(CONFIG_SATA_FSL) += sata_fsl.o
8+obj-$(CONFIG_SATA_INIC162X) += sata_inic162x.o
9+obj-$(CONFIG_SATA_SIL24) += sata_sil24.o
10+
11+# SFF w/ custom DMA
12+obj-$(CONFIG_PDC_ADMA) += pdc_adma.o
13+obj-$(CONFIG_PATA_MPC52xx) += pata_mpc52xx.o
14+obj-$(CONFIG_PATA_OCTEON_CF) += pata_octeon_cf.o
15+obj-$(CONFIG_SATA_QSTOR) += sata_qstor.o
16+obj-$(CONFIG_SATA_SX4) += sata_sx4.o
17+
18+# SFF SATA w/ BMDMA
719 obj-$(CONFIG_ATA_PIIX) += ata_piix.o
20+obj-$(CONFIG_SATA_MV) += sata_mv.o
21+obj-$(CONFIG_SATA_NV) += sata_nv.o
822 obj-$(CONFIG_SATA_PROMISE) += sata_promise.o
9−obj-$(CONFIG_SATA_QSTOR) += sata_qstor.o
1023 obj-$(CONFIG_SATA_SIL) += sata_sil.o
11−obj-$(CONFIG_SATA_SIL24) += sata_sil24.o
12−obj-$(CONFIG_SATA_VIA) += sata_via.o
13−obj-$(CONFIG_SATA_VITESSE) += sata_vsc.o
1424 obj-$(CONFIG_SATA_SIS) += sata_sis.o
15−obj-$(CONFIG_SATA_SX4) += sata_sx4.o
16−obj-$(CONFIG_SATA_NV) += sata_nv.o
25+obj-$(CONFIG_SATA_SVW) += sata_svw.o
1726 obj-$(CONFIG_SATA_ULI) += sata_uli.o
18−obj-$(CONFIG_SATA_MV) += sata_mv.o
19−obj-$(CONFIG_SATA_INIC162X) += sata_inic162x.o
20−obj-$(CONFIG_PDC_ADMA) += pdc_adma.o
21−obj-$(CONFIG_SATA_FSL) += sata_fsl.o
22−obj-$(CONFIG_PATA_MACIO) += pata_macio.o
27+obj-$(CONFIG_SATA_VIA) += sata_via.o
28+obj-$(CONFIG_SATA_VITESSE) += sata_vsc.o
2329
30+# SFF PATA w/ BMDMA
2431 obj-$(CONFIG_PATA_ALI) += pata_ali.o
2532 obj-$(CONFIG_PATA_AMD) += pata_amd.o
2633 obj-$(CONFIG_PATA_ARTOP) += pata_artop.o
27−obj-$(CONFIG_PATA_ATP867X) += pata_atp867x.o
28−obj-$(CONFIG_PATA_AT32) += pata_at32.o
2934 obj-$(CONFIG_PATA_ATIIXP) += pata_atiixp.o
30−obj-$(CONFIG_PATA_CMD640_PCI) += pata_cmd640.o
35+obj-$(CONFIG_PATA_ATP867X) += pata_atp867x.o
36+obj-$(CONFIG_PATA_BF54X) += pata_bf54x.o
3137 obj-$(CONFIG_PATA_CMD64X) += pata_cmd64x.o
3238 obj-$(CONFIG_PATA_CS5520) += pata_cs5520.o
3339 obj-$(CONFIG_PATA_CS5530) += pata_cs5530.o
@@ -39,47 +45,50 @@ obj-$(CONFIG_PATA_HPT366) += pata_hpt366.o · 5 unmodified lines
3945 obj-$(CONFIG_PATA_HPT37X) += pata_hpt37x.o
4046 obj-$(CONFIG_PATA_HPT3X2N) += pata_hpt3x2n.o
4147 obj-$(CONFIG_PATA_HPT3X3) += pata_hpt3x3.o
42−obj-$(CONFIG_PATA_ISAPNP) += pata_isapnp.o
43−obj-$(CONFIG_PATA_IT821X) += pata_it821x.o
48+obj-$(CONFIG_PATA_ICSIDE) += pata_icside.o
4449 obj-$(CONFIG_PATA_IT8213) += pata_it8213.o
50+obj-$(CONFIG_PATA_IT821X) += pata_it821x.o
4551 obj-$(CONFIG_PATA_JMICRON) += pata_jmicron.o
52+obj-$(CONFIG_PATA_MACIO) += pata_macio.o
53+obj-$(CONFIG_PATA_MARVELL) += pata_marvell.o
4654 obj-$(CONFIG_PATA_NETCELL) += pata_netcell.o
4755 obj-$(CONFIG_PATA_NINJA32) += pata_ninja32.o
48−obj-$(CONFIG_PATA_NS87410) += pata_ns87410.o
4956 obj-$(CONFIG_PATA_NS87415) += pata_ns87415.o
50−obj-$(CONFIG_PATA_OPTI) += pata_opti.o
51−obj-$(CONFIG_PATA_OPTIDMA) += pata_optidma.o
52−obj-$(CONFIG_PATA_MPC52xx) += pata_mpc52xx.o
53−obj-$(CONFIG_PATA_MARVELL) += pata_marvell.o
54−obj-$(CONFIG_PATA_MPIIX) += pata_mpiix.o
5557 obj-$(CONFIG_PATA_OLDPIIX) += pata_oldpiix.o
56−obj-$(CONFIG_PATA_PALMLD) += pata_palmld.o
57−obj-$(CONFIG_PATA_PCMCIA) += pata_pcmcia.o
58+obj-$(CONFIG_PATA_OPTIDMA) += pata_optidma.o
5859 obj-$(CONFIG_PATA_PDC2027X) += pata_pdc2027x.o
5960 obj-$(CONFIG_PATA_PDC_OLD) += pata_pdc202xx_old.o
60−obj-$(CONFIG_PATA_QDI) += pata_qdi.o
6161 obj-$(CONFIG_PATA_RADISYS) += pata_radisys.o
62−obj-$(CONFIG_PATA_RB532) += pata_rb532_cf.o
6362 obj-$(CONFIG_PATA_RDC) += pata_rdc.o
64−obj-$(CONFIG_PATA_RZ1000) += pata_rz1000.o
6563 obj-$(CONFIG_PATA_SC1200) += pata_sc1200.o
64+obj-$(CONFIG_PATA_SCC) += pata_scc.o
65+obj-$(CONFIG_PATA_SCH) += pata_sch.o
6666 obj-$(CONFIG_PATA_SERVERWORKS) += pata_serverworks.o
6767 obj-$(CONFIG_PATA_SIL680) += pata_sil680.o
68+obj-$(CONFIG_PATA_SIS) += pata_sis.o
6869 obj-$(CONFIG_PATA_TOSHIBA) += pata_piccolo.o
70+obj-$(CONFIG_PATA_TRIFLEX) += pata_triflex.o
6971 obj-$(CONFIG_PATA_VIA) += pata_via.o
7072 obj-$(CONFIG_PATA_WINBOND) += pata_sl82c105.o
71−obj-$(CONFIG_PATA_WINBOND_VLB) += pata_winbond.o
72−obj-$(CONFIG_PATA_SIS) += pata_sis.o
73−obj-$(CONFIG_PATA_TRIFLEX) += pata_triflex.o
73+
74+# SFF PIO only
75+obj-$(CONFIG_PATA_AT32) += pata_at32.o
76+obj-$(CONFIG_PATA_AT91) += pata_at91.o
77+obj-$(CONFIG_PATA_CMD640_PCI) += pata_cmd640.o
78+obj-$(CONFIG_PATA_ISAPNP) += pata_isapnp.o
7479 obj-$(CONFIG_PATA_IXP4XX_CF) += pata_ixp4xx_cf.o
75−obj-$(CONFIG_PATA_SCC) += pata_scc.o
76−obj-$(CONFIG_PATA_SCH) += pata_sch.o
77−obj-$(CONFIG_PATA_BF54X) += pata_bf54x.o
78−obj-$(CONFIG_PATA_OCTEON_CF) += pata_octeon_cf.o
80+obj-$(CONFIG_PATA_MPIIX) += pata_mpiix.o
81+obj-$(CONFIG_PATA_NS87410) += pata_ns87410.o
82+obj-$(CONFIG_PATA_OPTI) += pata_opti.o
83+obj-$(CONFIG_PATA_PCMCIA) += pata_pcmcia.o
84+obj-$(CONFIG_PATA_PALMLD) += pata_palmld.o
7985 obj-$(CONFIG_PATA_PLATFORM) += pata_platform.o
80−obj-$(CONFIG_PATA_AT91) += pata_at91.o
8186 obj-$(CONFIG_PATA_OF_PLATFORM) += pata_of_platform.o
82−obj-$(CONFIG_PATA_ICSIDE) += pata_icside.o
87+obj-$(CONFIG_PATA_QDI) += pata_qdi.o
88+obj-$(CONFIG_PATA_RB532) += pata_rb532_cf.o
89+obj-$(CONFIG_PATA_RZ1000) += pata_rz1000.o
90+obj-$(CONFIG_PATA_WINBOND_VLB) += pata_winbond.o
91+
8392 # Should be last but two libata driver
8493 obj-$(CONFIG_PATA_ACPI) += pata_acpi.o
8594 # Should be last but one libata driver
drivers/ata/ata_generic.c+1−1
@@ -155,7 +155,7 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id · 154 unmodified lines
155155 return rc;
156156 pcim_pin_device(dev);
157157 }
158− return ata_pci_sff_init_one(dev, ppi, &generic_sht, NULL, 0);
158+ return ata_pci_bmdma_init_one(dev, ppi, &generic_sht, NULL, 0);
159159 }
160160
161161 static struct pci_device_id ata_generic[] = {
drivers/ata/ata_piix.c+2−2
@@ -1589,7 +1589,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev, · 1588 unmodified lines
15891589 hpriv->map = piix_init_sata_map(pdev, port_info,
15901590 piix_map_db_table[ent->driver_data]);
15911591
1592− rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
1592+ rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
15931593 if (rc)
15941594 return rc;
15951595 host->private_data = hpriv;
@@ -1626,7 +1626,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev, · 30 unmodified lines
16261626 host->flags |= ATA_HOST_PARALLEL_SCAN;
16271627
16281628 pci_set_master(pdev);
1629− return ata_pci_sff_activate_host(host, ata_sff_interrupt, &piix_sht);
1629+ return ata_pci_sff_activate_host(host, ata_bmdma_interrupt, &piix_sht);
16301630 }
16311631
16321632 static void piix_remove_one(struct pci_dev *pdev)
drivers/ata/libata-core.c+15−1
@@ -160,6 +160,10 @@ int libata_allow_tpm = 0; · 159 unmodified lines
160160 module_param_named(allow_tpm, libata_allow_tpm, int, 0444);
161161 MODULE_PARM_DESC(allow_tpm, "Permit the use of TPM commands (0=off [default], 1=on)");
162162
163+static int atapi_an;
164+module_param(atapi_an, int, 0444);
165+MODULE_PARM_DESC(atapi_an, "Enable ATAPI AN media presence notification (0=0ff [default], 1=on)");
166+
163167 MODULE_AUTHOR("Jeff Garzik");
164168 MODULE_DESCRIPTION("Library module for ATA devices");
165169 MODULE_LICENSE("GPL");
@@ -2122,6 +2126,14 @@ retry: · 1956 unmodified lines
21222126 goto err_out;
21232127 }
21242128
2129+ if (dev->horkage & ATA_HORKAGE_DUMP_ID) {
2130+ ata_dev_printk(dev, KERN_DEBUG, "dumping IDENTIFY data, "
2131+ "class=%d may_fallback=%d tried_spinup=%d\n",
2132+ class, may_fallback, tried_spinup);
2133+ print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET,
2134+ 16, 2, id, ATA_ID_WORDS * sizeof(*id), true);
2135+ }
2136+
21252137 /* Falling back doesn't make sense if ID data was read
21262138 * successfully at least once.
21272139 */
@@ -2510,7 +2522,8 @@ int ata_dev_configure(struct ata_device *dev) · 382 unmodified lines
25102522 * to enable ATAPI AN to discern between PHY status
25112523 * changed notifications and ATAPI ANs.
25122524 */
2513− if ((ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id) &&
2525+ if (atapi_an &&
2526+ (ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id) &&
25142527 (!sata_pmp_attached(ap) ||
25152528 sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf) == 0)) {
25162529 unsigned int err_mask;
@@ -6372,6 +6385,7 @@ static int __init ata_parse_force_one(char **cur, · 3855 unmodified lines
63726385 { "3.0Gbps", .spd_limit = 2 },
63736386 { "noncq", .horkage_on = ATA_HORKAGE_NONCQ },
63746387 { "ncq", .horkage_off = ATA_HORKAGE_NONCQ },
6388+ { "dump_id", .horkage_on = ATA_HORKAGE_DUMP_ID },
63756389 { "pio0", .xfer_mask = 1 << (ATA_SHIFT_PIO + 0) },
63766390 { "pio1", .xfer_mask = 1 << (ATA_SHIFT_PIO + 1) },
63776391 { "pio2", .xfer_mask = 1 << (ATA_SHIFT_PIO + 2) },
drivers/ata/libata-sff.c+288−128
@@ -63,7 +63,6 @@ const struct ata_port_operations ata_sff_port_ops = { · 62 unmodified lines
6363 .sff_tf_read = ata_sff_tf_read,
6464 .sff_exec_command = ata_sff_exec_command,
6565 .sff_data_xfer = ata_sff_data_xfer,
66− .sff_irq_clear = ata_sff_irq_clear,
6766 .sff_drain_fifo = ata_sff_drain_fifo,
6867
6968 .lost_interrupt = ata_sff_lost_interrupt,
@@ -395,32 +394,11 @@ void ata_sff_irq_on(struct ata_port *ap) · 325 unmodified lines
395394 ata_sff_set_devctl(ap, ap->ctl);
396395 ata_wait_idle(ap);
397396
398− ap->ops->sff_irq_clear(ap);
397+ if (ap->ops->sff_irq_clear)
398+ ap->ops->sff_irq_clear(ap);
399399 }
400400 EXPORT_SYMBOL_GPL(ata_sff_irq_on);
401401
402−/**
403− * ata_sff_irq_clear - Clear PCI IDE BMDMA interrupt.
404− * @ap: Port associated with this ATA transaction.
405− *
406− * Clear interrupt and error flags in DMA status register.
407− *
408− * May be used as the irq_clear() entry in ata_port_operations.
409− *
410− * LOCKING:
411− * spin_lock_irqsave(host lock)
412− */
413−void ata_sff_irq_clear(struct ata_port *ap)
414−{
415− void __iomem *mmio = ap->ioaddr.bmdma_addr;
416−
417− if (!mmio)
418− return;
419−
420− iowrite8(ioread8(mmio + ATA_DMA_STATUS), mmio + ATA_DMA_STATUS);
421−}
422−EXPORT_SYMBOL_GPL(ata_sff_irq_clear);
423−
424402 /**
425403 * ata_sff_tf_load - send taskfile registers to host controller
426404 * @ap: Port to which output is sent
@@ -820,11 +798,15 @@ static void atapi_send_cdb(struct ata_port *ap, struct ata_queued_cmd *qc) · 393 unmodified lines
820798 case ATAPI_PROT_NODATA:
821799 ap->hsm_task_state = HSM_ST_LAST;
822800 break;
801+#ifdef CONFIG_ATA_BMDMA
823802 case ATAPI_PROT_DMA:
824803 ap->hsm_task_state = HSM_ST_LAST;
825804 /* initiate bmdma */
826805 ap->ops->bmdma_start(qc);
827806 break;
807+#endif /* CONFIG_ATA_BMDMA */
808+ default:
809+ BUG();
828810 }
829811 }
830812
@@ -1491,27 +1473,27 @@ bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc) · 660 unmodified lines
14911473 }
14921474 EXPORT_SYMBOL_GPL(ata_sff_qc_fill_rtf);
14931475
1494−/**
1495− * ata_sff_host_intr - Handle host interrupt for given (port, task)
1496− * @ap: Port on which interrupt arrived (possibly...)
1497− * @qc: Taskfile currently active in engine
1498− *
1499− * Handle host interrupt for given queued command. Currently,
1500− * only DMA interrupts are handled. All other commands are
1501− * handled via polling with interrupts disabled (nIEN bit).
1502− *
1503− * LOCKING:
1504− * spin_lock_irqsave(host lock)
1505− *
1506− * RETURNS:
1507− * One if interrupt was handled, zero if not (shared irq).
1508− */
1509−unsigned int ata_sff_host_intr(struct ata_port *ap,
1510− struct ata_queued_cmd *qc)
1476+static unsigned int ata_sff_idle_irq(struct ata_port *ap)
15111477 {
1512− struct ata_eh_info *ehi = &ap->link.eh_info;
1513− u8 status, host_stat = 0;
1514− bool bmdma_stopped = false;
1478+ ap->stats.idle_irq++;
1479+
1480+#ifdef ATA_IRQ_TRAP
1481+ if ((ap->stats.idle_irq % 1000) == 0) {
1482+ ap->ops->sff_check_status(ap);
1483+ if (ap->ops->sff_irq_clear)
1484+ ap->ops->sff_irq_clear(ap);
1485+ ata_port_printk(ap, KERN_WARNING, "irq trap\n");
1486+ return 1;
1487+ }
1488+#endif
1489+ return 0; /* irq not handled */
1490+}
1491+
1492+static unsigned int __ata_sff_port_intr(struct ata_port *ap,
1493+ struct ata_queued_cmd *qc,
1494+ bool hsmv_on_idle)
1495+{
1496+ u8 status;
15151497
15161498 VPRINTK("ata%u: protocol %d task_state %d\n",
15171499 ap->print_id, qc->tf.protocol, ap->hsm_task_state);
@@ -1528,90 +1510,56 @@ unsigned int ata_sff_host_intr(struct ata_port *ap, · 10 unmodified lines
15281510 * need to check ata_is_atapi(qc->tf.protocol) again.
15291511 */
15301512 if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR))
1531− goto idle_irq;
1532− break;
1533− case HSM_ST_LAST:
1534− if (qc->tf.protocol == ATA_PROT_DMA ||
1535− qc->tf.protocol == ATAPI_PROT_DMA) {
1536− /* check status of DMA engine */
1537− host_stat = ap->ops->bmdma_status(ap);
1538− VPRINTK("ata%u: host_stat 0x%X\n",
1539− ap->print_id, host_stat);
1540−
1541− /* if it's not our irq... */
1542− if (!(host_stat & ATA_DMA_INTR))
1543− goto idle_irq;
1544−
1545− /* before we do anything else, clear DMA-Start bit */
1546− ap->ops->bmdma_stop(qc);
1547− bmdma_stopped = true;
1548−
1549− if (unlikely(host_stat & ATA_DMA_ERR)) {
1550− /* error when transfering data to/from memory */
1551− qc->err_mask |= AC_ERR_HOST_BUS;
1552− ap->hsm_task_state = HSM_ST_ERR;
1553− }
1554− }
1513+ return ata_sff_idle_irq(ap);
15551514 break;
15561515 case HSM_ST:
1516+ case HSM_ST_LAST:
15571517 break;
15581518 default:
1559− goto idle_irq;
1519+ return ata_sff_idle_irq(ap);
15601520 }
15611521
1562−
15631522 /* check main status, clearing INTRQ if needed */
15641523 status = ata_sff_irq_status(ap);
15651524 if (status & ATA_BUSY) {
1566− if (bmdma_stopped) {
1525+ if (hsmv_on_idle) {
15671526 /* BMDMA engine is already stopped, we're screwed */
15681527 qc->err_mask |= AC_ERR_HSM;
15691528 ap->hsm_task_state = HSM_ST_ERR;
15701529 } else
1571− goto idle_irq;
1530+ return ata_sff_idle_irq(ap);
15721531 }
15731532
15741533 /* clear irq events */
1575− ap->ops->sff_irq_clear(ap);
1534+ if (ap->ops->sff_irq_clear)
1535+ ap->ops->sff_irq_clear(ap);
15761536
15771537 ata_sff_hsm_move(ap, qc, status, 0);
15781538
1579− if (unlikely(qc->err_mask) && (qc->tf.protocol == ATA_PROT_DMA ||
1580− qc->tf.protocol == ATAPI_PROT_DMA))
1581− ata_ehi_push_desc(ehi, "BMDMA stat 0x%x", host_stat);
1582−
15831539 return 1; /* irq handled */
1584−
1585−idle_irq:
1586− ap->stats.idle_irq++;
1587−
1588−#ifdef ATA_IRQ_TRAP
1589− if ((ap->stats.idle_irq % 1000) == 0) {
1590− ap->ops->sff_check_status(ap);
1591− ap->ops->sff_irq_clear(ap);
1592− ata_port_printk(ap, KERN_WARNING, "irq trap\n");
1593− return 1;
1594− }
1595−#endif
1596− return 0; /* irq not handled */
15971540 }
1598−EXPORT_SYMBOL_GPL(ata_sff_host_intr);
15991541
16001542 /**
1601− * ata_sff_interrupt - Default ATA host interrupt handler
1602− * @irq: irq line (unused)
1603− * @dev_instance: pointer to our ata_host information structure
1543+ * ata_sff_port_intr - Handle SFF port interrupt
1544+ * @ap: Port on which interrupt arrived (possibly...)
1545+ * @qc: Taskfile currently active in engine
16041546 *
1605− * Default interrupt handler for PCI IDE devices. Calls
1606− * ata_sff_host_intr() for each port that is not disabled.
1547+ * Handle port interrupt for given queued command.
16071548 *
16081549 * LOCKING:
1609− * Obtains host lock during operation.
1550+ * spin_lock_irqsave(host lock)
16101551 *
16111552 * RETURNS:
1612− * IRQ_NONE or IRQ_HANDLED.
1553+ * One if interrupt was handled, zero if not (shared irq).
16131554 */
1614−irqreturn_t ata_sff_interrupt(int irq, void *dev_instance)
1555+unsigned int ata_sff_port_intr(struct ata_port *ap, struct ata_queued_cmd *qc)
1556+{
1557+ return __ata_sff_port_intr(ap, qc, false);
1558+}
1559+EXPORT_SYMBOL_GPL(ata_sff_port_intr);
1560+
1561+static inline irqreturn_t __ata_sff_interrupt(int irq, void *dev_instance,
1562+ unsigned int (*port_intr)(struct ata_port *, struct ata_queued_cmd *))
16151563 {
16161564 struct ata_host *host = dev_instance;
16171565 bool retried = false;
@@ -1631,7 +1579,7 @@ retry: · 13 unmodified lines
16311579 qc = ata_qc_from_tag(ap, ap->link.active_tag);
16321580 if (qc) {
16331581 if (!(qc->tf.flags & ATA_TFLAG_POLLING))
1634− handled |= ata_sff_host_intr(ap, qc);
1582+ handled |= port_intr(ap, qc);
16351583 else
16361584 polling |= 1 << i;
16371585 } else
@@ -1658,7 +1606,8 @@ retry: · 20 unmodified lines
16581606
16591607 if (idle & (1 << i)) {
16601608 ap->ops->sff_check_status(ap);
1661− ap->ops->sff_irq_clear(ap);
1609+ if (ap->ops->sff_irq_clear)
1610+ ap->ops->sff_irq_clear(ap);
16621611 } else {
16631612 /* clear INTRQ and check if BUSY cleared */
16641613 if (!(ap->ops->sff_check_status(ap) & ATA_BUSY))
@@ -1680,6 +1629,25 @@ retry: · 15 unmodified lines
16801629
16811630 return IRQ_RETVAL(handled);
16821631 }
1632+
1633+/**
1634+ * ata_sff_interrupt - Default SFF ATA host interrupt handler
1635+ * @irq: irq line (unused)
1636+ * @dev_instance: pointer to our ata_host information structure
1637+ *
1638+ * Default interrupt handler for PCI IDE devices. Calls
1639+ * ata_sff_port_intr() for each port that is not disabled.
1640+ *
1641+ * LOCKING:
1642+ * Obtains host lock during operation.
1643+ *
1644+ * RETURNS:
1645+ * IRQ_NONE or IRQ_HANDLED.
1646+ */
1647+irqreturn_t ata_sff_interrupt(int irq, void *dev_instance)
1648+{
1649+ return __ata_sff_interrupt(irq, dev_instance, ata_sff_port_intr);
1650+}
16831651 EXPORT_SYMBOL_GPL(ata_sff_interrupt);
16841652
16851653 /**
@@ -1717,7 +1685,7 @@ void ata_sff_lost_interrupt(struct ata_port *ap) · 31 unmodified lines
17171685 status);
17181686 /* Run the host interrupt logic as if the interrupt had not been
17191687 lost */
1720− ata_sff_host_intr(ap, qc);
1688+ ata_sff_port_intr(ap, qc);
17211689 }
17221690 EXPORT_SYMBOL_GPL(ata_sff_lost_interrupt);
17231691
@@ -1744,7 +1712,8 @@ void ata_sff_freeze(struct ata_port *ap) · 20 unmodified lines
17441712 */
17451713 ap->ops->sff_check_status(ap);
17461714
1747− ap->ops->sff_irq_clear(ap);
1715+ if (ap->ops->sff_irq_clear)
1716+ ap->ops->sff_irq_clear(ap);
17481717 }
17491718 EXPORT_SYMBOL_GPL(ata_sff_freeze);
17501719
@@ -1761,7 +1730,8 @@ void ata_sff_thaw(struct ata_port *ap) · 10 unmodified lines
17611730 {
17621731 /* clear & re-enable interrupts */
17631732 ap->ops->sff_check_status(ap);
1764− ap->ops->sff_irq_clear(ap);
1733+ if (ap->ops->sff_irq_clear)
1734+ ap->ops->sff_irq_clear(ap);
17651735 ata_sff_irq_on(ap);
17661736 }
17671737 EXPORT_SYMBOL_GPL(ata_sff_thaw);
@@ -2349,13 +2319,13 @@ int ata_pci_sff_init_host(struct ata_host *host) · 581 unmodified lines
23492319 EXPORT_SYMBOL_GPL(ata_pci_sff_init_host);
23502320
23512321 /**
2352− * ata_pci_sff_prepare_host - helper to prepare native PCI ATA host
2322+ * ata_pci_sff_prepare_host - helper to prepare PCI PIO-only SFF ATA host
23532323 * @pdev: target PCI device
23542324 * @ppi: array of port_info, must be enough for two ports
23552325 * @r_host: out argument for the initialized ATA host
23562326 *
2357− * Helper to allocate ATA host for @pdev, acquire all native PCI
2358− * resources and initialize it accordingly in one go.
2327+ * Helper to allocate PIO-only SFF ATA host for @pdev, acquire
2328+ * all PCI resources and initialize it accordingly in one go.
23592329 *
23602330 * LOCKING:
23612331 * Inherited from calling layer (may sleep).
@@ -2385,9 +2355,6 @@ int ata_pci_sff_prepare_host(struct pci_dev *pdev, · 23 unmodified lines
23852355 if (rc)
23862356 goto err_out;
23872357
2388− /* init DMA related stuff */
2389− ata_pci_bmdma_init(host);
2390−
23912358 devres_remove_group(&pdev->dev, NULL);
23922359 *r_host = host;
23932360 return 0;
@@ -2492,8 +2459,21 @@ out: · 98 unmodified lines
24922459 }
24932460 EXPORT_SYMBOL_GPL(ata_pci_sff_activate_host);
24942461
2462+static const struct ata_port_info *ata_sff_find_valid_pi(
2463+ const struct ata_port_info * const *ppi)
2464+{
2465+ int i;
2466+
2467+ /* look up the first valid port_info */
2468+ for (i = 0; i < 2 && ppi[i]; i++)
2469+ if (ppi[i]->port_ops != &ata_dummy_port_ops)
2470+ return ppi[i];
2471+
2472+ return NULL;
2473+}
2474+
24952475 /**
2496− * ata_pci_sff_init_one - Initialize/register PCI IDE host controller
2476+ * ata_pci_sff_init_one - Initialize/register PIO-only PCI IDE controller
24972477 * @pdev: Controller to be initialized
24982478 * @ppi: array of port_info, must be enough for two ports
24992479 * @sht: scsi_host_template to use when registering the host
@@ -2502,11 +2482,7 @@ EXPORT_SYMBOL_GPL(ata_pci_sff_activate_host); · 2 unmodified lines
25022482 *
25032483 * This is a helper function which can be called from a driver's
25042484 * xxx_init_one() probe function if the hardware uses traditional
2505− * IDE taskfile registers.
2506− *
2507− * This function calls pci_enable_device(), reserves its register
2508− * regions, sets the dma mask, enables bus master mode, and calls
2509− * ata_device_add()
2485+ * IDE taskfile registers and is PIO only.
25102486 *
25112487 * ASSUMPTION:
25122488 * Nobody makes a single channel controller that appears solely as
@@ -2523,20 +2499,13 @@ int ata_pci_sff_init_one(struct pci_dev *pdev, · 10 unmodified lines
25232499 struct scsi_host_template *sht, void *host_priv, int hflag)
25242500 {
25252501 struct device *dev = &pdev->dev;
2526− const struct ata_port_info *pi = NULL;
2502+ const struct ata_port_info *pi;
25272503 struct ata_host *host = NULL;
2528− int i, rc;
2504+ int rc;
25292505
25302506 DPRINTK("ENTER\n");
25312507
2532− /* look up the first valid port_info */
2533− for (i = 0; i < 2 && ppi[i]; i++) {
2534− if (ppi[i]->port_ops != &ata_dummy_port_ops) {
2535− pi = ppi[i];
2536− break;
2537− }
2538− }
2539−
2508+ pi = ata_sff_find_valid_pi(ppi);
25402509 if (!pi) {
25412510 dev_printk(KERN_ERR, &pdev->dev,
25422511 "no valid port_info specified\n");
@@ -2557,7 +2526,6 @@ int ata_pci_sff_init_one(struct pci_dev *pdev, · 14 unmodified lines
25572526 host->private_data = host_priv;
25582527 host->flags |= hflag;
25592528
2560− pci_set_master(pdev);
25612529 rc = ata_pci_sff_activate_host(host, ata_sff_interrupt, sht);
25622530 out:
25632531 if (rc == 0)
@@ -2571,6 +2539,12 @@ EXPORT_SYMBOL_GPL(ata_pci_sff_init_one); · 7 unmodified lines
25712539
25722540 #endif /* CONFIG_PCI */
25732541
2542+/*
2543+ * BMDMA support
2544+ */
2545+
2546+#ifdef CONFIG_ATA_BMDMA
2547+
25742548 const struct ata_port_operations ata_bmdma_port_ops = {
25752549 .inherits = &ata_sff_port_ops,
25762550
@@ -2580,6 +2554,7 @@ const struct ata_port_operations ata_bmdma_port_ops = { · 3 unmodified lines
25802554 .qc_prep = ata_bmdma_qc_prep,
25812555 .qc_issue = ata_bmdma_qc_issue,
25822556
2557+ .sff_irq_clear = ata_bmdma_irq_clear,
25832558 .bmdma_setup = ata_bmdma_setup,
25842559 .bmdma_start = ata_bmdma_start,
25852560 .bmdma_stop = ata_bmdma_stop,
@@ -2803,6 +2778,75 @@ unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc) · 217 unmodified lines
28032778 }
28042779 EXPORT_SYMBOL_GPL(ata_bmdma_qc_issue);
28052780
2781+/**
2782+ * ata_bmdma_port_intr - Handle BMDMA port interrupt
2783+ * @ap: Port on which interrupt arrived (possibly...)
2784+ * @qc: Taskfile currently active in engine
2785+ *
2786+ * Handle port interrupt for given queued command.
2787+ *
2788+ * LOCKING:
2789+ * spin_lock_irqsave(host lock)
2790+ *
2791+ * RETURNS:
2792+ * One if interrupt was handled, zero if not (shared irq).
2793+ */
2794+unsigned int ata_bmdma_port_intr(struct ata_port *ap, struct ata_queued_cmd *qc)
2795+{
2796+ struct ata_eh_info *ehi = &ap->link.eh_info;
2797+ u8 host_stat = 0;
2798+ bool bmdma_stopped = false;
2799+ unsigned int handled;
2800+
2801+ if (ap->hsm_task_state == HSM_ST_LAST && ata_is_dma(qc->tf.protocol)) {
2802+ /* check status of DMA engine */
2803+ host_stat = ap->ops->bmdma_status(ap);
2804+ VPRINTK("ata%u: host_stat 0x%X\n", ap->print_id, host_stat);
2805+
2806+ /* if it's not our irq... */
2807+ if (!(host_stat & ATA_DMA_INTR))
2808+ return ata_sff_idle_irq(ap);
2809+
2810+ /* before we do anything else, clear DMA-Start bit */
2811+ ap->ops->bmdma_stop(qc);
2812+ bmdma_stopped = true;
2813+
2814+ if (unlikely(host_stat & ATA_DMA_ERR)) {
2815+ /* error when transfering data to/from memory */
2816+ qc->err_mask |= AC_ERR_HOST_BUS;
2817+ ap->hsm_task_state = HSM_ST_ERR;
2818+ }
2819+ }
2820+
2821+ handled = __ata_sff_port_intr(ap, qc, bmdma_stopped);
2822+
2823+ if (unlikely(qc->err_mask) && ata_is_dma(qc->tf.protocol))
2824+ ata_ehi_push_desc(ehi, "BMDMA stat 0x%x", host_stat);
2825+
2826+ return handled;
2827+}
2828+EXPORT_SYMBOL_GPL(ata_bmdma_port_intr);
2829+
2830+/**
2831+ * ata_bmdma_interrupt - Default BMDMA ATA host interrupt handler
2832+ * @irq: irq line (unused)
2833+ * @dev_instance: pointer to our ata_host information structure
2834+ *
2835+ * Default interrupt handler for PCI IDE devices. Calls
2836+ * ata_bmdma_port_intr() for each port that is not disabled.
2837+ *
2838+ * LOCKING:
2839+ * Obtains host lock during operation.
2840+ *
2841+ * RETURNS:
2842+ * IRQ_NONE or IRQ_HANDLED.
2843+ */
2844+irqreturn_t ata_bmdma_interrupt(int irq, void *dev_instance)
2845+{
2846+ return __ata_sff_interrupt(irq, dev_instance, ata_bmdma_port_intr);
2847+}
2848+EXPORT_SYMBOL_GPL(ata_bmdma_interrupt);
2849+
28062850 /**
28072851 * ata_bmdma_error_handler - Stock error handler for BMDMA controller
28082852 * @ap: port to handle error for
@@ -2848,7 +2892,8 @@ void ata_bmdma_error_handler(struct ata_port *ap) · 39 unmodified lines
28482892 /* if we're gonna thaw, make sure IRQ is clear */
28492893 if (thaw) {
28502894 ap->ops->sff_check_status(ap);
2851− ap->ops->sff_irq_clear(ap);
2895+ if (ap->ops->sff_irq_clear)
2896+ ap->ops->sff_irq_clear(ap);
28522897 }
28532898 }
28542899
@@ -2881,6 +2926,28 @@ void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc) · 26 unmodified lines
28812926 }
28822927 EXPORT_SYMBOL_GPL(ata_bmdma_post_internal_cmd);
28832928
2929+/**
2930+ * ata_bmdma_irq_clear - Clear PCI IDE BMDMA interrupt.
2931+ * @ap: Port associated with this ATA transaction.
2932+ *
2933+ * Clear interrupt and error flags in DMA status register.
2934+ *
2935+ * May be used as the irq_clear() entry in ata_port_operations.
2936+ *
2937+ * LOCKING:
2938+ * spin_lock_irqsave(host lock)
2939+ */
2940+void ata_bmdma_irq_clear(struct ata_port *ap)
2941+{
2942+ void __iomem *mmio = ap->ioaddr.bmdma_addr;
2943+
2944+ if (!mmio)
2945+ return;
2946+
2947+ iowrite8(ioread8(mmio + ATA_DMA_STATUS), mmio + ATA_DMA_STATUS);
2948+}
2949+EXPORT_SYMBOL_GPL(ata_bmdma_irq_clear);
2950+
28842951 /**
28852952 * ata_bmdma_setup - Set up PCI IDE BMDMA transaction
28862953 * @qc: Info associated with this ATA transaction.
@@ -3137,7 +3204,100 @@ void ata_pci_bmdma_init(struct ata_host *host) · 250 unmodified lines
31373204 }
31383205 EXPORT_SYMBOL_GPL(ata_pci_bmdma_init);
31393206
3207+/**
3208+ * ata_pci_bmdma_prepare_host - helper to prepare PCI BMDMA ATA host
3209+ * @pdev: target PCI device
3210+ * @ppi: array of port_info, must be enough for two ports
3211+ * @r_host: out argument for the initialized ATA host
3212+ *
3213+ * Helper to allocate BMDMA ATA host for @pdev, acquire all PCI
3214+ * resources and initialize it accordingly in one go.
3215+ *
3216+ * LOCKING:
3217+ * Inherited from calling layer (may sleep).
3218+ *
3219+ * RETURNS:
3220+ * 0 on success, -errno otherwise.
3221+ */
3222+int ata_pci_bmdma_prepare_host(struct pci_dev *pdev,
3223+ const struct ata_port_info * const * ppi,
3224+ struct ata_host **r_host)
3225+{
3226+ int rc;
3227+
3228+ rc = ata_pci_sff_prepare_host(pdev, ppi, r_host);
3229+ if (rc)
3230+ return rc;
3231+
3232+ ata_pci_bmdma_init(*r_host);
3233+ return 0;
3234+}
3235+EXPORT_SYMBOL_GPL(ata_pci_bmdma_prepare_host);
3236+
3237+/**
3238+ * ata_pci_bmdma_init_one - Initialize/register BMDMA PCI IDE controller
3239+ * @pdev: Controller to be initialized
3240+ * @ppi: array of port_info, must be enough for two ports
3241+ * @sht: scsi_host_template to use when registering the host
3242+ * @host_priv: host private_data
3243+ * @hflags: host flags
3244+ *
3245+ * This function is similar to ata_pci_sff_init_one() but also
3246+ * takes care of BMDMA initialization.
3247+ *
3248+ * LOCKING:
3249+ * Inherited from PCI layer (may sleep).
3250+ *
3251+ * RETURNS:
3252+ * Zero on success, negative on errno-based value on error.
3253+ */
3254+int ata_pci_bmdma_init_one(struct pci_dev *pdev,
3255+ const struct ata_port_info * const * ppi,
3256+ struct scsi_host_template *sht, void *host_priv,
3257+ int hflags)
3258+{
3259+ struct device *dev = &pdev->dev;
3260+ const struct ata_port_info *pi;
3261+ struct ata_host *host = NULL;
3262+ int rc;
3263+
3264+ DPRINTK("ENTER\n");
3265+
3266+ pi = ata_sff_find_valid_pi(ppi);
3267+ if (!pi) {
3268+ dev_printk(KERN_ERR, &pdev->dev,
3269+ "no valid port_info specified\n");
3270+ return -EINVAL;
3271+ }
3272+
3273+ if (!devres_open_group(dev, NULL, GFP_KERNEL))
3274+ return -ENOMEM;
3275+
3276+ rc = pcim_enable_device(pdev);
3277+ if (rc)
3278+ goto out;
3279+
3280+ /* prepare and activate BMDMA host */
3281+ rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
3282+ if (rc)
3283+ goto out;
3284+ host->private_data = host_priv;
3285+ host->flags |= hflags;
3286+
3287+ pci_set_master(pdev);
3288+ rc = ata_pci_sff_activate_host(host, ata_bmdma_interrupt, sht);
3289+ out:
3290+ if (rc == 0)
3291+ devres_remove_group(&pdev->dev, NULL);
3292+ else
3293+ devres_release_group(&pdev->dev, NULL);
3294+
3295+ return rc;
3296+}
3297+EXPORT_SYMBOL_GPL(ata_pci_bmdma_init_one);
3298+
31403299 #endif /* CONFIG_PCI */
3300+#endif /* CONFIG_ATA_BMDMA */
31413301
31423302 /**
31433303 * ata_sff_port_init - Initialize SFF/BMDMA ATA port
drivers/ata/pata_acpi.c+1−1
@@ -260,7 +260,7 @@ static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id) · 259 unmodified lines
260260 return rc;
261261 pcim_pin_device(pdev);
262262 }
263− return ata_pci_sff_init_one(pdev, ppi, &pacpi_sht, NULL, 0);
263+ return ata_pci_bmdma_init_one(pdev, ppi, &pacpi_sht, NULL, 0);
264264 }
265265
266266 static const struct pci_device_id pacpi_pci_tbl[] = {
drivers/ata/pata_ali.c+4−1
@@ -583,7 +583,10 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 582 unmodified lines
583583 ppi[0] = &info_20_udma;
584584 }
585585
586− return ata_pci_sff_init_one(pdev, ppi, &ali_sht, NULL, 0);
586+ if (!ppi[0]->mwdma_mask && !ppi[0]->udma_mask)
587+ return ata_pci_sff_init_one(pdev, ppi, &ali_sht, NULL, 0);
588+ else
589+ return ata_pci_bmdma_init_one(pdev, ppi, &ali_sht, NULL, 0);
587590 }
588591
589592 #ifdef CONFIG_PM
drivers/ata/pata_amd.c+1−1
@@ -574,7 +574,7 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 573 unmodified lines
574574 }
575575
576576 /* And fire it up */
577− return ata_pci_sff_init_one(pdev, ppi, &amd_sht, hpriv, 0);
577+ return ata_pci_bmdma_init_one(pdev, ppi, &amd_sht, hpriv, 0);
578578 }
579579
580580 #ifdef CONFIG_PM
drivers/ata/pata_artop.c+1−1
@@ -421,7 +421,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) · 420 unmodified lines
421421
422422 BUG_ON(ppi[0] == NULL);
423423
424− return ata_pci_sff_init_one(pdev, ppi, &artop_sht, NULL, 0);
424+ return ata_pci_bmdma_init_one(pdev, ppi, &artop_sht, NULL, 0);
425425 }
426426
427427 static const struct pci_device_id artop_pci_tbl[] = {
drivers/ata/pata_atiixp.c+2−2
@@ -246,8 +246,8 @@ static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 245 unmodified lines
246246 if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i]))
247247 ppi[i] = &ata_dummy_port_info;
248248
249− return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL,
250− ATA_HOST_PARALLEL_SCAN);
249+ return ata_pci_bmdma_init_one(pdev, ppi, &atiixp_sht, NULL,
250+ ATA_HOST_PARALLEL_SCAN);
251251 }
252252
253253 static const struct pci_device_id atiixp[] = {
drivers/ata/pata_atp867x.c+1−1
@@ -525,7 +525,7 @@ static int atp867x_init_one(struct pci_dev *pdev, · 524 unmodified lines
525525
526526 pci_set_master(pdev);
527527
528− rc = ata_host_activate(host, pdev->irq, ata_sff_interrupt,
528+ rc = ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
529529 IRQF_SHARED, &atp867x_sht);
530530 if (rc)
531531 dev_printk(KERN_ERR, &pdev->dev, "failed to activate host\n");
drivers/ata/pata_bf54x.c+1−1
@@ -1214,7 +1214,7 @@ static unsigned int bfin_data_xfer(struct ata_device *dev, unsigned char *buf, · 1213 unmodified lines
12141214 * bfin_irq_clear - Clear ATAPI interrupt.
12151215 * @ap: Port associated with this ATA transaction.
12161216 *
1217− * Note: Original code is ata_sff_irq_clear().
1217+ * Note: Original code is ata_bmdma_irq_clear().
12181218 */
12191219
12201220 static void bfin_irq_clear(struct ata_port *ap)
drivers/ata/pata_cmd64x.c+1−1
@@ -367,7 +367,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 366 unmodified lines
367367 pci_write_config_byte(pdev, UDIDETCR0, 0xF0);
368368 #endif
369369
370− return ata_pci_sff_init_one(pdev, ppi, &cmd64x_sht, NULL, 0);
370+ return ata_pci_bmdma_init_one(pdev, ppi, &cmd64x_sht, NULL, 0);
371371 }
372372
373373 #ifdef CONFIG_PM
drivers/ata/pata_cs5520.c+1−1
@@ -221,7 +221,7 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi · 220 unmodified lines
221221 continue;
222222
223223 rc = devm_request_irq(&pdev->dev, irq[ap->port_no],
224− ata_sff_interrupt, 0, DRV_NAME, host);
224+ ata_bmdma_interrupt, 0, DRV_NAME, host);
225225 if (rc)
226226 return rc;
227227
drivers/ata/pata_cs5530.c+1−1
@@ -324,7 +324,7 @@ static int cs5530_init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 323 unmodified lines
324324 ppi[1] = &info_palmax_secondary;
325325
326326 /* Now kick off ATA set up */
327− return ata_pci_sff_init_one(pdev, ppi, &cs5530_sht, NULL, 0);
327+ return ata_pci_bmdma_init_one(pdev, ppi, &cs5530_sht, NULL, 0);
328328 }
329329
330330 #ifdef CONFIG_PM
drivers/ata/pata_cs5535.c+1−1
@@ -198,7 +198,7 @@ static int cs5535_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 197 unmodified lines
198198 rdmsr(ATAC_CH0D1_PIO, timings, dummy);
199199 if (CS5535_BAD_PIO(timings))
200200 wrmsr(ATAC_CH0D1_PIO, 0xF7F4F7F4UL, 0);
201− return ata_pci_sff_init_one(dev, ppi, &cs5535_sht, NULL, 0);
201+ return ata_pci_bmdma_init_one(dev, ppi, &cs5535_sht, NULL, 0);
202202 }
203203
204204 static const struct pci_device_id cs5535[] = {
drivers/ata/pata_cs5536.c+1−1
@@ -260,7 +260,7 @@ static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 259 unmodified lines
260260 return -ENODEV;
261261 }
262262
263− return ata_pci_sff_init_one(dev, ppi, &cs5536_sht, NULL, 0);
263+ return ata_pci_bmdma_init_one(dev, ppi, &cs5536_sht, NULL, 0);
264264 }
265265
266266 static const struct pci_device_id cs5536[] = {
drivers/ata/pata_cypress.c+1−1
@@ -138,7 +138,7 @@ static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *i · 137 unmodified lines
138138 if (PCI_FUNC(pdev->devfn) != 1)
139139 return -ENODEV;
140140
141− return ata_pci_sff_init_one(pdev, ppi, &cy82c693_sht, NULL, 0);
141+ return ata_pci_bmdma_init_one(pdev, ppi, &cy82c693_sht, NULL, 0);
142142 }
143143
144144 static const struct pci_device_id cy82c693[] = {
drivers/ata/pata_efar.c+2−2
@@ -277,8 +277,8 @@ static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) · 276 unmodified lines
277277 dev_printk(KERN_DEBUG, &pdev->dev,
278278 "version " DRV_VERSION "\n");
279279
280− return ata_pci_sff_init_one(pdev, ppi, &efar_sht, NULL,
281− ATA_HOST_PARALLEL_SCAN);
280+ return ata_pci_bmdma_init_one(pdev, ppi, &efar_sht, NULL,
281+ ATA_HOST_PARALLEL_SCAN);
282282 }
283283
284284 static const struct pci_device_id efar_pci_tbl[] = {
drivers/ata/pata_hpt366.c+1−1
@@ -361,7 +361,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 360 unmodified lines
361361 break;
362362 }
363363 /* Now kick off ATA set up */
364− return ata_pci_sff_init_one(dev, ppi, &hpt36x_sht, hpriv, 0);
364+ return ata_pci_bmdma_init_one(dev, ppi, &hpt36x_sht, hpriv, 0);
365365 }
366366
367367 #ifdef CONFIG_PM
drivers/ata/pata_hpt37x.c+1−1
@@ -987,7 +987,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 986 unmodified lines
987987 }
988988
989989 /* Now kick off ATA set up */
990− return ata_pci_sff_init_one(dev, ppi, &hpt37x_sht, private_data, 0);
990+ return ata_pci_bmdma_init_one(dev, ppi, &hpt37x_sht, private_data, 0);
991991 }
992992
993993 static const struct pci_device_id hpt37x[] = {
drivers/ata/pata_hpt3x2n.c+1−1
@@ -548,7 +548,7 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 547 unmodified lines
548548 outb(inb(iobase + 0x9c) | 0x04, iobase + 0x9c);
549549
550550 /* Now kick off ATA set up */
551− return ata_pci_sff_init_one(dev, ppi, &hpt3x2n_sht, hpriv, 0);
551+ return ata_pci_bmdma_init_one(dev, ppi, &hpt3x2n_sht, hpriv, 0);
552552 }
553553
554554 static const struct pci_device_id hpt3x2n[] = {
drivers/ata/pata_hpt3x3.c+1−1
@@ -248,7 +248,7 @@ static int hpt3x3_init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 247 unmodified lines
248248 ata_port_pbar_desc(ap, 4, offset_cmd[i], "cmd");
249249 }
250250 pci_set_master(pdev);
251− return ata_host_activate(host, pdev->irq, ata_sff_interrupt,
251+ return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
252252 IRQF_SHARED, &hpt3x3_sht);
253253 }
254254
drivers/ata/pata_icside.c+1−1
@@ -470,7 +470,7 @@ static int __devinit pata_icside_add_ports(struct pata_icside_info *info) · 469 unmodified lines
470470 pata_icside_setup_ioaddr(ap, info->base, info, info->port[i]);
471471 }
472472
473− return ata_host_activate(host, ec->irq, ata_sff_interrupt, 0,
473+ return ata_host_activate(host, ec->irq, ata_bmdma_interrupt, 0,
474474 &pata_icside_sht);
475475 }
476476
drivers/ata/pata_it8213.c+1−1
@@ -273,7 +273,7 @@ static int it8213_init_one (struct pci_dev *pdev, const struct pci_device_id *en · 272 unmodified lines
273273 dev_printk(KERN_DEBUG, &pdev->dev,
274274 "version " DRV_VERSION "\n");
275275
276− return ata_pci_sff_init_one(pdev, ppi, &it8213_sht, NULL, 0);
276+ return ata_pci_bmdma_init_one(pdev, ppi, &it8213_sht, NULL, 0);
277277 }
278278
279279 static const struct pci_device_id it8213_pci_tbl[] = {
drivers/ata/pata_it821x.c+1−1
@@ -933,7 +933,7 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 932 unmodified lines
933933 else
934934 ppi[0] = &info_smart;
935935 }
936− return ata_pci_sff_init_one(pdev, ppi, &it821x_sht, NULL, 0);
936+ return ata_pci_bmdma_init_one(pdev, ppi, &it821x_sht, NULL, 0);
937937 }
938938
939939 #ifdef CONFIG_PM
drivers/ata/pata_jmicron.c+1−1
@@ -144,7 +144,7 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i · 143 unmodified lines
144144 };
145145 const struct ata_port_info *ppi[] = { &info, NULL };
146146
147− return ata_pci_sff_init_one(pdev, ppi, &jmicron_sht, NULL, 0);
147+ return ata_pci_bmdma_init_one(pdev, ppi, &jmicron_sht, NULL, 0);
148148 }
149149
150150 static const struct pci_device_id jmicron_pci_tbl[] = {
drivers/ata/pata_macio.c+1−1
@@ -1110,7 +1110,7 @@ static int __devinit pata_macio_common_init(struct pata_macio_priv *priv, · 1109 unmodified lines
11101110
11111111 /* Start it up */
11121112 priv->irq = irq;
1113− return ata_host_activate(priv->host, irq, ata_sff_interrupt, 0,
1113+ return ata_host_activate(priv->host, irq, ata_bmdma_interrupt, 0,
11141114 &pata_macio_sht);
11151115 }
11161116
drivers/ata/pata_marvell.c+1−1
@@ -153,7 +153,7 @@ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *i · 152 unmodified lines
153153 return -ENODEV;
154154 }
155155 #endif
156− return ata_pci_sff_init_one(pdev, ppi, &marvell_sht, NULL, 0);
156+ return ata_pci_bmdma_init_one(pdev, ppi, &marvell_sht, NULL, 0);
157157 }
158158
159159 static const struct pci_device_id marvell_pci_tbl[] = {
drivers/ata/pata_mpc52xx.c+1−1
@@ -659,7 +659,7 @@ mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv, · 658 unmodified lines
659659 ata_port_desc(ap, "ata_regs 0x%lx", raw_ata_regs);
660660
661661 /* activate host */
662− return ata_host_activate(host, priv->ata_irq, ata_sff_interrupt, 0,
662+ return ata_host_activate(host, priv->ata_irq, ata_bmdma_interrupt, 0,
663663 &mpc52xx_ata_sht);
664664 }
665665
drivers/ata/pata_netcell.c+1−1
@@ -82,7 +82,7 @@ static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *e · 81 unmodified lines
8282 ata_pci_bmdma_clear_simplex(pdev);
8383
8484 /* And let the library code do the work */
85− return ata_pci_sff_init_one(pdev, port_info, &netcell_sht, NULL, 0);
85+ return ata_pci_bmdma_init_one(pdev, port_info, &netcell_sht, NULL, 0);
8686 }
8787
8888 static const struct pci_device_id netcell_pci_tbl[] = {
drivers/ata/pata_ninja32.c+1−1
@@ -149,7 +149,7 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 148 unmodified lines
149149
150150 ninja32_program(base);
151151 /* FIXME: Should we disable them at remove ? */
152− return ata_host_activate(host, dev->irq, ata_sff_interrupt,
152+ return ata_host_activate(host, dev->irq, ata_bmdma_interrupt,
153153 IRQF_SHARED, &ninja32_sht);
154154 }
155155
drivers/ata/pata_ns87415.c+1−1
@@ -380,7 +380,7 @@ static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e · 379 unmodified lines
380380
381381 ns87415_fixup(pdev);
382382
383− return ata_pci_sff_init_one(pdev, ppi, &ns87415_sht, NULL, 0);
383+ return ata_pci_bmdma_init_one(pdev, ppi, &ns87415_sht, NULL, 0);
384384 }
385385
386386 static const struct pci_device_id ns87415_pci_tbl[] = {
drivers/ata/pata_octeon_cf.c+0−18
@@ -749,20 +749,6 @@ static void octeon_cf_dev_config(struct ata_device *dev) · 748 unmodified lines
749749 dev->max_sectors = min(dev->max_sectors, 4095U);
750750 }
751751
752−/*
753− * Trap if driver tries to do standard bmdma commands. They are not
754− * supported.
755− */
756−static void unreachable_qc(struct ata_queued_cmd *qc)
757−{
758− BUG();
759−}
760−
761−static u8 unreachable_port(struct ata_port *ap)
762−{
763− BUG();
764−}
765−
766752 /*
767753 * We don't do ATAPI DMA so return 0.
768754 */
@@ -804,10 +790,6 @@ static struct ata_port_operations octeon_cf_ops = { · 35 unmodified lines
804790 .sff_dev_select = octeon_cf_dev_select,
805791 .sff_irq_on = octeon_cf_irq_on,
806792 .sff_irq_clear = octeon_cf_irq_clear,
807− .bmdma_setup = unreachable_qc,
808− .bmdma_start = unreachable_qc,
809− .bmdma_stop = unreachable_qc,
810− .bmdma_status = unreachable_port,
811793 .cable_detect = ata_cable_40wire,
812794 .set_piomode = octeon_cf_set_piomode,
813795 .set_dmamode = octeon_cf_set_dmamode,
drivers/ata/pata_oldpiix.c+1−1
@@ -248,7 +248,7 @@ static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *e · 247 unmodified lines
248248 dev_printk(KERN_DEBUG, &pdev->dev,
249249 "version " DRV_VERSION "\n");
250250
251− return ata_pci_sff_init_one(pdev, ppi, &oldpiix_sht, NULL, 0);
251+ return ata_pci_bmdma_init_one(pdev, ppi, &oldpiix_sht, NULL, 0);
252252 }
253253
254254 static const struct pci_device_id oldpiix_pci_tbl[] = {
drivers/ata/pata_optidma.c+1−1
@@ -429,7 +429,7 @@ static int optidma_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 428 unmodified lines
429429 if (optiplus_with_udma(dev))
430430 ppi[0] = &info_82c700_udma;
431431
432− return ata_pci_sff_init_one(dev, ppi, &optidma_sht, NULL, 0);
432+ return ata_pci_bmdma_init_one(dev, ppi, &optidma_sht, NULL, 0);
433433 }
434434
435435 static const struct pci_device_id optidma[] = {
drivers/ata/pata_pdc2027x.c+1−1
@@ -754,7 +754,7 @@ static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_de · 753 unmodified lines
754754 return -EIO;
755755
756756 pci_set_master(pdev);
757− return ata_host_activate(host, pdev->irq, ata_sff_interrupt,
757+ return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
758758 IRQF_SHARED, &pdc2027x_sht);
759759 }
760760
drivers/ata/pata_pdc202xx_old.c+1−1
@@ -337,7 +337,7 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id · 336 unmodified lines
337337 return -ENODEV;
338338 }
339339 }
340− return ata_pci_sff_init_one(dev, ppi, &pdc202xx_sht, NULL, 0);
340+ return ata_pci_bmdma_init_one(dev, ppi, &pdc202xx_sht, NULL, 0);
341341 }
342342
343343 static const struct pci_device_id pdc202xx[] = {
drivers/ata/pata_piccolo.c+1−1
@@ -95,7 +95,7 @@ static int ata_tosh_init_one(struct pci_dev *dev, const struct pci_device_id *id · 94 unmodified lines
9595 };
9696 const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info };
9797 /* Just one port for the moment */
98− return ata_pci_sff_init_one(dev, ppi, &tosh_sht, NULL, 0);
98+ return ata_pci_bmdma_init_one(dev, ppi, &tosh_sht, NULL, 0);
9999 }
100100
101101 static struct pci_device_id ata_tosh[] = {
drivers/ata/pata_radisys.c+1−1
@@ -227,7 +227,7 @@ static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *e · 226 unmodified lines
227227 dev_printk(KERN_DEBUG, &pdev->dev,
228228 "version " DRV_VERSION "\n");
229229
230− return ata_pci_sff_init_one(pdev, ppi, &radisys_sht, NULL, 0);
230+ return ata_pci_bmdma_init_one(pdev, ppi, &radisys_sht, NULL, 0);
231231 }
232232
233233 static const struct pci_device_id radisys_pci_tbl[] = {
drivers/ata/pata_rdc.c+2−2
@@ -344,7 +344,7 @@ static int __devinit rdc_init_one(struct pci_dev *pdev, · 343 unmodified lines
344344 */
345345 pci_read_config_dword(pdev, 0x54, &hpriv->saved_iocfg);
346346
347− rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
347+ rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
348348 if (rc)
349349 return rc;
350350 host->private_data = hpriv;
@@ -354,7 +354,7 @@ static int __devinit rdc_init_one(struct pci_dev *pdev, · 3 unmodified lines
354354 host->flags |= ATA_HOST_PARALLEL_SCAN;
355355
356356 pci_set_master(pdev);
357− return ata_pci_sff_activate_host(host, ata_sff_interrupt, &rdc_sht);
357+ return ata_pci_sff_activate_host(host, ata_bmdma_interrupt, &rdc_sht);
358358 }
359359
360360 static void rdc_remove_one(struct pci_dev *pdev)
drivers/ata/pata_sc1200.c+1−1
@@ -237,7 +237,7 @@ static int sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 236 unmodified lines
237237 };
238238 const struct ata_port_info *ppi[] = { &info, NULL };
239239
240− return ata_pci_sff_init_one(dev, ppi, &sc1200_sht, NULL, 0);
240+ return ata_pci_bmdma_init_one(dev, ppi, &sc1200_sht, NULL, 0);
241241 }
242242
243243 static const struct pci_device_id sc1200[] = {
drivers/ata/pata_scc.c+2−2
@@ -875,7 +875,7 @@ static void scc_postreset(struct ata_link *link, unsigned int *classes) · 874 unmodified lines
875875 * scc_irq_clear - Clear PCI IDE BMDMA interrupt.
876876 * @ap: Port associated with this ATA transaction.
877877 *
878− * Note: Original code is ata_sff_irq_clear().
878+ * Note: Original code is ata_bmdma_irq_clear().
879879 */
880880
881881 static void scc_irq_clear (struct ata_port *ap)
@@ -1105,7 +1105,7 @@ static int scc_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) · 223 unmodified lines
11051105 if (rc)
11061106 return rc;
11071107
1108− return ata_host_activate(host, pdev->irq, ata_sff_interrupt,
1108+ return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
11091109 IRQF_SHARED, &scc_sht);
11101110 }
11111111
drivers/ata/pata_sch.c+1−1
@@ -179,7 +179,7 @@ static int __devinit sch_init_one(struct pci_dev *pdev, · 178 unmodified lines
179179 dev_printk(KERN_DEBUG, &pdev->dev,
180180 "version " DRV_VERSION "\n");
181181
182− return ata_pci_sff_init_one(pdev, ppi, &sch_sht, NULL, 0);
182+ return ata_pci_bmdma_init_one(pdev, ppi, &sch_sht, NULL, 0);
183183 }
184184
185185 static int __init sch_init(void)
drivers/ata/pata_serverworks.c+1−1
@@ -460,7 +460,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id · 459 unmodified lines
460460 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)
461461 ata_pci_bmdma_clear_simplex(pdev);
462462
463− return ata_pci_sff_init_one(pdev, ppi, &serverworks_sht, NULL, 0);
463+ return ata_pci_bmdma_init_one(pdev, ppi, &serverworks_sht, NULL, 0);
464464 }
465465
466466 #ifdef CONFIG_PM
drivers/ata/pata_sil680.c+2−2
@@ -374,11 +374,11 @@ static int __devinit sil680_init_one(struct pci_dev *pdev, · 373 unmodified lines
374374 ata_sff_std_ports(&host->ports[1]->ioaddr);
375375
376376 /* Register & activate */
377− return ata_host_activate(host, pdev->irq, ata_sff_interrupt,
377+ return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
378378 IRQF_SHARED, &sil680_sht);
379379
380380 use_ioports:
381− return ata_pci_sff_init_one(pdev, ppi, &sil680_sht, NULL, 0);
381+ return ata_pci_bmdma_init_one(pdev, ppi, &sil680_sht, NULL, 0);
382382 }
383383
384384 #ifdef CONFIG_PM
drivers/ata/pata_sis.c+1−1
@@ -826,7 +826,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) · 825 unmodified lines
826826
827827 sis_fixup(pdev, chipset);
828828
829− return ata_pci_sff_init_one(pdev, ppi, &sis_sht, chipset, 0);
829+ return ata_pci_bmdma_init_one(pdev, ppi, &sis_sht, chipset, 0);
830830 }
831831
832832 #ifdef CONFIG_PM
drivers/ata/pata_sl82c105.c+1−1
@@ -316,7 +316,7 @@ static int sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id · 315 unmodified lines
316316 val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16;
317317 pci_write_config_dword(dev, 0x40, val);
318318
319− return ata_pci_sff_init_one(dev, ppi, &sl82c105_sht, NULL, 0);
319+ return ata_pci_bmdma_init_one(dev, ppi, &sl82c105_sht, NULL, 0);
320320 }
321321
322322 static const struct pci_device_id sl82c105[] = {
drivers/ata/pata_triflex.c+1−1
@@ -201,7 +201,7 @@ static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 200 unmodified lines
201201 if (!printed_version++)
202202 dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
203203
204− return ata_pci_sff_init_one(dev, ppi, &triflex_sht, NULL, 0);
204+ return ata_pci_bmdma_init_one(dev, ppi, &triflex_sht, NULL, 0);
205205 }
206206
207207 static const struct pci_device_id triflex[] = {
drivers/ata/pata_via.c+1−1
@@ -627,7 +627,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) · 626 unmodified lines
627627 }
628628
629629 /* We have established the device type, now fire it up */
630− return ata_pci_sff_init_one(pdev, ppi, &via_sht, (void *)config, 0);
630+ return ata_pci_bmdma_init_one(pdev, ppi, &via_sht, (void *)config, 0);
631631 }
632632
633633 #ifdef CONFIG_PM
drivers/ata/sata_mv.c+1−3
@@ -675,8 +675,6 @@ static struct ata_port_operations mv5_ops = { · 674 unmodified lines
675675 .freeze = mv_eh_freeze,
676676 .thaw = mv_eh_thaw,
677677 .hardreset = mv_hardreset,
678− .error_handler = ata_std_error_handler, /* avoid SFF EH */
679− .post_internal_cmd = ATA_OP_NULL,
680678
681679 .scr_read = mv5_scr_read,
682680 .scr_write = mv5_scr_write,
@@ -2813,7 +2811,7 @@ static void mv_port_intr(struct ata_port *ap, u32 port_cause) · 2130 unmodified lines
28132811 } else if (!edma_was_enabled) {
28142812 struct ata_queued_cmd *qc = mv_get_active_qc(ap);
28152813 if (qc)
2816− ata_sff_host_intr(ap, qc);
2814+ ata_bmdma_port_intr(ap, qc);
28172815 else
28182816 mv_unexpected_intr(ap, edma_was_enabled);
28192817 }
drivers/ata/sata_nv.c+4−4
@@ -920,7 +920,7 @@ static int nv_host_intr(struct ata_port *ap, u8 irq_stat) · 919 unmodified lines
920920 }
921921
922922 /* handle interrupt */
923− return ata_sff_host_intr(ap, qc);
923+ return ata_bmdma_port_intr(ap, qc);
924924 }
925925
926926 static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
@@ -1100,7 +1100,7 @@ static void nv_adma_irq_clear(struct ata_port *ap) · 173 unmodified lines
11001100 u32 notifier_clears[2];
11011101
11021102 if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) {
1103− ata_sff_irq_clear(ap);
1103+ ata_bmdma_irq_clear(ap);
11041104 return;
11051105 }
11061106
@@ -1505,7 +1505,7 @@ static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance) · 398 unmodified lines
15051505
15061506 qc = ata_qc_from_tag(ap, ap->link.active_tag);
15071507 if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) {
1508− handled += ata_sff_host_intr(ap, qc);
1508+ handled += ata_bmdma_port_intr(ap, qc);
15091509 } else {
15101510 /*
15111511 * No request pending? Clear interrupt status
@@ -2430,7 +2430,7 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 918 unmodified lines
24302430
24312431 ppi[0] = &nv_port_info[type];
24322432 ipriv = ppi[0]->private_data;
2433− rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
2433+ rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
24342434 if (rc)
24352435 return rc;
24362436
drivers/ata/sata_qstor.c+1−15
@@ -120,8 +120,6 @@ static void qs_host_stop(struct ata_host *host); · 119 unmodified lines
120120 static void qs_qc_prep(struct ata_queued_cmd *qc);
121121 static unsigned int qs_qc_issue(struct ata_queued_cmd *qc);
122122 static int qs_check_atapi_dma(struct ata_queued_cmd *qc);
123−static void qs_bmdma_stop(struct ata_queued_cmd *qc);
124−static u8 qs_bmdma_status(struct ata_port *ap);
125123 static void qs_freeze(struct ata_port *ap);
126124 static void qs_thaw(struct ata_port *ap);
127125 static int qs_prereset(struct ata_link *link, unsigned long deadline);
@@ -137,8 +135,6 @@ static struct ata_port_operations qs_ata_ops = { · 9 unmodified lines
137135 .inherits = &ata_sff_port_ops,
138136
139137 .check_atapi_dma = qs_check_atapi_dma,
140− .bmdma_stop = qs_bmdma_stop,
141− .bmdma_status = qs_bmdma_status,
142138 .qc_prep = qs_qc_prep,
143139 .qc_issue = qs_qc_issue,
144140
@@ -190,16 +186,6 @@ static int qs_check_atapi_dma(struct ata_queued_cmd *qc) · 45 unmodified lines
190186 return 1; /* ATAPI DMA not supported */
191187 }
192188
193−static void qs_bmdma_stop(struct ata_queued_cmd *qc)
194−{
195− /* nothing */
196−}
197−
198−static u8 qs_bmdma_status(struct ata_port *ap)
199−{
200− return 0;
201−}
202−
203189 static inline void qs_enter_reg_mode(struct ata_port *ap)
204190 {
205191 u8 __iomem *chan = qs_mmio_base(ap->host) + (ap->port_no * 0x4000);
@@ -454,7 +440,7 @@ static inline unsigned int qs_intr_mmio(struct ata_host *host) · 248 unmodified lines
454440 if (!pp || pp->state != qs_state_mmio)
455441 continue;
456442 if (!(qc->tf.flags & ATA_TFLAG_POLLING))
457− handled |= ata_sff_host_intr(ap, qc);
443+ handled |= ata_sff_port_intr(ap, qc);
458444 }
459445 return handled;
460446 }
drivers/ata/sata_sil.c+2−2
@@ -503,7 +503,7 @@ static void sil_host_intr(struct ata_port *ap, u32 bmdma2) · 502 unmodified lines
503503 goto err_hsm;
504504
505505 /* ack bmdma irq events */
506− ata_sff_irq_clear(ap);
506+ ata_bmdma_irq_clear(ap);
507507
508508 /* kick HSM in the ass */
509509 ata_sff_hsm_move(ap, qc, status, 0);
@@ -584,7 +584,7 @@ static void sil_thaw(struct ata_port *ap) · 74 unmodified lines
584584
585585 /* clear IRQ */
586586 ap->ops->sff_check_status(ap);
587− ata_sff_irq_clear(ap);
587+ ata_bmdma_irq_clear(ap);
588588
589589 /* turn on SATA IRQ if supported */
590590 if (!(ap->flags & SIL_FLAG_NO_SATA_IRQ))
drivers/ata/sata_sis.c+2−2
@@ -279,7 +279,7 @@ static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 278 unmodified lines
279279 break;
280280 }
281281
282− rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
282+ rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
283283 if (rc)
284284 return rc;
285285
@@ -308,7 +308,7 @@ static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 22 unmodified lines
308308
309309 pci_set_master(pdev);
310310 pci_intx(pdev, 1);
311− return ata_host_activate(host, pdev->irq, ata_sff_interrupt,
311+ return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
312312 IRQF_SHARED, &sis_sht);
313313 }
314314
drivers/ata/sata_svw.c+1−1
@@ -502,7 +502,7 @@ static int k2_sata_init_one(struct pci_dev *pdev, const struct pci_device_id *en · 501 unmodified lines
502502 writel(0x0, mmio_base + K2_SATA_SIM_OFFSET);
503503
504504 pci_set_master(pdev);
505− return ata_host_activate(host, pdev->irq, ata_sff_interrupt,
505+ return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
506506 IRQF_SHARED, &k2_sata_sht);
507507 }
508508
drivers/ata/sata_uli.c+1−1
@@ -242,7 +242,7 @@ static int uli_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 241 unmodified lines
242242
243243 pci_set_master(pdev);
244244 pci_intx(pdev, 1);
245− return ata_host_activate(host, pdev->irq, ata_sff_interrupt,
245+ return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
246246 IRQF_SHARED, &uli_sht);
247247 }
248248
drivers/ata/sata_via.c+4−4
@@ -308,7 +308,7 @@ static void svia_noop_freeze(struct ata_port *ap) · 307 unmodified lines
308308 * certain way. Leave it alone and just clear pending IRQ.
309309 */
310310 ap->ops->sff_check_status(ap);
311− ata_sff_irq_clear(ap);
311+ ata_bmdma_irq_clear(ap);
312312 }
313313
314314 /**
@@ -463,7 +463,7 @@ static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) · 148 unmodified lines
463463 struct ata_host *host;
464464 int rc;
465465
466− rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
466+ rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
467467 if (rc)
468468 return rc;
469469 *r_host = host;
@@ -520,7 +520,7 @@ static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) · 50 unmodified lines
520520 struct ata_host *host;
521521 int i, rc;
522522
523− rc = ata_pci_sff_prepare_host(pdev, ppi, &host);
523+ rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
524524 if (rc)
525525 return rc;
526526 *r_host = host;
@@ -628,7 +628,7 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 101 unmodified lines
628628 svia_configure(pdev);
629629
630630 pci_set_master(pdev);
631− return ata_host_activate(host, pdev->irq, ata_sff_interrupt,
631+ return ata_host_activate(host, pdev->irq, ata_bmdma_interrupt,
632632 IRQF_SHARED, &svia_sht);
633633 }
634634
drivers/ata/sata_vsc.c+1−1
@@ -245,7 +245,7 @@ static void vsc_port_intr(u8 port_status, struct ata_port *ap) · 244 unmodified lines
245245
246246 qc = ata_qc_from_tag(ap, ap->link.active_tag);
247247 if (qc && likely(!(qc->tf.flags & ATA_TFLAG_POLLING)))
248− handled = ata_sff_host_intr(ap, qc);
248+ handled = ata_bmdma_port_intr(ap, qc);
249249
250250 /* We received an interrupt during a polled command,
251251 * or some other spurious condition. Interrupt reporting
include/linux/libata.h+29−7
@@ -386,6 +386,7 @@ enum { · 385 unmodified lines
386386 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */
387387 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */
388388 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */
389+ ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */
389390
390391 /* DMA mask for user DMA control: User visible values; DO NOT
391392 renumber */
@@ -513,7 +514,9 @@ struct ata_ioports { · 121 unmodified lines
513514 void __iomem *command_addr;
514515 void __iomem *altstatus_addr;
515516 void __iomem *ctl_addr;
517+#ifdef CONFIG_ATA_BMDMA
516518 void __iomem *bmdma_addr;
519+#endif /* CONFIG_ATA_BMDMA */
517520 void __iomem *scr_addr;
518521 };
519522 #endif /* CONFIG_ATA_SFF */
@@ -721,8 +724,10 @@ struct ata_port { · 201 unmodified lines
721724 u8 ctl; /* cache of ATA control register */
722725 u8 last_ctl; /* Cache last written value */
723726 struct delayed_work sff_pio_task;
727+#ifdef CONFIG_ATA_BMDMA
724728 struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */
725729 dma_addr_t bmdma_prd_dma; /* and its DMA mapping */
730+#endif /* CONFIG_ATA_BMDMA */
726731 #endif /* CONFIG_ATA_SFF */
727732
728733 unsigned int pio_mask;
@@ -856,10 +861,12 @@ struct ata_port_operations { · 127 unmodified lines
856861 void (*sff_irq_clear)(struct ata_port *);
857862 void (*sff_drain_fifo)(struct ata_queued_cmd *qc);
858863
864+#ifdef CONFIG_ATA_BMDMA
859865 void (*bmdma_setup)(struct ata_queued_cmd *qc);
860866 void (*bmdma_start)(struct ata_queued_cmd *qc);
861867 void (*bmdma_stop)(struct ata_queued_cmd *qc);
862868 u8 (*bmdma_status)(struct ata_port *ap);
869+#endif /* CONFIG_ATA_BMDMA */
863870 #endif /* CONFIG_ATA_SFF */
864871
865872 ssize_t (*em_show)(struct ata_port *ap, char *buf);
@@ -1555,7 +1562,6 @@ extern void sata_pmp_error_handler(struct ata_port *ap); · 689 unmodified lines
15551562 #ifdef CONFIG_ATA_SFF
15561563
15571564 extern const struct ata_port_operations ata_sff_port_ops;
1558−extern const struct ata_port_operations ata_bmdma_port_ops;
15591565 extern const struct ata_port_operations ata_bmdma32_port_ops;
15601566
15611567 /* PIO only, sg_tablesize and dma_boundary limits can be removed */
@@ -1564,11 +1570,6 @@ extern const struct ata_port_operations ata_bmdma32_port_ops; · 2 unmodified lines
15641570 .sg_tablesize = LIBATA_MAX_PRD, \
15651571 .dma_boundary = ATA_DMA_BOUNDARY
15661572
1567−#define ATA_BMDMA_SHT(drv_name) \
1568− ATA_BASE_SHT(drv_name), \
1569− .sg_tablesize = LIBATA_MAX_PRD, \
1570− .dma_boundary = ATA_DMA_BOUNDARY
1571−
15721573 extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device);
15731574 extern u8 ata_sff_check_status(struct ata_port *ap);
15741575 extern void ata_sff_pause(struct ata_port *ap);
@@ -1593,7 +1594,7 @@ extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, · 18 unmodified lines
15931594 extern void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay);
15941595 extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc);
15951596 extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc);
1596−extern unsigned int ata_sff_host_intr(struct ata_port *ap,
1597+extern unsigned int ata_sff_port_intr(struct ata_port *ap,
15971598 struct ata_queued_cmd *qc);
15981599 extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance);
15991600 extern void ata_sff_lost_interrupt(struct ata_port *ap);
@@ -1625,11 +1626,24 @@ extern int ata_pci_sff_init_one(struct pci_dev *pdev, · 25 unmodified lines
16251626 struct scsi_host_template *sht, void *host_priv, int hflags);
16261627 #endif /* CONFIG_PCI */
16271628
1629+#ifdef CONFIG_ATA_BMDMA
1630+
1631+extern const struct ata_port_operations ata_bmdma_port_ops;
1632+
1633+#define ATA_BMDMA_SHT(drv_name) \
1634+ ATA_BASE_SHT(drv_name), \
1635+ .sg_tablesize = LIBATA_MAX_PRD, \
1636+ .dma_boundary = ATA_DMA_BOUNDARY
1637+
16281638 extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc);
16291639 extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc);
16301640 extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc);
1641+extern unsigned int ata_bmdma_port_intr(struct ata_port *ap,
1642+ struct ata_queued_cmd *qc);
1643+extern irqreturn_t ata_bmdma_interrupt(int irq, void *dev_instance);
16311644 extern void ata_bmdma_error_handler(struct ata_port *ap);
16321645 extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc);
1646+extern void ata_bmdma_irq_clear(struct ata_port *ap);
16331647 extern void ata_bmdma_setup(struct ata_queued_cmd *qc);
16341648 extern void ata_bmdma_start(struct ata_queued_cmd *qc);
16351649 extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
@@ -1640,7 +1654,15 @@ extern int ata_bmdma_port_start32(struct ata_port *ap); · 4 unmodified lines
16401654 #ifdef CONFIG_PCI
16411655 extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev);
16421656 extern void ata_pci_bmdma_init(struct ata_host *host);
1657+extern int ata_pci_bmdma_prepare_host(struct pci_dev *pdev,
1658+ const struct ata_port_info * const * ppi,
1659+ struct ata_host **r_host);
1660+extern int ata_pci_bmdma_init_one(struct pci_dev *pdev,
1661+ const struct ata_port_info * const * ppi,
1662+ struct scsi_host_template *sht,
1663+ void *host_priv, int hflags);
16431664 #endif /* CONFIG_PCI */
1665+#endif /* CONFIG_ATA_BMDMA */
16441666
16451667 /**
16461668 * ata_sff_busy_wait - Wait for a port status register