public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix interface autodetection in legacy IDE driver
       [not found] <1370547790.13391287.1470739631878.JavaMail.yahoo.ref@mail.yahoo.com>
@ 2016-08-09 10:47 ` lramos.prof
  2016-08-09 13:50   ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: lramos.prof @ 2016-08-09 10:47 UTC (permalink / raw)
  To: davem@davemloft.net, linux-ide@vger.kernel.org

This patch fixes the automatic setting of ide_generic.probe_mask,
when it is set to zero (like when default options are used) AND
the PCI subsystem has detected primary and/or secondary interfaces.

The effect is that those interfaces go undetected under those
conditions.

The former implementation misunderstands the information detected by
the PCI subsystem, and may only work if one use ide_generic.probe_mask
set to 0x3f (or 0x03, minimally), like the suggestion echoed to the
console.

Probably this has been stayed under the radar because everybody
migrated to libata. Anyway, IMHO it's worth to fix it, as the code isn't
entirely dead.

If I'm not wrong, this change applies to kernels from 2009 up to now.

Signed-off-by: Luiz Carlos Ramos <lramos.prof@yahoo.com.br>
---
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index 54d7c4685d23aa5e62ce606e7b994a57bb54b08a..419818a39c270d3ad219e8f7b5df56a9aea3d640 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 "
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix interface autodetection in legacy IDE driver
  2016-08-09 10:47 ` [PATCH] Fix interface autodetection in legacy IDE driver lramos.prof
@ 2016-08-09 13:50   ` Sergei Shtylyov
  2016-08-09 23:51     ` Luiz Carlos Ramos
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2016-08-09 13:50 UTC (permalink / raw)
  To: lramos.prof, davem@davemloft.net, linux-ide@vger.kernel.org

Hello.

On 08/09/2016 01:47 PM, lramos.prof@yahoo.com.br wrote:

> This patch fixes the automatic setting of ide_generic.probe_mask,
> when it is set to zero (like when default options are used) AND
> the PCI subsystem has detected primary and/or secondary interfaces.
>
> The effect is that those interfaces go undetected under those
> conditions.
>
> The former implementation misunderstands the information detected by
> the PCI subsystem, and may only work if one use ide_generic.probe_mask
> set to 0x3f (or 0x03, minimally), like the suggestion echoed to the
> console.
>
> Probably this has been stayed under the radar because everybody

    Has stayed, maybe?

> migrated to libata. Anyway, IMHO it's worth to fix it, as the code isn't
> entirely dead.
>
> If I'm not wrong, this change applies to kernels from 2009 up to now.
>
> Signed-off-by: Luiz Carlos Ramos <lramos.prof@yahoo.com.br>
> ---
> diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
> index 54d7c4685d23aa5e62ce606e7b994a57bb54b08a..419818a39c270d3ad219e8f7b5df56a9aea3d640 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;

    Your patch is line wrapped...

>
> -               if (secondary == 0)
> +               if (secondary)
> probe_mask |= 0x2;
> } else
> printk(KERN_INFO DRV_NAME ": enforcing probing of I/O ports "

    ... and whitespace damaged too. :-(

MBR, Sergei


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix interface autodetection in legacy IDE driver
  2016-08-09 13:50   ` Sergei Shtylyov
@ 2016-08-09 23:51     ` Luiz Carlos Ramos
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Carlos Ramos @ 2016-08-09 23:51 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: davem@davemloft.net, linux-ide@vger.kernel.org

Sergei:

Many thanks for your patience and careful review! I apologize for
those mistakes.

Here I'll send a hopefully corrected version:





This patch fixes the automatic setting of ide_generic.probe_mask,
when it is set to zero (like when default options are used) AND
the PCI subsystem has detected primary and/or secondary interfaces.

The effect is that those IDE interfaces go undetected under those
conditions.

The former implementation misunderstands the information detected by
the PCI subsystem, and may only work if one use ide_generic.probe_mask
set to 0x3f (or 0x03, minimally), like the suggestion echoed to the
console.

Signed-off-by: Luiz Carlos Ramos <lramos.prof@yahoo.com.br>
---
 drivers/ide/ide-generic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index 54d7c4685d23aa5e62ce606e7b994a57bb54b08a..419818a39c270d3ad219e8f7b5df56a9aea3d640 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 "
-- 
2.8.2



On Tue, Aug 09, 2016 at 04:50:15PM +0300, Sergei Shtylyov wrote:
> Hello.
> 
> On 08/09/2016 01:47 PM, lramos.prof@yahoo.com.br wrote:
> 
> >This patch fixes the automatic setting of ide_generic.probe_mask,
> >when it is set to zero (like when default options are used) AND
> >the PCI subsystem has detected primary and/or secondary interfaces.
> >
> >The effect is that those interfaces go undetected under those
> >conditions.
> >
> >The former implementation misunderstands the information detected by
> >the PCI subsystem, and may only work if one use ide_generic.probe_mask
> >set to 0x3f (or 0x03, minimally), like the suggestion echoed to the
> >console.
> >
> >Probably this has been stayed under the radar because everybody
> 
>    Has stayed, maybe?
> 
> >migrated to libata. Anyway, IMHO it's worth to fix it, as the code isn't
> >entirely dead.
> >
> >If I'm not wrong, this change applies to kernels from 2009 up to now.
> >
> >Signed-off-by: Luiz Carlos Ramos <lramos.prof@yahoo.com.br>
> >---
> >diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
> >index 54d7c4685d23aa5e62ce606e7b994a57bb54b08a..419818a39c270d3ad219e8f7b5df56a9aea3d640 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;
> 
>    Your patch is line wrapped...
> 
> >
> >-               if (secondary == 0)
> >+               if (secondary)
> >probe_mask |= 0x2;
> >} else
> >printk(KERN_INFO DRV_NAME ": enforcing probing of I/O ports "
> 
>    ... and whitespace damaged too. :-(
> 
> MBR, Sergei
> 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-09 23:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1370547790.13391287.1470739631878.JavaMail.yahoo.ref@mail.yahoo.com>
2016-08-09 10:47 ` [PATCH] Fix interface autodetection in legacy IDE driver lramos.prof
2016-08-09 13:50   ` Sergei Shtylyov
2016-08-09 23:51     ` Luiz Carlos Ramos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox