All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Roger Quadros <rogerq@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>,
	Guenter Roeck <linux@roeck-us.net>,
	krzysztof.kozlowski@canonical.com, vigneshr@ti.com, nm@ti.com,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: rawnand: omap2: Actually prevent invalid configuration and build error
Date: Mon, 7 Mar 2022 15:12:49 +0100	[thread overview]
Message-ID: <20220307151249.7e5b7210@xps13> (raw)
In-Reply-To: <c39d64f0-deef-4cae-fab7-555a48e31811@kernel.org>

Hi Roger,

rogerq@kernel.org wrote on Mon, 7 Mar 2022 14:25:48 +0200:

> Hi Miquel,
> 
> On 07/03/2022 12:03, Miquel Raynal wrote:
> > Hi Roger,
> > 
> > rogerq@kernel.org wrote on Sat, 5 Mar 2022 00:50:14 +0200:
> >   
> >> Hi Miquel,
> >>
> >> On 04/03/2022 17:54, Miquel Raynal wrote:  
> >>> Hi Guenter, Roger,
> >>>
> >>> rdunlap@infradead.org wrote on Sat, 26 Feb 2022 22:55:28 -0800:
> >>>     
> >>>> On 2/19/22 16:44, Guenter Roeck wrote:    
> >>>>> On Sat, Feb 19, 2022 at 09:36:00PM +0200, Roger Quadros wrote:      
> >>>>>> The root of the problem is that we are selecting symbols that have
> >>>>>> dependencies. This can cause random configurations that can fail.
> >>>>>> The cleanest solution is to avoid using select.
> >>>>>>
> >>>>>> This driver uses interfaces from the OMAP_GPMC driver so we have to
> >>>>>> depend on it instead.
> >>>>>>
> >>>>>> Fixes: 4cd335dae3cf ("mtd: rawnand: omap2: Prevent invalid configuration and build error")
> >>>>>> Signed-off-by: Roger Quadros <rogerq@kernel.org>      
> >>>>>
> >>>>> Tested-by: Guenter Roeck <linux@roeck-us.net>      
> >>>>
> >>>> Tested-by: Randy Dunlap <rdunlap@infradead.org>    
> >>>
> >>> Sorry for noticing that just now, but there is still a problem with
> >>> this patch: we now always compile-in the OMAP_GPMC driver whenever we
> >>> need the NAND controller, even though it is not needed. This grows the
> >>> kernel for no reason.    
> >>
> >> Sorry, I did not understand what you meant.
> >>
> >> We no longer explicitly enable OMAP_GPMC since we dropped the "select".
> >> This fixes all build issues that were reported recently.
> >>
> >> MTD_NAND_OMAP2 will not be enabled if OMAP_GPMC is not since we added
> >> the "depends on". This fixes the original build issue that we started to
> >> fix with select initially.  
> > 
> > Yes, this side is fine.
> > 
> > In the initial commit, you proposed:
> > 
> > --- a/drivers/mtd/nand/raw/Kconfig
> > +++ b/drivers/mtd/nand/raw/Kconfig
> > @@ -42,7 +42,8 @@ config MTD_NAND_OMAP2
> >         tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
> >         depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
> >         depends on HAS_IOMEM
> > +       select OMAP_GPMC if ARCH_K3
> > 
> > Which creates a dependency over OMAP_GPMC only for a single
> > architecture. Which means that other OMAP platforms do not necessarily
> > need OMAP_GPMC for the NAND controller to work. Now, you propose:  
> 
> No that is not true. Other platforms that need MTD_NAND_OMAP2 are
> explicitly selecting OMAP_GPMC
> i.e. in arch/arm/mach-omap2/Kconfig

Okay, in this case the fix is fine but we will need to clean this up in
a second time.

> > --- a/drivers/mtd/nand/raw/Kconfig
> > +++ b/drivers/mtd/nand/raw/Kconfig
> > @@ -42,8 +42,7 @@ config MTD_NAND_OMAP2
> >  	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
> >  	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
> >  	depends on HAS_IOMEM
> > 	depends on OMAP_GPMC
> > 
> > This means any of the other OMAP architectures will compile the GPMC
> > driver even though they might not need it, which would unnecessarily
> > increase the kernel size.
> > 
> > Am I missing something?  
> 
> MTD_NAND_OMAP2 NAND controller is a submodule of the OMAP GPMC IP. So it
> cannot work without OMAP_GPMC driver.

I didn't remember exactly but in that case it's okay, I was just
surprised by the "select GPMC if ARCH_K3" but indeed with this
explanation it makes more sense.

> Hope this clarifies the doubts.

Yes, thanks. I will send the fix to Linus then.

Cheers,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Roger Quadros <rogerq@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>,
	Guenter Roeck <linux@roeck-us.net>,
	krzysztof.kozlowski@canonical.com, vigneshr@ti.com, nm@ti.com,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: rawnand: omap2: Actually prevent invalid configuration and build error
Date: Mon, 7 Mar 2022 15:12:49 +0100	[thread overview]
Message-ID: <20220307151249.7e5b7210@xps13> (raw)
In-Reply-To: <c39d64f0-deef-4cae-fab7-555a48e31811@kernel.org>

Hi Roger,

rogerq@kernel.org wrote on Mon, 7 Mar 2022 14:25:48 +0200:

