libata updates
PATCH 1/1 libata updates
Includes some pre-window-closing stuff (new drivers), but I was waiting on some bug fixes before pushing.
Please pull from 'upstream-linus' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git upstream-linus
to receive the following updates:
drivers/ata/Kconfig | 20 ++- drivers/ata/Makefile | 2 + drivers/ata/ahci.c | 2 - drivers/ata/ata_piix.c | 24 ++- drivers/ata/libata-core.c | 16 +- drivers/ata/libata-scsi.c | 4 +- drivers/ata/pata_ali.c | 4 +- drivers/ata/pata_cs5520.c | 2 +- drivers/ata/pata_cs5530.c | 8 +- drivers/ata/pata_hpt366.c | 2 +- drivers/ata/pata_hpt37x.c | 4 +- drivers/ata/pata_hpt3x3.c | 2 +- drivers/ata/pata_it8213.c | 354 +++++++++++++++++++++++++ drivers/ata/pata_jmicron.c | 2 +- drivers/ata/pata_marvell.c | 4 +- drivers/ata/pata_mpc52xx.c | 563 ++++++++++++++++++++++++++++++++++++++++ drivers/ata/pata_serverworks.c | 2 +- drivers/ata/pata_sil680.c | 2 +- drivers/ata/pata_sis.c | 2 +- drivers/ata/pata_via.c | 10 +- drivers/ata/pata_winbond.c | 16 +- drivers/ata/sata_nv.c | 18 +- drivers/ata/sata_sis.c | 79 ++++-- drivers/ata/sata_svw.c | 41 +++- drivers/ata/sata_via.c | 2 +- include/linux/libata.h | 2 +- include/linux/pci_ids.h | 1 + 27 files changed, 1099 insertions(+), 89 deletions(-) create mode 100644 drivers/ata/pata_it8213.c create mode 100644 drivers/ata/pata_mpc52xx.c
Alan (1):
pata_it8213: Add new driver for the IT8213 card
Jason Gaston (1):
ata_piix: IDE mode SATA patch for Intel ICH9
Jeff Garzik (3):
[libata] use kmap_atomic(KM_IRQ0) in SCSI simulator
[libata] trim trailing whitespace
[libata] sata_svw: Disable ATAPI DMA on current boards (errata workaround)
Sylvain Munaut (1):
libata: Add support for the MPC52xx ATA controller
Tejun Heo (3):
ata_piix: use piix_host_stop() in ich_pata_ops
libata: don't initialize sg in ata_exec_internal() if DMA_NONE (take #2)
ahci: do not mangle saved HOST_CAP while resetting controller
Uwe Koziolek (1):
sata_sis: support SiS966/966L
drivers/ata/Kconfig +19 -1
@@ -292,7 +292,7 @@ config PATA_ISAPNP If unsure, say N. config PATA_IT821X - tristate "IT821x PATA support (Experimental)" + tristate "IT8211/2 PATA support (Experimental)" depends on PCI && EXPERIMENTAL help This option enables support for the ITE 8211 and 8212
@@ -301,6 +301,15 @@ config PATA_IT821X If unsure, say N. +config PATA_IT8213 + tristate "IT8213 PATA support (Experimental)" + depends on PCI && EXPERIMENTAL + help + This option enables support for the ITE 821 PATA + controllers via the new ATA layer. + + If unsure, say N. + config PATA_JMICRON tristate "JMicron PATA support" depends on PCI
@@ -337,6 +346,15 @@ config PATA_MARVELL If unsure, say N. +config PATA_MPC52xx + tristate "Freescale MPC52xx SoC internal IDE" + depends on PPC_MPC52xx + help + This option enables support for integrated IDE controller + of the Freescale MPC52xx SoC. + + If unsure, say N. + config PATA_MPIIX tristate "Intel PATA MPIIX support" depends on PCI
drivers/ata/Makefile +2 -0
@@ -33,11 +33,13 @@ obj-$(CONFIG_PATA_HPT3X2N) += pata_hpt3x2n.o obj-$(CONFIG_PATA_HPT3X3) += pata_hpt3x3.o obj-$(CONFIG_PATA_ISAPNP) += pata_isapnp.o obj-$(CONFIG_PATA_IT821X) += pata_it821x.o +obj-$(CONFIG_PATA_IT8213) += pata_it8213.o obj-$(CONFIG_PATA_JMICRON) += pata_jmicron.o obj-$(CONFIG_PATA_NETCELL) += pata_netcell.o obj-$(CONFIG_PATA_NS87410) += pata_ns87410.o obj-$(CONFIG_PATA_OPTI) += pata_opti.o obj-$(CONFIG_PATA_OPTIDMA) += pata_optidma.o +obj-$(CONFIG_PATA_MPC52xx) += pata_mpc52xx.o obj-$(CONFIG_PATA_MARVELL) += pata_marvell.o obj-$(CONFIG_PATA_MPIIX) += pata_mpiix.o obj-$(CONFIG_PATA_OLDPIIX) += pata_oldpiix.o
drivers/ata/ahci.c +0 -2
@@ -645,8 +645,6 @@ static int ahci_reset_controller(void __iomem *mmio, struct pci_dev *pdev)u32 cap_save, impl_save, tmp; cap_save =readl (mmio +HOST_CAP ); - cap_save &= ( (1 <<28 ) | (1 <<17 ) ); - cap_save |= (1 <<27 ); impl_save =readl (mmio +HOST_PORTS_IMPL );/* global controller reset */
drivers/ata/ata_piix.c +18 -6
@@ -226,14 +226,26 @@ static const struct pci_device_id piix_pci_tbl[] = { { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },/* 2801GBM/GHM (ICH7M, identical to ICH6M) */ { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci }, -/* Enterprise Southbridge 2 (where's the datasheet?) */ +/* Enterprise Southbridge 2 (631xESB/632xESB) */ { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, -/* SATA Controller 1 IDE (ICH8, no datasheet yet) */ +/* SATA Controller 1 IDE (ICH8) */ { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -/* SATA Controller 2 IDE (ICH8, ditto) */ +/* SATA Controller 2 IDE (ICH8) */ { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -/* Mobile SATA Controller IDE (ICH8M, ditto) */ +/* Mobile SATA Controller IDE (ICH8M) */ { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, +/* SATA Controller IDE (ICH9) */ + { 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, +/* SATA Controller IDE (ICH9) */ + { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, +/* SATA Controller IDE (ICH9) */ + { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, +/* SATA Controller IDE (ICH9M) */ + { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, +/* SATA Controller IDE (ICH9M) */ + { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, +/* SATA Controller IDE (ICH9M) */ + { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, { } /* terminate list */ };
@@ -330,7 +342,7 @@ static const struct ata_port_operations ich_pata_ops = { .port_start = ata_port_start, .port_stop = ata_port_stop, - .host_stop = ata_host_stop, + .host_stop = piix_host_stop, };static const struct ata_port_operations piix_sata_ops = {
@@ -620,7 +632,7 @@ static int piix_pata_prereset(struct ata_port *ap)if (!pci_test_config_bits (pdev, &piix_enable_bits[ap->port_no]))return -ENOENT ; - + ap->cbl =ATA_CBL_PATA40 ;return ata_std_prereset (ap); }
drivers/ata/libata-core.c +11 -5
@@ -1332,7 +1332,7 @@ unsigned ata_exec_internal_sg(struct ata_device *dev, }/** -* ata_exec_internal_sg - execute libata internal command +* ata_exec_internal - execute libata internal command * @dev: Device to which the command is sent * @tf: Taskfile registers for the command and the result * @cdb: CDB for packet command
@@ -1353,11 +1353,17 @@ unsigned ata_exec_internal(struct ata_device *dev, struct ata_taskfile *tf, const u8 *cdb, int dma_dir, void *buf, unsigned int buflen) { - struct scatterlist sg; + struct scatterlist *psg = NULL, sg; +unsigned int n_elem =0 ; -sg_init_one (&sg, buf, buflen); +if (dma_dir !=DMA_NONE ) { +WARN_ON (!buf); +sg_init_one (&sg, buf, buflen); + psg = &sg; + n_elem++; + } -return ata_exec_internal_sg (dev, tf, cdb, dma_dir, &sg,1 ); +return ata_exec_internal_sg (dev, tf, cdb, dma_dir, psg, n_elem); }/**
@@ -5773,7 +5779,7 @@ int ata_device_add(const struct ata_probe_ent *ent)int rc;DPRINTK ("ENTER\n" ); - +if (ent->irq ==0 ) {dev_printk (KERN_ERR , dev,"is not available: No interrupt assigned.\n" );return 0 ;
drivers/ata/libata-scsi.c +2 -2
@@ -1539,7 +1539,7 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd *cmd, u8 **buf_out)struct scatterlist *sg; sg = (struct scatterlist *) cmd->request_buffer; - buf =kmap_atomic (sg->page,KM_USER0 ) + sg->offset; + buf =kmap_atomic (sg->page,KM_IRQ0 ) + sg->offset; buflen = sg->length; }else { buf = cmd->request_buffer;
@@ -1567,7 +1567,7 @@ static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf)struct scatterlist *sg; sg = (struct scatterlist *) cmd->request_buffer; -kunmap_atomic (buf - sg->offset,KM_USER0 ); +kunmap_atomic (buf - sg->offset,KM_IRQ0 ); } }
drivers/ata/pata_ali.c +2 -2
@@ -504,7 +504,7 @@ static struct ata_port_operations ali_c5_port_ops = {* Perform the setup on the device that must be done both at boot * and at resume time. */ - +static void ali_init_chipset (struct pci_dev *pdev) {u8 rev, tmp;
@@ -655,7 +655,7 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id) port_info[0 ] = port_info[1 ] = &info_c5;ali_init_chipset (pdev); - + isa_bridge =pci_get_device (PCI_VENDOR_ID_AL ,PCI_DEVICE_ID_AL_M1533 ,NULL );if (isa_bridge && rev >=0x20 && rev <0xC2 ) {/* Are we paired with a UDMA capable chip */
drivers/ata/pata_cs5520.c +1 -1
@@ -305,7 +305,7 @@ static void __devexit cs5520_remove_one(struct pci_dev *pdev)* Do any reconfiguration work needed by a resume from RAM. We need * to restore DMA mode support on BIOSen which disabled it */ - +static int cs5520_reinit_one (struct pci_dev *pdev) {u8 pcicfg;
drivers/ata/pata_cs5530.c +4 -4
@@ -247,7 +247,7 @@ static int cs5530_is_palmax(void)* Perform the chip initialisation work that is shared between both * setup and resume paths */ - +static int cs5530_init_chip (void ) {struct pci_dev *master_0 =NULL , *cs5530_0 =NULL , *dev =NULL ;
@@ -357,11 +357,11 @@ static int cs5530_init_one(struct pci_dev *pdev, const struct pci_device_id *id) .port_ops = &cs5530_port_ops };static struct ata_port_info *port_info[2 ] = { &info, &info }; - +/* Chip initialisation */ if (cs5530_init_chip ())return -ENODEV ; - +if (cs5530_is_palmax ()) port_info[1 ] = &info_palmax_secondary;
@@ -375,7 +375,7 @@ static int cs5530_reinit_one(struct pci_dev *pdev)BUG_ON (cs5530_init_chip ());return ata_pci_device_resume (pdev); } - +static const struct pci_device_id cs5530[] = { {PCI_VDEVICE (CYRIX ,PCI_DEVICE_ID_CYRIX_5530_IDE ), },
drivers/ata/pata_hpt366.c +1 -1
@@ -232,7 +232,7 @@ static int hpt36x_pre_reset(struct ata_port *ap)if (!pci_test_config_bits (pdev, &hpt36x_enable_bits[ap->port_no]))return -ENOENT ; - +pci_read_config_byte (pdev,0x5A , &ata66);if (ata66 & (1 << ap->port_no)) ap->cbl =ATA_CBL_PATA40 ;
drivers/ata/pata_hpt37x.c +2 -2
@@ -459,7 +459,7 @@ static int hpt37x_pre_reset(struct ata_port *ap) };if (!pci_test_config_bits (pdev, &hpt37x_enable_bits[ap->port_no]))return -ENOENT ; - +pci_read_config_byte (pdev,0x5B , &scr2);pci_write_config_byte (pdev,0x5B , scr2 & ~0x01 );/* Cable register now active */
@@ -504,7 +504,7 @@ static int hpt374_pre_reset(struct ata_port *ap)if (!pci_test_config_bits (pdev, &hpt37x_enable_bits[ap->port_no]))return -ENOENT ; - +/* Do the extra channel work */ pci_read_config_word (pdev,0x52 , &mcr3);pci_read_config_word (pdev,0x56 , &mcr6);
drivers/ata/pata_hpt3x3.c +1 -1
@@ -164,7 +164,7 @@ static struct ata_port_operations hpt3x3_port_ops = {* * Perform the setup required at boot and on resume. */ - +static void hpt3x3_init_chipset (struct pci_dev *dev) {u16 cmd;
drivers/ata/pata_it8213.c new file +354 -0
354 lines not on this page · raw message
drivers/ata/pata_jmicron.c +1 -1
@@ -229,7 +229,7 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *istatic int jmicron_reinit_one (struct pci_dev *pdev) {u32 reg; - +switch (pdev->device) {case PCI_DEVICE_ID_JMICRON_JMB368 :break ;
drivers/ata/pata_marvell.c +2 -2
@@ -45,10 +45,10 @@ static int marvell_pre_reset(struct ata_port *ap)for (i =0 ; i <=0x0F ; i++)printk ("%02X:%02X " , i,readb (barp + i));printk ("\n" ); - + devices =readl (barp +0x0C );pci_iounmap (pdev, barp); - +if ((pdev->device ==0x6145 ) && (ap->port_no ==0 ) && (!(devices &0x10 )))/* PATA enable ? */ return -ENOENT ;
drivers/ata/pata_mpc52xx.c new file +563 -0
563 lines not on this page · raw message
drivers/ata/pata_serverworks.c +1 -1
@@ -559,7 +559,7 @@ static int serverworks_reinit_one(struct pci_dev *pdev) {/* Force master latency timer to 64 PCI clocks */ pci_write_config_byte (pdev,PCI_LATENCY_TIMER ,0x40 ); - +switch (pdev->device) {case PCI_DEVICE_ID_SERVERWORKS_OSB4IDE :
drivers/ata/pata_sil680.c +1 -1
@@ -270,7 +270,7 @@ static struct ata_port_operations sil680_port_ops = {* is powered up on boot and when we resume in case we resumed from RAM. * Returns the final clock settings. */ - +static u8 sil680_init_chip (struct pci_dev *pdev) {u32 class_rev =0 ;
drivers/ata/pata_sis.c +1 -1
@@ -847,7 +847,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)struct sis_chipset *chipset =NULL ;static struct sis_chipset sis_chipsets[] = { - + {0x0968 , &sis_info133 }, {0x0966 , &sis_info133 }, {0x0965 , &sis_info133 },
drivers/ata/pata_via.c +5 -5
@@ -384,11 +384,11 @@ static struct ata_port_operations via_port_ops_noirq = {static void via_config_fifo (struct pci_dev *pdev,unsigned int flags) {u8 enable; - +/* 0x40 low bits indicate enabled channels */ pci_read_config_byte (pdev,0x40 , &enable); enable &=3 ; - +if (flags &VIA_SET_FIFO ) {u8 fifo_setting[4 ] = {0x00 ,0x60 ,0x00 ,0x20 };u8 fifo;
@@ -509,7 +509,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)/* Initialise the FIFO for the enabled channels. */ via_config_fifo (pdev, config->flags); - +/* Clock set up */ switch (config->flags &VIA_UDMA ) {case VIA_UDMA_NONE :
@@ -568,7 +568,7 @@ static int via_reinit_one(struct pci_dev *pdev)u32 timing;struct ata_host *host =dev_get_drvdata (&pdev->dev);const struct via_isa_bridge *config = host->private_data; - +via_config_fifo (pdev, config->flags);if ((config->flags &VIA_UDMA ) ==VIA_UDMA_66 ) {
@@ -583,7 +583,7 @@ static int via_reinit_one(struct pci_dev *pdev) timing &= ~0x80008 ;pci_write_config_dword (pdev,0x50 , timing); } -return ata_pci_device_resume (pdev); +return ata_pci_device_resume (pdev); }static const struct pci_device_id via[] = {
drivers/ata/pata_winbond.c +8 -8
@@ -5,7 +5,7 @@* Support for the Winbond 83759A when operating in advanced mode. * Multichip mode is not currently supported. */ - +#include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h>
@@ -69,7 +69,7 @@ static void winbond_set_piomode(struct ata_port *ap, struct ata_device *adev)int timing =0x88 + (ap->port_no *4 ) + (adev->devno *2 ); reg =winbond_readcfg (winbond->config,0x81 ); - +/* Get the timing data in cycles */ if (reg &0x40 )/* Fast VLB bus, assume 50MHz */ ata_timing_compute (adev, adev->pio_mode, &t,20000 ,1000 );
@@ -80,9 +80,9 @@ static void winbond_set_piomode(struct ata_port *ap, struct ata_device *adev) recovery = (FIT (t.recover,1 ,15 ) +1 ) &0x0F ; timing = (active <<4 ) | recovery;winbond_writecfg (winbond->config, timing, reg); - +/* Load the setup timing */ - + reg =0x35 ;if (adev->class !=ATA_DEV_ATA ) reg |=0x08 ;/* FIFO off */
@@ -194,13 +194,13 @@ static __init int winbond_init_one(unsigned long port)winbond_writecfg (port,0x85 , reg); reg =winbond_readcfg (port,0x81 ); - +if (!(reg &0x03 ))/* Disabled */ return 0 ;for (i =0 ; i <2 ; i ++) { -if (reg & (1 << i)) { +if (reg & (1 << i)) {/* * Fill in a probe structure first of all */
@@ -217,7 +217,7 @@ static __init int winbond_init_one(unsigned long port) ae.pio_mask =0x1F ; ae.sht = &winbond_sht; - + ae.n_ports =1 ; ae.irq =14 + i; ae.irq_flags =0 ;
@@ -257,7 +257,7 @@ static __init int winbond_init(void)int ct =0 ;int i; - +if (probe_winbond ==0 )return -ENODEV ;
drivers/ata/sata_nv.c +9 -9
@@ -536,7 +536,7 @@ static void nv_adma_mode(struct ata_port *ap)if (!(pp->flags &NV_ADMA_PORT_REGISTER_MODE ))return ; - +WARN_ON (pp->flags &NV_ADMA_ATAPI_SETUP_COMPLETE ); tmp =readw (mmio +NV_ADMA_CTL );
@@ -576,7 +576,7 @@ static int nv_adma_slave_config(struct scsi_device *sdev)/* Subtract 1 since an extra entry may be needed for padding, see libata-scsi.c */ sg_tablesize =LIBATA_MAX_PRD -1 ; - +/* Since the legacy DMA engine is in use, we need to disable ADMA on the port. */ adma_enable =0 ;
@@ -588,7 +588,7 @@ static int nv_adma_slave_config(struct scsi_device *sdev) sg_tablesize =NV_ADMA_SGTBL_TOTAL_LEN ; adma_enable =1 ; } - +pci_read_config_dword (pdev,NV_MCP_SATA_CFG_20 , ¤t_reg);if (ap->port_no ==1 )
@@ -597,7 +597,7 @@ static int nv_adma_slave_config(struct scsi_device *sdev)else config_mask =NV_MCP_SATA_CFG_20_PORT0_EN |NV_MCP_SATA_CFG_20_PORT0_PWB_EN ; - +if (adma_enable) { new_reg = current_reg | config_mask; pp->flags &= ~NV_ADMA_ATAPI_SETUP_COMPLETE ;
@@ -606,10 +606,10 @@ static int nv_adma_slave_config(struct scsi_device *sdev) new_reg = current_reg & ~config_mask; pp->flags |=NV_ADMA_ATAPI_SETUP_COMPLETE ; } - +if (current_reg != new_reg)pci_write_config_dword (pdev,NV_MCP_SATA_CFG_20 , new_reg); - +blk_queue_bounce_limit (sdev->request_queue, bounce_limit);blk_queue_segment_boundary (sdev->request_queue, segment_boundary);blk_queue_max_hw_segments (sdev->request_queue, sg_tablesize);
@@ -822,13 +822,13 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance) handled++;/* irq handled if we got here */ } } - +if (notifier_clears[0 ] || notifier_clears[1 ]) {/* Note: Both notifier clear registers must be written if either is set, even if one is zero, according to NVIDIA. */ -writel (notifier_clears[0 ], +writel (notifier_clears[0 ],nv_adma_notifier_clear_block (host->ports[0 ])); -writel (notifier_clears[1 ], +writel (notifier_clears[1 ],nv_adma_notifier_clear_block (host->ports[1 ])); }
drivers/ata/sata_sis.c +54 -25
164 lines not on this page · raw message
drivers/ata/sata_svw.c +34 -7
88 lines not on this page · raw message
drivers/ata/sata_via.c +1 -1
@@ -319,7 +319,7 @@ static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev) {struct ata_probe_ent *probe_ent;struct ata_port_info *ppi[2 ]; - + ppi[0 ] = ppi[1 ] = &vt6420_port_info; probe_ent =ata_pci_init_native_mode (pdev, ppi,ATA_PORT_PRIMARY |ATA_PORT_SECONDARY );if (!probe_ent)
include/linux/libata.h +1 -1
@@ -307,7 +307,7 @@ enum {* most devices. */ ATA_SPINUP_WAIT = 8000, - +/* Horkage types. May be set by libata or controller on drives (some horkage may be drive/controller pair dependant */
include/linux/pci_ids.h +1 -0
@@ -1621,6 +1621,7 @@#define PCI_VENDOR_ID_ITE 0x1283#define PCI_DEVICE_ID_ITE_8211 0x8211#define PCI_DEVICE_ID_ITE_8212 0x8212 +#define PCI_DEVICE_ID_ITE_8213 0x8213#define PCI_DEVICE_ID_ITE_8872 0x8872#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
drivers/ata/Kconfig config PATA_IT821X · line 308
Quoted 6 lines
drivers/ata/Kconfig +5
-0+config PATA_IT8213 + tristate "IT8213 PATA support (Experimental)" + depends on PCI && EXPERIMENTAL + help + This option enables support for the ITE 821 PATA
Typo (IT8213) - probably my fault but only just noticed it