cmd640: fix warm-plug support for the secondary interface
PATCH 1/14 cmd640: fix warm-plug support for the secondary interface
Register secondary interface also when user requested not to probe devices.
While at it:
- remove write-only second_port_toggled variable
--- drivers/ide/pci/cmd640.c | 51 +++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 30 deletions(-)
drivers/ide/pci/cmd640.c +21 -30
@@ -687,9 +687,6 @@ static int cmd640x_init_one(unsigned lon*/ static int __init cmd640x_init (void ) { -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED -int second_port_toggled =0 ; -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ int second_port_cmd640 =0 , rc;const char *bus_type, *port2;unsigned int index;
@@ -778,46 +775,40 @@ static int __init cmd640x_init(void)put_cmd640_reg (CMDTIM ,0 );put_cmd640_reg (BRST ,0x40 ); - cmd_hwif1 =ide_find_port (); + b =get_cmd640_reg (CNTRL );/* * Try to enable the secondary interface, if not already enabled */ -if (cmd_hwif1 && - cmd_hwif1->drives[0 ].noprobe && cmd_hwif1->drives[1 ].noprobe) { - port2 ="not probed" ; +if (secondary_port_responding ()) { +if ((b &CNTRL_ENA_2ND )) { + second_port_cmd640 =1 ; + port2 ="okay" ; + }else if (cmd640_vlb) { + second_port_cmd640 =1 ; + port2 ="alive" ; + }else + port2 ="not cmd640" ; }else { - b =get_cmd640_reg (CNTRL ); +put_cmd640_reg (CNTRL , b ^CNTRL_ENA_2ND );/* toggle the bit */ if (secondary_port_responding ()) { -if ((b &CNTRL_ENA_2ND )) { - second_port_cmd640 =1 ; - port2 ="okay" ; - }else if (cmd640_vlb) { - second_port_cmd640 =1 ; - port2 ="alive" ; - }else - port2 ="not cmd640" ; + second_port_cmd640 =1 ; + port2 ="enabled" ; }else { -put_cmd640_reg (CNTRL , b ^CNTRL_ENA_2ND );/* toggle the bit */ -if (secondary_port_responding ()) { - second_port_cmd640 =1 ; -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED - second_port_toggled =1 ; -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ - port2 ="enabled" ; - }else { -put_cmd640_reg (CNTRL , b);/* restore original setting */ - port2 ="not responding" ; - } +put_cmd640_reg (CNTRL , b);/* restore original setting */ + port2 ="not responding" ; } }/* * Initialize data for secondary cmd640 port, if enabled */ -if (second_port_cmd640 && cmd_hwif1) { -ide_init_port_hw (cmd_hwif1, &hw[1 ]); - idx[1 ] = cmd_hwif1->index; +if (second_port_cmd640) { + cmd_hwif1 =ide_find_port (); +if (cmd_hwif1) { +ide_init_port_hw (cmd_hwif1, &hw[1 ]); + idx[1 ] = cmd_hwif1->index; + } }printk (KERN_INFO "cmd640: %sserialized, secondary interface %s\n" , second_port_cmd640 ?"" :"not " , port2);
PATCH 2/14 ide: ->port_init_devs -> ->init_dev
Change ->port_init_devs method to take 'ide_drive_t *' as an argument instead of 'ide_hwif_t *' and rename it to ->init_dev.
There should be no functional changes caused by this patch.
--- drivers/ide/ide-probe.c | 6 +++--- drivers/ide/legacy/ht6560b.c | 8 ++++---- drivers/ide/legacy/ide-4drives.c | 10 ++++------ drivers/ide/legacy/qd65xx.c | 16 ++++++++-------- drivers/ide/pci/opti621.c | 7 +++---- include/linux/ide.h | 4 ++-- 6 files changed, 24 insertions(+), 27 deletions(-)
drivers/ide/ide-probe.c +3 -3
@@ -1326,10 +1326,10 @@ static void ide_port_init_devices(ide_hw drive->unmask =1 ;if (hwif->host_flags &IDE_HFLAG_NO_UNMASK_IRQS ) drive->no_unmask =1 ; - } -if (port_ops && port_ops->port_init_devs) - port_ops->port_init_devs (hwif); +if (port_ops && port_ops->init_dev) + port_ops->init_dev (drive); + } } static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
drivers/ide/legacy/ht6560b.c +4 -4
@@ -310,16 +310,16 @@ static void ht6560b_set_pio_mode(ide_dri#endif } -static void __init ht6560b_port_init_devs (ide_hwif_t *hwif) +static void __init ht6560b_init_dev (ide_drive_t *drive) { +ide_hwif_t *hwif = drive->hwif;/* Setting default configurations for drives. */ int t = (HT_CONFIG_DEFAULT <<8 ) |HT_TIMING_DEFAULT ;if (hwif->channel) t |= (HT_SECONDARY_IF <<8 ); - hwif->drives[0 ].drive_data = t; - hwif->drives[1 ].drive_data = t; + drive->drive_data = t; }static int probe_ht6560b;
@@ -328,7 +328,7 @@ module_param_named(probe, probe_ht6560b,MODULE_PARM_DESC (probe,"probe for HT6560B chipset" );static const struct ide_port_ops ht6560b_port_ops = { - .port_init_devs = ht6560b_port_init_devs, + .init_dev = ht6560b_init_dev, .set_pio_mode = ht6560b_set_pio_mode, .selectproc = ht6560b_selectproc, };
drivers/ide/legacy/ide-4drives.c +4 -6
@@ -11,16 +11,14 @@ static int probe_4drives;module_param_named (probe, probe_4drives, bool,0 );MODULE_PARM_DESC (probe,"probe for generic IDE chipset with 4 drives/port" ); -static void ide_4drives_port_init_devs (ide_hwif_t *hwif) +static void ide_4drives_init_dev (ide_drive_t *drive) { -if (hwif->channel) { - hwif->drives[0 ].select.all ^=0x20 ; - hwif->drives[1 ].select.all ^=0x20 ; - } +if (drive->hwif->channel) + drive->select.all ^=0x20 ; }static const struct ide_port_ops ide_4drives_port_ops = { - .port_init_devs = ide_4drives_port_init_devs, + .init_dev = ide_4drives_init_dev, };static const struct ide_port_info ide_4drives_port_info = {
drivers/ide/legacy/qd65xx.c +8 -8
@@ -282,17 +282,18 @@ static int __init qd_testreg(int port)return (readreg !=QD_TESTVAL ); } -static void __init qd6500_port_init_devs (ide_hwif_t *hwif) +static void __init qd6500_init_dev (ide_drive_t *drive) { +ide_hwif_t *hwif = drive->hwif;u8 base = (hwif->config_data &0xff00 ) >>8 ;u8 config =QD_CONFIG (hwif); - hwif->drives[0 ].drive_data =QD6500_DEF_DATA ; - hwif->drives[1 ].drive_data =QD6500_DEF_DATA ; + drive->drive_data =QD6500_DEF_DATA ; } -static void __init qd6580_port_init_devs (ide_hwif_t *hwif) +static void __init qd6580_init_dev (ide_drive_t *drive) { +ide_hwif_t *hwif = drive->hwif;u16 t1, t2;u8 base = (hwif->config_data &0xff00 ) >>8 ;u8 config =QD_CONFIG (hwif);
@@ -303,18 +304,17 @@ static void __init qd6580_port_init_devs }else t2 = t1 = hwif->channel ?QD6580_DEF_DATA2 :QD6580_DEF_DATA ; - hwif->drives[0 ].drive_data = t1; - hwif->drives[1 ].drive_data = t2; + drive->drive_data = drive->select.b.unit ? t2 : t1; }static const struct ide_port_ops qd6500_port_ops = { - .port_init_devs = qd6500_port_init_devs, + .init_dev = qd6500_init_dev, .set_pio_mode = qd6500_set_pio_mode, .selectproc = qd65xx_select, };static const struct ide_port_ops qd6580_port_ops = { - .port_init_devs = qd6580_port_init_devs, + .init_dev = qd6580_init_dev, .set_pio_mode = qd6580_set_pio_mode, .selectproc = qd65xx_select, };
drivers/ide/pci/opti621.c +3 -4
@@ -319,14 +319,13 @@ static void opti621_set_pio_mode(ide_drispin_unlock_irqrestore (&opti621_lock, flags); } -static void __devinit opti621_port_init_devs (ide_hwif_t *hwif) +static void __devinit opti621_init_dev (ide_drive_t *drive) { - hwif->drives[0 ].drive_data =PIO_DONT_KNOW ; - hwif->drives[1 ].drive_data =PIO_DONT_KNOW ; + drive->drive_data =PIO_DONT_KNOW ; }static const struct ide_port_ops opti621_port_ops = { - .port_init_devs = opti621_port_init_devs, + .init_dev = opti621_init_dev, .set_pio_mode = opti621_set_pio_mode, };
include/linux/ide.h +2 -2
@@ -390,8 +390,8 @@ typedef struct ide_drive_s {struct ide_port_info ;struct ide_port_ops { -/* host specific initialization of devices on a port */ -void (*port_init_devs)(struct hwif_s *); +/* host specific initialization of a device */ +void (*init_dev)(ide_drive_t *);/* routine to program host for PIO mode */ void (*set_pio_mode)(ide_drive_t *,const u8 );/* routine to program host for DMA mode */
PATCH 3/14 cmd640: add ->init_dev method
In reply to Bartlomiej ZolnierkiewiczConvert the driver to use ->init_dev method instead of open-coding devices init in cmd640x_init().
While at it:
- fix printk()-s to use KERN_INFO level instead of the default KERN_ERR
- use DRV_NAME define in printk()-s
- set proper ->pio_mask also for CONFIG_BLK_DEV_CMD640_ENHANCED=n
There should be no functional changes caused by this patch (except fixing printk()-s levels).
--- drivers/ide/pci/cmd640.c | 72 +++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 42 deletions(-)
drivers/ide/pci/cmd640.c +30 -42
@@ -611,11 +611,40 @@ static void cmd640_set_pio_mode(ide_drivdisplay_clocks (index); } +#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ + +static void cmd640_init_dev (ide_drive_t *drive) +{ +unsigned int i = drive->hwif->channel *2 + drive->select.b.unit; + +#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED +/* +* Reset timing to the slowest speed and turn off prefetch. +* This way, the drive identify code has a better chance. +*/ + setup_counts[i] =4 ;/* max possible */ + active_counts[i] =16 ;/* max possible */ + recovery_counts[i] =16 ;/* max possible */ +program_drive_counts (drive, i); +set_prefetch_mode (drive, i,0 ); + printk(KERN_INFO DRV_NAME ": drive%d timings/prefetch cleared\n", i); +#else +/* +* Set the drive unmask flags to match the prefetch setting. +*/ +check_prefetch (drive, i); + printk(KERN_INFO DRV_NAME ": drive%d timings/prefetch(%s) preserved\n", + i, drive->no_io_32bit ? "off" : "on"); +#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ +} +static const struct ide_port_ops cmd640_port_ops = { + .init_dev = cmd640_init_dev, +#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED .set_pio_mode = cmd640_set_pio_mode, +#endif }; -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ static int pci_conf1 (void ) {
@@ -658,10 +687,8 @@ static const struct ide_port_info cmd640IDE_HFLAG_NO_DMA |IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_ABUSE_FAST_DEVSEL, -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED .port_ops = &cmd640_port_ops, .pio_mask = ATA_PIO5, -#endif };static int cmd640x_init_one (unsigned long base,unsigned long ctl)
@@ -689,7 +716,6 @@ static int __init cmd640x_init(void) {int second_port_cmd640 =0 , rc;const char *bus_type, *port2; -unsigned int index;u8 b, cfr;u8 idx[4 ] = {0xff ,0xff ,0xff ,0xff };hw_regs_t hw[2 ];
@@ -813,44 +839,6 @@ static int __init cmd640x_init(void)printk (KERN_INFO "cmd640: %sserialized, secondary interface %s\n" , second_port_cmd640 ?"" :"not " , port2); -/* -* Establish initial timings/prefetch for all drives. -* Do not unnecessarily disturb any prior BIOS setup of these. -*/ -for (index =0 ; index < (2 + (second_port_cmd640 <<1 )); index++) { -ide_drive_t *drive; - -if (index >1 ) { -if (cmd_hwif1 ==NULL ) -continue ; - drive = &cmd_hwif1->drives[index &1 ]; - }else { -if (cmd_hwif0 ==NULL ) -continue ; - drive = &cmd_hwif0->drives[index &1 ]; - } - -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED -/* -* Reset timing to the slowest speed and turn off prefetch. -* This way, the drive identify code has a better chance. -*/ - setup_counts [index] =4 ;/* max possible */ - active_counts [index] =16 ;/* max possible */ - recovery_counts [index] =16 ;/* max possible */ -program_drive_counts (drive, index); -set_prefetch_mode (drive, index,0 ); -printk ("cmd640: drive%d timings/prefetch cleared\n" , index); -#else -/* -* Set the drive unmask flags to match the prefetch setting -*/ -check_prefetch (drive, index); -printk ("cmd640: drive%d timings/prefetch(%s) preserved\n" , - index, drive->no_io_32bit ?"off" :"on" ); -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ - } -#ifdef CMD640_DUMP_REGS cmd640_dump_regs ();#endif
PATCH 4/14 rapide: use struct ide_port_info
In reply to Bartlomiej ZolnierkiewiczConvert the driver to use struct ide_port_info.
There should be no functional changes caused by this patch.
--- drivers/ide/arm/rapide.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/ide/arm/rapide.c +5 -2
@@ -11,6 +11,10 @@#include <asm/ecard.h> +static struct const ide_port_info rapide_port_info = { + .host_flags =IDE_HFLAG_MMIO |IDE_HFLAG_NO_DMA , +}; +static void rapide_setup_ports (hw_regs_t *hw,void __iomem *base,void __iomem *ctrl,unsigned int sz,int irq) {
@@ -53,12 +57,11 @@ rapide_probe(struct expansion_card *ec,ide_init_port_hw (hwif, &hw); - hwif->host_flags =IDE_HFLAG_MMIO ;default_hwif_mmiops (hwif); idx[0 ] = hwif->index; -ide_device_add (idx,NULL ); +ide_device_add (idx, &rapide_port_info);ecard_set_drvdata (ec, hwif); goto out;
PATCH 5/14 ide-h8300: use struct ide_port_info
In reply to Bartlomiej ZolnierkiewiczConvert the driver to use struct ide_port_info.
There should be no functional changes caused by this patch.
--- drivers/ide/h8300/ide-h8300.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/ide/h8300/ide-h8300.c +5 -2
@@ -176,6 +176,10 @@ static inline void hwif_setup(ide_hwif_t hwif->output_data = h8300_output_data; } +static const struct ide_port_info h8300_port_info = { + .host_flags =IDE_HFLAG_NO_IO_32BIT |IDE_HFLAG_NO_DMA , +}; +static int __init h8300_ide_init (void ) {hw_regs_t hw;
@@ -201,12 +205,11 @@ static int __init h8300_ide_init(void) index = hwif->index;ide_init_port_hw (hwif, &hw);hwif_setup (hwif); - hwif->host_flags =IDE_HFLAG_NO_IO_32BIT ;printk (KERN_INFO "ide%d: H8/300 generic IDE interface\n" , index); idx[0 ] = index; -ide_device_add (idx,NULL ); +ide_device_add (idx, &h8300_port_info);return 0 ;
PATCH 6/14 ide_platform: use struct ide_port_info
In reply to Bartlomiej ZolnierkiewiczConvert the driver to use struct ide_port_info.
There should be no functional changes caused by this patch.
--- drivers/ide/legacy/ide_platform.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/ide/legacy/ide_platform.c +7 -2
@@ -44,6 +44,10 @@ static void __devinit plat_ide_setup_por hw->chipset = ide_generic; } +static const struct ide_port_info platform_ide_port_info = { + .host_flags =IDE_HFLAG_NO_DMA , +}; +static int __devinit plat_ide_probe (struct platform_device *pdev) {struct resource *res_base, *res_alt, *res_irq;
@@ -54,6 +58,7 @@ static int __devinit plat_ide_probe(struint ret =0 ;int mmio =0 ;hw_regs_t hw; +struct ide_port_info d = platform_ide_port_info; pdata = pdev->dev.platform_data;
@@ -102,13 +107,13 @@ static int __devinit plat_ide_probe(struide_init_port_hw (hwif, &hw);if (mmio) { - hwif->host_flags =IDE_HFLAG_MMIO ; + d.host_flags |=IDE_HFLAG_MMIO ;default_hwif_mmiops (hwif); } idx[0 ] = hwif->index; -ide_device_add (idx,NULL ); +ide_device_add (idx, &d);platform_set_drvdata (pdev, hwif);
PATCH 7/14 ide: print message on error in ide_find_port_slot()
In reply to Bartlomiej Zolnierkiewicz* Add DRV_NAME define to ide-h8300.c.
* Fix ide-h8300.c, swarm.c and sgiioc4.c to set .name field in struct ide_port_info to DRV_NAME, then convert these host drivers to use ide_find_port_slot() instead of ide_find_port().
* Print message on error in ide_find_port_slot().
--- drivers/ide/h8300/ide-h8300.c | 8 ++++---- drivers/ide/ide-probe.c | 3 +++ drivers/ide/mips/swarm.c | 7 +++---- drivers/ide/pci/scc_pata.c | 7 ++----- drivers/ide/pci/sgiioc4.c | 8 +++----- drivers/ide/setup-pci.c | 5 +---- 6 files changed, 16 insertions(+), 22 deletions(-)
drivers/ide/h8300/ide-h8300.c +4 -4
@@ -8,6 +8,8 @@#include <asm/io.h> #include <asm/irq.h> +#define DRV_NAME "ide-h8300" +#define bswap (d) \ ({ \ u16 r; \
@@ -196,11 +198,9 @@ static int __init h8300_ide_init(void)hw_setup (&hw); - hwif =ide_find_port (); -if (hwif ==NULL ) { -printk (KERN_ERR "ide-h8300: IDE I/F register failed\n" ); + hwif =ide_find_port_slot (&h8300_port_info); +if (hwif ==NULL )return -ENOENT ; - } index = hwif->index;ide_init_port_hw (hwif, &hw);
drivers/ide/ide-probe.c +3 -0
@@ -1496,6 +1496,9 @@ ide_hwif_t *ide_find_port_slot(const str } } +printk (KERN_ERR "%s: no free slot for interface\n" , + d ? d->name :"ide" ); +return NULL ; out_found:
drivers/ide/mips/swarm.c +3 -4
@@ -62,6 +62,7 @@ static struct resource swarm_ide_resourcstatic struct platform_device *swarm_ide_dev;static const struct ide_port_info swarm_port_info = { + .name =DRV_NAME , .host_flags =IDE_HFLAG_MMIO |IDE_HFLAG_NO_DMA , };
@@ -81,11 +82,9 @@ static int __devinit swarm_ide_probe(strif (!SIBYTE_HAVE_IDE )return -ENODEV ; - hwif =ide_find_port (); -if (hwif ==NULL ) { - printk(KERN_ERR DRV_NAME ": no free slot for interface\n"); + hwif =ide_find_port_slot (&swarm_port_info); +if (hwif ==NULL )return -ENOMEM ; - } base =ioremap (A_IO_EXT_BASE ,0x800 ); offset =__raw_readq (base +R_IO_EXT_REG (R_IO_EXT_START_ADDR ,IDE_CS ));
drivers/ide/pci/scc_pata.c +2 -5
@@ -558,12 +558,9 @@ static int scc_ide_setup_pci_device(struu8 idx[4 ] = {0xff ,0xff ,0xff ,0xff };int i; - hwif =ide_find_port (); -if (hwif ==NULL ) { -printk (KERN_ERR "%s: too many IDE interfaces, " -"no room in table\n" ,SCC_PATA_NAME ); + hwif =ide_find_port_slot (d); +if (hwif ==NULL )return -ENOMEM ; - }memset (&hw,0 ,sizeof (hw));for (i =0 ; i <=8 ; i++)
drivers/ide/pci/sgiioc4.c +3 -5
@@ -568,6 +568,7 @@ static const struct ide_dma_ops sgiioc4_ };static const struct ide_port_info sgiioc4_port_info__devinitdata = { + .name =DRV_NAME , .chipset = ide_pci, .init_dma = ide_dma_sgiioc4, .port_ops = &sgiioc4_port_ops,
@@ -587,12 +588,9 @@ sgiioc4_ide_setup_pci_device(struct pci_hw_regs_t hw;struct ide_port_info d = sgiioc4_port_info; - hwif =ide_find_port (); -if (hwif ==NULL ) { -printk (KERN_ERR "%s: too many IDE interfaces, no room in table\n" , -DRV_NAME ); + hwif =ide_find_port_slot (&d); +if (hwif ==NULL )return -ENOMEM ; - }/* Get the CmdBlk and CtrlBlk Base Registers */ bar0 =pci_resource_start (dev,0 );
drivers/ide/setup-pci.c +1 -4
@@ -332,11 +332,8 @@ static ide_hwif_t *ide_hwif_configure(st } hwif =ide_find_port_slot (d); -if (hwif ==NULL ) { -printk (KERN_ERR "%s: too many IDE interfaces, no room in " -"table\n" , d->name); +if (hwif ==NULL )return NULL ; - }memset (&hw,0 ,sizeof (hw)); hw.irq = irq;
PATCH 8/14 ide-h8300: print driver banner message early
In reply to Bartlomiej ZolnierkiewiczPrint driver banner message early and without interface number.
--- drivers/ide/h8300/ide-h8300.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ide/h8300/ide-h8300.c +2 -1
@@ -189,6 +189,8 @@ static int __init h8300_ide_init(void)int index;u8 idx[4 ] = {0xff ,0xff ,0xff ,0xff }; + printk(KERN_INFO DRV_NAME ": H8/300 generic IDE interface\n"); +if (!request_region (CONFIG_H8300_IDE_BASE ,H8300_IDE_GAP *8 ,"ide-h8300" )) goto out_busy;if (!request_region (CONFIG_H8300_IDE_ALT ,H8300_IDE_GAP ,"ide-h8300" )) {
@@ -205,7 +207,6 @@ static int __init h8300_ide_init(void) index = hwif->index;ide_init_port_hw (hwif, &hw);hwif_setup (hwif); -printk (KERN_INFO "ide%d: H8/300 generic IDE interface\n" , index); idx[0 ] = index;
PATCH 9/14 ide-pnp: print driver banner message early
In reply to Bartlomiej ZolnierkiewiczPrint driver banner message early and without interface number.
--- drivers/ide/ide-pnp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ide/ide-pnp.c +2 -1
@@ -33,6 +33,8 @@ static int idepnp_probe(struct pnp_dev *ide_hwif_t *hwif;unsigned long base, ctl; + printk(KERN_INFO DRV_NAME ": generic PnP IDE interface\n"); +if (!(pnp_port_valid (dev,0 ) &&pnp_port_valid (dev,1 ) &&pnp_irq_valid (dev,0 )))return -1 ;
@@ -64,7 +66,6 @@ static int idepnp_probe(struct pnp_dev *ide_init_port_hw (hwif, &hw); -printk (KERN_INFO "ide%d: generic PnP IDE interface\n" , index);pnp_set_drvdata (dev, hwif);ide_device_add (idx,NULL );
PATCH 10/14 ide: allow any command requesting DMA data phase for HDIO_DRIVE_TASKFILE
In reply to Bartlomiej ZolnierkiewiczAllow any command requesting DMA data phase for HDIO_DRIVE_TASKFILE ioctl and remove no longer needed task_dma_ok()
--- drivers/ide/ide-taskfile.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-)
drivers/ide/ide-taskfile.c +1 -21
@@ -62,25 +62,6 @@ int taskfile_lib_get_identify (ide_drivereturn ide_raw_taskfile (drive, &args, buf,1 ); } -static int inline task_dma_ok (ide_task_t *task) -{ -if (blk_fs_request (task->rq) || (task->tf_flags &IDE_TFLAG_FLAGGED )) -return 1 ; - -switch (task->tf.command) { -case WIN_WRITEDMA_ONCE : -case WIN_WRITEDMA : -case WIN_WRITEDMA_EXT : -case WIN_READDMA_ONCE : -case WIN_READDMA : -case WIN_READDMA_EXT : -case WIN_IDENTIFY_DMA : -return 1 ; - } - -return 0 ; -} -static ide_startstop_t task_no_data_intr (ide_drive_t *);static ide_startstop_t set_geometry_intr (ide_drive_t *);static ide_startstop_t recal_intr (ide_drive_t *);
@@ -139,8 +120,7 @@ ide_startstop_t do_rw_taskfile (ide_driv WAIT_WORSTCASE, NULL);return ide_started;default : -if (task_dma_ok (task) ==0 || drive->using_dma ==0 || - dma_ops->dma_setup (drive)) +if (drive->using_dma ==0 || dma_ops->dma_setup (drive))return ide_stopped; dma_ops->dma_exec_cmd (drive, tf->command); dma_ops->dma_start (drive);
PATCH 11/14 ide: remove superfluous BUG_ON() from set_geometry_intr()
In reply to Bartlomiej Zolnierkiewiczide_set_handler() bugs on ->handler == NULL so no need to do it in set_geometry_intr().
There should be no functional changes caused by this patch.
--- drivers/ide/ide-taskfile.c | 1 - 1 file changed, 1 deletion(-)
drivers/ide/ide-taskfile.c +0 -1
@@ -163,7 +163,6 @@ static ide_startstop_t set_geometry_intrif (stat & (ERR_STAT |DRQ_STAT ))return ide_error (drive,"set_geometry_intr" , stat); -BUG_ON (HWGROUP (drive)->handler !=NULL );ide_set_handler (drive, &set_geometry_intr,WAIT_WORSTCASE ,NULL );return ide_started; }
PATCH 12/14 ide: remove needless includes from ide.c
In reply to Bartlomiej Zolnierkiewicz--- drivers/ide/ide.c | 13 ------------- 1 file changed, 13 deletions(-)
drivers/ide/ide.c +0 -13
@@ -50,29 +50,16 @@#include <linux/types.h> #include <linux/string.h> #include <linux/kernel.h> -#include <linux/timer.h> -#include <linux/mm.h> #include <linux/interrupt.h> #include <linux/major.h> #include <linux/errno.h> #include <linux/genhd.h> -#include <linux/blkpg.h> #include <linux/slab.h> #include <linux/init.h> #include <linux/pci.h> -#include <linux/delay.h> #include <linux/ide.h> #include <linux/completion.h> -#include <linux/reboot.h> -#include <linux/cdrom.h> -#include <linux/seq_file.h> #include <linux/device.h> -#include <linux/bitops.h> - -#include <asm/byteorder.h> -#include <asm/irq.h> -#include <asm/uaccess.h> -#include <asm/io.h> /* default maximum number of failures */
PATCH 13/14 ide: remove needless includes from ide-taskfile.c
In reply to Bartlomiej Zolnierkiewicz--- drivers/ide/ide-taskfile.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/ide/ide-taskfile.c +0 -11
@@ -8,28 +8,17 @@* The big the bad and the ugly. */ -#include <linux/module.h> #include <linux/types.h> #include <linux/string.h> #include <linux/kernel.h> -#include <linux/timer.h> -#include <linux/mm.h> #include <linux/sched.h> #include <linux/interrupt.h> -#include <linux/major.h> #include <linux/errno.h> -#include <linux/genhd.h> -#include <linux/blkpg.h> #include <linux/slab.h> -#include <linux/pci.h> #include <linux/delay.h> #include <linux/hdreg.h> #include <linux/ide.h> -#include <linux/bitops.h> -#include <linux/scatterlist.h> -#include <asm/byteorder.h> -#include <asm/irq.h> #include <asm/uaccess.h> #include <asm/io.h>
PATCH 14/14 ide: remove needless includes from setup-pci.c
In reply to Bartlomiej Zolnierkiewicz--- drivers/ide/setup-pci.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/ide/setup-pci.c +0 -5
@@ -6,19 +6,14 @@* May be copied or modified under the terms of the GNU General Public License */ -#include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/pci.h> #include <linux/init.h> -#include <linux/timer.h> -#include <linux/mm.h> #include <linux/interrupt.h> #include <linux/ide.h> -#include <linux/dma-mapping.h> #include <asm/io.h> -#include <asm/irq.h> /** * ide_setup_pci_baseregs - place a PCI IDE controller native