Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1498685 > unrolled thread

[PATCH] scsi: NCR5380: no longer mark irq probing as __init

Started byArnd Bergmann <arnd@arndb.de>
First post2016-10-11 11:30 +0200
Last post2016-10-12 01:30 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] scsi: NCR5380: no longer mark irq probing as __init Arnd Bergmann <arnd@arndb.de> - 2016-10-11 11:30 +0200
    Re: [PATCH] scsi: NCR5380: no longer mark irq probing as __init Finn Thain <fthain@telegraphics.com.au> - 2016-10-11 11:50 +0200
      Re: [PATCH] scsi: NCR5380: no longer mark irq probing as __init Ondrej Zary <linux@rainbow-software.org> - 2016-10-11 23:00 +0200
        Re: [PATCH] scsi: NCR5380: no longer mark irq probing as __init Finn Thain <fthain@telegraphics.com.au> - 2016-10-12 01:30 +0200

#1498685 — [PATCH] scsi: NCR5380: no longer mark irq probing as __init

FromArnd Bergmann <arnd@arndb.de>
Date2016-10-11 11:30 +0200
Subject[PATCH] scsi: NCR5380: no longer mark irq probing as __init
Message-ID<sr1xM-4Ta-41@gated-at.bofh.it>
The g_NCR5380 has been converted to more regular probing, which
means its probe function can now be invoked after the __init section
is discarded, as pointed out by this kbuild warning:

WARNING: drivers/scsi/built-in.o(.text+0x3a105): Section mismatch in reference from the function generic_NCR5380_isa_match() to the function .init.text:probe_intr()
WARNING: drivers/scsi/built-in.o(.text+0x3a145): Section mismatch in reference from the function generic_NCR5380_isa_match() to the variable .init.data:probe_irq

To make sure this works correctly in all cases, let's remove
the __init and __initdata annotations.

Fixes: a8cfbcaec0c1 ("scsi: g_NCR5380: Stop using scsi_module.c")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/NCR5380.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 7053de5bd468..61f34aca2fa0 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -353,7 +353,7 @@ static void NCR5380_print_phase(struct Scsi_Host *instance)
 #endif
 
 
-static int probe_irq __initdata;
+static int probe_irq;
 
 /**
  * probe_intr	-	helper for IRQ autoprobe
@@ -365,7 +365,7 @@ static int probe_irq __initdata;
  * used by the IRQ probe code.
  */
 
