All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: 6214/2: fix release_mem_region() size
@ 2025-12-16 17:47 Thomas Fourier
  2025-12-17  7:28 ` Geert Uytterhoeven
  2025-12-29 13:08 ` Andy Shevchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Fourier @ 2025-12-16 17:47 UTC (permalink / raw)
  Cc: Thomas Fourier, Andy Shevchenko, Geert Uytterhoeven,
	Linus Walleij, Russell King, linux-kernel

It seems like, after the request_mem_region(), the corresponding
release_mem_region() must take the same size. This was done
in charlcd_remove() but not in the error path in charlcd_probe().

Fixes: ce8962455e90 ("ARM: 6214/2: driver for the character LCD found in ARM refdesigns")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
 drivers/auxdisplay/arm-charlcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/auxdisplay/arm-charlcd.c b/drivers/auxdisplay/arm-charlcd.c
index a7eae99a48f7..4e22882f57c9 100644
--- a/drivers/auxdisplay/arm-charlcd.c
+++ b/drivers/auxdisplay/arm-charlcd.c
@@ -323,7 +323,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
 out_no_irq:
 	iounmap(lcd->virtbase);
 out_no_memregion:
-	release_mem_region(lcd->phybase, SZ_4K);
+	release_mem_region(lcd->phybase, lcd->physize);
 out_no_resource:
 	kfree(lcd);
 	return ret;
-- 
2.43.0


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

* Re: [PATCH] ARM: 6214/2: fix release_mem_region() size
  2025-12-16 17:47 [PATCH] ARM: 6214/2: fix release_mem_region() size Thomas Fourier
@ 2025-12-17  7:28 ` Geert Uytterhoeven
  2025-12-27 16:01   ` Andy Shevchenko
  2025-12-29 13:08 ` Andy Shevchenko
  1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2025-12-17  7:28 UTC (permalink / raw)
  To: Thomas Fourier; +Cc: Andy Shevchenko, Linus Walleij, Russell King, linux-kernel

Hi Thomas,

Thanks for your patch!

The patch prefix should be "auxdisplay: arm-charlcd:", not an rmk
patch tracker ID.

On Tue, 16 Dec 2025 at 18:49, Thomas Fourier <fourier.thomas@gmail.com> wrote:
> It seems like, after the request_mem_region(), the corresponding
> release_mem_region() must take the same size. This was done
> in charlcd_remove() but not in the error path in charlcd_probe().

Unfortunately charlcd_remove() was removed in one of these silly
"make <foo> explicitly non-modular" patches...

> Fixes: ce8962455e90 ("ARM: 6214/2: driver for the character LCD found in ARM refdesigns")
> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>

> --- a/drivers/auxdisplay/arm-charlcd.c
> +++ b/drivers/auxdisplay/arm-charlcd.c
> @@ -323,7 +323,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
>  out_no_irq:
>         iounmap(lcd->virtbase);
>  out_no_memregion:

Looks like the first "goto out_no_memregion" is incorrect, and should be
"goto out_no_resource".

> -       release_mem_region(lcd->phybase, SZ_4K);
> +       release_mem_region(lcd->phybase, lcd->physize);
>  out_no_resource:
>         kfree(lcd);
>         return ret;

The actual change LGTM to me, so
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

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] 5+ messages in thread

* Re: [PATCH] ARM: 6214/2: fix release_mem_region() size
  2025-12-17  7:28 ` Geert Uytterhoeven
