diff mbox series

net: dsa: microchip: Support GMII on user ports

Message ID 20220823104343.6141-1-marex@denx.de (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: microchip: Support GMII on user ports | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 85 this patch: 85
netdev/cc_maintainers warning 7 maintainers not CCed: woojung.huh@microchip.com edumazet@google.com pabeni@redhat.com kuba@kernel.org vivien.didelot@gmail.com UNGLinuxDriver@microchip.com andrew@lunn.ch
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 85 this patch: 85
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Marek Vasut Aug. 23, 2022, 10:43 a.m. UTC
The user ports on KSZ879x indicate they are of GMII interface type instead
of INTERNAL interface type. Add GMII into the list of supported user port
interfaces to avoid the following failure on probe:

"
ksz8795-switch spi0.0 lan1 (uninitialized): validation of gmii with support 0000000,00000000,000062cf and advertisement 0000000,00000000,000062cf failed: -EINVAL
ksz8795-switch spi0.0 lan1 (uninitialized): failed to connect to PHY: -EINVAL
ksz8795-switch spi0.0 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
"

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Arun Ramadoss <arun.ramadoss@microchip.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Vladimir Oltean <olteanv@gmail.com>
---
 drivers/net/dsa/microchip/ksz_common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Vladimir Oltean Aug. 23, 2022, 6:13 p.m. UTC | #1
On Tue, Aug 23, 2022 at 12:43:43PM +0200, Marek Vasut wrote:
> The user ports on KSZ879x indicate they are of GMII interface type instead
> of INTERNAL interface type. Add GMII into the list of supported user port
> interfaces to avoid the following failure on probe:
> 
> "
> ksz8795-switch spi0.0 lan1 (uninitialized): validation of gmii with support 0000000,00000000,000062cf and advertisement 0000000,00000000,000062cf failed: -EINVAL
> ksz8795-switch spi0.0 lan1 (uninitialized): failed to connect to PHY: -EINVAL
> ksz8795-switch spi0.0 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
> "
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Arun Ramadoss <arun.ramadoss@microchip.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Vladimir Oltean <olteanv@gmail.com>

https://lore.kernel.org/netdev/20220818143250.2797111-1-vladimir.oltean@nxp.com/
Marek Vasut Aug. 23, 2022, 10:10 p.m. UTC | #2
On 8/23/22 20:13, Vladimir Oltean wrote:
> On Tue, Aug 23, 2022 at 12:43:43PM +0200, Marek Vasut wrote:
>> The user ports on KSZ879x indicate they are of GMII interface type instead
>> of INTERNAL interface type. Add GMII into the list of supported user port
>> interfaces to avoid the following failure on probe:
>>
>> "
>> ksz8795-switch spi0.0 lan1 (uninitialized): validation of gmii with support 0000000,00000000,000062cf and advertisement 0000000,00000000,000062cf failed: -EINVAL
>> ksz8795-switch spi0.0 lan1 (uninitialized): failed to connect to PHY: -EINVAL
>> ksz8795-switch spi0.0 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
>> "
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> ---
>> Cc: Arun Ramadoss <arun.ramadoss@microchip.com>
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: Florian Fainelli <f.fainelli@gmail.com>
>> Cc: Vladimir Oltean <olteanv@gmail.com>
> 
> https://lore.kernel.org/netdev/20220818143250.2797111-1-vladimir.oltean@nxp.com/

Nice, thanks !
diff mbox series

Patch

diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index ed7d137cba994..4a77c8b0e664e 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -803,9 +803,12 @@  static void ksz_phylink_get_caps(struct dsa_switch *ds, int port,
 	if (dev->info->supports_rgmii[port])
 		phy_interface_set_rgmii(config->supported_interfaces);
 
-	if (dev->info->internal_phy[port])
+	if (dev->info->internal_phy[port]) {
+		__set_bit(PHY_INTERFACE_MODE_GMII,
+			  config->supported_interfaces);
 		__set_bit(PHY_INTERFACE_MODE_INTERNAL,
 			  config->supported_interfaces);
+	}
 
 	if (dev->dev_ops->get_caps)
 		dev->dev_ops->get_caps(dev, port, config);