[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20c29fee-691d-686c-83c9-578e15b5ba79@gmail.com>
Date: Tue, 27 Feb 2024 19:27:53 +0300
From: Sergei Shtylyov <sergei.shtylyov@...il.com>
To: Théo Lebrun <theo.lebrun@...tlin.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, Roger Quadros <rogerq@...nel.org>,
Peter Chen <peter.chen@...nel.org>, Pawel Laszczak <pawell@...ence.com>,
Nishanth Menon <nm@...com>, Vignesh Raghavendra <vigneshr@...com>,
Tero Kristo <kristo@...nel.org>
Cc: Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Grégory Clement <gregory.clement@...tlin.com>,
Kevin Hilman <khilman@...nel.org>, Alan Stern <stern@...land.harvard.edu>,
linux-usb@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3 4/8] usb: cdns3-ti: support reset-on-resume behavior
On 2/26/24 1:13 PM, Théo Lebrun wrote:
[...]
>>> Add match data support, with one boolean to indicate whether the
>>> hardware resets after a system-wide suspend. If hardware resets, we
>>> force execute ->runtime_resume() at system-wide resume to run the
>>> hardware init sequence.
>>>
>>> No compatible exploits this functionality, just yet.
>>>
>>> Signed-off-by: Théo Lebrun <theo.lebrun@...tlin.com>
>>> ---
>>> drivers/usb/cdns3/cdns3-ti.c | 27 +++++++++++++++++++++++++++
>>> 1 file changed, 27 insertions(+)
>>>
>>> diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c
>>> index 4c8a557e6a6f..f76327566798 100644
>>> --- a/drivers/usb/cdns3/cdns3-ti.c
>>> +++ b/drivers/usb/cdns3/cdns3-ti.c
>> [...]
>>> @@ -220,8 +226,29 @@ static int cdns_ti_runtime_resume(struct device *dev)
>>> return 0;
>>> }
>>>
>>> +static int cdns_ti_suspend(struct device *dev)
>>> +{
>>> + struct cdns_ti *data = dev_get_drvdata(dev);
>>> +
>>> + if (data->match_data && data->match_data->reset_on_resume)
>>> + return pm_runtime_force_suspend(dev);
>>> + else
>>
>> Pointless *else* after *return*...
>
> Indeed! I used this form explicitely as it reads nicely: "if reset on
> reset, force suspend, else do nothing". It also prevents the error of
s/reset/resume/ here? :-)
> adding behavior below the if-statement without seeing that it won't
> apply to both cases.
You were going to add stuff after the final *return*? :-)
> If you do believe it would make the code better I'll happily change it
> for the next revision, I do not mind.
Up to you!
This is a thing people usually complain about when reviewing
patches. I even thought checkpatch.pl would complain as well, but it
didn't... :-)
> Thanks for the review Sergey!
>
> --
> Théo Lebrun, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
MBR, Swrgey
Powered by blists - more mailing lists