IDE updates part 2
PATCH 1/1 IDE updates part 2
Contains:
- critical+obvious execve() fix from Al (not an IDE fix but included here to have IDE changes fully bisectable in the mainline)
- fix the infamous ide_4drives allmodconfig error (Frederik Deweerdt)
- fix checking of PCI BARs 0-3 for standard IDE PCI controllers (Sergei Shtylyov)
- rework of I/O and MEM resource handling (me)
- preparations for removal of the static array of IDE interfaces (me)
- a lot of coding style fixes (Paolo Ciarrocchi)
- removal of the internal 64k buffer from ide-cd (Borislav Petkov)
- and more (thanks to all people contributing)
PS1 There are still 3-4 IDE updates to go.
PS2 I'm still catching up with the patches/mail from the last week so if
you've sent me something recently please give me few more days for reply before re-sending.
Linus, please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/
to receive the following updates:
drivers/ide/Kconfig | 2 +- drivers/ide/arm/bast-ide.c | 12 +- drivers/ide/arm/icside.c | 2 +- drivers/ide/arm/ide_arm.c | 2 +- drivers/ide/arm/palm_bk3710.c | 26 ++-- drivers/ide/arm/rapide.c | 2 +- drivers/ide/cris/ide-cris.c | 2 +- drivers/ide/h8300/ide-h8300.c | 3 +- drivers/ide/ide-cd.c | 412 ++++++++++++++----------------------- drivers/ide/ide-cd.h | 4 - drivers/ide/ide-disk.c | 159 ++++++++------- drivers/ide/ide-dma.c | 13 +- drivers/ide/ide-floppy.c | 16 +- drivers/ide/ide-generic.c | 16 ++- drivers/ide/ide-io.c | 4 - drivers/ide/ide-lib.c | 22 +- drivers/ide/ide-pnp.c | 12 +- drivers/ide/ide-probe.c | 48 +++++ drivers/ide/ide-proc.c | 155 +++++++------- drivers/ide/ide.c | 69 ++----- drivers/ide/legacy/ali14xx.c | 30 ++- drivers/ide/legacy/buddha.c | 2 +- drivers/ide/legacy/dtc2278.c | 22 +- drivers/ide/legacy/falconide.c | 9 +- drivers/ide/legacy/gayle.c | 2 +- drivers/ide/legacy/hd.c | 78 ++++---- drivers/ide/legacy/ht6560b.c | 34 ++-- drivers/ide/legacy/ide-4drives.c | 36 ++-- drivers/ide/legacy/ide-cs.c | 2 +- drivers/ide/legacy/ide_platform.c | 7 +- drivers/ide/legacy/macide.c | 2 +- drivers/ide/legacy/q40ide.c | 2 +- drivers/ide/legacy/qd65xx.c | 165 +++++++-------- drivers/ide/legacy/qd65xx.h | 1 - drivers/ide/legacy/umc8672.c | 81 ++++---- drivers/ide/mips/au1xxx-ide.c | 8 +- drivers/ide/mips/swarm.c | 9 +- drivers/ide/pci/aec62xx.c | 3 +- drivers/ide/pci/alim15x3.c | 1 - drivers/ide/pci/amd74xx.c | 4 +- drivers/ide/pci/atiixp.c | 5 +- drivers/ide/pci/cmd640.c | 188 +++++++++--------- drivers/ide/pci/cmd64x.c | 9 +- drivers/ide/pci/cs5520.c | 3 +- drivers/ide/pci/cs5530.c | 3 +- drivers/ide/pci/cs5535.c | 2 +- drivers/ide/pci/cy82c693.c | 77 ++++---- drivers/ide/pci/delkin_cb.c | 6 +- drivers/ide/pci/generic.c | 10 +- drivers/ide/pci/hpt34x.c | 2 +- drivers/ide/pci/hpt366.c | 2 +- drivers/ide/pci/it8213.c | 12 +- drivers/ide/pci/it821x.c | 25 ++- drivers/ide/pci/jmicron.c | 4 +- drivers/ide/pci/ns87415.c | 3 +- drivers/ide/pci/opti621.c | 61 +++--- drivers/ide/pci/piix.c | 4 +- drivers/ide/pci/rz1000.c | 2 +- drivers/ide/pci/sc1200.c | 3 +- drivers/ide/pci/scc_pata.c | 17 +- drivers/ide/pci/serverworks.c | 5 +- drivers/ide/pci/sgiioc4.c | 12 +- drivers/ide/pci/siimage.c | 1 - drivers/ide/pci/sis5513.c | 225 ++++++++++---------- drivers/ide/pci/sl82c105.c | 3 +- drivers/ide/pci/slc90e66.c | 8 +- drivers/ide/pci/tc86c001.c | 28 ++-- drivers/ide/pci/triflex.c | 1 - drivers/ide/pci/trm290.c | 1 - drivers/ide/pci/via82cxxx.c | 4 +- drivers/ide/ppc/mpc8xx.c | 58 ++++-- drivers/ide/ppc/pmac.c | 90 +++++---- drivers/ide/setup-pci.c | 129 +++--------- include/linux/Kbuild | 1 - include/linux/hdsmart.h | 126 ----------- include/linux/ide.h | 23 ++- kernel/fork.c | 2 +- 77 files changed, 1195 insertions(+), 1439 deletions(-) delete mode 100644 include/linux/hdsmart.h
Adrian Bunk (1):
remove include/linux/hdsmart.h
Al Viro (1):
fix execve()
Bartlomiej Zolnierkiewicz (35):
ide: cleanup ide_match_hwif()
ide: cleanup ide_find_port()
swarm: use ide_find_port()
ide-pmac: dynamically allocate struct pmac_ide_hwif instances (take 2)
ide-pmac: use ide_find_port()
sgiioc4: use ide_find_port()
scc_pata: use ide_find_port()
au1xxx-ide: use ide_find_port()
cmd640: remove cmd_drives[]
cmd640: use ide_find_port()
scc_pata: store 'hwif' pointer in struct scc_ports
umc8672: don't use ide_hwifs[] in umc_set_pio_mode()
ht6560b: use driver name for resource allocation
qd65xx: return error value in qd_probe()
ide: IDE_HFLAG_BOOTABLE -> IDE_HFLAG_NON_BOOTABLE
ide: remove PIO "downgrade" quirk
ide: merge ide_match_hwif() and ide_find_port()
ide: use ide_find_port() in legacy VLB host drivers (take 2)
ide-generic: use ide_find_port() (take 3)
ide: unexport ide_hwifs[]
ide-disk: add proc_idedisk_read_smart() helper
ide-disk: fix issues found by checkpatch.pl
ide_platform: fix resources handling
delkin_cb: fix resources handling
bast-ide: fix resources reservation
ide-mpc8xx: make m8xx_ide_init_ports() return an error value
ide-mpc8xx: fix resources reservation
falconide: fix resources reservation (take 2)
ide: remove IDE_HFLAG_CY82C693 host flag
ide: remove hwif->straight8 flag
qd65xx: always use ->selectproc method
qd65xx: use IDE_HFLAG_SINGLE host flag
it821x: fix kzalloc() failure handling
sis5513: fail early for unsupported chipsets
ide: sanitize handling of IDE_HFLAG_NO_SET_MODE host flag
Borislav Petkov (2):
ide-cd: remove the internal 64k buffer
ide-cd: put proc-related functions together under single ifdef
Frederik Deweerdt (1):
ide/Kconfig: BLK_DEV_4DRIVES should be a tristate
Julia Lawall (1):
ide: use DIV_ROUND_UP
Paolo Ciarrocchi (19):
IDE: Coding Style fixes to drivers/ide/setup-pci.c
IDE: Coding Style fixes to drivers/ide/pci/tc86c001.c
IDE: Coding Style fixes to drivers/ide/pci/slc90e66.c
IDE: Coding Style fixes to drivers/ide/pci/sis5513.c
IDE: Coding Style fixes to drivers/ide/pci/jmicron.c
IDE: Coding Style fixes to drivers/ide/pci/generic.c
IDE: Coding Style fixes to drivers/ide/legacy/umc8672.c
IDE: Coding Style fixes to drivers/ide/legacy/ide-4drives.c
IDE: Coding Style fixes to drivers/ide/ide-proc.c
IDE: Coding Style fixes to drivers/ide/ide-pnp.c
IDE: Coding Style fixes to drivers/ide/pci/opti621.c
IDE: Coding Style fixes to drivers/ide/pci/cmd640.c
IDE: Coding Style fixes to drivers/ide/legacy/hd.c
IDE: Coding Style fixes to drivers/ide/legacy/ali14xx.c
IDE: Coding Style fixes to drivers/ide/ide-floppy.c
IDE: Coding Style fixes to drivers/ide/pci/it8213.c
IDE: Coding Style fixes to drivers/ide/pci/cy82c693.c
IDE: Coding Style fixes to drivers/ide/ide-cd.c
ide-cd: Replace __FUNCTION__ with __func__
Sergei Shtylyov (1):
ide: make ide_pci_check_iomem() actually work
drivers/ide/Kconfig +1 -1
@@ -1031,7 +1031,7 @@ comment "Other IDE chipsets support" comment "Note: most of these also require special kernel boot parameters" config BLK_DEV_4DRIVES - bool "Generic 4 drives/port support" + tristate "Generic 4 drives/port support" help Certain older chipsets, including the Tekram 690CD, use a single set of I/O ports at 0x1f0 to control up to four drives, instead of the
drivers/ide/arm/bast-ide.c +11 -1
@@ -21,6 +21,8 @@#include <asm/arch/bast-map.h> #include <asm/arch/bast-irq.h> +#define DRV_NAME "bast-ide" +static int __init bastide_register (unsigned int base,unsigned int aux,int irq) {ide_hwif_t *hwif;
@@ -41,7 +43,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq) hw.io_ports[IDE_CONTROL_OFFSET ] = aux + (6 *0x20 ); hw.irq = irq; - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif ==NULL ) goto out;
@@ -53,6 +55,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq)ide_init_port_data (hwif, i);ide_init_port_hw (hwif, &hw); + hwif->mmio =1 ; hwif->quirkproc =NULL ; idx[0 ] = i;
@@ -64,6 +67,8 @@ out:static int __init bastide_init (void ) { +unsigned long base =BAST_VA_IDEPRI +BAST_IDE_CS ; +/* we can treat the VR1000 and the BAST the same */ if (!(machine_is_bast () ||machine_is_vr1000 ()))
@@ -71,6 +76,11 @@ static int __init bastide_init(void)printk ("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n" ); +if (!request_mem_region (base,0x400000 ,DRV_NAME )) { +printk (KERN_ERR "%s: resources busy\n" ,DRV_NAME ); +return -EBUSY ; + } +bastide_register (BAST_VA_IDEPRI ,BAST_VA_IDEPRIAUX ,IRQ_IDE0 );bastide_register (BAST_VA_IDESEC ,BAST_VA_IDESECAUX ,IRQ_IDE1 );
drivers/ide/arm/icside.c +1 -1
@@ -400,7 +400,7 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *eunsigned long port = (unsigned long )base + info->dataoffset;ide_hwif_t *hwif; - hwif =ide_find_port (port); + hwif =ide_find_port ();if (hwif) {int i;
drivers/ide/arm/ide_arm.c +1 -1
@@ -34,7 +34,7 @@ static int __init ide_arm_init(void)ide_std_init_ports (&hw,IDE_ARM_IO ,IDE_ARM_IO +0x206 ); hw.irq =IDE_ARM_IRQ ; - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif) {ide_init_port_hw (hwif, &hw); idx[0 ] = hwif->index;
drivers/ide/arm/palm_bk3710.c +13 -13
@@ -96,11 +96,11 @@ static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev,u16 val16;/* DMA Data Setup */ - t0 = (palm_bk3710_udmatimings[mode].cycletime + ide_palm_clk -1 ) - / ide_palm_clk -1 ; - tenv = (20 + ide_palm_clk -1 ) / ide_palm_clk -1 ; - trp = (palm_bk3710_udmatimings[mode].rptime + ide_palm_clk -1 ) - / ide_palm_clk -1 ; + t0 =DIV_ROUND_UP (palm_bk3710_udmatimings[mode].cycletime, + ide_palm_clk) -1 ; + tenv =DIV_ROUND_UP (20 , ide_palm_clk) -1 ; + trp =DIV_ROUND_UP (palm_bk3710_udmatimings[mode].rptime, + ide_palm_clk) -1 ;/* udmatim Register */ val16 =readw (base +BK3710_UDMATIM ) & (dev ?0xFF0F :0xFFF0 );
@@ -141,8 +141,8 @@ static void palm_bk3710_setdmamode(void __iomem *base, unsigned int dev, cycletime =max_t (int, t->cycle, min_cycle);/* DMA Data Setup */ - t0 = (cycletime + ide_palm_clk -1 ) / ide_palm_clk; - td = (t->active + ide_palm_clk -1 ) / ide_palm_clk; + t0 =DIV_ROUND_UP (cycletime, ide_palm_clk); + td =DIV_ROUND_UP (t->active, ide_palm_clk); tkw = t0 - td -1 ; td -=1 ;
@@ -168,9 +168,9 @@ static void palm_bk3710_setpiomode(void __iomem *base, ide_drive_t *mate,struct ide_timing *t;/* PIO Data Setup */ - t0 = (cycletime + ide_palm_clk -1 ) / ide_palm_clk; - t2 = (ide_timing_find_mode (XFER_PIO_0 + mode)->active + - ide_palm_clk -1 ) / ide_palm_clk; + t0 =DIV_ROUND_UP (cycletime, ide_palm_clk); + t2 =DIV_ROUND_UP (ide_timing_find_mode (XFER_PIO_0 + mode)->active, + ide_palm_clk); t2i = t0 - t2 -1 ; t2 -=1 ;
@@ -192,8 +192,8 @@ static void palm_bk3710_setpiomode(void __iomem *base, ide_drive_t *mate,/* TASKFILE Setup */ t =ide_timing_find_mode (XFER_PIO_0 + mode); - t0 = (t->cyc8b + ide_palm_clk -1 ) / ide_palm_clk; - t2 = (t->act8b + ide_palm_clk -1 ) / ide_palm_clk; + t0 =DIV_ROUND_UP (t->cyc8b, ide_palm_clk); + t2 =DIV_ROUND_UP (t->act8b, ide_palm_clk); t2i = t0 - t2 -1 ; t2 -=1 ;
@@ -378,7 +378,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) hw.irq = irq->start; hw.chipset = ide_palm3710; - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif ==NULL ) goto out;
drivers/ide/arm/rapide.c +1 -1
@@ -44,7 +44,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) goto release; } - hwif =ide_find_port ((unsigned long )base); + hwif =ide_find_port ();if (hwif) {memset (&hw,0 ,sizeof (hw));rapide_setup_ports (&hw, base, base +0x818 ,1 <<6 , ec->irq);
drivers/ide/cris/ide-cris.c +1 -1
@@ -804,7 +804,7 @@ static int __init init_e100_ide(void)cris_setup_ports (&hw,cris_ide_base_address (h)); - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif ==NULL )continue ;ide_init_port_data (hwif, hwif->index);
drivers/ide/h8300/ide-h8300.c +1 -2
@@ -99,8 +99,7 @@ static int __init h8300_ide_init(void)hw_setup (&hw); -/* register if */ - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif ==NULL ) {printk (KERN_ERR "ide-h8300: IDE I/F register failed\n" );return -ENOENT ;
drivers/ide/ide-cd.c +152 -260
783 lines not on this page · raw message
drivers/ide/ide-cd.h +0 -4
@@ -119,10 +119,6 @@ struct cdrom_info {struct atapi_toc *toc; -unsigned long sector_buffered; -unsigned long nsectors_buffered; -unsigned char *buffer; -/* The result of the last successful request sense command on this device. */ struct request_sense sense_data;
drivers/ide/ide-disk.c +87 -72
321 lines not on this page · raw message
drivers/ide/ide-dma.c +2 -11
@@ -703,17 +703,8 @@ static int ide_tune_dma(ide_drive_t *drive) speed =ide_max_dma_mode (drive); -if (!speed) { -/* is this really correct/needed? */ -if ((hwif->host_flags &IDE_HFLAG_CY82C693 ) && -ide_dma_good_drive (drive)) -return 1 ; -else -return 0 ; - } - -if (hwif->host_flags &IDE_HFLAG_NO_SET_MODE ) -return 1 ; +if (!speed) +return 0 ;if (ide_set_dma_mode (drive, speed))return 0 ;
drivers/ide/ide-floppy.c +8 -8
@@ -396,7 +396,7 @@ static void idefloppy_retry_pc(ide_drive_t *drive) }/* The usual interrupt handler called during a packet command. */ -static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive) +static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive) {idefloppy_floppy_t *floppy = drive->driver_data;ide_hwif_t *hwif = drive->hwif;
@@ -1596,13 +1596,13 @@ static int idefloppy_revalidate_disk(struct gendisk *disk) }static struct block_device_operations idefloppy_ops = { - .owner =THIS_MODULE , - .open = idefloppy_open, - .release = idefloppy_release, - .ioctl = idefloppy_ioctl, - .getgeo = idefloppy_getgeo, - .media_changed = idefloppy_media_changed, - .revalidate_disk= idefloppy_revalidate_disk + .owner =THIS_MODULE , + .open = idefloppy_open, + .release = idefloppy_release, + .ioctl = idefloppy_ioctl, + .getgeo = idefloppy_getgeo, + .media_changed = idefloppy_media_changed, + .revalidate_disk = idefloppy_revalidate_disk };static int ide_floppy_probe (ide_drive_t *drive)
drivers/ide/ide-generic.c +13 -3
@@ -33,7 +33,7 @@ static ssize_t store_add(struct class *cls, const char *buf, size_t n)if (sscanf (buf,"%x:%x:%d" , &base, &ctl, &irq) !=3 )return -EINVAL ; - hwif =ide_find_port (base); + hwif =ide_find_port ();if (hwif ==NULL )return -ENOENT ;
@@ -90,11 +90,21 @@ static int __init ide_generic_init(void)int i;for (i =0 ; i <MAX_HWIFS ; i++) { -ide_hwif_t *hwif = &ide_hwifs[i]; +ide_hwif_t *hwif;unsigned long io_addr =ide_default_io_base (i);hw_regs_t hw; -if (hwif->chipset == ide_unknown && io_addr) { +if (io_addr) { +/* +* Skip probing if the corresponding +* slot is already occupied. +*/ + hwif =ide_find_port (); +if (hwif ==NULL || hwif->index != i) { + idx[i] =0xff ; +continue ; + } +memset (&hw,0 ,sizeof (hw));ide_std_init_ports (&hw, io_addr, io_addr +0x206 ); hw.irq =ide_default_irq (io_addr);
drivers/ide/ide-io.c +0 -4
@@ -726,10 +726,6 @@ static ide_startstop_t do_special (ide_drive_t *drive) s->b.set_tune =0 ;if (set_pio_mode_abuse (drive->hwif, req_pio)) { - -if (hwif->set_pio_mode ==NULL ) -return ide_stopped; -/* * take ide_lock for drive->[no_]unmask/[no_]io_32bit */
drivers/ide/ide-lib.c +10 -12
@@ -274,16 +274,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode)if (overridden)printk (KERN_INFO "%s: tPIO > 2, assuming tPIO = 2\n" , drive->name); - -/* -* Conservative "downgrade" for all pre-ATA2 drives -*/ -if ((drive->hwif->host_flags &IDE_HFLAG_PIO_NO_DOWNGRADE ) ==0 && - pio_mode && pio_mode <4 ) { - pio_mode--; -printk (KERN_INFO "%s: applying conservative " -"PIO \"downgrade\"\n" , drive->name); - } }if (pio_mode > max_mode)
@@ -300,7 +290,8 @@ void ide_set_pio(ide_drive_t *drive, u8 req_pio)ide_hwif_t *hwif = drive->hwif;u8 host_pio, pio; -if (hwif->set_pio_mode ==NULL ) +if (hwif->set_pio_mode ==NULL || + (hwif->host_flags &IDE_HFLAG_NO_SET_MODE ))return ;BUG_ON (hwif->pio_mask ==0x00 );
@@ -353,6 +344,9 @@ int ide_set_pio_mode(ide_drive_t *drive, const u8 mode) {ide_hwif_t *hwif = drive->hwif; +if (hwif->host_flags &IDE_HFLAG_NO_SET_MODE ) +return 0 ; +if (hwif->set_pio_mode ==NULL )return -1 ;
@@ -380,6 +374,9 @@ int ide_set_dma_mode(ide_drive_t *drive, const u8 mode) {ide_hwif_t *hwif = drive->hwif; +if (hwif->host_flags &IDE_HFLAG_NO_SET_MODE ) +return 0 ; +if (hwif->set_dma_mode ==NULL )return -1 ;
@@ -410,7 +407,8 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) {ide_hwif_t *hwif = drive->hwif; -if (hwif->set_dma_mode ==NULL ) +if (hwif->set_dma_mode ==NULL || + (hwif->host_flags &IDE_HFLAG_NO_SET_MODE ))return -1 ; rate =ide_rate_filter (drive, rate);
drivers/ide/ide-pnp.c +6 -6
@@ -11,7 +11,7 @@* * You should have received a copy of the GNU General Public License * (for example /usr/src/linux/COPYING); if not, write to the Free -* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/init.h>
@@ -20,12 +20,12 @@/* Add your devices here :)) */ static struct pnp_device_id idepnp_devices[] = { -/* Generic ESDI/IDE/ATA compatible hard disk controller */ +/* Generic ESDI/IDE/ATA compatible hard disk controller */ {.id ="PNP0600" , .driver_data =0 }, {.id ="" } }; -static int idepnp_probe (struct pnp_dev * dev,const struct pnp_device_id *dev_id) +static int idepnp_probe (struct pnp_dev *dev,const struct pnp_device_id *dev_id) {hw_regs_t hw;ide_hwif_t *hwif;
@@ -38,7 +38,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id pnp_port_start(dev, 1)); hw.irq =pnp_irq (dev,0 ); - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif) {u8 index = hwif->index;u8 idx[4 ] = { index,0xff ,0xff ,0xff };
@@ -47,7 +47,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_idide_init_port_hw (hwif, &hw);printk (KERN_INFO "ide%d: generic PnP IDE interface\n" , index); -pnp_set_drvdata (dev,hwif); +pnp_set_drvdata (dev, hwif);ide_device_add (idx,NULL );
@@ -57,7 +57,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_idreturn -1 ; } -static void idepnp_remove (struct pnp_dev * dev) +static void idepnp_remove (struct pnp_dev *dev) {ide_hwif_t *hwif =pnp_get_drvdata (dev);
drivers/ide/ide-probe.c +48 -0
54 lines not on this page · raw message
drivers/ide/ide-proc.c +75 -80
295 lines not on this page · raw message
drivers/ide/ide.c +14 -55
116 lines not on this page · raw message
drivers/ide/legacy/ali14xx.c +20 -10
@@ -86,7 +86,7 @@ static u8 regOff; /* output to base port to close registers *//* * Read a controller register. */ -static inline u8 inReg (u8 reg) +static inline u8 inReg (u8 reg) {outb_p (reg, regPort);return inb (dataPort);
@@ -95,7 +95,7 @@ static inline u8 inReg (u8 reg)/* * Write a controller register. */ -static void outReg (u8 data,u8 reg) +static void outReg (u8 data,u8 reg) {outb_p (reg, regPort);outb_p (data, dataPort);
@@ -143,7 +143,7 @@ static void ali14xx_set_pio_mode(ide_drive_t *drive, const u8 pio)/* * Auto-detect the IDE controller port. */ -static int __init findPort (void ) +static int __init findPort (void ) {int i;u8 t;
@@ -175,7 +175,8 @@ static int __init findPort (void)/* * Initialize controller registers with default values. */ -static int __init initRegisters (void ) { +static int __init initRegisters (void ) +{const RegInitializer *p;u8 t;unsigned long flags;
@@ -199,7 +200,8 @@ static const struct ide_port_info ali14xx_port_info = {static int __init ali14xx_probe (void ) { -static u8 idx[4 ] = {0 ,1 ,0xff ,0xff }; +ide_hwif_t *hwif, *mate; +static u8 idx[4 ] = {0xff ,0xff ,0xff ,0xff };hw_regs_t hw[2 ]; printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n",
@@ -219,18 +221,26 @@ static int __init ali14xx_probe(void)ide_std_init_ports (&hw[1 ],0x170 ,0x376 ); hw[1 ].irq =15 ; -ide_init_port_hw (&ide_hwifs[0 ], &hw[0 ]); -ide_init_port_hw (&ide_hwifs[1 ], &hw[1 ]); + hwif =ide_find_port (); +if (hwif) { +ide_init_port_hw (hwif, &hw[0 ]); + hwif->set_pio_mode = &ali14xx_set_pio_mode; + idx[0 ] = hwif->index; + } - ide_hwifs[0 ].set_pio_mode = &ali14xx_set_pio_mode; - ide_hwifs[1 ].set_pio_mode = &ali14xx_set_pio_mode; + mate =ide_find_port (); +if (mate) { +ide_init_port_hw (mate, &hw[1 ]); + mate->set_pio_mode = &ali14xx_set_pio_mode; + idx[1 ] = mate->index; + }ide_device_add (idx, &ali14xx_port_info);return 0 ; } -int probe_ali14xx =0 ; +int probe_ali14xx;module_param_named (probe, probe_ali14xx, bool,0 );MODULE_PARM_DESC (probe,"probe for ALI M14xx chipsets" );
drivers/ide/legacy/buddha.c +1 -1
@@ -221,7 +221,7 @@ fail_base2:buddha_setup_ports (&hw, base, ctl, irq_port, ack_intr); - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif) {u8 index = hwif->index;
drivers/ide/legacy/dtc2278.c +12 -10
@@ -102,15 +102,9 @@ static int __init dtc2278_probe(void) {unsigned long flags;ide_hwif_t *hwif, *mate; -static u8 idx[4 ] = {0 ,1 ,0xff ,0xff }; +static u8 idx[4 ] = {0xff ,0xff ,0xff ,0xff };hw_regs_t hw[2 ]; - hwif = &ide_hwifs[0 ]; - mate = &ide_hwifs[1 ]; - -if (hwif->chipset != ide_unknown || mate->chipset != ide_unknown) -return 1 ; -local_irq_save (flags);/* * This enables the second interface
@@ -137,10 +131,18 @@ static int __init dtc2278_probe(void)ide_std_init_ports (&hw[1 ],0x170 ,0x376 ); hw[1 ].irq =15 ; -ide_init_port_hw (hwif, &hw[0 ]); -ide_init_port_hw (mate, &hw[1 ]); + hwif =ide_find_port (); +if (hwif) { +ide_init_port_hw (hwif, &hw[0 ]); + hwif->set_pio_mode = dtc2278_set_pio_mode; + idx[0 ] = hwif->index; + } - hwif->set_pio_mode = &dtc2278_set_pio_mode; + mate =ide_find_port (); +if (mate) { +ide_init_port_hw (mate, &hw[1 ]); + idx[1 ] = mate->index; + }ide_device_add (idx, &dtc2278_port_info);
drivers/ide/legacy/falconide.c +8 -1
@@ -22,6 +22,7 @@#include <asm/atariints.h> #include <asm/atari_stdma.h> +#define DRV_NAME "falconide"/* * Base of the IDE interface
@@ -74,15 +75,21 @@ static int __init falconide_init(void)printk (KERN_INFO "ide: Falcon IDE controller\n" ); +if (!request_mem_region (ATA_HD_BASE ,0x40 ,DRV_NAME )) { +printk (KERN_ERR "%s: resources busy\n" ,DRV_NAME ); +return -EBUSY ; + } +falconide_setup_ports (&hw); - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif) {u8 index = hwif->index;u8 idx[4 ] = { index,0xff ,0xff ,0xff };ide_init_port_data (hwif, index);ide_init_port_hw (hwif, &hw); + hwif->mmio =1 ;ide_get_lock (NULL ,NULL );ide_device_add (idx,NULL );
drivers/ide/legacy/gayle.c +1 -1
@@ -175,7 +175,7 @@ found:gayle_setup_ports (&hw, base, ctrlport, irqport, ack_intr); - hwif =ide_find_port (base); + hwif =ide_find_port ();if (hwif) {u8 index = hwif->index;
drivers/ide/legacy/hd.c +40 -38
222 lines not on this page · raw message
drivers/ide/legacy/ht6560b.c +19 -15
@@ -35,6 +35,7 @@* Try: http://www.maf.iki.fi/~maf/ht6560b/ */ +#define DRV_NAME "ht6560b"#define HT6560B_VERSION "v0.08"#include <linux/module.h>
@@ -339,16 +340,13 @@ static const struct ide_port_info ht6560b_port_info __initdata = {static int __init ht6560b_init (void ) {ide_hwif_t *hwif, *mate; -static u8 idx[4 ] = {0 ,1 ,0xff ,0xff }; +static u8 idx[4 ] = {0xff ,0xff ,0xff ,0xff };hw_regs_t hw[2 ];if (probe_ht6560b ==0 )return -ENODEV ; - hwif = &ide_hwifs[0 ]; - mate = &ide_hwifs[1 ]; - -if (!request_region (HT_CONFIG_PORT ,1 , hwif->name)) { +if (!request_region (HT_CONFIG_PORT ,1 ,DRV_NAME )) {printk (KERN_NOTICE "%s: HT_CONFIG_PORT not found\n" , __FUNCTION__);return -ENODEV ;
@@ -367,17 +365,23 @@ static int __init ht6560b_init(void)ide_std_init_ports (&hw[1 ],0x170 ,0x376 ); hw[1 ].irq =15 ; -ide_init_port_hw (hwif, &hw[0 ]); -ide_init_port_hw (mate, &hw[1 ]); - - hwif->selectproc = &ht6560b_selectproc; - hwif->set_pio_mode = &ht6560b_set_pio_mode; - - mate->selectproc = &ht6560b_selectproc; - mate->set_pio_mode = &ht6560b_set_pio_mode; + hwif =ide_find_port (); +if (hwif) { +ide_init_port_hw (hwif, &hw[0 ]); + hwif->selectproc = ht6560b_selectproc; + hwif->set_pio_mode = ht6560b_set_pio_mode; + hwif->port_init_devs = ht6560b_port_init_devs; + idx[0 ] = hwif->index; + } - hwif->port_init_devs = ht6560b_port_init_devs; - mate->port_init_devs = ht6560b_port_init_devs; + mate =ide_find_port (); +if (mate) { +ide_init_port_hw (mate, &hw[1 ]); + mate->selectproc = ht6560b_selectproc; + mate->set_pio_mode = ht6560b_set_pio_mode; + mate->port_init_devs = ht6560b_port_init_devs; + idx[1 ] = mate->index; + }ide_device_add (idx, &ht6560b_port_info);
drivers/ide/legacy/ide-4drives.c +21 -15
@@ -4,7 +4,7 @@#include <linux/module.h> #include <linux/ide.h> -int probe_4drives =0 ; +int probe_4drives;module_param_named (probe, probe_4drives, bool,0 );MODULE_PARM_DESC (probe,"probe for generic IDE chipset with 4 drives/port" );
@@ -12,31 +12,37 @@ MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port");static int __init ide_4drives_init (void ) {ide_hwif_t *hwif, *mate; -u8 idx[4 ] = {0 ,1 ,0xff ,0xff }; +u8 idx[4 ] = {0xff ,0xff ,0xff ,0xff };hw_regs_t hw;if (probe_4drives ==0 )return -ENODEV ; - hwif = &ide_hwifs[0 ]; - mate = &ide_hwifs[1 ]; -memset (&hw,0 ,sizeof (hw));ide_std_init_ports (&hw,0x1f0 ,0x3f6 ); hw.irq =14 ; hw.chipset = ide_4drives; -ide_init_port_hw (hwif, &hw); -ide_init_port_hw (mate, &hw); - - mate->drives[0 ].select.all ^=0x20 ; - mate->drives[1 ].select.all ^=0x20 ; - - hwif->mate = mate; - mate->mate = hwif; - - hwif->serialized = mate->serialized =1 ; + hwif =ide_find_port (); +if (hwif) { +ide_init_port_hw (hwif, &hw); + idx[0 ] = hwif->index; + } + + mate =ide_find_port (); +if (mate) { +ide_init_port_hw (mate, &hw); + mate->drives[0 ].select.all ^=0x20 ; + mate->drives[1 ].select.all ^=0x20 ; + idx[1 ] = mate->index; + +if (hwif) { + hwif->mate = mate; + mate->mate = hwif; + hwif->serialized = mate->serialized =1 ; + } + }ide_device_add (idx,NULL );
drivers/ide/legacy/ide-cs.c +1 -1
@@ -156,7 +156,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq hw.chipset = ide_pci; hw.dev = &handle->dev; - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif ==NULL )return -1 ;
drivers/ide/legacy/ide_platform.c +3 -4
@@ -89,7 +89,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev) res_alt->start, res_alt->end - res_alt->start + 1); } - hwif =ide_find_port ((unsigned long )base); + hwif =ide_find_port ();if (!hwif) { ret = -ENODEV ; goto out;
@@ -100,11 +100,10 @@ static int __devinit plat_ide_probe(struct platform_device *pdev) hw.dev = &pdev->dev;ide_init_port_hw (hwif, &hw); + hwif->mmio =1 ; -if (mmio) { - hwif->mmio =1 ; +if (mmio)default_hwif_mmiops (hwif); - } idx[0 ] = hwif->index;
drivers/ide/legacy/macide.c +1 -1
@@ -120,7 +120,7 @@ static int __init macide_init(void)macide_setup_ports (&hw, base, irq, ack_intr); - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif) {u8 index = hwif->index;u8 idx[4 ] = { index,0xff ,0xff ,0xff };
drivers/ide/legacy/q40ide.c +1 -1
@@ -137,7 +137,7 @@ static int __init q40ide_init(void)// m68kide_iops, q40ide_default_irq(pcide_bases[i])); - hwif =ide_find_port (hw.io_ports[IDE_DATA_OFFSET ]); + hwif =ide_find_port ();if (hwif) {ide_init_port_data (hwif, hwif->index);ide_init_port_hw (hwif, &hw);
drivers/ide/legacy/qd65xx.c +78 -87
285 lines not on this page · raw message
drivers/ide/legacy/qd65xx.h +0 -1
@@ -30,7 +30,6 @@#define QD_ID3 ((config & QD_CONFIG_ID3)!=0)#define QD_CONFIG (hwif) ((hwif)->config_data & 0x00ff) -#define QD_CONTROL (hwif) (((hwif)->config_data & 0xff00) >> 8)#define QD_TIMING (drive) (byte)(((drive)->drive_data) & 0x00ff)#define QD_TIMREG (drive) (byte)((((drive)->drive_data) & 0xff00) >> 8)
drivers/ide/legacy/umc8672.c +45 -36
163 lines not on this page · raw message
drivers/ide/mips/au1xxx-ide.c +5 -3
@@ -599,9 +599,11 @@ static int au_ide_probe(struct device *dev) goto out; } -/* FIXME: This might possibly break PCMCIA IDE devices */ - - hwif = &ide_hwifs[pdev->id]; + hwif =ide_find_port (); +if (hwif ==NULL ) { + ret = -ENOENT ; + goto out; + }memset (&hw,0 ,sizeof (hw));auide_setup_ports (&hw, ahwif);
drivers/ide/mips/swarm.c +2 -7
@@ -76,17 +76,12 @@ static int __devinit swarm_ide_probe(struct device *dev)if (!SIBYTE_HAVE_IDE )return -ENODEV ; -/* Find an empty slot. */ -for (i =0 ; i <MAX_HWIFS ; i++) -if (!ide_hwifs[i].io_ports[IDE_DATA_OFFSET ]) -break ; -if (i >=MAX_HWIFS ) { + hwif =ide_find_port (); +if (hwif ==NULL ) { printk(KERN_ERR DRV_NAME ": no free slot for interface\n");return -ENOMEM ; } - hwif = ide_hwifs + i; - base =ioremap (A_IO_EXT_BASE ,0x800 ); offset =__raw_readq (base +R_IO_EXT_REG (R_IO_EXT_START_ADDR ,IDE_CS )); size =__raw_readq (base +R_IO_EXT_REG (R_IO_EXT_MULT_SIZE ,IDE_CS ));
drivers/ide/pci/aec62xx.c +2 -1
@@ -220,7 +220,8 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = { .init_hwif = init_hwif_aec62xx, .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, .host_flags = IDE_HFLAG_NO_ATAPI_DMA | - IDE_HFLAG_ABUSE_SET_DMA_MODE, +IDE_HFLAG_ABUSE_SET_DMA_MODE | + IDE_HFLAG_NON_BOOTABLE, .pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, .udma_mask = ATA_UDMA4,
drivers/ide/pci/alim15x3.c +0 -1
@@ -750,7 +750,6 @@ static const struct ide_port_info ali15x3_chipset __devinitdata = { .init_chipset = init_chipset_ali15x3, .init_hwif = init_hwif_ali15x3, .init_dma = init_dma_ali15x3, - .host_flags = IDE_HFLAG_BOOTABLE, .pio_mask = ATA_PIO5, .swdma_mask = ATA_SWDMA2, .mwdma_mask = ATA_MWDMA2,
drivers/ide/pci/amd74xx.c +1 -3
@@ -219,12 +219,10 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)#define IDE_HFLAGS_AMD \ (IDE_HFLAG_PIO_NO_BLACKLIST | \ - IDE_HFLAG_PIO_NO_DOWNGRADE | \ IDE_HFLAG_ABUSE_SET_DMA_MODE | \ IDE_HFLAG_POST_SET_MODE | \ IDE_HFLAG_IO_32BIT | \ - IDE_HFLAG_UNMASK_IRQS | \ - IDE_HFLAG_BOOTABLE) + IDE_HFLAG_UNMASK_IRQS)#define DECLARE_AMD_DEV (name_str, swdma, udma) \ { \
drivers/ide/pci/atiixp.c +2 -3
@@ -151,7 +151,7 @@ static const struct ide_port_info atiixp_pci_info[] __devinitdata = { .name = "ATIIXP", .init_hwif = init_hwif_atiixp, .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, - .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_BOOTABLE, + .host_flags = IDE_HFLAG_LEGACY_IRQS, .pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, .udma_mask = ATA_UDMA5,
@@ -159,8 +159,7 @@ static const struct ide_port_info atiixp_pci_info[] __devinitdata = { .name = "SB600_PATA", .init_hwif = init_hwif_atiixp, .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}}, - .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_LEGACY_IRQS | - IDE_HFLAG_BOOTABLE, + .host_flags = IDE_HFLAG_SINGLE | IDE_HFLAG_LEGACY_IRQS, .pio_mask = ATA_PIO4, .mwdma_mask = ATA_MWDMA2, .udma_mask = ATA_UDMA5,
drivers/ide/pci/cmd640.c +93 -95
15 lines not on this page · raw message
drivers/ide/pci/cy82c693.c +38 -39
77 lines not on this page · raw message
drivers/ide/pci/opti621.c +32 -29
61 lines not on this page · raw message
drivers/ide/pci/sis5513.c +111 -114
225 lines not on this page · raw message
drivers/ide/ppc/mpc8xx.c +42 -16
58 lines not on this page · raw message
drivers/ide/ppc/pmac.c +50 -40
90 lines not on this page · raw message
drivers/ide/setup-pci.c +31 -98
129 lines not on this page · raw message
include/linux/hdsmart.h deleted +0 -126
126 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.