Message ID | 20231108094303.46303-2-acelan.kao@canonical.com |
---|---|
State | Superseded |
Headers | show |
Series | [v5,1/2] spi: Replace -ENOTSUPP with -EOPNOTSUPP in op checking | expand |
> From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com> > > When the software reset command isn't supported, we now stop reporting > the warning message to avoid unnecessary warnings and potential > confusion. > > Reviewed-by: Dhruva Gole <d-gole@ti.com> > Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com> Reviewed-by: Michael Walle <michael@walle.cc>
On Wed, Nov 08, 2023 at 05:43:03PM +0800, AceLan Kao wrote: > From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com> > > When the software reset command isn't supported, we now stop reporting > the warning message to avoid unnecessary warnings and potential confusion. > > Reviewed-by: Dhruva Gole <d-gole@ti.com> > Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com> Looks good to me, only small comment is that perhaps you want to update the kernel-doc of spi_mem_exec_op() to mention that if the driver/controller does not support reset it can return -EOPNOTSUPP. In any case, Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Hi Michael, On Thu, Nov 09 2023, Michael Walle wrote: >> From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com> >> When the software reset command isn't supported, we now stop reporting >> the warning message to avoid unnecessary warnings and potential confusion. >> Reviewed-by: Dhruva Gole <d-gole@ti.com> >> Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com> > > Reviewed-by: Michael Walle <michael@walle.cc> I did read your reply on the previous thread but did not find time to write a response. I do largely see sense in your argument though I have not fully thought it through yet. But I think it would be great if we can ask the controller "do we need to do a soft reset?" Anyway, I do not think this patch does anything too bad so it is probably not worth debating so much on. So for now, Acked-by: Pratyush Yadav <pratyush@kernel.org>
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 1b0c6770c14e..75bac1418045 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3252,7 +3252,8 @@ static void spi_nor_soft_reset(struct spi_nor *nor) ret = spi_mem_exec_op(nor->spimem, &op); if (ret) { - dev_warn(nor->dev, "Software reset failed: %d\n", ret); + if (ret != -EOPNOTSUPP) + dev_warn(nor->dev, "Software reset failed: %d\n", ret); return; }