From b2ae75052a8c1611b2030fa49ba1c6b6439fa04f Mon Sep 17 00:00:00 2001 From: "lramos.prof@yahoo.com.br" Date: Tue, 11 Oct 2016 22:12:45 -0300 Subject: ide: Fix interface autodetection in legacy IDE driver (trial #2) This humble patch was sent one or two months before, and had no actions, except for a colleague reply which friendly pointed out some formatting problems (which were solved in a second message). It relates to an old code, the legacy IDE driver, but the bug it addresses is real. The code, although rarely used, is still there to be compiled if one chooses to do so (like me). Also, the fix has a very low risk of present collateral effects IMHO. It is already compiled and tested in some embedded machines. So, again IMHO, it is worth be fixed. This email is a second trial with it. I hope it can help the one or two guys out there which are still running the legacy IDE driver and haven't noticed the former email. Fixes: 20df429dd667 ("ide-generic: handle probing of legacy io-ports v5") Signed-off-by: Luiz Carlos Ramos Signed-off-by: David S. Miller --- drivers/ide/ide-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 54d7c4685d23..419818a39c27 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c @@ -96,10 +96,10 @@ static int __init ide_generic_init(void) printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" " "module parameter for probing all legacy ISA IDE ports\n"); - if (primary == 0) + if (primary) probe_mask |= 0x1; - if (secondary == 0) + if (secondary) probe_mask |= 0x2; } else printk(KERN_INFO DRV_NAME ": enforcing probing of I/O ports " -- cgit v1.2.3 From da095587e6be858efd41490762cb952dffd6107a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 9 Jan 2017 15:27:59 -0500 Subject: Revert "ide: Fix interface autodetection in legacy IDE driver (trial #2)" This reverts commit b2ae75052a8c1611b2030fa49ba1c6b6439fa04f. The inverse logic is intentional, and this change even breaks booting on some systems. Signed-off-by: David S. Miller --- drivers/ide/ide-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 419818a39c27..54d7c4685d23 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c @@ -96,10 +96,10 @@ static int __init ide_generic_init(void) printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" " "module parameter for probing all legacy ISA IDE ports\n"); - if (primary) + if (primary == 0) probe_mask |= 0x1; - if (secondary) + if (secondary == 0) probe_mask |= 0x2; } else printk(KERN_INFO DRV_NAME ": enforcing probing of I/O ports " -- cgit v1.2.3 From 96297aee8bce237961b0e1b99e22913c5726af12 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Fri, 30 Dec 2016 14:50:02 +0530 Subject: ide: palm_bk3710: add __initdata to palm_bk3710_port_info The object palm_bk3710_port_info of type ide_port_info is never referenced anywhere after initialization by palm_bk3710_probe. It is also passed as a parameter to ide_host_add which is called from the init function but this call doesn't store the object reference anywhere, and it only dereferences the values of the fields. Therefore add __initdata to its declaration. Signed-off-by: Bhumika Goyal Signed-off-by: David S. Miller --- drivers/ide/palm_bk3710.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ide') diff --git a/drivers/ide/palm_bk3710.c b/drivers/ide/palm_bk3710.c index 46427ea01753..157f2d1fb7e1 100644 --- a/drivers/ide/palm_bk3710.c +++ b/drivers/ide/palm_bk3710.c @@ -300,7 +300,7 @@ static const struct ide_port_ops palm_bk3710_ports_ops = { .cable_detect = palm_bk3710_cable_detect, }; -static struct ide_port_info palm_bk3710_port_info = { +static struct ide_port_info palm_bk3710_port_info __initdata = { .init_dma = palm_bk3710_init_dma, .port_ops = &palm_bk3710_ports_ops, .dma_ops = &sff_dma_ops, -- cgit v1.2.3