diff mbox

[v2] mtd: omap: fix mtd devices not showing up

Message ID 1414420445-9020-1-git-send-email-frans.klaver@xsens.com
State Accepted
Commit 0c53b4e7e25a2635aef3006b990b6802cefc873f
Headers show

Commit Message

Frans Klaver Oct. 27, 2014, 2:34 p.m. UTC
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(-)

Comments

Roger Quadros Oct. 28, 2014, 9:46 a.m. UTC | #1
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
Frans Klaver Oct. 29, 2014, 11:36 a.m. UTC | #2
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
Roger Quadros Oct. 29, 2014, 1:33 p.m. UTC | #3
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
Ezequiel Garcia Oct. 29, 2014, 1:34 p.m. UTC | #4
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.
Brian Norris Oct. 30, 2014, 1:47 a.m. UTC | #5
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
Frans Klaver Oct. 30, 2014, 6:02 a.m. UTC | #6
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
diff mbox

Patch

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)) {