On 30.06.2024 12:29 PM, Akhil P Oommen wrote: > On Tue, Jun 25, 2024 at 08:28:09PM +0200, Konrad Dybcio wrote: >> There is no need to reinvent the wheel for simple read-match-set logic. >> >> Make speedbin discovery and assignment generation independent. >> >> This implicitly removes the bogus 0x80 / BIT(7) speed bin on A5xx, >> which has no representation in hardware whatshowever. >> >> Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx> >> --- [...] >> + >> + /* Traverse the known speedbins */ >> + for (int i = 0; info->speedbins[i].fuse != SHRT_MAX; i++) { >> + if (info->speedbins[i].fuse == fuse) { >> + supp_hw = BIT(info->speedbins[i].speedbin); >> + return devm_pm_opp_set_supported_hw(dev, &supp_hw, 1); > > Can we do this if supp_hw property is not present in opp table? No, but this is also the case without this patchset (a.k.a. no change in behavior). We shouldn't add code complexity to support that case, as having speedbin data in the driver and not the dt means the DT is incomplete, which is not a case we should care about I can however try and add a clearer error path that would perhaps not crash the kernel in this situation.. in a separate patchset Konrad