[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200426203150.GA1183480@lunn.ch>
Date: Sun, 26 Apr 2020 22:31:50 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Michal Kubecek <mkubecek@...e.cz>
Cc: netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Chris Healy <cphealy@...il.com>
Subject: Re: [PATCH net-next v1 1/9] net: phy: Add cable test support to
state machine
> > + mutex_lock(&phydev->lock);
> > + if (phydev->state < PHY_UP ||
> > + phydev->state >= PHY_CABLETEST) {
> > + NL_SET_ERR_MSG(extack,
> > + "PHY not configured. Try setting interface up");
> > + err = -EBUSY;
> > + goto out;
> > + }
>
> If I read the code correctly, this check would also catch an attempt to
> start a cable test while the test is already in progress in which case
> the error message would be rather misleading. I'm not sure what would be
> more appropriate in such case: we can return -EBUSY (with more fitting
> error message) but we could also silently ignore the request and let the
> client wait for the notification from the test which is already in
> progress.
Hi Michal
Yes, i will change this to handle phydev->state == PHY_CABLETEST
differently. Probably -EBUSY is the simplest.
Thanks
Andrew
Powered by blists - more mailing lists