diff mbox

mtd: gpmi: Remove noisy error message

Message ID 1415721691-14073-1-git-send-email-fabio.estevam@freescale.com
State Accepted
Commit 41bed23b78bf79ee68dbdff88c0461271a61f893
Headers show

Commit Message

Fabio Estevam Nov. 11, 2014, 4:01 p.m. UTC
mx28evk board has a socket for NAND flash that comes with no NAND flash
populated, and then we get this message on every boot:

[    1.657603] gpmi-nand 8000c000.gpmi-nand: driver registration failed: -19

,which is not very helpful, so get rid of this error message.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Richard Weinberger Nov. 11, 2014, 7:45 p.m. UTC | #1
On Tue, Nov 11, 2014 at 5:01 PM, Fabio Estevam
<fabio.estevam@freescale.com> wrote:
> mx28evk board has a socket for NAND flash that comes with no NAND flash

Wouldn't it make more sense to fix your board's devicetree/boardfile
to not load the gpmi driver?
Fabio Estevam Nov. 11, 2014, 7:57 p.m. UTC | #2
On Tue, Nov 11, 2014 at 5:45 PM, Richard Weinberger
<richard.weinberger@gmail.com> wrote:
> On Tue, Nov 11, 2014 at 5:01 PM, Fabio Estevam
> <fabio.estevam@freescale.com> wrote:
>> mx28evk board has a socket for NAND flash that comes with no NAND flash
>
> Wouldn't it make more sense to fix your board's devicetree/boardfile
> to not load the gpmi driver?

Then the people who populated the NAND flash in the socket would not
be able to use the NAND driver.

In my opinion, removing the error message would be better.
Richard Weinberger Nov. 11, 2014, 8 p.m. UTC | #3
Am 11.11.2014 um 20:57 schrieb Fabio Estevam:
> On Tue, Nov 11, 2014 at 5:45 PM, Richard Weinberger
> <richard.weinberger@gmail.com> wrote:
>> On Tue, Nov 11, 2014 at 5:01 PM, Fabio Estevam
>> <fabio.estevam@freescale.com> wrote:
>>> mx28evk board has a socket for NAND flash that comes with no NAND flash
>>
>> Wouldn't it make more sense to fix your board's devicetree/boardfile
>> to not load the gpmi driver?
> 
> Then the people who populated the NAND flash in the socket would not
> be able to use the NAND driver.

By fixing your devicetree/boardfile I meant fixing *your* devicetree/boardfile
for *your* board and not for all others. :-)

Thanks,
//richard
Fabio Estevam Nov. 11, 2014, 8:05 p.m. UTC | #4
On Tue, Nov 11, 2014 at 6:00 PM, Richard Weinberger <richard@nod.at> wrote:

> By fixing your devicetree/boardfile I meant fixing *your* devicetree/boardfile
> for *your* board and not for all others. :-)

It's not my board. It is a development board.

The board is arch/arm/boot/dts/imx28-evk.dts. This is a development
board that comes with a NAND socket.

It comes with no NAND flash populated. In this case on every boot we get the:

gpmi-nand 8000c000.gpmi-nand: driver registration failed: -19

,which isn't very helpful an this is what this patch tries to avoid.

I don't think we should change the dts.
Richard Weinberger Nov. 11, 2014, 8:10 p.m. UTC | #5
Am 11.11.2014 um 21:05 schrieb Fabio Estevam:
> On Tue, Nov 11, 2014 at 6:00 PM, Richard Weinberger <richard@nod.at> wrote:
> 
>> By fixing your devicetree/boardfile I meant fixing *your* devicetree/boardfile
>> for *your* board and not for all others. :-)
> 
> It's not my board. It is a development board.
> 
> The board is arch/arm/boot/dts/imx28-evk.dts. This is a development
> board that comes with a NAND socket.
> 
> It comes with no NAND flash populated. In this case on every boot we get the:
> 
> gpmi-nand 8000c000.gpmi-nand: driver registration failed: -19
> 
> ,which isn't very helpful an this is what this patch tries to avoid.
> 
> I don't think we should change the dts.

If the development board has by default no NAND, disable the driver
in imx28-evk.dts file.
You can leave a comment how to enable the driver if an user creates
a new board based on this eval board with a NAND.

Thanks,
//richard
Fabio Estevam Nov. 11, 2014, 8:16 p.m. UTC | #6
On Tue, Nov 11, 2014 at 6:10 PM, Richard Weinberger <richard@nod.at> wrote:

> If the development board has by default no NAND, disable the driver
> in imx28-evk.dts file.

Again, people are free to put a NAND into the socket and just use it.

> You can leave a comment how to enable the driver if an user creates
> a new board based on this eval board with a NAND.

No, I don't think this is a good idea.

BTW, I don't see any other nand driver that prints error on the probe
error path like this one.
Richard Weinberger Nov. 11, 2014, 8:22 p.m. UTC | #7
Am 11.11.2014 um 21:16 schrieb Fabio Estevam:
> On Tue, Nov 11, 2014 at 6:10 PM, Richard Weinberger <richard@nod.at> wrote:
> 
>> If the development board has by default no NAND, disable the driver
>> in imx28-evk.dts file.
> 
> Again, people are free to put a NAND into the socket and just use it.

If people change their board they are free to fix their dts. :)

>> You can leave a comment how to enable the driver if an user creates
>> a new board based on this eval board with a NAND.
> 
> No, I don't think this is a good idea.
> 
> BTW, I don't see any other nand driver that prints error on the probe
> error path like this one.

mpc5121_nfc.c for example does. Before every "goto error" in mpc5121_nfc_probe()
it prints an error message.

