2024-01-22 18:52:35

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH v2 13/33] mtd: rawnand: fsl_elbc: Let .probe retry if local bus is missing

If during probe fsl_lbc_ctrl_dev is NULL that might just be because the
fsl_lbc driver didn't bind yet. So return -EPROBE_DEFER in this case to
make the driver core retry probing later.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
drivers/mtd/nand/raw/fsl_elbc_nand.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c
index 1e3a80f06f33..df6a0d5c86bb 100644
--- a/drivers/mtd/nand/raw/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c
@@ -869,7 +869,8 @@ static int fsl_elbc_nand_probe(struct platform_device *pdev)
struct mtd_info *mtd;

if (!fsl_lbc_ctrl_dev || !fsl_lbc_ctrl_dev->regs)
- return -ENODEV;
+ return dev_err_probe(&pdev->dev, -EPROBE_DEFER, "lbc_ctrl_dev missing\n");
+
lbc = fsl_lbc_ctrl_dev->regs;
dev = fsl_lbc_ctrl_dev->dev;

--
2.43.0



2024-01-22 18:54:36

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH v2 13/33] mtd: rawnand: fsl_elbc: Let .probe retry if local bus is missing

Hi Uwe,

[email protected] wrote on Mon, 22 Jan 2024 19:07:08 +0100:

> If during probe fsl_lbc_ctrl_dev is NULL that might just be because the
> fsl_lbc driver didn't bind yet. So return -EPROBE_DEFER in this case to
> make the driver core retry probing later.

Despite the probable usefulness of this change, I don't see any
relationship with the current series. So unless there is a good reason
I might take this one through the nand tree.

Also, what about a Fixes/Cc: stable tag here?

> Signed-off-by: Uwe Kleine-König <[email protected]>

Thanks,
Miquèl

2024-01-22 21:29:26

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH v2 13/33] mtd: rawnand: fsl_elbc: Let .probe retry if local bus is missing

Hi Miqu?l,

On Mon, Jan 22, 2024 at 07:19:44PM +0100, Miquel Raynal wrote:
> [email protected] wrote on Mon, 22 Jan 2024 19:07:08 +0100:
>
> > If during probe fsl_lbc_ctrl_dev is NULL that might just be because the
> > fsl_lbc driver didn't bind yet. So return -EPROBE_DEFER in this case to
> > make the driver core retry probing later.
>
> Despite the probable usefulness of this change, I don't see any
> relationship with the current series. So unless there is a good reason
> I might take this one through the nand tree.

This patch indeed doesn't belong into this series. It just happend to be
in my tree and shuffled into the middle when I sorted the patches by
subsystem. Note I already sent it separately at

https://lore.kernel.org/linux-mtd/[email protected]

> Also, what about a Fixes/Cc: stable tag here?

The problem exists since

3ab8f2a2e701 ("P4080/eLBC: Make Freescale elbc interrupt common to elbc devices")

which was included in v2.6.37-rc1. At that time there was no
EPROBE_DEFER yet. I think I wouldn't add a Fixes: line for that, but
feel free to add one if you think there should be one.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |


Attachments:
(No filename) (1.34 kB)
signature.asc (499.00 B)
Download all attachments