linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH typo-resend] mtd: omap: fix mtd devices not showing up
@ 2014-10-27 13:32 Frans Klaver
  2014-10-27 13:56 ` Roger Quadros
  2014-10-27 14:34 ` [PATCH v2] " Frans Klaver
  0 siblings, 2 replies; 13+ messages in thread
From: Frans Klaver @ 2014-10-27 13:32 UTC (permalink / raw)
  To: Brian Norris
  Cc: Frans Klaver, Ezequiel García, Roger Quadros, linux-mtd,
	linux-omap

Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
omap_elm"), I don't have any mtd devices present on my am335x. This
appears to be related to the link order of the omap_elm and omap2
objects. Fix it by swapping the two in the Makefile.

Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
---
I hoped this wouldn't make a difference, but it very much did. I don't
have a proper explanation for why this actually fixes it for me though.

Resend due to misspelling in ...infradead.org

 drivers/mtd/nand/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 9c847e4..24b81ec 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -26,8 +26,8 @@ obj-$(CONFIG_MTD_NAND_CS553X)		+= cs553x_nand.o
 obj-$(CONFIG_MTD_NAND_NDFC)		+= ndfc.o
 obj-$(CONFIG_MTD_NAND_ATMEL)		+= atmel_nand.o
 obj-$(CONFIG_MTD_NAND_GPIO)		+= gpio.o
-obj-$(CONFIG_MTD_NAND_OMAP2) 		+= omap2.o
 obj-$(CONFIG_MTD_NAND_OMAP_BCH_BUILD)	+= omap_elm.o
+obj-$(CONFIG_MTD_NAND_OMAP2) 		+= omap2.o
 obj-$(CONFIG_MTD_NAND_CM_X270)		+= cmx270_nand.o
 obj-$(CONFIG_MTD_NAND_PXA3xx)		+= pxa3xx_nand.o
 obj-$(CONFIG_MTD_NAND_TMIO)		+= tmio_nand.o
-- 
2.1.0


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

* Re: [PATCH typo-resend] mtd: omap: fix mtd devices not showing up
  2014-10-27 13:32 [PATCH typo-resend] mtd: omap: fix mtd devices not showing up Frans Klaver
@ 2014-10-27 13:56 ` Roger Quadros
  2014-10-27 14:01   ` Frans Klaver
  2014-10-27 19:27   ` Ezequiel Garcia
  2014-10-27 14:34 ` [PATCH v2] " Frans Klaver
  1 sibling, 2 replies; 13+ messages in thread
From: Roger Quadros @ 2014-10-27 13:56 UTC (permalink / raw)
  To: Frans Klaver, Brian Norris; +Cc: Ezequiel García, linux-mtd, linux-omap

Hi Frans,

On 10/27/2014 03:32 PM, Frans Klaver wrote:
> Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
> omap_elm"), I don't have any mtd devices present on my am335x. This
> appears to be related to the link order of the omap_elm and omap2
> objects. Fix it by swapping the two in the Makefile.

Alternatively we could fix either elm_config() or omap_nand_probe() to
return -EPROBE_DEFER in case the device is present but driver not yet probed.

cheers,
-roger

> 
> Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
> ---
> I hoped this wouldn't make a difference, but it very much did. I don't
> have a proper explanation for why this actually fixes it for me though.
> 
> Resend due to misspelling in ...infradead.org
> 
>  drivers/mtd/nand/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
> index 9c847e4..24b81ec 100644
> --- a/drivers/mtd/nand/Makefile
> +++ b/drivers/mtd/nand/Makefile
> @@ -26,8 +26,8 @@ obj-$(CONFIG_MTD_NAND_CS553X)		+= cs553x_nand.o
>  obj-$(CONFIG_MTD_NAND_NDFC)		+= ndfc.o
>  obj-$(CONFIG_MTD_NAND_ATMEL)		+= atmel_nand.o
>  obj-$(CONFIG_MTD_NAND_GPIO)		+= gpio.o
> -obj-$(CONFIG_MTD_NAND_OMAP2) 		+= omap2.o
>  obj-$(CONFIG_MTD_NAND_OMAP_BCH_BUILD)	+= omap_elm.o
> +obj-$(CONFIG_MTD_NAND_OMAP2) 		+= omap2.o
>  obj-$(CONFIG_MTD_NAND_CM_X270)		+= cmx270_nand.o
>  obj-$(CONFIG_MTD_NAND_PXA3xx)		+= pxa3xx_nand.o
>  obj-$(CONFIG_MTD_NAND_TMIO)		+= tmio_nand.o
> 


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