-static irqreturn_t __init probe_intr(int irq, void *dev_id)
+static irqreturn_t probe_intr(int irq, void *dev_id)
 {
 	probe_irq = irq;
 	return IRQ_HANDLED;
@@ -380,7 +380,7 @@ static irqreturn_t __init probe_intr(int irq, void *dev_id)
  * and then looking to see what interrupt actually turned up.
  */
 
-static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance,
+static int __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance,
 						int possible)
 {
 	struct NCR5380_hostdata *hostdata = shost_priv(instance);
-- 
2.9.0

[toc] | [next] | [standalone]


#1498692

FromFinn Thain <fthain@telegraphics.com.au>
Date2016-10-11 11:50 +0200
Message-ID<sr1Rc-4Zl-5@gated-at.bofh.it>
In reply to#1498685
Acked-by: Finn Thain <fthain@telegraphics.com.au>

Thanks.

On Tue, 11 Oct 2016, Arnd Bergmann wrote:

> The g_NCR5380 has been converted to more regular probing, which
> means its probe function can now be invoked after the __init section
> is discarded, as pointed out by this kbuild warning:
> 
> WARNING: drivers/scsi/built-in.o(.text+0x3a105): Section mismatch in reference from the function generic_NCR5380_isa_match() to the function .init.text:probe_intr()
> WARNING: drivers/scsi/built-in.o(.text+0x3a145): Section mismatch in reference from the function generic_NCR5380_isa_match() to the variable .init.data:probe_irq
> 
> To make sure this works correctly in all cases, let's remove
> the __init and __initdata annotations.
> 
> Fixes: a8cfbcaec0c1 ("scsi: g_NCR5380: Stop using scsi_module.c")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/scsi/NCR5380.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
> index 7053de5bd468..61f34aca2fa0 100644
> --- a/drivers/scsi/NCR5380.c
> +++ b/drivers/scsi/NCR5380.c
> @@ -353,7 +353,7 @@ static void NCR5380_print_phase(struct Scsi_Host *instance)
>  #endif
>  
>  
> -static int probe_irq __initdata;
> +static int probe_irq;
>  
>  /**
>   * probe_intr	-	helper for IRQ autoprobe
> @@ -365,7 +365,7 @@ static int probe_irq __initdata;
>   * used by the IRQ probe code.
>   */
>  
> -static irqreturn_t __init probe_intr(int irq, void *dev_id)
> +static irqreturn_t probe_intr(int irq, void *dev_id)
>  {
>  	probe_irq = irq;
>  	return IRQ_HANDLED;
> @@ -380,7 +380,7 @@ static irqreturn_t __init probe_intr(int irq, void *dev_id)
>   * and then looking to see what interrupt actually turned up.
>   */
>  
> -static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance,
> +static int __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance,
>  						int possible)
>  {
>  	struct NCR5380_hostdata *hostdata = shost_priv(instance);
> 

[toc] | [prev] | [next] | [standalone]


#1499204

FromOndrej Zary <linux@rainbow-software.org>
Date2016-10-11 23:00 +0200
Message-ID<srcjw-30Y-7@gated-at.bofh.it>
In reply to#1498692
On Tuesday 11 October 2016 11:39:57 Finn Thain wrote:
> Acked-by: Finn Thain <fthain@telegraphics.com.au>
>
> Thanks.
>
> On Tue, 11 Oct 2016, Arnd Bergmann wrote:
> > The g_NCR5380 has been converted to more regular probing, which
> > means its probe function can now be invoked after the __init section
> > is discarded, as pointed out by this kbuild warning:
> >
> > WARNING: drivers/scsi/built-in.o(.text+0x3a105): Section mismatch in
> > reference from the function generic_NCR5380_isa_match() to the function
> > .init.text:probe_intr() WARNING: drivers/scsi/built-in.o(.text+0x3a145):
> > Section mismatch in reference from the function
> > generic_NCR5380_isa_match() to the variable .init.data:probe_irq
> >
> > To make sure this works correctly in all cases, let's remove
> > the __init and __initdata annotations.
> >
> > Fixes: a8cfbcaec0c1 ("scsi: g_NCR5380: Stop using scsi_module.c")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/scsi/NCR5380.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
> > index 7053de5bd468..61f34aca2fa0 100644
> > --- a/drivers/scsi/NCR5380.c
> > +++ b/drivers/scsi/NCR5380.c
> > @@ -353,7 +353,7 @@ static void NCR5380_print_phase(struct Scsi_Host
> > *instance) #endif
> >
> >
> > -static int probe_irq __initdata;
> > +static int probe_irq;
> >
> >  /**
> >   * probe_intr	-	helper for IRQ autoprobe
> > @@ -365,7 +365,7 @@ static int probe_irq __initdata;
> >   * used by the IRQ probe code.
> >   */
> >
> > -static irqreturn_t __init probe_intr(int irq, void *dev_id)
> > +static irqreturn_t probe_intr(int irq, void *dev_id)
> >  {
> >  	probe_irq = irq;
> >  	return IRQ_HANDLED;
> > @@ -380,7 +380,7 @@ static irqreturn_t __init probe_intr(int irq, void
> > *dev_id) * and then looking to see what interrupt actually turned up.
> >   */
> >
> > -static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host
> > *instance, +static int __maybe_unused NCR5380_probe_irq(struct Scsi_Host
> > *instance, int possible)
> >  {
> >  	struct NCR5380_hostdata *hostdata = shost_priv(instance);

I've tested IRQ probing on my IRQ7-hardwired ISA card without any success some 
time ago. No IRQ was detected because it wasn't even generated (no increment 
in /proc/interruptts). It also produced some warnings in dmesg about 
conflicting interrupt flags. Can't the IRQ probing be simply deleted?

-- 
Ondrej Zary

[toc] | [prev] | [next] | [standalone]


#1499288

FromFinn Thain <fthain@telegraphics.com.au>
Date2016-10-12 01:30 +0200
Message-ID<sreEF-4Dp-1@gated-at.bofh.it>
In reply to#1499204
On Tue, 11 Oct 2016, Ondrej Zary wrote:

> 
> I've tested IRQ probing on my IRQ7-hardwired ISA card without any 
> success some time ago. No IRQ was detected because it wasn't even 
> generated (no increment in /proc/interruptts).

The IRQ line does not appear in /proc/interrupts unless it has already 
been claimed. So if you saw that the interrupt count stayed the same, then 
the interrupt line wasn't available in the first place.

> It also produced some warnings in dmesg about conflicting interrupt 
> flags.

Presumably that's because there is no way to probe shared interrupt lines.

> Can't the IRQ probing be simply deleted?
> 

It isn't clear to me that there's a bug in the driver. I never saw a bug 
in the irq probe code when I went looking for a reason to delete that code 
a while ago.

Anyway, assuming that the interrupt line on your card works fine, have you 
considered using probe_irq_on/probe_irq_off? See for example, sym53c416.c 
and NCR53c406a.c.

Bug or no bug, I'd be very happy to delete the NCR5380 probe code if we 
can use the standard probe functions to retain the documented 
functionality.

-- 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web