Hi "kwangdo.yi",

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.2]
[cannot apply to next-20190708]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/kwangdo-yi/phy-added-a-PHY_BUSY-state-into-phy_state_machine/20190709-075228
config: arm-omap2plus_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <l...@intel.com>

All error/warnings (new ones prefixed by >>):

   drivers/net/phy/phy.c: In function 'phy_state_to_str':
>> drivers/net/phy/phy.c:38:2: warning: enumeration value 'PHY_BUSY' not 
>> handled in switch [-Wswitch]
     switch (st) {
     ^~~~~~
   drivers/net/phy/phy.c: In function 'phy_state_machine':
>> drivers/net/phy/phy.c:925:4: error: 'phy' undeclared (first use in this 
>> function)
       phy->state = PHY_BUSY;
       ^~~
   drivers/net/phy/phy.c:925:4: note: each undeclared identifier is reported 
only once for each function it appears in

vim +/phy +925 drivers/net/phy/phy.c

   894  
   895  /**
   896   * phy_state_machine - Handle the state machine
   897   * @work: work_struct that describes the work to be done
   898   */
   899  void phy_state_machine(struct work_struct *work)
   900  {
   901          struct delayed_work *dwork = to_delayed_work(work);
   902          struct phy_device *phydev =
   903                          container_of(dwork, struct phy_device, 
state_queue);
   904          bool needs_aneg = false, do_suspend = false;
   905          enum phy_state old_state;
   906          int err = 0;
   907  
   908          mutex_lock(&phydev->lock);
   909  
   910          old_state = phydev->state;
   911  
   912          switch (phydev->state) {
   913          case PHY_DOWN:
   914          case PHY_READY:
   915                  break;
   916          case PHY_UP:
   917                  needs_aneg = true;
   918  
   919                  break;
   920          case PHY_NOLINK:
   921          case PHY_RUNNING:
   922          case PHY_BUSY:
   923                  err = phy_check_link_status(phydev);
   924                  if (err == -ETIMEDOUT && old_state == PHY_RUNNING) {
 > 925                          phy->state = PHY_BUSY;
   926                          err = 0;
   927  
   928                  }
   929                  break;
   930          case PHY_FORCING:
   931                  err = genphy_update_link(phydev);
   932                  if (err)
   933                          break;
   934  
   935                  if (phydev->link) {
   936                          phydev->state = PHY_RUNNING;
   937                          phy_link_up(phydev);
   938                  } else {
   939                          if (0 == phydev->link_timeout--)
   940                                  needs_aneg = true;
   941                          phy_link_down(phydev, false);
   942                  }
   943                  break;
   944          case PHY_HALTED:
   945                  if (phydev->link) {
   946                          phydev->link = 0;
   947                          phy_link_down(phydev, true);
   948                          do_suspend = true;
   949                  }
   950                  break;
   951          }
   952  
   953          mutex_unlock(&phydev->lock);
   954  
   955          if (needs_aneg)
   956                  err = phy_start_aneg(phydev);
   957          else if (do_suspend)
   958                  phy_suspend(phydev);
   959  
   960          if (err < 0)
   961                  phy_error(phydev);
   962  
   963          if (old_state != phydev->state) {
   964                  phydev_dbg(phydev, "PHY state change %s -> %s\n",
   965                             phy_state_to_str(old_state),
   966                             phy_state_to_str(phydev->state));
   967                  if (phydev->drv && phydev->drv->link_change_notify)
   968                          phydev->drv->link_change_notify(phydev);
   969          }
   970  
   971          /* Only re-schedule a PHY state machine change if we are 
polling the
   972           * PHY, if PHY_IGNORE_INTERRUPT is set, then we will be moving
   973           * between states from phy_mac_interrupt().
   974           *
   975           * In state PHY_HALTED the PHY gets suspended, so rescheduling 
the
   976           * state machine would be pointless and possibly error prone 
when
   977           * called from phy_disconnect() synchronously.
   978           */
   979          mutex_lock(&phydev->lock);
   980          if (phy_polling_mode(phydev) && phy_is_started(phydev))
   981                  phy_queue_state_machine(phydev, PHY_STATE_TIME);
   982          mutex_unlock(&phydev->lock);
   983  }
   984  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to