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: Wed, 29 May 2024 18:17:00 +0200
From: Johan Hovold <johan@...nel.org>
To: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
Cc: Johan Hovold <johan+linaro@...nel.org>, Lee Jones <lee@...nel.org>,
	Mark Brown <broonie@...nel.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Bjorn Andersson <andersson@...nel.org>,
	Konrad Dybcio <konrad.dybcio@...aro.org>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Liam Girdwood <lgirdwood@...il.com>,
	Das Srinagesh <quic_gurus@...cinc.com>,
	Satya Priya <quic_c_skakit@...cinc.com>,
	Stephen Boyd <swboyd@...omium.org>, linux-arm-msm@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-gpio@...r.kernel.org
Subject: Re: [PATCH 03/13] mfd: pm8008: deassert reset on probe

On Thu, May 09, 2024 at 11:31:22AM +0200, Johan Hovold wrote:
> On Wed, May 08, 2024 at 05:12:51PM +0100, Bryan O'Donoghue wrote:
> > On 06/05/2024 16:08, Johan Hovold wrote:
> > > Request and deassert any (optional) reset gpio during probe in case it
> > > has been left asserted by the boot firmware.
> > > 
> > > Note the reset line is not asserted to avoid reverting to the default
> > > I2C address in case the firmware has configured an alternate address.
> 
> > > @@ -169,6 +171,10 @@ static int pm8008_probe(struct i2c_client *client)
> > >   
> > >   	i2c_set_clientdata(client, regmap);
> > >   
> > > +	reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
> > > +	if (IS_ERR(reset))
> > > +		return PTR_ERR(reset);
> > > +
> > >   	if (of_property_read_bool(dev->of_node, "interrupt-controller")) {
> > >   		rc = devm_regmap_add_irq_chip(dev, regmap, client->irq,
> > >   				IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data);
> > 
> > So not resetting is fine and I understand you want to retain the address 
> > given by the firmware, I think that's the right thing to do.
> 
> > In addition to adding a small delay suggested by Andy - a few 
> > microseconds pick a number, I think you should verify the chip is out of 
> > reset as we would do with many other i2c devices.
> 
> > In this case, suggest reading REVID_PERPH_TYPE @ 0x104 and 
> > REVID_PERPH_SUBTYPE @ 0x105
> > 
> > REVID_PERPH_TYPE @ 0x104 == 0x51 (PMIC)
> > REVID_PERPH_SUBYTE @ 0x105 == 0x2C (PM8008)
> 
> I'll consider it for v2.

I decided to not add any revid checks for v2 as it's not strictly
needed. This is something can be added later when/if needed.

The irqchip registration will also fail if there's no from reply from
this address.

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