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]
Message-ID: <3c204a61-86ae-1bbe-1442-527831f15232@gmail.com>
Date:   Thu, 17 Dec 2020 16:47:50 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Thierry Reding <thierry.reding@...il.com>
Cc:     Jonathan Hunter <jonathanh@...dia.com>,
        Peter Chen <Peter.Chen@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Alan Stern <stern@...land.harvard.edu>,
        Felipe Balbi <balbi@...nel.org>,
        Matt Merhar <mattmerhar@...tonmail.com>,
        Nicolas Chauvet <kwizart@...il.com>,
        Peter Geis <pgwipeout@...il.com>,
        Ion Agorria <ion@...rria.com>, linux-tegra@...r.kernel.org,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/8] usb: phy: tegra: Support waking up from a low
 power mode

17.12.2020 16:33, Thierry Reding пишет:
>> +	/* PHY won't resume if reset is asserted */
>> +	if (phy->wakeup_enabled)
>> +		goto chrg_cfg0;
>>  
>>  	val = readl_relaxed(base + USB_SUSP_CTRL);
>>  	val |= UTMIP_RESET;
>>  	writel_relaxed(val, base + USB_SUSP_CTRL);
>>  
>> +chrg_cfg0:
> I found this diffcult to read until I realized that it was basically
> just the equivalent of this:
> 
> 	if (!phy->wakeup_enabled) {
> 		val = readl_relaxed(base + USB_SUSP_CTRL);
> 		val |= UTMIP_RESET;
> 		writel_relaxed(val, base + USB_SUSP_CTRL);
> 	}
> 
>>  	val = readl_relaxed(base + UTMIP_BAT_CHRG_CFG0);
>>  	val |= UTMIP_PD_CHRG;
>>  	writel_relaxed(val, base + UTMIP_BAT_CHRG_CFG0);
>>  
>> +	if (phy->wakeup_enabled)
>> +		goto xcvr_cfg1;
>> +
>>  	val = readl_relaxed(base + UTMIP_XCVR_CFG0);
>>  	val |= UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN |
>>  	       UTMIP_FORCE_PDZI_POWERDOWN;
>>  	writel_relaxed(val, base + UTMIP_XCVR_CFG0);
>>  
>> +xcvr_cfg1:
> Similarly, I think this is more readable as:
> 
> 	if (!phy->wakeup_enabled) {
> 		val = readl_relaxed(base + UTMIP_XCVR_CFG0);
> 		val |= UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN |
> 		       UTMIP_FORCE_PDZI_POWERDOWN;
> 		writel_relaxed(val, base + UTMIP_XCVR_CFG0);
> 	}
> 
>>  	val = readl_relaxed(base + UTMIP_XCVR_CFG1);
>>  	val |= UTMIP_FORCE_PDDISC_POWERDOWN | UTMIP_FORCE_PDCHRP_POWERDOWN |
>>  	       UTMIP_FORCE_PDDR_POWERDOWN;
>>  	writel_relaxed(val, base + UTMIP_XCVR_CFG1);
>>  
>> +	if (phy->wakeup_enabled) {
> Which then also matches the style of this conditional here.

I'll change it in v3, thanks.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