Re: [PATCH v6 1/8] drm: bridge: dw_mipi_dsi: add initial regmap infrastructure

From: Adrian Ratiu
Date: Fri Apr 17 2020 - 04:06:35 EST


On Thu, 16 Apr 2020, Enric Balletbo Serra <eballetbo@xxxxxxxxx> wrote:
Hi Adrian,
[snip]
>> >> +static void dw_mipi_dsi_get_hw_version(struct dw_mipi_dsi >> *dsi) +{ + regmap_read(dsi->regs, DSI_VERSION, >> &dsi->hw_version); + dsi->hw_version &= VERSION; + if >> (!dsi->hw_version) + dev_err(dsi->dev, "Failed >> to read DSI hw version register\n"); > > Is this an error that should be ignored? If you can't get the > HW version, probably, there is something wrong with your > hardware so, don't you need to return an error? >
After thinking a bit more about it, that error should be a warning.
I added it because in some cases (for eg. if the peripheral clock is disabled) the reads can return 0 which is obviously an invalid version and the bridge will error in the next step when not finding a layout.

If you'll error anyway, why wait? IIUC at this point the clock *must* be enabled, and if not, something is wrong with the driver, I don't see any advantage on delay the error. do you have a use case where this is called and peripheral clock disabled?

There should be no real use-case (maybe malfunctioning HW), and we could error out here to catch driver bugs ASAP, so I'll go this route then :)

Thank you, much appreciated!


So I'll make this a warning in v7 and explicitely mention that
reads version == 0 can be caused by a disabled pclk.


-- Enric

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel