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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 29 Nov 2021 12:27:22 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Krishna Yarlagadda <kyarlagadda@...dia.com>,
        Philipp Zabel <p.zabel@...gutronix.de>
Cc:     Laxman Dewangan <ldewangan@...dia.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Sowjanya Komatineni <skomatineni@...dia.com>,
        "linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
        "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] spi: tegra210-quad: add acpi support

On Mon, Nov 29, 2021 at 09:09:30AM +0000, Krishna Yarlagadda wrote:

> > > +#ifdef CONFIG_ACPI
> > > +	if (ACPI_FAILURE(acpi_evaluate_object(ACPI_HANDLE(tqspi->dev),
> > > +					      "_RST", NULL, NULL)))
> > > +		dev_err(tqspi->dev, "failed to reset device\n"); #endif

> > What happens when this runs on a DT system?

> For a DT system reset handle would be present and this code will not run

This code is really unclearly structured, the early return doesn't
match the normal kernel style and the ifdefs aren't helping with
clarity.  Please restructure it so it's clear that *both* cases have
checks for the correct firmware type being present.

That said frankly I'd expect this handling of ACPI reset to be pushed
into the reset code, it's obviously not good to be open coding this in
drivers when this looks like it's completely generic to any ACPI object
so shouldn't be being open coded in individual driers especially with
the ifdefery.  Shouldn't the reset API be able to figure out that an
object with _RST has a reset control and provide access to it through
the reset API?

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