2019-10-01 18:10:31

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt

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 <[email protected]>
---
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


2019-10-02 06:46:09

by Yoshihiro Shimoda

[permalink] [raw]
Subject: RE: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt

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 <[email protected]>
> ---
> This is a fix for v5.4-rc1.
> ---

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <[email protected]>

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

Tested-by: Yoshihiro Shimoda <[email protected]>

Best regards,
Yoshihiro Shimoda

2019-10-02 08:52:43

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt

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 <[email protected]>

Reviewed-by: Wolfram Sang <[email protected]>

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 <[email protected]>

But will report back when I fixed the unrelated issue.


Attachments:
(No filename) (1.07 kB)
signature.asc (849.00 B)
Download all attachments

2019-10-02 08:57:47

by Yoshihiro Shimoda

[permalink] [raw]
Subject: RE: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt

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

2019-10-02 08:58:42

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt

Hi Shimoda-san, Wolfram,

On Wed, Oct 2, 2019 at 10:26 AM Yoshihiro Shimoda
<[email protected]> 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 -- [email protected]

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

2019-10-02 09:04:04

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt


> 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 <[email protected]>

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

Thanks again,

Wolfram


Attachments:
(No filename) (420.00 B)
signature.asc (849.00 B)
Download all attachments

2019-10-02 09:17:31

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt

Hi Wolfram,

On Wed, Oct 2, 2019 at 10:58 AM Wolfram Sang <[email protected]> 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 <[email protected]>
>
> 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 -- [email protected]

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

2019-10-02 09:22:14

by Yoshihiro Shimoda

[permalink] [raw]
Subject: RE: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt

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
> <[email protected]> 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

2019-10-03 10:07:04

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH] mmc: sh_mmcif: Use platform_get_irq_optional() for optional interrupt

On Tue, 1 Oct 2019 at 20:08, Geert Uytterhoeven <[email protected]> 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 <[email protected]>

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
>