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]
Message-ID: <6ce928fa-0a86-4d9a-8f48-d31d95fc1978@kernel.org>
Date: Thu, 18 Apr 2024 19:07:01 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Paul Geurts <paul_geurts@...e.nl>, mgreer@...malcreek.com,
 linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] NFC: trf7970a: disable all regulators on removal

On 18/04/2024 10:12, Paul Geurts wrote:
> On 17-04-2024 15:15, Krzysztof Kozlowski wrote:
>> On 16/04/2024 22:28, Paul Geurts wrote:
>>> During module probe, regulator 'vin' and 'vdd-io' are used and enabled,
>>> but the vdd-io regulator overwrites the 'vin' regulator pointer. During
>>> remove, only the vdd-io is disabled, as the vin regulator pointer is not
>>> available anymore. When regulator_put() is called during resource
>>> cleanup a kernel warning is given, as the regulator is still enabled.
>>>
>>> Store the two regulators in separate pointers and disable both the
>>> regulators on module remove.
>>>
>>> Fixes: 49d22c70aaf0 ("NFC: trf7970a: Add device tree option of 1.8 Volt IO voltage")
>>>
>>> Signed-off-by: Paul Geurts <paul_geurts@...e.nl>
>> No blank lines between tags. Please look at existing commits (git log).
> Will fix this, thanks
>>
>>> ---
>>>  drivers/nfc/trf7970a.c | 42 +++++++++++++++++++++++-------------------
>>>  1 file changed, 23 insertions(+), 19 deletions(-)
>>>
>>> diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
>>> index 7eb17f46a815..9e1a34e23af2 100644
>>> --- a/drivers/nfc/trf7970a.c
>>> +++ b/drivers/nfc/trf7970a.c
>>> @@ -424,7 +424,8 @@ struct trf7970a {
>>>  	enum trf7970a_state		state;
>>>  	struct device			*dev;
>>>  	struct spi_device		*spi;
>>> -	struct regulator		*regulator;
>>> +	struct regulator		*vin_regulator;
>>> +	struct regulator		*vddio_regulator;
>>>  	struct nfc_digital_dev		*ddev;
>>>  	u32				quirks;
>>>  	bool				is_initiator;
>>> @@ -1883,7 +1884,7 @@ static int trf7970a_power_up(struct trf7970a *trf)
>>>  	if (trf->state != TRF7970A_ST_PWR_OFF)
>>>  		return 0;
>>>  
>>> -	ret = regulator_enable(trf->regulator);
>>> +	ret = regulator_enable(trf->vin_regulator);
>> That does not look like equivalent code. Previously this was vddio, right?
> This is part of the original issue created by 49d22c70aaf0. This should be the VIN regulator, but the pointer override made it VDD-IO.

True, good point.


Reviewed-by: Krzysztof Kozlowski <krzk@...nel.org>

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