2.4.x libata update
PATCH 1/1 2.4.x libata update
Here's the queue of stuff that was waiting on 2.4.28 release...
Please do a
bk pull bk://kernel.bkbits.net/jgarzik/libata-upstream-2.4
This will update the following files:
drivers/scsi/Config.in | 1 drivers/scsi/Makefile | 1 drivers/scsi/ahci.c | 1040 ++++++++++++++++++++++++++++++++++++++++++ drivers/scsi/ata_piix.c | 16 drivers/scsi/libata-core.c | 346 +++++++++---- drivers/scsi/libata-scsi.c | 94 ++- drivers/scsi/libata.h | 7 drivers/scsi/sata_nv.c | 16 drivers/scsi/sata_promise.c | 67 +- drivers/scsi/sata_sil.c | 8 drivers/scsi/sata_sis.c | 9 drivers/scsi/sata_svw.c | 7 drivers/scsi/sata_sx4.c | 13 drivers/scsi/sata_uli.c | 9 drivers/scsi/sata_via.c | 3 drivers/scsi/sata_vsc.c | 13 include/linux/ata.h | 44 - include/linux/libata-compat.h | 66 ++ include/linux/libata.h | 61 +- include/linux/mm.h | 5 20 files changed, 1560 insertions(+), 266 deletions(-)
through these ChangeSets:
Bartlomiej Zolnierkiewicz:
o libata PIO bugfix
o make ATAPI PIO work
o arbitrary size ATAPI PIO support bugfixes
o [libata] arbitrary size ATAPI PIO support
o REQUEST_SENSE support for ATAPI
Christoph Hellwig:
o fix sata_svw compile
Jeff Garzik:
o [libata ahci] minor fixes
o [libata] fix DocBook bugs
o [libata] bump versions, add MODULE_VERSION() tags
o [libata] remove dependence on PCI (2.4 stub version)
o Remove silly comment from linux/ata.h
o Resync linux/ata.h with 2.6.x
o Add nth_page() helper
o [libata ahci] bump version to 1.00
o [libata] add ssleep() function
o [libata] cosmetic: make syncing with 2.6 easier
o [libata] use kunmap_atomic() correctly
o [libata] return ENOTTY rather than EOPNOTSUPP for unknown-ioctl
o [libata] fix minor 2.6 backport problems
o [libata] add AHCI driver
Jeremy Higdon:
o per-port LED control for sata_vsc
Mark Lord:
o Export ata_scsi_simulate() for use by non-libata drivers
Matthijs Melchior:
o [libata ahci] fix rather serious (and/or embarassing) bugs
Meelis Roos:
o ata.h undefined types in USB
Nishanth Aravamudan:
o scsi/ahci: replace schedule_timeout() with msleep()/ssleep()
Tobias Lorenz:
o [libata sata_promise] s/sata/ata/
drivers/scsi/Config.in +1 -0
@@ -69,6 +69,7 @@ dep_tristate 'AMI MegaRAID support' CONFIG_SCSI_MEGARAID $CONFIG_SCSI dep_tristate 'AMI MegaRAID2 support' CONFIG_SCSI_MEGARAID2 $CONFIG_SCSI dep_mbool 'Serial ATA (SATA) support' CONFIG_SCSI_SATA $CONFIG_SCSI +dep_tristate ' AHCI SATA support (EXPERIMENTAL)' CONFIG_SCSI_SATA_AHCI $CONFIG_SCSI_SATA $CONFIG_PCI $CONFIG_EXPERIMENTAL dep_tristate ' ServerWorks Frodo / Apple K2 SATA support (EXPERIMENTAL)' CONFIG_SCSI_SATA_SVW $CONFIG_SCSI_SATA $CONFIG_PCI $CONFIG_EXPERIMENTAL dep_tristate ' Intel PIIX/ICH SATA support' CONFIG_SCSI_ATA_PIIX $CONFIG_SCSI_SATA $CONFIG_PCI dep_tristate ' NVIDIA SATA support (EXPERIMENTAL)' CONFIG_SCSI_SATA_NV $CONFIG_SCSI_SATA $CONFIG_PCI
drivers/scsi/Makefile +1 -0
@@ -130,6 +130,7 @@ obj-$(CONFIG_SCSI_CPQFCTS) += cpqfc.o obj-$(CONFIG_SCSI_LASI700) += lasi700.o 53c700.o obj-$(CONFIG_SCSI_NSP32) += nsp32.o +obj-$(CONFIG_SCSI_SATA_AHCI) += libata.o ahci.o obj-$(CONFIG_SCSI_SATA_SVW) += libata.o sata_svw.o obj-$(CONFIG_SCSI_ATA_PIIX) += libata.o ata_piix.o obj-$(CONFIG_SCSI_SATA_PROMISE) += libata.o sata_promise.o
drivers/scsi/ahci.c new file +1040 -0
1,040 lines not on this page · raw message
drivers/scsi/ata_piix.c +9 -7
@@ -32,7 +32,7 @@#include <linux/libata.h> #define DRV_NAME "ata_piix" -#define DRV_VERSION "1.02" +#define DRV_VERSION "1.03"enum {PIIX_IOCFG =0x54 ,/* IDE I/O configuration register */
@@ -248,6 +248,7 @@MODULE_DESCRIPTION ("SCSI low-level driver for Intel PIIX/ICH ATA controllers" );MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, piix_pci_tbl); +MODULE_VERSION (DRV_VERSION );/** * piix_pata_cbl_detect - Probe host controller cable detect info
@@ -261,7 +262,7 @@*/ static void piix_pata_cbl_detect (struct ata_port *ap) { -struct pci_dev *pdev = ap->host_set->pdev; +struct pci_dev *pdev =to_pci_dev (ap->host_set->dev);u8 tmp, mask;/* no 80c support in host controller? */
@@ -294,8 +295,9 @@static void piix_pata_phy_reset (struct ata_port *ap) { -if (!pci_test_config_bits (ap->host_set->pdev, - &piix_enable_bits[ap->hard_port_no])) { +struct pci_dev *pdev =to_pci_dev (ap->host_set->dev); + +if (!pci_test_config_bits (pdev, &piix_enable_bits[ap->hard_port_no])) {ata_port_disable (ap);printk (KERN_INFO "ata%u: port disabled. ignoring.\n" , ap->id);return ;
@@ -323,7 +325,7 @@*/ static int piix_sata_probe (struct ata_port *ap) { -struct pci_dev *pdev = ap->host_set->pdev; +struct pci_dev *pdev =to_pci_dev (ap->host_set->dev);int combined = (ap->flags &ATA_FLAG_SLAVE_POSS );int orig_mask, mask, i;u8 pcs;
@@ -393,7 +395,7 @@static void piix_set_piomode (struct ata_port *ap,struct ata_device *adev) {unsigned int pio = adev->pio_mode -XFER_PIO_0 ; -struct pci_dev *dev = ap->host_set->pdev; +struct pci_dev *dev =to_pci_dev (ap->host_set->dev);unsigned int is_slave = (adev->devno !=0 );unsigned int master_port= ap->hard_port_no ?0x42 :0x40 ;unsigned int slave_port =0x44 ;
@@ -445,7 +447,7 @@static void piix_set_dmamode (struct ata_port *ap,struct ata_device *adev) {unsigned int udma = adev->dma_mode;/* FIXME: MWDMA too */ -struct pci_dev *dev = ap->host_set->pdev; +struct pci_dev *dev =to_pci_dev (ap->host_set->dev);u8 maslave = ap->hard_port_no ?0x42 :0x40 ;u8 speed = udma;unsigned int drive_dn = (ap->hard_port_no ?2 :0 ) + adev->devno;
drivers/scsi/libata-core.c +240 -106
648 lines not on this page · raw message
drivers/scsi/libata-scsi.c +50 -44
318 lines not on this page · raw message
drivers/scsi/libata.h +3 -4
@@ -26,12 +26,11 @@#define __LIBATA_H__#define DRV_NAME "libata" -#define DRV_VERSION "1.02"/* must be exactly four chars */ +#define DRV_VERSION "1.10"/* must be exactly four chars */ struct ata_scsi_args { -struct ata_port *ap; -struct ata_device *dev; -struct scsi_cmnd *cmd; +u16 *id; +struct scsi_cmnd *cmd;void (*done)(struct scsi_cmnd *); };
drivers/scsi/sata_nv.c +8 -8
@@ -44,7 +44,7 @@#include <linux/libata.h> #define DRV_NAME "sata_nv" -#define DRV_VERSION "0.03" +#define DRV_VERSION "0.5"#define NV_PORTS 2#define NV_PIO_MASK 0x1f
@@ -235,6 +235,7 @@MODULE_DESCRIPTION ("low-level driver for NVIDIA nForce SATA controller" );MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, nv_pci_tbl); +MODULE_VERSION (DRV_VERSION );irqreturn_t nv_interrupt (int irq,void *dev_instance,struct pt_regs *regs) {
@@ -379,9 +380,6 @@return 0 ; -err_out_iounmap: -if (host->host_desc->host_flags &NV_HOST_FLAGS_SCR_MMIO ) -iounmap (probe_ent->mmio_base); err_out_free_host:kfree (host); err_out_free_ent:
@@ -448,12 +446,13 @@static void nv_enable_hotplug_ck804 (struct ata_probe_ent *probe_ent) { +struct pci_dev *pdev =to_pci_dev (probe_ent->dev);u8 intr_mask;u8 regval; -pci_read_config_byte (probe_ent->pdev,NV_MCP_SATA_CFG_20 , ®val); +pci_read_config_byte (pdev,NV_MCP_SATA_CFG_20 , ®val); regval |=NV_MCP_SATA_CFG_20_SATA_SPACE_EN ; -pci_write_config_byte (probe_ent->pdev,NV_MCP_SATA_CFG_20 , regval); +pci_write_config_byte (pdev,NV_MCP_SATA_CFG_20 , regval);writeb (NV_INT_STATUS_HOTPLUG , probe_ent->mmio_base +NV_INT_STATUS_CK804 );
@@ -465,6 +464,7 @@static void nv_disable_hotplug_ck804 (struct ata_host_set *host_set) { +struct pci_dev *pdev =to_pci_dev (host_set->dev);u8 intr_mask;u8 regval;
@@ -474,9 +474,9 @@writeb (intr_mask, host_set->mmio_base +NV_INT_ENABLE_CK804 ); -pci_read_config_byte (host_set->pdev,NV_MCP_SATA_CFG_20 , ®val); +pci_read_config_byte (pdev,NV_MCP_SATA_CFG_20 , ®val); regval &= ~NV_MCP_SATA_CFG_20_SATA_SPACE_EN ; -pci_write_config_byte (host_set->pdev,NV_MCP_SATA_CFG_20 , regval); +pci_write_config_byte (pdev,NV_MCP_SATA_CFG_20 , regval); }static void nv_check_hotplug_ck804 (struct ata_host_set *host_set)
drivers/scsi/sata_promise.c +34 -33
199 lines not on this page · raw message
drivers/scsi/sata_sil.c +5 -3
@@ -38,7 +38,7 @@#include <linux/libata.h> #define DRV_NAME "sata_sil" -#define DRV_VERSION "0.54" +#define DRV_VERSION "0.8"enum { sil_3112 =0 ,
@@ -87,6 +87,7 @@ { "ST380023AS", SIL_QUIRK_MOD15WRITE }, { "ST3120023AS", SIL_QUIRK_MOD15WRITE }, { "ST3160023AS", SIL_QUIRK_MOD15WRITE }, + { "ST3120026AS", SIL_QUIRK_MOD15WRITE }, { "ST340014ASL", SIL_QUIRK_MOD15WRITE }, { "ST360014ASL", SIL_QUIRK_MOD15WRITE }, { "ST380011ASL", SIL_QUIRK_MOD15WRITE },
@@ -190,6 +191,7 @@MODULE_DESCRIPTION ("low-level driver for Silicon Image SATA controller" );MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, sil_pci_tbl); +MODULE_VERSION (DRV_VERSION );static void sil_post_set_mode (struct ata_port *ap) {
@@ -288,7 +290,7 @@const char *s;unsigned int len; -ata_dev_id_string (dev, model_num,ATA_ID_PROD_OFS , +ata_dev_id_string (dev->id, model_num,ATA_ID_PROD_OFS ,sizeof (model_num)); s = &model_num[0 ]; len =strnlen (s,sizeof (model_num));
@@ -360,7 +362,7 @@memset (probe_ent,0 ,sizeof (*probe_ent));INIT_LIST_HEAD (&probe_ent->node); - probe_ent->pdev = pdev; + probe_ent->dev =pci_dev_to_dev (pdev); probe_ent->port_ops = sil_port_info[ent->driver_data].port_ops; probe_ent->sht = sil_port_info[ent->driver_data].sht; probe_ent->n_ports = (ent->driver_data == sil_3114) ?4 :2 ;
drivers/scsi/sata_sis.c +6 -3
@@ -38,7 +38,7 @@#include <linux/libata.h> #define DRV_NAME "sata_sis" -#define DRV_VERSION "0.10" +#define DRV_VERSION "0.5"enum { sis_180 =0 ,
@@ -129,6 +129,7 @@MODULE_DESCRIPTION ("low-level driver for Silicon Integratad Systems SATA controller" );MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, sis_pci_tbl); +MODULE_VERSION (DRV_VERSION );static unsigned int get_scr_cfg_addr (unsigned int port_no,unsigned int sc_reg) {
@@ -141,22 +142,24 @@static u32 sis_scr_cfg_read (struct ata_port *ap,unsigned int sc_reg) { +struct pci_dev *pdev =to_pci_dev (ap->host_set->dev);unsigned int cfg_addr =get_scr_cfg_addr (ap->port_no, sc_reg);u32 val;if (sc_reg ==SCR_ERROR )/* doesn't exist in PCI cfg space */ return 0xffffffff ; -pci_read_config_dword (ap->host_set->pdev, cfg_addr, &val); +pci_read_config_dword (pdev, cfg_addr, &val);return val; }static void sis_scr_cfg_write (struct ata_port *ap,unsigned int scr,u32 val) { +struct pci_dev *pdev =to_pci_dev (ap->host_set->dev);unsigned int cfg_addr =get_scr_cfg_addr (ap->port_no, scr);if (scr ==SCR_ERROR )/* doesn't exist in PCI cfg space */ return ; -pci_write_config_dword (ap->host_set->pdev, cfg_addr, val); +pci_write_config_dword (pdev, cfg_addr, val); }static u32 sis_scr_read (struct ata_port *ap,unsigned int sc_reg)
drivers/scsi/sata_svw.c +4 -3
@@ -49,7 +49,7 @@#endif /* CONFIG_PPC_OF */ #define DRV_NAME "sata_svw" -#define DRV_VERSION "1.04" +#define DRV_VERSION "1.05"/* Taskfile registers offsets */ #define K2_SATA_TF_CMD_OFFSET 0x00
@@ -245,7 +245,7 @@return 0 ;/* Find the OF node for the PCI device proper */ - np =pci_device_to_OF_node (ap->host_set->pdev); + np =pci_device_to_OF_node (to_pci_dev (ap->host_set->dev));if (np ==NULL )return 0 ;
@@ -374,7 +374,7 @@ }memset (probe_ent,0 ,sizeof (*probe_ent)); - probe_ent->pdev = pdev; + probe_ent->dev =pci_dev_to_dev (pdev);INIT_LIST_HEAD (&probe_ent->node); mmio_base = ioremap(pci_resource_start(pdev, 5),
@@ -483,6 +483,7 @@MODULE_DESCRIPTION ("low-level driver for K2 SATA controller" );MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, k2_sata_pci_tbl); +MODULE_VERSION (DRV_VERSION );module_init (k2_sata_init);module_exit (k2_sata_exit);
drivers/scsi/sata_sx4.c +7 -6
@@ -40,7 +40,7 @@#include "sata_promise.h" #define DRV_NAME "sata_sx4" -#define DRV_VERSION "0.50" +#define DRV_VERSION "0.7"enum {
@@ -249,7 +249,7 @@static int pdc_port_start (struct ata_port *ap) { -struct pci_dev *pdev = ap->host_set->pdev; +struct device *dev = ap->host_set->dev;struct pdc_port_priv *pp;int rc;
@@ -264,7 +264,7 @@ }memset (pp,0 ,sizeof (*pp)); - pp->pkt =pci_alloc_consistent (pdev,128 , &pp->pkt_dma); + pp->pkt =dma_alloc_coherent (dev,128 , &pp->pkt_dma,GFP_KERNEL );if (!pp->pkt) { rc = -ENOMEM ; goto err_out_kfree;
@@ -284,11 +284,11 @@static void pdc_port_stop (struct ata_port *ap) { -struct pci_dev *pdev = ap->host_set->pdev; +struct device *dev = ap->host_set->dev;struct pdc_port_priv *pp = ap->private_data; ap->private_data =NULL ; -pci_free_consistent (pdev,128 , pp->pkt, pp->pkt_dma); +dma_free_coherent (dev,128 , pp->pkt, pp->pkt_dma);kfree (pp);ata_port_stop (ap); }
@@ -1397,7 +1397,7 @@ }memset (probe_ent,0 ,sizeof (*probe_ent)); - probe_ent->pdev = pdev; + probe_ent->dev =pci_dev_to_dev (pdev);INIT_LIST_HEAD (&probe_ent->node); mmio_base = ioremap(pci_resource_start(pdev, 3),
@@ -1507,6 +1507,7 @@MODULE_DESCRIPTION ("Promise SATA low-level driver" );MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, pdc_sata_pci_tbl); +MODULE_VERSION (DRV_VERSION );module_init (pdc_sata_init);module_exit (pdc_sata_exit);
drivers/scsi/sata_uli.c +6 -3
@@ -32,7 +32,7 @@#include <linux/libata.h> #define DRV_NAME "sata_uli" -#define DRV_VERSION "0.11" +#define DRV_VERSION "0.2"enum { uli_5289 =0 ,
@@ -124,6 +124,7 @@MODULE_DESCRIPTION ("low-level driver for ULi Electronics SATA controller" );MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, uli_pci_tbl); +MODULE_VERSION (DRV_VERSION );static unsigned int get_scr_cfg_addr (unsigned int port_no,unsigned int sc_reg) {
@@ -150,18 +151,20 @@static u32 uli_scr_cfg_read (struct ata_port *ap,unsigned int sc_reg) { +struct pci_dev *pdev =to_pci_dev (ap->host_set->dev);unsigned int cfg_addr =get_scr_cfg_addr (ap->port_no, sc_reg);u32 val; -pci_read_config_dword (ap->host_set->pdev, cfg_addr, &val); +pci_read_config_dword (pdev, cfg_addr, &val);return val; }static void uli_scr_cfg_write (struct ata_port *ap,unsigned int scr,u32 val) { +struct pci_dev *pdev =to_pci_dev (ap->host_set->dev);unsigned int cfg_addr =get_scr_cfg_addr (ap->port_no, scr); -pci_write_config_dword (ap->host_set->pdev, cfg_addr, val); +pci_write_config_dword (pdev, cfg_addr, val); }static u32 uli_scr_read (struct ata_port *ap,unsigned int sc_reg)
drivers/scsi/sata_via.c +2 -1
@@ -38,7 +38,7 @@#include <asm/io.h> #define DRV_NAME "sata_via" -#define DRV_VERSION "0.20" +#define DRV_VERSION "1.0"enum { via_sata =0 ,
@@ -139,6 +139,7 @@MODULE_DESCRIPTION ("SCSI low-level driver for VIA SATA controllers" );MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, svia_pci_tbl); +MODULE_VERSION (DRV_VERSION );static u32 svia_scr_read (struct ata_port *ap,unsigned int sc_reg) {
drivers/scsi/sata_vsc.c +11 -2
@@ -26,7 +26,7 @@#include <linux/libata.h> #define DRV_NAME "sata_vsc" -#define DRV_VERSION "0.01" +#define DRV_VERSION "1.0"/* Interrupt register offsets (from chip base address) */ #define VSC_SATA_INT_STAT_OFFSET 0x00
@@ -291,7 +291,7 @@ goto err_out_regions; }memset (probe_ent,0 ,sizeof (*probe_ent)); - probe_ent->pdev = pdev; + probe_ent->dev =pci_dev_to_dev (pdev);INIT_LIST_HEAD (&probe_ent->node); mmio_base = ioremap(pci_resource_start(pdev, 0),
@@ -331,6 +331,14 @@pci_set_master (pdev); +/* +* Config offset 0x98 is "Extended Control and Status Register 0" +* Default value is (1 << 28). All bits except bit 28 are reserved in +* DPA mode. If bit 28 is set, LED 0 reflects all ports' activity. +* If bit 28 is clear, each port has its own LED. +*/ +pci_write_config_dword (pdev,0x98 ,0 ); +ata_add_to_probe_list (probe_ent);return 0 ;
@@ -401,6 +409,7 @@MODULE_DESCRIPTION ("low-level driver for Vitesse VSC7174 SATA controller" );MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, vsc_sata_pci_tbl); +MODULE_VERSION (DRV_VERSION );module_init (vsc_sata_init);module_exit (vsc_sata_exit);
include/linux/ata.h +24 -20
68 lines not on this page · raw message
include/linux/libata-compat.h new file +66 -0
66 lines not on this page · raw message
include/linux/libata.h +38 -23
140 lines not on this page · raw message
include/linux/mm.h +5 -0
@@ -199,6 +199,11 @@#define page_count (p) atomic_read(&(p)->count)#define set_page_count (p,v) atomic_set(&(p)->count, v) +static inline struct page *nth_page (struct page *page,int n) +{ +return page + n; +} +/* * Various page->flags bits: *