diff mbox series

[net,1/3] net: phy: broadcom: Add power down exit reset state delay

Message ID 20210310204106.2767772-2-f.fainelli@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: phy: broadcom: Suspend fixes | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers warning 2 maintainers not CCed: bcm-kernel-feedback-list@broadcom.com linux@armlinux.org.uk
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit fail Errors and warnings before: 295 this patch: 7
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_allmodconfig_warn fail Errors and warnings before: 2291 this patch: 7
netdev/header_inline success Link

Commit Message

Florian Fainelli March 10, 2021, 8:41 p.m. UTC
Per the datasheet, when we clear the power down bit, the PHY remains in
an internal reset state for 40us and then resume normal operation.
Account for that delay to avoid any issues in the future if
genphy_resume() changes.

Fixes: fe26821fa614 ("net: phy: broadcom: Wire suspend/resume for BCM54810")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/broadcom.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

kernel test robot March 10, 2021, 10:36 p.m. UTC | #1
Hi Florian,

I love your patch! Yet something to improve:

[auto build test ERROR on net/master]

url:    https://github.com/0day-ci/linux/commits/Florian-Fainelli/net-phy-broadcom-Suspend-fixes/20210311-044539
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git 8515455720c52a0841bd1c9c5f457c9616900110
config: arm-randconfig-r023-20210310 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project cd9a69289c7825d54450cb6829fef2c8e0f1963a)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/06734c5da3238dad0a1ec26dac3d4698724157ac
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Florian-Fainelli/net-phy-broadcom-Suspend-fixes/20210311-044539
        git checkout 06734c5da3238dad0a1ec26dac3d4698724157ac
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/net/phy/broadcom.c:405:2: error: implicit declaration of function 'usleep' [-Werror,-Wimplicit-function-declaration]
           usleep(40);
           ^
   1 error generated.


vim +/usleep +405 drivers/net/phy/broadcom.c

   390	
   391	static int bcm54xx_resume(struct phy_device *phydev)
   392	{
   393		int ret;
   394	
   395		/* Writes to register other than BMCR would be ignored
   396		 * unless we clear the PDOWN bit first
   397		 */
   398		ret = genphy_resume(phydev);
   399		if (ret < 0)
   400			return ret;
   401	
   402		/* Upon exiting power down, the PHY remains in an internal reset state
   403		 * for 40us
   404		 */
 > 405		usleep(40);
   406	
   407		return bcm54xx_config_init(phydev);
   408	}
   409	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot March 10, 2021, 11:20 p.m. UTC | #2
Hi Florian,

I love your patch! Yet something to improve:

[auto build test ERROR on net/master]

url:    https://github.com/0day-ci/linux/commits/Florian-Fainelli/net-phy-broadcom-Suspend-fixes/20210311-044539
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git 8515455720c52a0841bd1c9c5f457c9616900110
config: nios2-randconfig-r006-20210309 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/06734c5da3238dad0a1ec26dac3d4698724157ac
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Florian-Fainelli/net-phy-broadcom-Suspend-fixes/20210311-044539
        git checkout 06734c5da3238dad0a1ec26dac3d4698724157ac
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/net/phy/broadcom.c: In function 'bcm54xx_resume':
>> drivers/net/phy/broadcom.c:405:2: error: implicit declaration of function 'usleep'; did you mean 'fsleep'? [-Werror=implicit-function-declaration]
     405 |  usleep(40);
         |  ^~~~~~
         |  fsleep
   cc1: some warnings being treated as errors


vim +405 drivers/net/phy/broadcom.c

   390	
   391	static int bcm54xx_resume(struct phy_device *phydev)
   392	{
   393		int ret;
   394	
   395		/* Writes to register other than BMCR would be ignored
   396		 * unless we clear the PDOWN bit first
   397		 */
   398		ret = genphy_resume(phydev);
   399		if (ret < 0)
   400			return ret;
   401	
   402		/* Upon exiting power down, the PHY remains in an internal reset state
   403		 * for 40us
   404		 */
 > 405		usleep(40);
   406	
   407		return bcm54xx_config_init(phydev);
   408	}
   409	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index fa0be591ae79..b8eb736fb456 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -399,6 +399,11 @@  static int bcm54xx_resume(struct phy_device *phydev)
 	if (ret < 0)
 		return ret;
 
+	/* Upon exiting power down, the PHY remains in an internal reset state
+	 * for 40us
+	 */
+	usleep(40);
+
 	return bcm54xx_config_init(phydev);
 }