diff mbox series

mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt

Message ID 20191001180834.1158-1-geert+renesas@glider.be
State Mainlined
Commit faf97b84fa86d40eba5a30e9071dfb55133fb1b7
Delegated to: Geert Uytterhoeven
Headers show
Series mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt | expand

Commit Message

Geert Uytterhoeven Oct. 1, 2019, 6:08 p.m. UTC
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(-)

Comments

Yoshihiro Shimoda Oct. 2, 2019, 4:50 a.m. UTC | #1
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
Wolfram Sang Oct. 2, 2019, 8:15 a.m. UTC | #2
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.
Yoshihiro Shimoda Oct. 2, 2019, 8:26 a.m. UTC | #3
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
Geert Uytterhoeven Oct. 2, 2019, 8:32 a.m. UTC | #4
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
Wolfram Sang Oct. 2, 2019, 8:58 a.m. UTC | #5
> 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
Geert Uytterhoeven Oct. 2, 2019, 9:14 a.m. UTC | #6
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
Yoshihiro Shimoda Oct. 2, 2019, 9:20 a.m. UTC | #7
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
Ulf Hansson Oct. 3, 2019, 10:01 a.m. UTC | #8
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
>
diff mbox series

Patch

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);