Message ID | 26edfbe4-3c62-184b-b4cc-3d89f21ae394@alvarezp.org |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show |
Series | PROBLEM: [1/2] Marvell 88E8040 (sky2) stopped working | expand |
Hi Octavio, > PROBLEM: [1/2] Marvell 88E8040 (sky2) stopped working I'm sorry, that I've ruined your day. > Linux version 5.1.0-12511-g72cf0b07418a (alvarezp@alvarezp-samsung) What do I need to do/apply in order to get the same source tree with 72cf0b07418a hash? I'm not able to find that commit. > [ 1.447809] BUG: kernel NULL pointer dereference, address: > 0000000000000000 Interesting. > [ 1.448476] RIP: 0010:sky2_init_netdev+0x221/0x2e0 [sky2] gdb drivers/net/ethernet/marvell/sky2.o >>> l *sky2_init_netdev+0x221 0x828a is in sky2_init_netdev (./include/linux/etherdevice.h:124). 119 * By definition the broadcast address is also a multicast address. 120 */ 121 static inline bool is_multicast_ether_addr(const u8 *addr) 122 { 123 #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) 124 u32 a = *(const u32 *)addr; 125 #else 126 u16 a = *(const u16 *)addr; 127 #endif 128 #ifdef __BIG_ENDIAN > --- a/drivers/net/ethernet/marvell/sky2.c > +++ b/drivers/net/ethernet/marvell/sky2.c > @@ -4808,7 +4808,7 @@ static struct net_device *sky2_init_netdev(struct > sky2_hw *hw, unsigned port, > * 2) from internal registers set by bootloader > */ > iap = of_get_mac_address(hw->pdev->dev.of_node); > - if (iap) > + if (!IS_ERR(iap)) I'm just shooting out of the blue, as I don't have currently any rational explanation for that now, but could you please change the line above to following: if (!IS_ERR_OR_NULL(iap)) try again and report back? Thanks! -- ynezz
Hi, Petr, On 5/18/19 4:58 PM, Petr Štetiar wrote: >> Linux version 5.1.0-12511-g72cf0b07418a (alvarezp@alvarezp-samsung) > > What do I need to do/apply in order to get the same source tree with > 72cf0b07418a hash? I'm not able to find that commit. It's the most recent master, so my guess is just fetch it. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=72cf0b07418a9c8349aa9137194b1ccba6e54a9d commit 72cf0b07418a9c8349aa9137194b1ccba6e54a9d (HEAD -> master, origin/master, origin/HEAD) Merge: 0ef0fd351550 56df90b631fc Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Fri May 17 13:57:54 2019 -0700 Merge tag 'sound-fix-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound >> iap = of_get_mac_address(hw->pdev->dev.of_node); >> - if (iap) >> + if (!IS_ERR(iap)) > > I'm just shooting out of the blue, as I don't have currently any rational > explanation for that now, but could you please change the line above to > following: > > if (!IS_ERR_OR_NULL(iap)) It worked! Thank you for being so quick! $ sudo dmesg | grep sky2 [ 1.520831] sky2: driver version 1.30 [ 1.521197] sky2 0000:06:00.0: Yukon-2 FE+ chip revision 0 [ 1.522574] sky2 0000:06:00.0 eth0: addr e8:11:32:8d:86:49 [ 52.881706] sky2 0000:06:00.0 eth0: enabling interface [ 54.455020] sky2 0000:06:00.0 eth0: Link is up at 100 Mbps, full duplex, flow control rx [ 235.562317] sky2 0000:06:00.0 eth0: disabling interface [ 238.947494] sky2 0000:06:00.0 eth0: enabling interface
On 5/18/19 8:22 PM, Octavio Alvarez wrote: > Hi, Petr, > >> I'm just shooting out of the blue, as I don't have currently any rational >> explanation for that now, but could you please change the line above to >> following: >> >> if (!IS_ERR_OR_NULL(iap)) > > It worked! Thank you for being so quick! Hi, Petr, I just pulled from master and I don't see any updates for sky2.c. What would be the next step for getting the fix into the kernel? I have never written a patch for the kernel before and I really don't know if it would break anything else or disrupt any future work. Should I write a patch or should I let you do it? And if I do, should I just change IS_ERR for IS_ERR_OR_NULL for all the drivers on your original patch or just for the sky2? I will be glad to help. Thanks, Octavio.
Octavio Alvarez <octallk1@alvarezp.org> [2019-05-28 22:59:24]: Hi, > On 5/18/19 8:22 PM, Octavio Alvarez wrote: > > Hi, Petr, > > > > > I'm just shooting out of the blue, as I don't have currently any rational > > > explanation for that now, but could you please change the line above to > > > following: > > > > > > if (!IS_ERR_OR_NULL(iap)) > > > > It worked! Thank you for being so quick! > > I just pulled from master and I don't see any updates for sky2.c. it was fixed in commit 6a0a923dfa14 ("of_net: fix of_get_mac_address retval if compiled without CONFIG_OF"). -- ynezz
On 5/28/19 11:57 PM, Petr Štetiar wrote: >> I just pulled from master and I don't see any updates for sky2.c. > > it was fixed in commit 6a0a923dfa14 ("of_net: fix of_get_mac_address retval if > compiled without CONFIG_OF"). > Oh! I see it now. I appreciate the quick help. Thanks! Octavio.
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index 8b3495ee2b6e..c4050ec594f4 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c @@ -4808,7 +4808,7 @@ static struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port, * 2) from internal registers set by bootloader */ iap = of_get_mac_address(hw->pdev->dev.of_node); - if (iap) + if (!IS_ERR(iap)) memcpy(dev->dev_addr, iap, ETH_ALEN); else memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port * 8, If I use one commit before, my card works again, albeit with a problem that I reported separately, in which it does not work after returning from hibernation. I am reporting that one along with this one as problem 2/2. Last night I pulled from master and it still does not work, even after this commit: [2d2924af9688] net: ethernet: fix similar warning reported by kbuild test robot diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index 9d070cca3e9e..5adf307fbbfd 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c @@ -4805,7 +4805,7 @@ static struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port, */ iap = of_get_mac_address(hw->pdev->dev.of_node); if (!IS_ERR(iap)) - memcpy(dev->dev_addr, iap, ETH_ALEN); + ether_addr_copy(dev->dev_addr, iap); else memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port * 8,