@ 2025-12-27 16:01   ` Andy Shevchenko
  2025-12-27 18:39     ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-12-27 16:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Thomas Fourier, Andy Shevchenko, Linus Walleij, Russell King,
	linux-kernel

On Wed, Dec 17, 2025 at 08:28:27AM +0100, Geert Uytterhoeven wrote:
> Hi Thomas,
> 
> Thanks for your patch!
> 
> The patch prefix should be "auxdisplay: arm-charlcd:", not an rmk
> patch tracker ID.
> 
> On Tue, 16 Dec 2025 at 18:49, Thomas Fourier <fourier.thomas@gmail.com> wrote:
> > It seems like, after the request_mem_region(), the corresponding
> > release_mem_region() must take the same size. This was done
> > in charlcd_remove() but not in the error path in charlcd_probe().
> 
> Unfortunately charlcd_remove() was removed in one of these silly
> "make <foo> explicitly non-modular" patches...
> 
> > Fixes: ce8962455e90 ("ARM: 6214/2: driver for the character LCD found in ARM refdesigns")
> > Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
> 
> > --- a/drivers/auxdisplay/arm-charlcd.c
> > +++ b/drivers/auxdisplay/arm-charlcd.c
> > @@ -323,7 +323,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
> >  out_no_irq:
> >         iounmap(lcd->virtbase);
> >  out_no_memregion:
> 
> Looks like the first "goto out_no_memregion" is incorrect, and should be
> "goto out_no_resource".

Should it be in this change or in a separate change? I'm not sure I got what
should be done about this.

> > -       release_mem_region(lcd->phybase, SZ_4K);
> > +       release_mem_region(lcd->phybase, lcd->physize);
> >  out_no_resource:
> >         kfree(lcd);
> >         return ret;
> 
> The actual change LGTM to me, so
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>

Reading between the lines, should I alter the commit message to mention that
there is no more charlcd_remove()? Something like:

    It seems like, after the request_mem_region(), the corresponding
    release_mem_region() must take the same size. This was done
    in recently dropped charlcd_remove() but not in the error path
    in charlcd_probe().

(and Subject line)?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] ARM: 6214/2: fix release_mem_region() size
  2025-12-27 16:01   ` Andy Shevchenko
@ 2025-12-27 18:39     ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2025-12-27 18:39 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Thomas Fourier, Andy Shevchenko, Linus Walleij, Russell King,
	linux-kernel

Hi Andy,

On Sat, 27 Dec 2025 at 17:01, Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
> On Wed, Dec 17, 2025 at 08:28:27AM +0100, Geert Uytterhoeven wrote:
> > On Tue, 16 Dec 2025 at 18:49, Thomas Fourier <fourier.thomas@gmail.com> wrote:
> > > It seems like, after the request_mem_region(), the corresponding
> > > release_mem_region() must take the same size. This was done
> > > in charlcd_remove() but not in the error path in charlcd_probe().
> >
> > Unfortunately charlcd_remove() was removed in one of these silly
> > "make <foo> explicitly non-modular" patches...
> >
> > > Fixes: ce8962455e90 ("ARM: 6214/2: driver for the character LCD found in ARM refdesigns")
> > > Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
> >
> > > --- a/drivers/auxdisplay/arm-charlcd.c
> > > +++ b/drivers/auxdisplay/arm-charlcd.c
> > > @@ -323,7 +323,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
> > >  out_no_irq:
> > >         iounmap(lcd->virtbase);
> > >  out_no_memregion:
> >
> > Looks like the first "goto out_no_memregion" is incorrect, and should be
> > "goto out_no_resource".
>
> Should it be in this change or in a separate change? I'm not sure I got what
> should be done about this.

Separate change.

> > > -       release_mem_region(lcd->phybase, SZ_4K);
> > > +       release_mem_region(lcd->phybase, lcd->physize);
> > >  out_no_resource:
> > >         kfree(lcd);
> > >         return ret;
> >
> > The actual change LGTM to me, so
> > Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> Reading between the lines, should I alter the commit message to mention that
> there is no more charlcd_remove()? Something like:
>
>     It seems like, after the request_mem_region(), the corresponding
>     release_mem_region() must take the same size. This was done
>     in recently dropped charlcd_remove() but not in the error path
>     in charlcd_probe().
>
> (and Subject line)?

Yes please.  It is very confusing to refer to a function that no longer exists.

Thanks!

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] 5+ messages in thread

* Re: [PATCH] ARM: 6214/2: fix release_mem_region() size
  2025-12-16 17:47 [PATCH] ARM: 6214/2: fix release_mem_region() size Thomas Fourier
  2025-12-17  7:28 ` Geert Uytterhoeven
@ 2025-12-29 13:08 ` Andy Shevchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2025-12-29 13:08 UTC (permalink / raw)
  To: Thomas Fourier
  Cc: Andy Shevchenko, Geert Uytterhoeven, Linus Walleij, Russell King,
	linux-kernel

On Tue, Dec 16, 2025 at 06:47:13PM +0100, Thomas Fourier wrote:
> It seems like, after the request_mem_region(), the corresponding
> release_mem_region() must take the same size. This was done
> in charlcd_remove() but not in the error path in charlcd_probe().

Pushed to my review and testing queue, thanks!

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2025-12-29 13:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-16 17:47 [PATCH] ARM: 6214/2: fix release_mem_region() size Thomas Fourier
2025-12-17  7:28 ` Geert Uytterhoeven
2025-12-27 16:01   ` Andy Shevchenko
2025-12-27 18:39     ` Geert Uytterhoeven
2025-12-29 13:08 ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.