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

Uwe Kleine-König posted 33 patches 9 months, 3 weeks ago
There is a newer version of this series
[PATCH v2 13/33] mtd: rawnand: fsl_elbc: Let .probe retry if local bus is missing
Posted by Uwe Kleine-König 9 months, 3 weeks ago
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 <u.kleine-koenig@pengutronix.de>
---
 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

Re: [PATCH v2 13/33] mtd: rawnand: fsl_elbc: Let .probe retry if local bus is missing
Posted by Miquel Raynal 9 months, 3 weeks ago
Hi Uwe,

u.kleine-koenig@pengutronix.de 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 <u.kleine-koenig@pengutronix.de>

Thanks,
Miquèl
Re: [PATCH v2 13/33] mtd: rawnand: fsl_elbc: Let .probe retry if local bus is missing
Posted by Uwe Kleine-König 9 months, 3 weeks ago
Hi Miquèl,

On Mon, Jan 22, 2024 at 07:19:44PM +0100, Miquel Raynal wrote:
> u.kleine-koenig@pengutronix.de 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/20240115141245.3415035-2-u.kleine-koenig@pengutronix.de

> 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/ |