]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: macb: Properly handle phylink on at91rm9200
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 19 Feb 2020 14:15:51 +0000 (15:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:45:03 +0000 (16:45 +0100)
commitb1224761fce3899708f2715b5d32aa28ce6c3139
tree5d67b937de17a27eaaf00a321fd0a2f44c60c35a
parent453c6a72ccea37b4d5e14d9fb14a01888ddedfab
net: macb: Properly handle phylink on at91rm9200

[ Upstream commit ac2fcfa9fd26db67d7000677c05629c34cc94564 ]

at91ether_init was handling the phy mode and speed but since the switch to
phylink, the NCFGR register got overwritten by macb_mac_config(). The issue
is that the RM9200_RMII bit and the MACB_CLK_DIV32 field are cleared
but never restored as they conflict with the PAE, GBE and PCSSEL bits.

Add new capability to differentiate between EMAC and the other versions of
the IP and use it to set and avoid clearing the relevant bits.

Also, this fixes a NULL pointer dereference in macb_mac_link_up as the EMAC
doesn't use any rings/bufffers/queues.

Fixes: 7897b071ac3b ("net: macb: convert to phylink")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/cadence/macb.h
drivers/net/ethernet/cadence/macb_main.c