linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt
@ 2019-10-01 18:08 Geert Uytterhoeven
  2019-10-02  4:50 ` Yoshihiro Shimoda
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2019-10-01 18:08 UTC (permalink / raw)
  To: Ulf Hansson, Wolfram Sang, Jiri Slaby
  Cc: Stephen Boyd, Greg Kroah-Hartman, linux-renesas-soc, linux-mmc,
	linux-kernel, Geert Uytterhoeven

As platform_get_irq() now prints an error when the interrupt does not
exist, a scary warning may be printed for an optional interrupt:

    sh_mmcif ee200000.mmc: IRQ index 1 not found

Fix this by calling platform_get_irq_optional() instead for the second
interrupt, which is optional.

Remove the now superfluous error printing for the first interrupt, which
is mandatory.

Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This is a fix for v5.4-rc1.
---
 drivers/mmc/host/sh_mmcif.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 81bd9afb0980525e..98c575de43c755ed 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1393,11 +1393,9 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 	const char *name;
 
 	irq[0] = platform_get_irq(pdev, 0);
-	irq[1] = platform_get_irq(pdev, 1);
-	if (irq[0] < 0) {
-		dev_err(dev, "Get irq error\n");
+	irq[1] = platform_get_irq_optional(pdev, 1);
+	if (irq[0] < 0)
 		return -ENXIO;
-	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg = devm_ioremap_resource(dev, res);
-- 
2.17.1


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

* RE: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt
  2019-10-01 18:08 [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt Geert Uytterhoeven
@ 2019-10-02  4:50 ` Yoshihiro Shimoda
  2019-10-02  8:15 ` Wolfram Sang
  2019-10-03 10:01 ` Ulf Hansson
  2 siblings, 0 replies; 9+ messages in thread
From: Yoshihiro Shimoda @ 2019-10-02  4:50 UTC (permalink / raw)
  To: Geert Uytterhoeven, Ulf Hansson, Wolfram Sang, Jiri Slaby
  Cc: Stephen Boyd, Greg Kroah-Hartman, linux-renesas-soc, linux-mmc,
	linux-kernel

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Wednesday, October 2, 2019 3:09 AM
> 
> As platform_get_irq() now prints an error when the interrupt does not
> exist, a scary warning may be printed for an optional interrupt:
> 
>     sh_mmcif ee200000.mmc: IRQ index 1 not found
> 
> Fix this by calling platform_get_irq_optional() instead for the second
> interrupt, which is optional.
> 
> Remove the now superfluous error printing for the first interrupt, which
> is mandatory.
> 
> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> This is a fix for v5.4-rc1.
> ---

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

And, I tested this patch on R-Car H2. So,

Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt
  2019-10-01 18:08 [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt Geert Uytterhoeven
  2019-10-02  4:50 ` Yoshihiro Shimoda
@ 2019-10-02  8:15 ` Wolfram Sang
  2019-10-02  8:26   ` Yoshihiro Shimoda
  2019-10-03 10:01 ` Ulf Hansson
  2 siblings, 1 reply; 9+ messages in thread
From: Wolfram Sang @ 2019-10-02  8:15 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Ulf Hansson, Wolfram Sang, Jiri Slaby, Stephen Boyd,
	Greg Kroah-Hartman, linux-renesas-soc, linux-mmc, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1098 bytes --]

On Tue, Oct 01, 2019 at 08:08:34PM +0200, Geert Uytterhoeven wrote:
> As platform_get_irq() now prints an error when the interrupt does not
> exist, a scary warning may be printed for an optional interrupt:
> 
>     sh_mmcif ee200000.mmc: IRQ index 1 not found
> 
> Fix this by calling platform_get_irq_optional() instead for the second
> interrupt, which is optional.
> 
> Remove the now superfluous error printing for the first interrupt, which
> is mandatory.
> 
> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Tested on a R-Car H2: it does make the error message go away and the
MMCIF device acts normal during boot. Can't enter userspace currently
with v5.4-rc1 but this is unrelated to this patch and MMCIF. Looks like a
configuration thing on my side, so I will still give:

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

