Message ID | 20210212205721.2406849-2-f.fainelli@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: phy: broadcom: APD improvements | expand |
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-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | success | CCed 3 of 3 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 12 this patch: 12 |
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, 28 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 12 this patch: 12 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
On Fri, Feb 12, 2021 at 12:57:19PM -0800, Florian Fainelli wrote: > We have a number of unused flags defined today and since we are scarce > on space and may need to introduce new flags in the future remove and > shift every existing flag down into a contiguous assignment. No > functional change. > > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> > --- Good to see some of the dev_flags go away! PHY_BCM_FLAGS_MODE_1000BX is used just from broadcom.c, therefore it can probably be moved to a structure in phydev->priv. PHY_BRCM_STD_IBND_DISABLE, PHY_BRCM_EXT_IBND_RX_ENABLE and PHY_BRCM_EXT_IBND_TX_ENABLE are set by drivers/net/ethernet/broadcom/tg3.c but not used anywhere.
On 2/12/2021 4:56 PM, Vladimir Oltean wrote: > On Fri, Feb 12, 2021 at 12:57:19PM -0800, Florian Fainelli wrote: >> We have a number of unused flags defined today and since we are scarce >> on space and may need to introduce new flags in the future remove and >> shift every existing flag down into a contiguous assignment. No >> functional change. >> >> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> >> --- > > Good to see some of the dev_flags go away! > > PHY_BCM_FLAGS_MODE_1000BX is used just from broadcom.c, therefore it can > probably be moved to a structure in phydev->priv. The next step would be to move it to a private flag, indeed. > > PHY_BRCM_STD_IBND_DISABLE, PHY_BRCM_EXT_IBND_RX_ENABLE and > PHY_BRCM_EXT_IBND_TX_ENABLE are set by > drivers/net/ethernet/broadcom/tg3.c but not used anywhere. That's right, tg3 drove a lot of the Broadcom PHY driver changes back then, I also would like to rework the way we pass flags towards PHY drivers because tg3 is basically the only driver doing it right, where it checks the PHY ID first, then sets appropriate flags during connect.
On Fri, Feb 12, 2021 at 05:08:58PM -0800, Florian Fainelli wrote: > That's right, tg3 drove a lot of the Broadcom PHY driver changes back > then, I also would like to rework the way we pass flags towards PHY > drivers because tg3 is basically the only driver doing it right, where > it checks the PHY ID first, then sets appropriate flags during connect. Why does the tg3 controller need to enable the auto power down PHY feature in the first place and the PHY driver can't just enable it by itself?
On 2/12/2021 5:14 PM, Vladimir Oltean wrote: > On Fri, Feb 12, 2021 at 05:08:58PM -0800, Florian Fainelli wrote: >> That's right, tg3 drove a lot of the Broadcom PHY driver changes back >> then, I also would like to rework the way we pass flags towards PHY >> drivers because tg3 is basically the only driver doing it right, where >> it checks the PHY ID first, then sets appropriate flags during connect. > > Why does the tg3 controller need to enable the auto power down PHY > feature in the first place and the PHY driver can't just enable it by > itself? > That would be a question for Michael if he remembers those details from 12 years ago.
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index de9430d55c90..da7bf9dfef5b 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h @@ -61,19 +61,15 @@ #define PHY_BCM_OUI_5 0x03625e00 #define PHY_BCM_OUI_6 0xae025000 -#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001 -#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002 -#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010 -#define PHY_BCM_FLAGS_INTF_XAUI 0x00000020 -#define PHY_BRCM_WIRESPEED_ENABLE 0x00000100 -#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000200 -#define PHY_BRCM_RX_REFCLK_UNUSED 0x00000400 -#define PHY_BRCM_STD_IBND_DISABLE 0x00000800 -#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00001000 -#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000 -#define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000 -#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000 -#define PHY_BRCM_EN_MASTER_MODE 0x00010000 +#define PHY_BCM_FLAGS_MODE_1000BX 0x00000001 +#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000002 +#define PHY_BRCM_RX_REFCLK_UNUSED 0x00000004 +#define PHY_BRCM_STD_IBND_DISABLE 0x00000008 +#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00000010 +#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00000020 +#define PHY_BRCM_CLEAR_RGMII_MODE 0x00000040 +#define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00000080 +#define PHY_BRCM_EN_MASTER_MODE 0x00000100 /* Broadcom BCM7xxx specific workarounds */ #define PHY_BRCM_7XXX_REV(x) (((x) >> 8) & 0xff)
We have a number of unused flags defined today and since we are scarce on space and may need to introduce new flags in the future remove and shift every existing flag down into a contiguous assignment. No functional change. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> --- include/linux/brcmphy.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-)