Thanks,
//richard
Fabio Estevam Nov. 11, 2014, 8:28 p.m. UTC | #8
On Tue, Nov 11, 2014 at 6:22 PM, Richard Weinberger <richard@nod.at> wrote:
> Am 11.11.2014 um 21:16 schrieb Fabio Estevam:
>> On Tue, Nov 11, 2014 at 6:10 PM, Richard Weinberger <richard@nod.at> wrote:
>>
>>> If the development board has by default no NAND, disable the driver
>>> in imx28-evk.dts file.
>>
>> Again, people are free to put a NAND into the socket and just use it.
>
> If people change their board they are free to fix their dts. :)

Then in this case I need to remove PCI dts nodes as well, because my
dev boards do not come with a PCI device attached to it from the
factory ;-)

At least PCI driver does not complain about it on every boot ;-)
Richard Weinberger Nov. 11, 2014, 8:31 p.m. UTC | #9
Am 11.11.2014 um 21:28 schrieb Fabio Estevam:
> On Tue, Nov 11, 2014 at 6:22 PM, Richard Weinberger <richard@nod.at> wrote:
>> Am 11.11.2014 um 21:16 schrieb Fabio Estevam:
>>> On Tue, Nov 11, 2014 at 6:10 PM, Richard Weinberger <richard@nod.at> wrote:
>>>
>>>> If the development board has by default no NAND, disable the driver
>>>> in imx28-evk.dts file.
>>>
>>> Again, people are free to put a NAND into the socket and just use it.
>>
>> If people change their board they are free to fix their dts. :)
> 
> Then in this case I need to remove PCI dts nodes as well, because my
> dev boards do not come with a PCI device attached to it from the
> factory ;-)
> 
> At least PCI driver does not complain about it on every boot ;-)

Maybe this is why nobody fixed the dts so far? ;-)

Thanks,
//richard
Brian Norris Nov. 26, 2014, 3:18 a.m. UTC | #10
On Tue, Nov 11, 2014 at 06:16:29PM -0200, Fabio Estevam wrote:
> BTW, I don't see any other nand driver that prints error on the probe
> error path like this one.

You're probably still going to see failure prints like

  nand: No NAND device found

in nand_scan_ident(), right? Or does driver probe fail earlier than that
somehow?

In general, I don't think you can expect non-discoverable hardware types
not to complain at all when you falsely declare them as "present" in the
device tree.

If this is really the only thing being printed though, I can apply the
patch. It's not worth too much more discussion anyway, IMO.

(BTW, one thing you have going for you; you *do* print something when
you successfully probe. The absence of such a message in your log tells
you almost as much as the failure print you're trying to remove does.)

Brian
Fabio Estevam Nov. 26, 2014, 11:44 a.m. UTC | #11
On Wed, Nov 26, 2014 at 1:18 AM, Brian Norris
<computersforpeace@gmail.com> wrote:
> On Tue, Nov 11, 2014 at 06:16:29PM -0200, Fabio Estevam wrote:
>> BTW, I don't see any other nand driver that prints error on the probe
>> error path like this one.
>
> You're probably still going to see failure prints like
>
>   nand: No NAND device found
>
> in nand_scan_ident(), right? Or does driver probe fail earlier than that
> somehow?

Yes, this is what I get currently:

[    1.645433] nand: No NAND device found
[    1.650372] gpmi-nand 8000c000.gpmi-nand: driver registration failed: -19

In my opinion the "No NAND device found" is enough.

Thanks
Richard Weinberger Nov. 26, 2014, 1:35 p.m. UTC | #12
Am 26.11.2014 um 12:44 schrieb Fabio Estevam:
> On Wed, Nov 26, 2014 at 1:18 AM, Brian Norris
> <computersforpeace@gmail.com> wrote:
>> On Tue, Nov 11, 2014 at 06:16:29PM -0200, Fabio Estevam wrote:
>>> BTW, I don't see any other nand driver that prints error on the probe
>>> error path like this one.
>>
>> You're probably still going to see failure prints like
>>
>>   nand: No NAND device found
>>
>> in nand_scan_ident(), right? Or does driver probe fail earlier than that
>> somehow?
> 
> Yes, this is what I get currently:
> 
> [    1.645433] nand: No NAND device found
> [    1.650372] gpmi-nand 8000c000.gpmi-nand: driver registration failed: -19
> 
> In my opinion the "No NAND device found" is enough.

If we remove the said log message and one really has a NAND installed which fails
to probe will he notice that and get the correct error code printed?
If yes, the removal won't hurt.

My point is that having non-existing hardware in the device does not make much sense.
Lot's of DTs are very generic and carry a lot of unused stuff with them,
but this is not a good practice as DTs should describe the actual hardware and not
all possible board variants.

Thanks,
//richard
Brian Norris Dec. 17, 2014, 12:27 a.m. UTC | #13
On Tue, Nov 11, 2014 at 02:01:31PM -0200, Fabio Estevam wrote:
> mx28evk board has a socket for NAND flash that comes with no NAND flash
> populated, and then we get this message on every boot:
> 
> [    1.657603] gpmi-nand 8000c000.gpmi-nand: driver registration failed: -19
> 
> ,which is not very helpful, so get rid of this error message.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Enough pointless discussion has been had. There's enough other context
for most errors, I think.

Applied to l2-mtd.git/next.

Brian
diff mbox

Patch

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 959cb9b..1ecf0e3 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1828,7 +1828,6 @@  static int gpmi_nand_probe(struct platform_device *pdev)
 exit_nfc_init:
 	release_resources(this);
 exit_acquire_resources:
-	dev_err(this->dev, "driver registration failed: %d\n", ret);
 
 	return ret;
 }