But will report back when I fixed the unrelated issue.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* RE: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt
  2019-10-02  8:15 ` Wolfram Sang
@ 2019-10-02  8:26   ` Yoshihiro Shimoda
  2019-10-02  8:32     ` Geert Uytterhoeven
  0 siblings, 1 reply; 9+ messages in thread
From: Yoshihiro Shimoda @ 2019-10-02  8:26 UTC (permalink / raw)
  To: Wolfram Sang, Geert Uytterhoeven
  Cc: Ulf Hansson, Wolfram Sang, Jiri Slaby, Stephen Boyd,
	Greg Kroah-Hartman, linux-renesas-soc, linux-mmc, linux-kernel

Hi,

> From: Wolfram Sang, Sent: Wednesday, October 2, 2019 5:16 PM
<snip>
> Tested on a R-Car H2: it does make the error message go away and the
> MMCIF device acts normal during boot. Can't enter userspace currently
> with v5.4-rc1 but this is unrelated to this patch and MMCIF. Looks like a
> configuration thing on my side, so I will still give:

I also should have reported this though, my environment (R-Car H2 + NFS +
buildroot on v5.4-rc1 with shmobile_defconfig) also has a similar issue
like the following:

[    3.573488] VFS: Mounted root (nfs filesystem) on device 0:16.
[    3.579869] devtmpfs: mounted
[    3.588014] Freeing unused kernel memory: 1024K
[    3.651771] Run /sbin/init as init process
Starting syslogd: OK
Starting klogd: OK
Initializing random number generator... [    4.073629] random: dd: uninitialized urandom read (512 bytes read)
urandom start: failed.
done.
Starting network: ip: OVERRUN: Bad address
ip: OVERRUN: Bad address
ip: OVERRUN: Bad address

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt
  2019-10-02  8:26   ` Yoshihiro Shimoda
@ 2019-10-02  8:32     ` Geert Uytterhoeven
  2019-10-02  8:58       ` Wolfram Sang
  2019-10-02  9:20       ` Yoshihiro Shimoda
  0 siblings, 2 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2019-10-02  8:32 UTC (permalink / raw)
  To: Yoshihiro Shimoda, Wolfram Sang
  Cc: Geert Uytterhoeven, Ulf Hansson, Wolfram Sang, Jiri Slaby,
	Stephen Boyd, Greg Kroah-Hartman, linux-renesas-soc, linux-mmc,
	linux-kernel

Hi Shimoda-san, Wolfram,

On Wed, Oct 2, 2019 at 10:26 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> > From: Wolfram Sang, Sent: Wednesday, October 2, 2019 5:16 PM
> <snip>
> > Tested on a R-Car H2: it does make the error message go away and the
> > MMCIF device acts normal during boot. Can't enter userspace currently
> > with v5.4-rc1 but this is unrelated to this patch and MMCIF. Looks like a
> > configuration thing on my side, so I will still give:
>
> I also should have reported this though, my environment (R-Car H2 + NFS +
> buildroot on v5.4-rc1 with shmobile_defconfig) also has a similar issue
> like the following:
>
> [    3.573488] VFS: Mounted root (nfs filesystem) on device 0:16.
> [    3.579869] devtmpfs: mounted
> [    3.588014] Freeing unused kernel memory: 1024K
> [    3.651771] Run /sbin/init as init process
> Starting syslogd: OK
> Starting klogd: OK
> Initializing random number generator... [    4.073629] random: dd: uninitialized urandom read (512 bytes read)
> urandom start: failed.
> done.
> Starting network: ip: OVERRUN: Bad address
> ip: OVERRUN: Bad address
> ip: OVERRUN: Bad address

Please cherry-pick the top commit from renesas-devel:
6e47c841329eb9b0 ("ARM: fix __get_user_check() in case uaccess_* calls
are not inlined")

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt
  2019-10-02  8:32     ` Geert Uytterhoeven
@ 2019-10-02  8:58       ` Wolfram Sang
  2019-10-02  9:14         ` Geert Uytterhoeven
  2019-10-02  9:20       ` Yoshihiro Shimoda
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfram Sang @ 2019-10-02  8:58 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Yoshihiro Shimoda, Geert Uytterhoeven, Ulf Hansson, Wolfram Sang,
	Jiri Slaby, Stephen Boyd, Greg Kroah-Hartman, linux-renesas-soc,
	linux-mmc, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]


> Please cherry-pick the top commit from renesas-devel:
> 6e47c841329eb9b0 ("ARM: fix __get_user_check() in case uaccess_* calls
> are not inlined")

Thanks a lot, Geert. I can confirm this patch fixes the issue I was
seeing:

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Could you kindly forward this tag to Yamada-san or bounce me the patch
so I can do it?

Thanks again,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt
  2019-10-02  8:58       ` Wolfram Sang
@ 2019-10-02  9:14         ` Geert Uytterhoeven
  0 siblings, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2019-10-02  9:14 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Yoshihiro Shimoda, Geert Uytterhoeven, Ulf Hansson, Wolfram Sang,
	Jiri Slaby, Stephen Boyd, Greg Kroah-Hartman, linux-renesas-soc,
	linux-mmc, linux-kernel

Hi Wolfram,

On Wed, Oct 2, 2019 at 10:58 AM Wolfram Sang <wsa@the-dreams.de> wrote:
> > Please cherry-pick the top commit from renesas-devel:
> > 6e47c841329eb9b0 ("ARM: fix __get_user_check() in case uaccess_* calls
> > are not inlined")
>
> Thanks a lot, Geert. I can confirm this patch fixes the issue I was
> seeing:
>
> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> Could you kindly forward this tag to Yamada-san or bounce me the patch
> so I can do it?

Please check your linux-renesas-soc folder.  I CCed the list when providing
my own Tested-by yesterday.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* RE: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt
  2019-10-02  8:32     ` Geert Uytterhoeven
  2019-10-02  8:58       ` Wolfram Sang
@ 2019-10-02  9:20       ` Yoshihiro Shimoda
  1 sibling, 0 replies; 9+ messages in thread
