lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 15 Jun 2024 11:40:50 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Trevor Gamblin <tgamblin@...libre.com>
Cc: Nuno Sá <noname.nuno@...il.com>, Lars-Peter Clausen
 <lars@...afoo.de>, Michael Hennerich <Michael.Hennerich@...log.com>,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: adc: adi-axi-adc: improve probe() error messaging

On Fri, 14 Jun 2024 15:18:12 -0400
Trevor Gamblin <tgamblin@...libre.com> wrote:

> On 2024-06-14 5:11 a.m., Nuno Sá wrote:
> > On Thu, 2024-06-13 at 12:34 -0400, Trevor Gamblin wrote:  
> >> The current error handling for calls such as devm_clk_get_enabled() in
> >> the adi-axi-adc probe() function means that, if a property such as
> >> 'clocks' (for example) is not present in the devicetree when booting a
> >> kernel with the driver enabled, the resulting error message will be
> >> vague, e.g.:
> >>  
> >>> adi_axi_adc 44a00000.backend: probe with driver adi_axi_adc failed with error -2  
> >> Change the devm_clk_get_enabled(), devm_regmap_init_mmio(), and
> >> devm_iio_backend_register() checks to use dev_err_probe() with some
> >> context for easier debugging.
> >>
> >> After the fix:
> >>  
> >>> adi_axi_adc 44a00000.backend: error -ENOENT: failed to get clock
> >>> adi_axi_adc 44a00000.backend: probe with driver adi_axi_adc failed with error -2  
> >> Signed-off-by: Trevor Gamblin <tgamblin@...libre.com>
> >> ---  
> > Somehow feel that in these cases the error log should come from the functions we're
> > calling but bah... likely not going happen/change:
> >
> > Reviewed-by: Nuno Sa <nuno.sa@...log.com>
> >
> > (As a suggestion, you may do similar work in the axi-dac driver)  
> 
> Thanks. I'll send that early next week after a quick test on a board.
I tweaked the commit text to say
After the change:
as I don't want to see this picked up by a bot for stable.

As a side note, you could have taken the opportunity to add
struct device *dev = pdev->dev;
which I think would have reduced a few line lengths without loosing
readability.  Not important though and perhaps not even a good idea :)

Applied to the togreg branch of iio.git and pushed out as testing.
Note I plan to rebase my tree shortly to avoid some merge conflicts
that otherwise occur.  I'll probably do that before I push out
other than as testing.

Thanks,

Jonathan

> 
> Trevor
> 
> >
> > - Nuno Sá
> >
> >  
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