ide: fix host drivers missing hwif->chipset initialization

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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 343a3451
...@@ -42,6 +42,7 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq) ...@@ -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.io_ports.ctl_addr = aux + (6 * 0x20);
hw.irq = irq; hw.irq = irq;
hw.chipset = ide_generic;
hwif = ide_find_port(); hwif = ide_find_port();
if (hwif == NULL) if (hwif == NULL)
......
...@@ -49,6 +49,7 @@ static int __init ide_arm_init(void) ...@@ -49,6 +49,7 @@ static int __init ide_arm_init(void)
memset(&hw, 0, sizeof(hw)); memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, base, ctl); ide_std_init_ports(&hw, base, ctl);
hw.irq = IDE_ARM_IRQ; hw.irq = IDE_ARM_IRQ;
hw.chipset = ide_generic;
hwif = ide_find_port(); hwif = ide_find_port();
if (hwif) { if (hwif) {
......
...@@ -55,6 +55,7 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) ...@@ -55,6 +55,7 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
memset(&hw, 0, sizeof(hw)); memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, base, ctl); ide_std_init_ports(&hw, base, ctl);
hw.irq = pnp_irq(dev, 0); hw.irq = pnp_irq(dev, 0);
hw.chipset = ide_generic;
hwif = ide_find_port(); hwif = ide_find_port();
if (hwif) { if (hwif) {
......
...@@ -1664,6 +1664,7 @@ static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no, ...@@ -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); ide_std_init_ports(hw, base, ctl);
hw->irq = irq; hw->irq = irq;
hw->chipset = d->chipset;
hwif = ide_find_port_slot(d); hwif = ide_find_port_slot(d);
if (hwif) { if (hwif) {
......
...@@ -138,6 +138,8 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base, ...@@ -138,6 +138,8 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base,
hw->irq = IRQ_AMIGA_PORTS; hw->irq = IRQ_AMIGA_PORTS;
hw->ack_intr = ack_intr; hw->ack_intr = ack_intr;
hw->chipset = ide_generic;
} }
/* /*
......
...@@ -81,6 +81,8 @@ static void __init falconide_setup_ports(hw_regs_t *hw) ...@@ -81,6 +81,8 @@ static void __init falconide_setup_ports(hw_regs_t *hw)
hw->irq = IRQ_MFP_IDE; hw->irq = IRQ_MFP_IDE;
hw->ack_intr = NULL; hw->ack_intr = NULL;
hw->chipset = ide_generic;
} }
/* /*
......
...@@ -112,6 +112,8 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base, ...@@ -112,6 +112,8 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
hw->irq = IRQ_AMIGA_PORTS; hw->irq = IRQ_AMIGA_PORTS;
hw->ack_intr = ack_intr; hw->ack_intr = ack_intr;
hw->chipset = ide_generic;
} }
/* /*
......
...@@ -78,6 +78,8 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base, ...@@ -78,6 +78,8 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base,
hw->irq = irq; hw->irq = irq;
hw->ack_intr = ack_intr; hw->ack_intr = ack_intr;
hw->chipset = ide_generic;
} }
static const char *mac_ide_name[] = static const char *mac_ide_name[] =
......
...@@ -70,6 +70,8 @@ static void q40_ide_setup_ports(hw_regs_t *hw, unsigned long base, ...@@ -70,6 +70,8 @@ static void q40_ide_setup_ports(hw_regs_t *hw, unsigned long base,
hw->irq = irq; hw->irq = irq;
hw->ack_intr = ack_intr; hw->ack_intr = ack_intr;
hw->chipset = ide_generic;
} }
static void q40ide_input_data(ide_drive_t *drive, struct request *rq, static void q40ide_input_data(ide_drive_t *drive, struct request *rq,
......
...@@ -747,9 +747,11 @@ static int __init cmd640x_init(void) ...@@ -747,9 +747,11 @@ static int __init cmd640x_init(void)
ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
hw[0].irq = 14; hw[0].irq = 14;
hw[0].chipset = ide_cmd640;
ide_std_init_ports(&hw[1], 0x170, 0x376); ide_std_init_ports(&hw[1], 0x170, 0x376);
hw[1].irq = 15; hw[1].irq = 15;
hw[1].chipset = ide_cmd640;
printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x" printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
"\n", 'a' + cmd640_chip_version - 1, bus_type, cfr); "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
......
...@@ -303,6 +303,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) ...@@ -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_); pcmp->pcmc_per = 0x100000 >> (16 * _slot_);
#endif /* CONFIG_IDE_8xx_PCCARD */ #endif /* CONFIG_IDE_8xx_PCCARD */
hw->chipset = ide_generic;
return 0; return 0;
} }
#endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */ #endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */
...@@ -377,6 +379,8 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) ...@@ -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 |= ((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |=
(0x80000000 >> ioport_dsc[data_port].irq); (0x80000000 >> ioport_dsc[data_port].irq);
hw->chipset = ide_generic;
return 0; return 0;
} }
#endif /* CONFIG_IDE_8xx_DIRECT */ #endif /* CONFIG_IDE_8xx_DIRECT */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment