2.6.x libata updates
PATCH 1/1 2.6.x libata updates
The interesting changes are
* CONFIG_ ifdef for SATA PCI ids in IDE driver (discussed w/ Bart)
* new NVIDIA driver
* hopefully better irq acking
Please do a
bk pull bk://gkernel.bkbits.net/libata-2.6
This will update the following files:
drivers/ide/Kconfig | 20 ++ drivers/ide/pci/amd74xx.c | 20 -- drivers/ide/pci/generic.c | 2 drivers/ide/pci/piix.c | 4 drivers/ide/pci/siimage.c | 3 drivers/scsi/Kconfig | 8 drivers/scsi/Makefile | 1 drivers/scsi/ata_piix.c | 29 +-- drivers/scsi/libata-core.c | 410 +++++++++++++++----------------------------- drivers/scsi/sata_nv.c | 353 +++++++++++++++++++++++++++++++++++++ drivers/scsi/sata_promise.c | 8 drivers/scsi/sata_sil.c | 2 drivers/scsi/sata_sis.c | 2 drivers/scsi/sata_svw.c | 2 drivers/scsi/sata_sx4.c | 9 drivers/scsi/sata_via.c | 2 drivers/scsi/sata_vsc.c | 2 include/linux/libata.h | 64 ++++-- 18 files changed, 614 insertions(+), 327 deletions(-)
through these ChangeSets:
<[email protected]> (04/06/22 1.1793)
[libata ata_piix] combined mode bug fix; improved ICH6 support
<[email protected]> (04/06/22 1.1792)
[libata] fix build error, minor cleanups
<[email protected]> (04/06/22 1.1791)
[libata] move some code around
Split ata_eng_timeout into the main part (ata_qc_timeout) and the part called by the SCSI layer (ata_eng_timeout).
Zero behavior changes.
<[email protected]> (04/06/21 1.1790)
[PATCH] 2.6.7-mm1: drivers/scsi/hosts.h -> scsi/scsi_host.h
Quoted 5 lines · Andrew Morton
...
All 226 patches:
...
bk-libata.patch
...
drivers/scsi/hosts.h is obsolete, use scsi/scsi_host.h.
Please apply
Adrian
<[email protected]> (04/06/17 1.1789)
[libata/IDE nvidia] shuffle pci ids
* Mark conflicting PCI ids with CONFIG_BLK_DEV_IDE_SATA
* Move not-yet-released PCI ids to libata sata_nv driver
<[email protected]> (04/06/16 1.1788)
[libata] put nvidia in Kconfig, in alphabetical order
<[email protected]> (04/06/16 1.1787)
[libata] Add NVIDIA SATA driver
<[email protected]> (04/06/16 1.1786)
[IDE] Introduce SATA enable/disable config option
This config option is introduced to help reduce user confusion, and eliminate conflicts between the IDE driver (which is often built into user kernels) and the new libata SATA driver.
<[email protected]> (04/06/15 1.1754.9.5)
[libata] ->qc_prep hook
Rename ->fill_sg hook to ->qc_prep, and call it unconditionally (as opposed to ->fill_sg, which was called only when the flag ATA_QCFLAG_SG was set).
<[email protected]> (04/06/14 1.1754.9.4)
[libata] PCI IDE command-end/irq-acknowledge cleanup
Restruct default irq handler (used for many PCI IDE-like SATA controllers) to obtain device status and acknowledge interrupts a bit differently.
In an attempt to better attack the "ich5 screaming interrupt" problem, acknowledge and clear the device's INTRQ by reading the Status register _before_ ack'ing the controller's irq status. This is a deviation from how the Linux IDE driver acknowledges interrupts, but it may be the best method, since the ICH5 appears to continue to assert the interrupt bit in the BMDMA until the device INTRQ line is cleared.
Of course, SATA has no INTRQ line per se, so ICH5 essentially has new interrupt behavior not seen before in the PCI IDE world, while pretending that it's compatible with PCI IDE. Sigh.
This change affects all SATA controllers (for which there are libata drivers) except for sata_promise and sata_sx4.
<[email protected]> (04/06/14 1.1754.9.3)
[libata] PCI IDE DMA code shuffling
PCI IDE DMA standard (or "bmdma") helper routines ata_bmdma_stop, ata_bmdma_ack_irq, and ata_bmdma_status are added to linux/libata.h, and used in libata-core.
There is a minor behavior change, such that, the Alt Status register is read before acknowledging the bmdma interrupt. This should be ok, and furthermore there will be more significant behavior changes in this area coming soon.
<[email protected]> (04/06/14 1.1754.9.2)
[libata] don't probe from workqueue
Since we want the probe phase to call other workqueues, this is required to eliminate future deadlocks.
Other methods would include starting a single-shot thread just for probing, but overall, using a separate thread for probing is pointless since we are already in process context when we probe.
So, we simply call ata_bus_probe directly.
<[email protected]> (04/06/02 1.1726.75.4)
[PATCH] ata_check_bmdma
Move hand-coded BMDMA status check into separate function.
drivers/ide/Kconfig +20 -0
@@ -95,6 +95,26 @@ comment "Please see Documentation/ide.txt for help/info on IDE drives" +config BLK_DEV_IDE_SATA + bool "Support for SATA (deprecated; conflicts with libata SATA driver)" + default n + ---help--- + There are two drivers for Serial ATA controllers. + + The main driver, "libata", exists inside the SCSI subsystem + and supports most modern SATA controllers. + + The IDE driver (which you are currently configuring) supports + a few first-generation SATA controllers. + + In order to eliminate conflicts between the two subsystems, + this config option enables the IDE driver's SATA support. + Normally this is disabled, as it is preferred that libata + supports SATA controllers, and this (IDE) driver supports + PATA controllers. + + If unsure, say N. + config BLK_DEV_HD_IDE bool "Use old disk-only driver on primary interface" depends on ((X86 && X86_PC9800!=y) || SH_MPC1211)
drivers/ide/pci/amd74xx.c +6 -14
@@ -71,11 +71,7 @@ { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 0x50, AMD_UDMA_133 }, { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x50, AMD_UDMA_133 }, { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 }, - { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA, 0x50, AMD_UDMA_133 }, - { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2, 0x50, AMD_UDMA_133 }, { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 }, - { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA, 0x50, AMD_UDMA_133 }, - { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2, 0x50, AMD_UDMA_133 }, { 0 } };
@@ -487,11 +483,7 @@/* 11 */ DECLARE_NV_DEV ("NFORCE3-250-SATA" ),/* 12 */ DECLARE_NV_DEV ("NFORCE3-250-SATA2" ),/* 13 */ DECLARE_NV_DEV ("NFORCE-CK804" ), -/* 14 */ DECLARE_NV_DEV ("NFORCE-CK804-SATA" ), -/* 15 */ DECLARE_NV_DEV ("NFORCE-CK804-SATA2" ), -/* 16 */ DECLARE_NV_DEV ("NFORCE-MCP04" ), -/* 17 */ DECLARE_NV_DEV ("NFORCE-MCP04-SATA" ), - /* 18 */ DECLARE_NV_DEV("NFORCE-MCP04-SATA2") + /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"), };static int __devinit amd74xx_probe (struct pci_dev *dev,const struct pci_device_id *id)
@@ -512,17 +504,17 @@ { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 }, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6 }, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7 }, +#ifdef CONFIG_BLK_DEV_IDE_SATA { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8 }, +#endif { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9 }, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10 }, +#ifdef CONFIG_BLK_DEV_IDE_SATA { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11 }, { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12 }, +#endif { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17 }, - { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18 }, + { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 }, { 0, }, };MODULE_DEVICE_TABLE (pci, amd74xx_pci_tbl);
drivers/ide/pci/generic.c +2 -0
@@ -127,7 +127,9 @@ { PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6}, { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7}, { PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8}, +#ifdef CONFIG_BLK_DEV_IDE_SATA { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9}, +#endif { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10}, { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11}, { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
drivers/ide/pci/piix.c +2 -2
@@ -793,9 +793,9 @@ { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15}, { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_11, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16}, { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_10,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17}, -#ifndef CONFIG_SCSI_SATA +#ifdef CONFIG_BLK_DEV_IDE_SATA { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18}, -#endif /* !CONFIG_SCSI_SATA */ +#endif { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19}, { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_19, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 20}, { 0, },
drivers/ide/pci/siimage.c +3 -0
@@ -21,6 +21,7 @@* if neccessary */ +#include <linux/config.h> #include <linux/types.h> #include <linux/module.h> #include <linux/pci.h>
@@ -1127,8 +1128,10 @@static struct pci_device_id siimage_pci_tbl[] = { {PCI_VENDOR_ID_CMD ,PCI_DEVICE_ID_SII_680 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, +#ifdef CONFIG_BLK_DEV_IDE_SATA {PCI_VENDOR_ID_CMD ,PCI_DEVICE_ID_SII_3112 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,1 }, {PCI_VENDOR_ID_CMD ,PCI_DEVICE_ID_SII_1210SA ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,2 }, +#endif {0 , }, };MODULE_DEVICE_TABLE (pci, siimage_pci_tbl);
drivers/scsi/Kconfig +8 -0
@@ -422,6 +422,14 @@ If unsure, say N. +config SCSI_SATA_NV + tristate "NVIDIA SATA support" + depends on SCSI_SATA && PCI && EXPERIMENTAL + help + This option enables support for NVIDIA Serial ATA. + + If unsure, say N. + config SCSI_SATA_PROMISE tristate "Promise SATA TX2/TX4 support" depends on SCSI_SATA && PCI
drivers/scsi/Makefile +1 -0
@@ -127,6 +127,7 @@ obj-$(CONFIG_SCSI_SATA_VITESSE) += libata.o sata_vsc.o obj-$(CONFIG_SCSI_SATA_SIS) += libata.o sata_sis.o obj-$(CONFIG_SCSI_SATA_SX4) += libata.o sata_sx4.o +obj-$(CONFIG_SCSI_SATA_NV) += libata.o sata_nv.o obj-$(CONFIG_ARM) += arm/
drivers/scsi/ata_piix.c +16 -13
@@ -57,6 +57,7 @@ ich5_pata =0 , ich5_sata =1 , piix4_pata =2 , + ich6_sata = 3, }; static int piix_init_one (struct pci_dev *pdev,
@@ -91,10 +92,8 @@* and enhanced mode, with queueing and other fancy stuff. * This is distinguished by PCI class code. */ - {0x8086 ,0x2651 ,PCI_ANY_ID ,PCI_ANY_ID , - PCI_CLASS_STORAGE_IDE << 8, 0xffff00, ich5_sata }, - { 0x8086, 0x2652, PCI_ANY_ID, PCI_ANY_ID, - PCI_CLASS_STORAGE_IDE << 8, 0xffff00, ich5_sata }, + { 0x8086, 0x2651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata }, + { 0x8086, 0x2652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata }, { } /* terminate list */ };
@@ -138,7 +137,7 @@ .bmdma_setup = ata_bmdma_setup_pio, .bmdma_start = ata_bmdma_start_pio, - .fill_sg = ata_fill_sg, + .qc_prep = ata_qc_prep, .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt,
@@ -161,7 +160,7 @@ .bmdma_setup = ata_bmdma_setup_pio, .bmdma_start = ata_bmdma_start_pio, - .fill_sg = ata_fill_sg, + .qc_prep = ata_qc_prep, .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt,
@@ -199,6 +198,17 @@ .udma_mask = ATA_UDMA_MASK_40C, /* FIXME: cbl det */ .port_ops = &piix_pata_ops, }, + +/* ich6_sata */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SATA | ATA_FLAG_SRST | + PIIX_FLAG_COMBINED | PIIX_FLAG_CHECKINTR | + ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x03, /* pio3-4 */ + .udma_mask = 0x7f, /* udma0-6 ; FIXME */ + .port_ops = &piix_sata_ops, + }, };static struct pci_bits piix_enable_bits[] = {
@@ -327,13 +337,6 @@static void piix_sata_phy_reset (struct ata_port *ap) { -if (!pci_test_config_bits (ap->host_set->pdev, - &piix_enable_bits[ap->port_no])) { -ata_port_disable (ap); -printk (KERN_INFO "ata%u: port disabled. ignoring.\n" , ap->id); -return ; - } -if (!piix_sata_probe (ap)) {ata_port_disable (ap);printk (KERN_INFO "ata%u: SATA port has no device.\n" , ap->id);
drivers/scsi/libata-core.c +146 -264
639 lines not on this page · raw message
drivers/scsi/sata_nv.c new file +353 -0
353 lines not on this page · raw message
drivers/scsi/sata_promise.c +4 -4
@@ -81,7 +81,7 @@static int pdc_port_start (struct ata_port *ap);static void pdc_port_stop (struct ata_port *ap);static void pdc_phy_reset (struct ata_port *ap); -static void pdc_fill_sg (struct ata_queued_cmd *qc); +static void pdc_qc_prep (struct ata_queued_cmd *qc);static void pdc_tf_load_mmio (struct ata_port *ap,struct ata_taskfile *tf);static void pdc_exec_command_mmio (struct ata_port *ap,struct ata_taskfile *tf); static inline void pdc_dma_complete (struct ata_port *ap,
@@ -114,7 +114,7 @@ .phy_reset = pdc_phy_reset, .bmdma_setup = pdc_dma_setup, .bmdma_start = pdc_dma_start, - .fill_sg = pdc_fill_sg, + .qc_prep = pdc_qc_prep, .eng_timeout = pdc_eng_timeout, .irq_handler = pdc_interrupt, .scr_read = pdc_sata_scr_read,
@@ -261,14 +261,14 @@writel (val, (void *) ap->ioaddr.scr_addr + (sc_reg *4 )); } -static void pdc_fill_sg (struct ata_queued_cmd *qc) +static void pdc_qc_prep (struct ata_queued_cmd *qc) {struct pdc_port_priv *pp = qc->ap->private_data;unsigned int i;VPRINTK ("ENTER\n" ); -ata_fill_sg (qc); +ata_qc_prep (qc); i =pdc_pkt_header (&qc->tf, qc->ap->prd_dma, qc->dev->devno, pp->pkt);
drivers/scsi/sata_sil.c +1 -1
@@ -131,7 +131,7 @@ .post_set_mode = sil_post_set_mode, .bmdma_setup = ata_bmdma_setup_mmio, .bmdma_start = ata_bmdma_start_mmio, - .fill_sg = ata_fill_sg, + .qc_prep = ata_qc_prep, .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt, .scr_read = sil_scr_read,
drivers/scsi/sata_sis.c +1 -1
@@ -100,7 +100,7 @@ .phy_reset = sata_phy_reset, .bmdma_setup = ata_bmdma_setup_pio, .bmdma_start = ata_bmdma_start_pio, - .fill_sg = ata_fill_sg, + .qc_prep = ata_qc_prep, .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt, .scr_read = sis_scr_read,
drivers/scsi/sata_svw.c +1 -1
@@ -233,7 +233,7 @@ .phy_reset = sata_phy_reset, .bmdma_setup = ata_bmdma_setup_mmio, .bmdma_start = ata_bmdma_start_mmio, - .fill_sg = ata_fill_sg, + .qc_prep = ata_qc_prep, .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt, .scr_read = k2_sata_scr_read,
drivers/scsi/sata_sx4.c +6 -3
@@ -153,7 +153,7 @@static void pdc_20621_phy_reset (struct ata_port *ap);static int pdc_port_start (struct ata_port *ap);static void pdc_port_stop (struct ata_port *ap); -static void pdc20621_fill_sg (struct ata_queued_cmd *qc); +static void pdc20621_qc_prep (struct ata_queued_cmd *qc);static void pdc_tf_load_mmio (struct ata_port *ap,struct ata_taskfile *tf);static void pdc_exec_command_mmio (struct ata_port *ap,struct ata_taskfile *tf);static void pdc20621_host_stop (struct ata_host_set *host_set);
@@ -200,7 +200,7 @@ .phy_reset = pdc_20621_phy_reset, .bmdma_setup = pdc20621_dma_setup, .bmdma_start = pdc20621_dma_start, - .fill_sg = pdc20621_fill_sg, + .qc_prep = pdc20621_qc_prep, .eng_timeout = pdc_eng_timeout, .irq_handler = pdc20621_interrupt, .port_start = pdc_port_start,
@@ -434,7 +434,7 @@ buf32[dw + 3]); } -static void pdc20621_fill_sg (struct ata_queued_cmd *qc) +static void pdc20621_qc_prep (struct ata_queued_cmd *qc) {struct scatterlist *sg = qc->sg;struct ata_port *ap = qc->ap;
@@ -445,6 +445,9 @@unsigned int portno = ap->port_no;unsigned int i, last, idx, total_len =0 , sgt_len;u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ ]; + +if (!(qc->flags &ATA_QCFLAG_SG )) +return ;VPRINTK ("ata%u: ENTER\n" , ap->id);
drivers/scsi/sata_via.c +1 -1
@@ -108,7 +108,7 @@ .bmdma_setup = ata_bmdma_setup_pio, .bmdma_start = ata_bmdma_start_pio, - .fill_sg = ata_fill_sg, + .qc_prep = ata_qc_prep, .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt,
drivers/scsi/sata_vsc.c +1 -1
@@ -215,7 +215,7 @@ .phy_reset = sata_phy_reset, .bmdma_setup = ata_bmdma_setup_mmio, .bmdma_start = ata_bmdma_start_mmio, - .fill_sg = ata_fill_sg, + .qc_prep = ata_qc_prep, .eng_timeout = ata_eng_timeout, .irq_handler = vsc_sata_interrupt, .scr_read = vsc_sata_scr_read,
include/linux/libata.h +42 -22
104 lines not on this page · raw message