Re: [PATCH net-next 0/7] introduce read_poll_timeout

From: Dejin Zheng
Date: Fri Mar 20 2020 - 07:34:31 EST


On Thu, Mar 19, 2020 at 09:42:42AM -0700, Florian Fainelli wrote:
> Le 2020-03-19 Ã 09:39, Dejin Zheng a ÃcritÂ:
> > This patch sets is introduce read_poll_timeout macro, it is an extension
> > of readx_poll_timeout macro. the accessor function op just supports only
> > one parameter in the readx_poll_timeout macro, but this macro can
> > supports multiple variable parameters for it. so functions like
> > phy_read(struct phy_device *phydev, u32 regnum) and
> > phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum) can
> > use this poll timeout framework.
> >
> > the first patch introduce read_poll_timeout macro, and the second patch
> > redefined readx_poll_timeout macro by read_poll_timeout(), and the other
> > patches are examples using read_poll_timeout macro.
> >
> >
> > Dejin Zheng (7):
> > iopoll: introduce read_poll_timeout macro
> > iopoll: redefined readx_poll_timeout macro to simplify the code
> > net: phy: introduce phy_read_mmd_poll_timeout macro
> > net: phy: bcm84881: use phy_read_mmd_poll_timeout() to simplify the
> > code
> > net: phy: aquantia: use phy_read_mmd_poll_timeout() to simplify the
> > code
> > net: phy: introduce phy_read_poll_timeout macro
> > net: phy: use phy_read_poll_timeout() to simplify the code
> >
> > drivers/net/phy/aquantia_main.c | 16 +++++++--------
> > drivers/net/phy/bcm84881.c | 24 ++++++----------------
> > drivers/net/phy/phy_device.c | 18 ++++++-----------
> > include/linux/iopoll.h | 36 ++++++++++++++++++++++++++-------
> > include/linux/phy.h | 7 +++++++
> > 5 files changed, 55 insertions(+), 46 deletions(-)
>
> Your diffstat is positive, so what's the point of doing this? What
> problem are you trying to solve?

Since I added a lot of code comments(20 lines) in the first patch, so the
diffstat is positive.

this patches just want to fix an issue that people often implement polling
is wrong. we use a poll core which is known to be good by readx_poll_timeout
gives us. It can support multiple parameters after extending
readx_poll_timeout, so phy_read() and phy_read_mmd() also can use this
poll core.

> --
> Florian