Skip to content

Commit

Permalink
ide: fix host drivers missing hwif->chipset initialization
Browse files Browse the repository at this point in the history
ide_find_port() now depends on ->chipset being set for occupied ide_hwifs[]
slots so all host drivers have to initialize hwif->chipset properly.

This patch fixes a regression on hosts with > 1 port or with a single port
but no devices attached to it for an affected host drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jun 10, 2008
1 parent 343a345 commit d427e83
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/ide/arm/bast-ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq)

hw.io_ports.ctl_addr = aux + (6 * 0x20);
hw.irq = irq;
hw.chipset = ide_generic;

hwif = ide_find_port();
if (hwif == NULL)
Expand Down
1 change: 1 addition & 0 deletions drivers/ide/arm/ide_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static int __init ide_arm_init(void)
memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, base, ctl);
hw.irq = IDE_ARM_IRQ;
hw.chipset = ide_generic;

hwif = ide_find_port();
if (hwif) {
Expand Down
1 change: 1 addition & 0 deletions drivers/ide/ide-pnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, base, ctl);
hw.irq = pnp_irq(dev, 0);
hw.chipset = ide_generic;

hwif = ide_find_port();
if (hwif) {
Expand Down
1 change: 1 addition & 0 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,7 @@ static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no,

ide_std_init_ports(hw, base, ctl);
hw->irq = irq;
hw->chipset = d->chipset;

hwif = ide_find_port_slot(d);
if (hwif) {
Expand Down
2 changes: 2 additions & 0 deletions drivers/ide/legacy/buddha.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base,

hw->irq = IRQ_AMIGA_PORTS;
hw->ack_intr = ack_intr;

hw->chipset = ide_generic;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions drivers/ide/legacy/falconide.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ static void __init falconide_setup_ports(hw_regs_t *hw)

hw->irq = IRQ_MFP_IDE;
hw->ack_intr = NULL;

hw->chipset = ide_generic;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions drivers/ide/legacy/gayle.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,

hw->irq = IRQ_AMIGA_PORTS;
hw->ack_intr = ack_intr;

hw->chipset = ide_generic;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions drivers/ide/legacy/macide.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base,

hw->irq = irq;
hw->ack_intr = ack_intr;

hw->chipset = ide_generic;
}

static const char *mac_ide_name[] =
Expand Down
2 changes: 2 additions & 0 deletions drivers/ide/legacy/q40ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ static void q40_ide_setup_ports(hw_regs_t *hw, unsigned long base,

hw->irq = irq;
hw->ack_intr = ack_intr;

hw->chipset = ide_generic;
}

static void q40ide_input_data(ide_drive_t *drive, struct request *rq,
Expand Down
2 changes: 2 additions & 0 deletions drivers/ide/pci/cmd640.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,11 @@ static int __init cmd640x_init(void)

ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
hw[0].irq = 14;
hw[0].chipset = ide_cmd640;

ide_std_init_ports(&hw[1], 0x170, 0x376);
hw[1].irq = 15;
hw[1].chipset = ide_cmd640;

printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
"\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
Expand Down
4 changes: 4 additions & 0 deletions drivers/ide/ppc/mpc8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
pcmp->pcmc_per = 0x100000 >> (16 * _slot_);
#endif /* CONFIG_IDE_8xx_PCCARD */

hw->chipset = ide_generic;

return 0;
}
#endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */
Expand Down Expand Up @@ -377,6 +379,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |=
(0x80000000 >> ioport_dsc[data_port].irq);

hw->chipset = ide_generic;

return 0;
}
#endif /* CONFIG_IDE_8xx_DIRECT */
Expand Down

0 comments on commit d427e83

Please sign in to comment.