mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-09 02:43:53 +08:00
[Description]
Fix panic issue for mtk_pending_work. If without this patch, mtk_pending_work might cause kernel panic in the one gmac system. [Release-log] N/A Change-Id: I9d2940645d738bac8888a7410c5ad5586a08c115 Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6814894
This commit is contained in:
parent
61d10e148f
commit
50ca63a5b9
@ -3505,10 +3505,15 @@ static void mtk_pending_work(struct work_struct *work)
|
|||||||
mtk_prepare_reset_fe(eth);
|
mtk_prepare_reset_fe(eth);
|
||||||
|
|
||||||
/* Trigger Wifi SER reset */
|
/* Trigger Wifi SER reset */
|
||||||
call_netdevice_notifiers(MTK_FE_START_RESET, eth->netdev[0]);
|
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
rtnl_unlock();
|
if (!eth->netdev[i])
|
||||||
wait_for_completion_timeout(&wait_ser_done, 5000);
|
continue;
|
||||||
rtnl_lock();
|
call_netdevice_notifiers(MTK_FE_START_RESET, eth->netdev[i]);
|
||||||
|
rtnl_unlock();
|
||||||
|
wait_for_completion_timeout(&wait_ser_done, 5000);
|
||||||
|
rtnl_lock();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
while (test_and_set_bit_lock(MTK_RESETTING, ð->state))
|
while (test_and_set_bit_lock(MTK_RESETTING, ð->state))
|
||||||
cpu_relax();
|
cpu_relax();
|
||||||
@ -3535,7 +3540,7 @@ static void mtk_pending_work(struct work_struct *work)
|
|||||||
|
|
||||||
/* restart DMA and enable IRQs */
|
/* restart DMA and enable IRQs */
|
||||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
if (!test_bit(i, &restart))
|
if (!test_bit(i, &restart) || !eth->netdev[i])
|
||||||
continue;
|
continue;
|
||||||
err = mtk_open(eth->netdev[i]);
|
err = mtk_open(eth->netdev[i]);
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -3559,6 +3564,8 @@ static void mtk_pending_work(struct work_struct *work)
|
|||||||
|
|
||||||
/* Power up sgmii */
|
/* Power up sgmii */
|
||||||
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
|
if (!eth->netdev[i])
|
||||||
|
continue;
|
||||||
mac = netdev_priv(eth->netdev[i]);
|
mac = netdev_priv(eth->netdev[i]);
|
||||||
phy_node = of_parse_phandle(mac->of_node, "phy-handle", 0);
|
phy_node = of_parse_phandle(mac->of_node, "phy-handle", 0);
|
||||||
if (!phy_node && eth->xgmii->regmap_sgmii[i]) {
|
if (!phy_node && eth->xgmii->regmap_sgmii[i]) {
|
||||||
@ -3567,11 +3574,15 @@ static void mtk_pending_work(struct work_struct *work)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
call_netdevice_notifiers(MTK_FE_RESET_NAT_DONE, eth->netdev[0]);
|
for (i = 0; i < MTK_MAC_COUNT; i++) {
|
||||||
pr_info("[%s] HNAT reset done !\n", __func__);
|
if (!eth->netdev[i])
|
||||||
|
continue;
|
||||||
call_netdevice_notifiers(MTK_FE_RESET_DONE, eth->netdev[0]);
|
call_netdevice_notifiers(MTK_FE_RESET_NAT_DONE, eth->netdev[i]);
|
||||||
pr_info("[%s] WiFi SER reset done !\n", __func__);
|
pr_info("[%s] HNAT reset done !\n", __func__);
|
||||||
|
call_netdevice_notifiers(MTK_FE_RESET_DONE, eth->netdev[i]);
|
||||||
|
pr_info("[%s] WiFi SER reset done !\n", __func__);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
atomic_dec(&reset_lock);
|
atomic_dec(&reset_lock);
|
||||||
if (atomic_read(&force) > 0)
|
if (atomic_read(&force) > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user