Patch "net: macb: ensure the device is available before accessing GEMGXL control registers" has been added to the 4.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: macb: ensure the device is available before accessing GEMGXL control registers

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-macb-ensure-the-device-is-available-before-acces.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit bbb700848883e366f868049e9f6cf936ff3ef6c8
Author: Zong Li <zong.li@xxxxxxxxxx>
Date:   Sat May 22 17:16:11 2021 +0800

    net: macb: ensure the device is available before accessing GEMGXL control registers
    
    [ Upstream commit 5eff1461a6dec84f04fafa9128548bad51d96147 ]
    
    If runtime power menagement is enabled, the gigabit ethernet PLL would
    be disabled after macb_probe(). During this period of time, the system
    would hang up if we try to access GEMGXL control registers.
    
    We can't put runtime_pm_get/runtime_pm_put/ there due to the issue of
    sleep inside atomic section (7fa2955ff70ce453 ("sh_eth: Fix sleeping
    function called from invalid context"). Add netif_running checking to
    ensure the device is available before accessing GEMGXL device.
    
    Changed in v2:
     - Use netif_running instead of its own flag
    
    Signed-off-by: Zong Li <zong.li@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 78803e7de360..d1cdb8540e12 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1955,6 +1955,9 @@ static struct net_device_stats *gem_get_stats(struct macb *bp)
 	struct gem_stats *hwstat = &bp->hw_stats.gem;
 	struct net_device_stats *nstat = &bp->stats;
 
+	if (!netif_running(bp->dev))
+		return nstat;
+
 	gem_update_stats(bp);
 
 	nstat->rx_errors = (hwstat->rx_frame_check_sequence_errors +



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux