Re: [PATCH v5 15/17] ARM: dts: microchip: sama7d65: add cells for temperature calibration

[email protected] Tue, 04 Aug 2026 12:51:10 +0000
Newsgroups org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Low] The 'nvmem-cells' and 'nvmem-cell-names' properties are used in the ADC device tree node, but are not declared in the corresponding DT bindings schema.

Pre-existing issues:
- [High] The ADC driver silently swallows -EPROBE_DEFER from nvmem_cell_get(), which permanently drops the temperature sensor if the OTP controller probes later.
--

--- Patch [15]: [PATCH v5 15/17] ARM: dts: microchip: sama7d65: add cells for temperature calibration ---
commit a38951f8e3bfd0ea10718735901a2bfeb4e17375
Author: Varshini Rajendran <[email protected]>

ARM: dts: microchip: sama7d65: add cells for temperature calibration

This commit adds nvmem-cells for temperature calibration data to the ADC
node. The calibration data is read from the OTPC.

> diff --git a/arch/arm/boot/dts/microchip/sama7d65.dtsi b/arch/arm/boot/dts/microchip/sama7d65.dtsi
> index aac2e22d96cb3..a8b18ad0ef7f7 100644
> --- a/arch/arm/boot/dts/microchip/sama7d65.dtsi
> +++ b/arch/arm/boot/dts/microchip/sama7d65.dtsi
> @@ -318,6 +318,8 @@ adc: adc@e1000000 {
>  			dmas = <&dma0 AT91_XDMAC_DT_PERID(0)>;
>  			dma-names = "rx";
>  			#io-channel-cells = <1>;
> +			nvmem-cells = <&temperature_calib>;
> +			nvmem-cell-names = "temperature_calib";

[Severity: Low]
Will this cause dtbs_check validation to fail? The atmel,sama5d2-adc.yaml
bindings specify additionalProperties: false, but the nvmem-cells and
nvmem-cell-names properties don't appear to be declared in the schema.

[Severity: High]
This is a pre-existing issue, but won't adding these DT properties expose a
probe deferral race condition in the driver?

If the OTP controller hasn't probed yet, nvmem_cell_get() returns
-EPROBE_DEFER, which gets swallowed here in at91_adc_probe():

drivers/iio/adc/at91-sama5d2_adc.c:at91_adc_probe() {
    ...
    ret = at91_adc_temp_sensor_init(st, &pdev->dev);
    /* Don't register temperature channel if initialization failed. */
    if (ret)
        num_channels = st->soc_info.platform->max_channels - 1;
    else
        num_channels = st->soc_info.platform->max_channels;
    ...
}

Does this mean the temperature sensor hardware feature could be permanently
lost on boots where the ADC driver is probed before the OTP controller?

>  			atmel,min-sample-rate-hz = <200000>;
>  			atmel,max-sample-rate-hz = <20000000>;
>  			atmel,trigger-edge-type = <IRQ_TYPE_EDGE_RISING>;

-- 
Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=15