* Re: [PATCH typo-resend] mtd: omap: fix mtd devices not showing up
  2014-10-27 13:56 ` Roger Quadros
@ 2014-10-27 14:01   ` Frans Klaver
  2014-10-27 19:27   ` Ezequiel Garcia
  1 sibling, 0 replies; 13+ messages in thread
From: Frans Klaver @ 2014-10-27 14:01 UTC (permalink / raw)
  To: Roger Quadros; +Cc: Brian Norris, Ezequiel García, linux-mtd, linux-omap

On Mon, Oct 27, 2014 at 03:56:41PM +0200, Roger Quadros wrote:
> Hi Frans,

Hi,

> On 10/27/2014 03:32 PM, Frans Klaver wrote:
> > Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
> > omap_elm"), I don't have any mtd devices present on my am335x. This
> > appears to be related to the link order of the omap_elm and omap2
> > objects. Fix it by swapping the two in the Makefile.
> 
> Alternatively we could fix either elm_config() or omap_nand_probe() to
> return -EPROBE_DEFER in case the device is present but driver not yet probed.

I'd say that that would actually be nicer than having to depend on the
link order. I'll have a go at that.

Thanks,
Frans

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

* [PATCH v2] mtd: omap: fix mtd devices not showing up
  2014-10-27 13:32 [PATCH typo-resend] mtd: omap: fix mtd devices not showing up Frans Klaver
  2014-10-27 13:56 ` Roger Quadros
@ 2014-10-27 14:34 ` Frans Klaver
  2014-10-28  9:46   ` Roger Quadros
  1 sibling, 1 reply; 13+ messages in thread
From: Frans Klaver @ 2014-10-27 14:34 UTC (permalink / raw)
  To: Brian Norris
  Cc: Frans Klaver, Ezequiel García, Roger Quadros, linux-mtd,
	linux-omap

Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
omap_elm"), I don't have any mtd devices present on my am335x. This
changes the link order of the omap_elm and omap2 objects, causing them
to probe in the wrong order.

To fix this, make elm_config defer probing until the omap_elm driver is
actually loaded.

Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
---
 drivers/mtd/nand/omap_elm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/omap_elm.c b/drivers/mtd/nand/omap_elm.c
index b4f61c7..0585310 100644
--- a/drivers/mtd/nand/omap_elm.c
+++ b/drivers/mtd/nand/omap_elm.c
@@ -115,7 +115,7 @@ int elm_config(struct device *dev, enum bch_ecc bch_type,
 
 	if (!info) {
 		dev_err(dev, "Unable to configure elm - device not probed?\n");
-		return -ENODEV;
+		return -EPROBE_DEFER;
 	}
 	/* ELM cannot detect ECC errors for chunks > 1KB */
 	if (ecc_step_size > ((ELM_ECC_SIZE + 1) / 2)) {
-- 
2.1.0


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

* Re: [PATCH typo-resend] mtd: omap: fix mtd devices not showing up
  2014-10-27 13:56 ` Roger Quadros
  2014-10-27 14:01   ` Frans Klaver
@ 2014-10-27 19:27   ` Ezequiel Garcia
  2014-10-28  8:57     ` Frans Klaver
  1 sibling, 1 reply; 13+ messages in thread
From: Ezequiel Garcia @ 2014-10-27 19:27 UTC (permalink / raw)
  To: Roger Quadros, Frans Klaver, Brian Norris; +Cc: linux-mtd, linux-omap

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]



On 10/27/2014 10:56 AM, Roger Quadros wrote:
> Hi Frans,
> 
> On 10/27/2014 03:32 PM, Frans Klaver wrote:
>> Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
>> omap_elm"), I don't have any mtd devices present on my am335x. This
>> appears to be related to the link order of the omap_elm and omap2
>> objects. Fix it by swapping the two in the Makefile.
> 

I wonder how is it possible that I didn't got this on my tests.

> Alternatively we could fix either elm_config() or omap_nand_probe() to
> return -EPROBE_DEFER in case the device is present but driver not yet probed.
> 

Yes, that's a good idea. Can't we do both? Getting a systematic deferred
probe sounds like a bit silly to me.
-- 
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH typo-resend] mtd: omap: fix mtd devices not showing up
  2014-10-27 19:27   ` Ezequiel Garcia
@ 2014-10-28  8:57     ` Frans Klaver
  2014-10-28  8:58       ` Ezequiel Garcia
  0 siblings, 1 reply; 13+ messages in thread
From: Frans Klaver @ 2014-10-28  8:57 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: Roger Quadros, Brian Norris, linux-mtd, linux-omap

On Mon, Oct 27, 2014 at 04:27:45PM -0300, Ezequiel Garcia wrote:
> 
> On 10/27/2014 10:56 AM, Roger Quadros wrote:
> 
> > Alternatively we could fix either elm_config() or omap_nand_probe() to
> > return -EPROBE_DEFER in case the device is present but driver not yet probed.
> > 
> 
> Yes, that's a good idea. Can't we do both? Getting a systematic deferred
> probe sounds like a bit silly to me.

It may be. If we do both and something moves again, or something is
added that depends on omap_elm but is probed earlier, you won't be
noticing the new systematic probe deferral until you really start
looking at it.

There isn't a real dependency system in the drivers, is there?

Thanks,
Frans

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

* Re: [PATCH typo-resend] mtd: omap: fix mtd devices not showing up
  2014-10-28  8:57     ` Frans Klaver
@ 2014-10-28  8:58       ` Ezequiel Garcia
  0 siblings, 0 replies; 13+ messages in thread
From: Ezequiel Garcia @ 2014-10-28  8:58 UTC (permalink / raw)
  To: Frans Klaver; +Cc: Roger Quadros, Brian Norris, linux-mtd, linux-omap

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]



On 10/28/2014 05:57 AM, Frans Klaver wrote:
> On Mon, Oct 27, 2014 at 04:27:45PM -0300, Ezequiel Garcia wrote:
>>
>> On 10/27/2014 10:56 AM, Roger Quadros wrote:
>>
>>> Alternatively we could fix either elm_config() or omap_nand_probe() to
>>> return -EPROBE_DEFER in case the device is present but driver not yet probed.
>>>
>>
>> Yes, that's a good idea. Can't we do both? Getting a systematic deferred
>> probe sounds like a bit silly to me.
> 
> It may be. If we do both and something moves again, or something is
> added that depends on omap_elm but is probed earlier, you won't be
> noticing the new systematic probe deferral until you really start
> looking at it.
> 

That's correct. Relying on the link order is very fragile.

> There isn't a real dependency system in the drivers, is there?
> 

Nope.

-- 
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v2] mtd: omap: fix mtd devices not showing up
  2014-10-27 14:34 ` [PATCH v2] " Frans Klaver
@ 2014-10-28  9:46   ` Roger Quadros
  2014-10-29 11:36     ` Frans Klaver
  2014-10-30  1:47     ` Brian Norris
  0 siblings, 2 replies; 13+ messages in thread
From: Roger Quadros @ 2014-10-28  9:46 UTC (permalink / raw)
  To: Frans Klaver, Brian Norris; +Cc: Ezequiel García, linux-mtd, linux-omap

On 10/27/2014 04:34 PM, Frans Klaver wrote:
> Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
> omap_elm"), I don't have any mtd devices present on my am335x. This
> changes the link order of the omap_elm and omap2 objects, causing them
> to probe in the wrong order.
> 
> To fix this, make elm_config defer probing until the omap_elm driver is
> actually loaded.
> 
> Signed-off-by: Frans Klaver <frans.klaver@xsens.com>

Acked-by: Roger Quadros <rogerq@ti.com>

cheers,
-roger

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

* Re: [PATCH v2] mtd: omap: fix mtd devices not showing up
  2014-10-28  9:46   ` Roger Quadros
