Re: [PATCH] mmc: renesas_sdhi: Do not use platform_get_irq() to count interrupts

2019-10-02 Thread Geert Uytterhoeven
Hi Sergei,

On Wed, Oct 2, 2019 at 11:11 AM Sergei Shtylyov
 wrote:
> On 01.10.2019 21:07, Geert Uytterhoeven wrote:
> > As platform_get_irq() now prints an error when the interrupt does not
> > exist, counting interrupts by looping until failure causes the printing
>
>s/the//?

I believe "the printing" is correct.
Any native English speakers to comment?

> > of scary messages like:
> >
> >  renesas_sdhi_internal_dmac ee14.sd: IRQ index 1 not found
> >
> > Fix this by using the platform_irq_count() helper to avoid touching
> > non-existent interrupts.
> >
> > Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to 
> > platform_get_irq*()")
> > Signed-off-by: Geert Uytterhoeven 

> > --- a/drivers/mmc/host/renesas_sdhi_core.c
> > +++ b/drivers/mmc/host/renesas_sdhi_core.c
> [...]
> > @@ -825,24 +825,26 @@ int renesas_sdhi_probe(struct platform_device *pdev,
> >   host->hs400_complete = renesas_sdhi_hs400_complete;
> >   }
> >
> > - i = 0;
> > - while (1) {
> > + /* There must be at least one IRQ source */
> > + num_irqs = platform_irq_count(pdev);
> > + if (num_irqs < 1) {
> > + ret = num_irqs;
> > + goto eirq;
>
> This will return 0 with failed probe if 'num_irqs' is 0, I don't think you
> want this...

Thanks, will fix.

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@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


Re: [PATCH] mmc: renesas_sdhi: Do not use platform_get_irq() to count interrupts

2019-10-02 Thread Sergei Shtylyov

On 01.10.2019 21:07, Geert Uytterhoeven wrote:


As platform_get_irq() now prints an error when the interrupt does not
exist, counting interrupts by looping until failure causes the printing


  s/the//?


of scary messages like:

 renesas_sdhi_internal_dmac ee14.sd: IRQ index 1 not found

Fix this by using the platform_irq_count() helper to avoid touching
non-existent interrupts.

Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to 
platform_get_irq*()")
Signed-off-by: Geert Uytterhoeven 
---
This is a fix for v5.4-rc1.
---
  drivers/mmc/host/renesas_sdhi_core.c | 26 ++
  1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c 
b/drivers/mmc/host/renesas_sdhi_core.c
index d4ada5cca2d14f6a..122f429602d825bd 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c

[...]

@@ -825,24 +825,26 @@ int renesas_sdhi_probe(struct platform_device *pdev,
host->hs400_complete = renesas_sdhi_hs400_complete;
}
  
-	i = 0;

-   while (1) {
+   /* There must be at least one IRQ source */
+   num_irqs = platform_irq_count(pdev);
+   if (num_irqs < 1) {
+   ret = num_irqs;
+   goto eirq;


   This will return 0 with failed probe if 'num_irqs' is 0, I don't think you 
want this...


[...]

MBR, Sergei


Re: [PATCH] mmc: renesas_sdhi: Do not use platform_get_irq() to count interrupts

2019-10-02 Thread Wolfram Sang
On Tue, Oct 01, 2019 at 08:07:03PM +0200, Geert Uytterhoeven wrote:
> As platform_get_irq() now prints an error when the interrupt does not
> exist, counting interrupts by looping until failure causes the printing
> of scary messages like:
> 
> renesas_sdhi_internal_dmac ee14.sd: IRQ index 1 not found
> 
> Fix this by using the platform_irq_count() helper to avoid touching
> non-existent interrupts.
> 
> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to 
> platform_get_irq*()")

We will see this fixes line a lot :/

> Signed-off-by: Geert Uytterhoeven 

Have to admit, though, the new code looks much better. Tested on a
Renesas R-Car M3-N:

Reviewed-by: Wolfram Sang 
Tested-by: Wolfram Sang 



signature.asc
Description: PGP signature


RE: [PATCH] mmc: renesas_sdhi: Do not use platform_get_irq() to count interrupts

2019-10-01 Thread Yoshihiro Shimoda
Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Wednesday, October 2, 2019 3:07 AM
> 
> As platform_get_irq() now prints an error when the interrupt does not
> exist, counting interrupts by looping until failure causes the printing
> of scary messages like:
> 
> renesas_sdhi_internal_dmac ee14.sd: IRQ index 1 not found
> 
> Fix this by using the platform_irq_count() helper to avoid touching
> non-existent interrupts.
> 
> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to 
> platform_get_irq*()")
> Signed-off-by: Geert Uytterhoeven 
> ---
> This is a fix for v5.4-rc1.
> ---

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda 

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

Tested-by: Yoshihiro Shimoda 

Best regards,
Yoshihiro Shimoda