> Hi Miquel,
> 
> On 07/03/2022 12:03, Miquel Raynal wrote:
> > Hi Roger,
> > 
> > rogerq@kernel.org wrote on Sat, 5 Mar 2022 00:50:14 +0200:
> >   
> >> Hi Miquel,
> >>
> >> On 04/03/2022 17:54, Miquel Raynal wrote:  
> >>> Hi Guenter, Roger,
> >>>
> >>> rdunlap@infradead.org wrote on Sat, 26 Feb 2022 22:55:28 -0800:
> >>>     
> >>>> On 2/19/22 16:44, Guenter Roeck wrote:    
> >>>>> On Sat, Feb 19, 2022 at 09:36:00PM +0200, Roger Quadros wrote:      
> >>>>>> The root of the problem is that we are selecting symbols that have
> >>>>>> dependencies. This can cause random configurations that can fail.
> >>>>>> The cleanest solution is to avoid using select.
> >>>>>>
> >>>>>> This driver uses interfaces from the OMAP_GPMC driver so we have to
> >>>>>> depend on it instead.
> >>>>>>
> >>>>>> Fixes: 4cd335dae3cf ("mtd: rawnand: omap2: Prevent invalid configuration and build error")
> >>>>>> Signed-off-by: Roger Quadros <rogerq@kernel.org>      
> >>>>>
> >>>>> Tested-by: Guenter Roeck <linux@roeck-us.net>      
> >>>>
> >>>> Tested-by: Randy Dunlap <rdunlap@infradead.org>    
> >>>
> >>> Sorry for noticing that just now, but there is still a problem with
> >>> this patch: we now always compile-in the OMAP_GPMC driver whenever we
> >>> need the NAND controller, even though it is not needed. This grows the
> >>> kernel for no reason.    
> >>
> >> Sorry, I did not understand what you meant.
> >>
> >> We no longer explicitly enable OMAP_GPMC since we dropped the "select".
> >> This fixes all build issues that were reported recently.
> >>
> >> MTD_NAND_OMAP2 will not be enabled if OMAP_GPMC is not since we added
> >> the "depends on". This fixes the original build issue that we started to
> >> fix with select initially.  
> > 
> > Yes, this side is fine.
> > 
> > In the initial commit, you proposed:
> > 
> > --- a/drivers/mtd/nand/raw/Kconfig
> > +++ b/drivers/mtd/nand/raw/Kconfig
> > @@ -42,7 +42,8 @@ config MTD_NAND_OMAP2
> >         tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
> >         depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
> >         depends on HAS_IOMEM
> > +       select OMAP_GPMC if ARCH_K3
> > 
> > Which creates a dependency over OMAP_GPMC only for a single
> > architecture. Which means that other OMAP platforms do not necessarily
> > need OMAP_GPMC for the NAND controller to work. Now, you propose:  
> 
> No that is not true. Other platforms that need MTD_NAND_OMAP2 are
> explicitly selecting OMAP_GPMC
> i.e. in arch/arm/mach-omap2/Kconfig

Okay, in this case the fix is fine but we will need to clean this up in
a second time.

> > --- a/drivers/mtd/nand/raw/Kconfig
> > +++ b/drivers/mtd/nand/raw/Kconfig
> > @@ -42,8 +42,7 @@ config MTD_NAND_OMAP2
> >  	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
> >  	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
> >  	depends on HAS_IOMEM
> > 	depends on OMAP_GPMC
> > 
> > This means any of the other OMAP architectures will compile the GPMC
> > driver even though they might not need it, which would unnecessarily
> > increase the kernel size.
> > 
> > Am I missing something?  
> 
> MTD_NAND_OMAP2 NAND controller is a submodule of the OMAP GPMC IP. So it
> cannot work without OMAP_GPMC driver.

I didn't remember exactly but in that case it's okay, I was just
surprised by the "select GPMC if ARCH_K3" but indeed with this
explanation it makes more sense.

> Hope this clarifies the doubts.

Yes, thanks. I will send the fix to Linus then.

Cheers,
Miquèl

  reply	other threads:[~2022-03-07 14:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-20  0:44 [PATCH] mtd: rawnand: omap2: Actually prevent invalid configuration and build error Guenter Roeck
2022-02-27  6:55 ` Randy Dunlap
2022-02-27  6:55   ` Randy Dunlap
2022-03-04 15:54   ` Miquel Raynal
2022-03-04 15:54     ` Miquel Raynal
2022-03-04 20:04     ` Guenter Roeck
2022-03-04 20:04       ` Guenter Roeck
2022-03-04 22:50     ` Roger Quadros
2022-03-04 22:50       ` Roger Quadros
2022-03-07 10:03       ` Miquel Raynal
2022-03-07 10:03         ` Miquel Raynal
2022-03-07 12:25         ` Roger Quadros
2022-03-07 12:25           ` Roger Quadros
2022-03-07 14:12           ` Miquel Raynal [this message]
2022-03-07 14:12             ` Miquel Raynal
2022-03-07 21:05             ` Roger Quadros
2022-03-07 21:05               ` Roger Quadros
2022-03-08  9:26               ` Miquel Raynal
2022-03-08  9:26                 ` Miquel Raynal
2022-03-07 14:21           ` Miquel Raynal
2022-03-07 14:21             ` Miquel Raynal
  -- strict thread matches above, loose matches on Subject: below --
2022-02-19 19:36 Roger Quadros
2022-02-19 19:36 ` Roger Quadros
2022-02-25 11:15 ` Miquel Raynal
2022-02-25 11:15   ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220307151249.7e5b7210@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux@roeck-us.net \
    --cc=nm@ti.com \
    --cc=rdunlap@infradead.org \
    --cc=rogerq@kernel.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.