@ 2014-10-29 11:36     ` Frans Klaver
  2014-10-29 13:33       ` Roger Quadros
  2014-10-30  1:47     ` Brian Norris
  1 sibling, 1 reply; 13+ messages in thread
From: Frans Klaver @ 2014-10-29 11:36 UTC (permalink / raw)
  To: Roger Quadros; +Cc: Brian Norris, Ezequiel García, linux-mtd, linux-omap

On Tue, Oct 28, 2014 at 11:46:57AM +0200, Roger Quadros wrote:
> On 10/27/2014 04:34 PM, Frans Klaver wrote:
> > Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
> > omap_elm"), I don't have any mtd devices present on my am335x. This
> > changes the link order of the omap_elm and omap2 objects, causing them
> > to probe in the wrong order.
> > 
> > To fix this, make elm_config defer probing until the omap_elm driver is
> > actually loaded.
> > 
> > Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
> 
> Acked-by: Roger Quadros <rogerq@ti.com>

Thanks. How about Ezequiel's remark about doing both changes?

Thanks,
Frans

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

* Re: [PATCH v2] mtd: omap: fix mtd devices not showing up
  2014-10-29 11:36     ` Frans Klaver
@ 2014-10-29 13:33       ` Roger Quadros
  2014-10-29 13:34         ` Ezequiel Garcia
  0 siblings, 1 reply; 13+ messages in thread
From: Roger Quadros @ 2014-10-29 13:33 UTC (permalink / raw)
  To: Frans Klaver; +Cc: Brian Norris, Ezequiel García, linux-mtd, linux-omap

On 10/29/2014 01:36 PM, Frans Klaver wrote:
> On Tue, Oct 28, 2014 at 11:46:57AM +0200, Roger Quadros wrote:
>> On 10/27/2014 04:34 PM, Frans Klaver wrote:
>>> Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
>>> omap_elm"), I don't have any mtd devices present on my am335x. This
>>> changes the link order of the omap_elm and omap2 objects, causing them
>>> to probe in the wrong order.
>>>
>>> To fix this, make elm_config defer probing until the omap_elm driver is
>>> actually loaded.
>>>
>>> Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
>>
>> Acked-by: Roger Quadros <rogerq@ti.com>
> 
> Thanks. How about Ezequiel's remark about doing both changes?

I don't have any strong feeling for or against it. We shouldn't be depending on module load order anyways.

cheers,
-roger

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

* Re: [PATCH v2] mtd: omap: fix mtd devices not showing up
  2014-10-29 13:33       ` Roger Quadros
@ 2014-10-29 13:34         ` Ezequiel Garcia
  0 siblings, 0 replies; 13+ messages in thread
From: Ezequiel Garcia @ 2014-10-29 13:34 UTC (permalink / raw)
  To: Roger Quadros, Frans Klaver; +Cc: Brian Norris, linux-mtd, linux-omap

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]



On 10/29/2014 10:33 AM, Roger Quadros wrote:
> On 10/29/2014 01:36 PM, Frans Klaver wrote:
>> On Tue, Oct 28, 2014 at 11:46:57AM +0200, Roger Quadros wrote:
>>> On 10/27/2014 04:34 PM, Frans Klaver wrote:
>>>> Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
>>>> omap_elm"), I don't have any mtd devices present on my am335x. This
>>>> changes the link order of the omap_elm and omap2 objects, causing them
>>>> to probe in the wrong order.
>>>>
>>>> To fix this, make elm_config defer probing until the omap_elm driver is
>>>> actually loaded.
>>>>
>>>> Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
>>>
>>> Acked-by: Roger Quadros <rogerq@ti.com>
>>
>> Thanks. How about Ezequiel's remark about doing both changes?
> 
> I don't have any strong feeling for or against it. We shouldn't be depending on module load order anyways.
> 