From: Yoshihiro Shimoda @ 2019-10-02  9:20 UTC (permalink / raw)
  To: Geert Uytterhoeven, Wolfram Sang
  Cc: Geert Uytterhoeven, Ulf Hansson, Wolfram Sang, Jiri Slaby,
	Stephen Boyd, Greg Kroah-Hartman, linux-renesas-soc, linux-mmc,
	linux-kernel

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Wednesday, October 2, 2019 5:32 PM
> 
> Hi Shimoda-san, Wolfram,
> 
> On Wed, Oct 2, 2019 at 10:26 AM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > From: Wolfram Sang, Sent: Wednesday, October 2, 2019 5:16 PM
> > <snip>
> > > Tested on a R-Car H2: it does make the error message go away and the
> > > MMCIF device acts normal during boot. Can't enter userspace currently
> > > with v5.4-rc1 but this is unrelated to this patch and MMCIF. Looks like a
> > > configuration thing on my side, so I will still give:
> >
> > I also should have reported this though, my environment (R-Car H2 + NFS +
> > buildroot on v5.4-rc1 with shmobile_defconfig) also has a similar issue
> > like the following:
> >
> > [    3.573488] VFS: Mounted root (nfs filesystem) on device 0:16.
> > [    3.579869] devtmpfs: mounted
> > [    3.588014] Freeing unused kernel memory: 1024K
> > [    3.651771] Run /sbin/init as init process
> > Starting syslogd: OK
> > Starting klogd: OK
> > Initializing random number generator... [    4.073629] random: dd: uninitialized urandom read (512 bytes read)
> > urandom start: failed.
> > done.
> > Starting network: ip: OVERRUN: Bad address
> > ip: OVERRUN: Bad address
> > ip: OVERRUN: Bad address
> 
> Please cherry-pick the top commit from renesas-devel:
> 6e47c841329eb9b0 ("ARM: fix __get_user_check() in case uaccess_* calls
> are not inlined")

Thank you for the information. This commit could fix the issue on my environment.

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt
  2019-10-01 18:08 [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt Geert Uytterhoeven
  2019-10-02  4:50 ` Yoshihiro Shimoda
  2019-10-02  8:15 ` Wolfram Sang
@ 2019-10-03 10:01 ` Ulf Hansson
  2 siblings, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2019-10-03 10:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Wolfram Sang, Jiri Slaby, Stephen Boyd, Greg Kroah-Hartman,
	Linux-Renesas, linux-mmc, Linux Kernel Mailing List

On Tue, 1 Oct 2019 at 20:08, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
>
> As platform_get_irq() now prints an error when the interrupt does not
> exist, a scary warning may be printed for an optional interrupt:
>
>     sh_mmcif ee200000.mmc: IRQ index 1 not found
>
> Fix this by calling platform_get_irq_optional() instead for the second
> interrupt, which is optional.
>
> Remove the now superfluous error printing for the first interrupt, which
> is mandatory.
>
> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Applied for fixes, thanks!

Kind regards
Uffe


> ---
> This is a fix for v5.4-rc1.
> ---
>  drivers/mmc/host/sh_mmcif.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index 81bd9afb0980525e..98c575de43c755ed 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -1393,11 +1393,9 @@ static int sh_mmcif_probe(struct platform_device *pdev)
>         const char *name;
>
>         irq[0] = platform_get_irq(pdev, 0);
> -       irq[1] = platform_get_irq(pdev, 1);
> -       if (irq[0] < 0) {
> -               dev_err(dev, "Get irq error\n");
> +       irq[1] = platform_get_irq_optional(pdev, 1);
> +       if (irq[0] < 0)
>                 return -ENXIO;
> -       }
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>         reg = devm_ioremap_resource(dev, res);
> --
> 2.17.1
>

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

end of thread, other threads:[~2019-10-03 10:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 18:08 [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt Geert Uytterhoeven
2019-10-02  4:50 ` Yoshihiro Shimoda
2019-10-02  8:15 ` Wolfram Sang
2019-10-02  8:26   ` Yoshihiro Shimoda
2019-10-02  8:32     ` Geert Uytterhoeven
2019-10-02  8:58       ` Wolfram Sang
2019-10-02  9:14         ` Geert Uytterhoeven
2019-10-02  9:20       ` Yoshihiro Shimoda
2019-10-03 10:01 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).