aspeed-adc driver kpanic

Patrick Williams patrick at stwcx.xyz
Tue Oct 5 05:54:02 AEDT 2021


On Mon, Oct 04, 2021 at 01:34:54PM -0500, Patrick Williams wrote:
> Hi Billy,
> 
> When I run the latest linux-5.14 on QEMU with the Witherspoon config, I end up
> with a kernel panic[1].  I think there is an ordering problem in the aspeed_adc
> driver.  
> 
> See [2,3].  The code registers with devm a pointer to the prescaler object which
> is not yet created.  I think it is possible that the struct value contains
> uninitialized data as well.  Can you please take a look at this?
> 
> 1. https://gist.github.com/williamspatrick/4a0f0d1e0ca6f54816461a8df09e6cb8
> 2. https://github.com/openbmc/linux/blob/dev-5.14/drivers/iio/adc/aspeed_adc.c#L513
> 3. https://github.com/openbmc/linux/blob/dev-5.14/drivers/iio/adc/aspeed_adc.c#L527
> 
> -- 
> Patrick Williams

Also, Peter D. has been working on getting the QEMU code for the ADC working
and I cherry-picked his commits[1] and the code gets farther but crashes with
what seems like a memory alignment issue in a read at [2].  New gist of kernel panic
at [3].

1. https://github.com/peterdelevoryas/qemu/tree/adc-support-v2
2. https://github.com/openbmc/linux/blob/dev-5.14/drivers/iio/adc/aspeed_adc.c#L248
3. https://gist.github.com/williamspatrick/76827c99e2db8fce385b9a87f7526d33

-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20211004/90ee8754/attachment-0001.sig>


More information about the openbmc mailing list