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 Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
@@ -687,9 +687,6 @@ static int cmd640x_init_one(unsigned long base, unsigned long ctl)
|
|||||||
*/
|
*/
|
||||||
static int __init cmd640x_init(void)
|
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;
|
int second_port_cmd640 = 0, rc;
|
||||||
const char *bus_type, *port2;
|
const char *bus_type, *port2;
|
||||||
unsigned int index;
|
unsigned int index;
|
||||||
@@ -778,46 +775,40 @@ static int __init cmd640x_init(void)
|
|||||||
put_cmd640_reg(CMDTIM, 0);
|
put_cmd640_reg(CMDTIM, 0);
|
||||||
put_cmd640_reg(BRST, 0x40);
|
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
|
* Try to enable the secondary interface, if not already enabled
|
||||||
*/
|
*/
|
||||||
if (cmd_hwif1 &&
|
if (secondary_port_responding()) {
|
||||||
cmd_hwif1->drives[0].noprobe && cmd_hwif1->drives[1].noprobe) {
|
if ((b & CNTRL_ENA_2ND)) {
|
||||||
port2 = "not probed";
|
second_port_cmd640 = 1;
|
||||||
|
port2 = "okay";
|
||||||
|
} else if (cmd640_vlb) {
|
||||||
|
second_port_cmd640 = 1;
|
||||||
|
port2 = "alive";
|
||||||
|
} else
|
||||||
|
port2 = "not cmd640";
|
||||||
} else {
|
} else {
|
||||||
b = get_cmd640_reg(CNTRL);
|
put_cmd640_reg(CNTRL, b ^ CNTRL_ENA_2ND); /* toggle the bit */
|
||||||
if (secondary_port_responding()) {
|
if (secondary_port_responding()) {
|
||||||
if ((b & CNTRL_ENA_2ND)) {
|
second_port_cmd640 = 1;
|
||||||
second_port_cmd640 = 1;
|
port2 = "enabled";
|
||||||
port2 = "okay";
|
|
||||||
} else if (cmd640_vlb) {
|
|
||||||
second_port_cmd640 = 1;
|
|
||||||
port2 = "alive";
|
|
||||||
} else
|
|
||||||
port2 = "not cmd640";
|
|
||||||
} else {
|
} else {
|
||||||
put_cmd640_reg(CNTRL, b ^ CNTRL_ENA_2ND); /* toggle the bit */
|
put_cmd640_reg(CNTRL, b); /* restore original setting */
|
||||||
if (secondary_port_responding()) {
|
port2 = "not 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";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize data for secondary cmd640 port, if enabled
|
* Initialize data for secondary cmd640 port, if enabled
|
||||||
*/
|
*/
|
||||||
if (second_port_cmd640 && cmd_hwif1) {
|
if (second_port_cmd640) {
|
||||||
ide_init_port_hw(cmd_hwif1, &hw[1]);
|
cmd_hwif1 = ide_find_port();
|
||||||
idx[1] = cmd_hwif1->index;
|
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",
|
printk(KERN_INFO "cmd640: %sserialized, secondary interface %s\n",
|
||||||
second_port_cmd640 ? "" : "not ", port2);
|
second_port_cmd640 ? "" : "not ", port2);
|
||||||
|
Reference in New Issue
Block a user