Agreed, feel free to disregard my suggestion.

-- 
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v2] mtd: omap: fix mtd devices not showing up
  2014-10-28  9:46   ` Roger Quadros
  2014-10-29 11:36     ` Frans Klaver
@ 2014-10-30  1:47     ` Brian Norris
  2014-10-30  6:02       ` Frans Klaver
  1 sibling, 1 reply; 13+ messages in thread
From: Brian Norris @ 2014-10-30  1:47 UTC (permalink / raw)
  To: Roger Quadros; +Cc: Frans Klaver, Ezequiel García, linux-mtd, linux-omap

On Tue, Oct 28, 2014 at 11:46:57AM +0200, Roger Quadros wrote:
> On 10/27/2014 04:34 PM, Frans Klaver wrote:
> > Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename as
> > omap_elm"), I don't have any mtd devices present on my am335x. This
> > changes the link order of the omap_elm and omap2 objects, causing them
> > to probe in the wrong order.
> > 
> > To fix this, make elm_config defer probing until the omap_elm driver is
> > actually loaded.
> > 
> > Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
> 
> Acked-by: Roger Quadros <rogerq@ti.com>

Pushed to l2-mtd.git/for-3.18. Thanks!

While this might be considered a link-order bug from long ago, it's not
actually important until 3.18-rc1 where we changed the link order,
right? So it doesn't need to go to -stable?

Brian

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

* Re: [PATCH v2] mtd: omap: fix mtd devices not showing up
  2014-10-30  1:47     ` Brian Norris
@ 2014-10-30  6:02       ` Frans Klaver
  0 siblings, 0 replies; 13+ messages in thread
From: Frans Klaver @ 2014-10-30  6:02 UTC (permalink / raw)
  To: Brian Norris, Roger Quadros
  Cc: Frans Klaver, linux-omap, linux-mtd, Ezequiel García

On 30 October 2014 02:47:04 CET, Brian Norris <computersforpeace@gmail.com> wrote:
>On Tue, Oct 28, 2014 at 11:46:57AM +0200, Roger Quadros wrote:
>> On 10/27/2014 04:34 PM, Frans Klaver wrote:
>> > Since commit 6d178ef2fd5e ("mtd: nand: Move ELM driver and rename
>as
>> > omap_elm"), I don't have any mtd devices present on my am335x. This
>> > changes the link order of the omap_elm and omap2 objects, causing
>them
>> > to probe in the wrong order.
>> > 
>> > To fix this, make elm_config defer probing until the omap_elm
>driver is
>> > actually loaded.
>> > 
>> > Signed-off-by: Frans Klaver <frans.klaver@xsens.com>
>> 
>> Acked-by: Roger Quadros <rogerq@ti.com>
>
>Pushed to l2-mtd.git/for-3.18. Thanks!

Thanks 

>While this might be considered a link-order bug from long ago, it's not
>actually important until 3.18-rc1 where we changed the link order,
>right? So it doesn't need to go to -stable?

Correct. 

Thanks, 
Frans 



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

end of thread, other threads:[~2014-10-30  6:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-27 13:32 [PATCH typo-resend] mtd: omap: fix mtd devices not showing up Frans Klaver
2014-10-27 13:56 ` Roger Quadros
2014-10-27 14:01   ` Frans Klaver
2014-10-27 19:27   ` Ezequiel Garcia
2014-10-28  8:57     ` Frans Klaver
2014-10-28  8:58       ` Ezequiel Garcia
2014-10-27 14:34 ` [PATCH v2] " Frans Klaver
2014-10-28  9:46   ` Roger Quadros
2014-10-29 11:36     ` Frans Klaver
2014-10-29 13:33       ` Roger Quadros
2014-10-29 13:34         ` Ezequiel Garcia
2014-10-30  1:47     ` Brian Norris
2014-10-30  6:02       ` Frans Klaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).