From a8ab50ee77d004e4a00cd6280cc1b542e57054b1 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Thu, 6 Mar 2014 00:09:30 +0000 Subject: sunxi: driver refresh for 3.13 - update gmac / mmc / usb / ahci drivers to follow mainline dev trees - add driver for spi - update clock support - update a31 support - move to new DT compats where appropriate - re-order patchqueue where needed - verified working a20 smp - move most DTSes off files/ - update defconfig Signed-off-by: Zoltan HERPAI git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39782 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../sunxi/patches-3.13/151-9-stmmac-fixup-9.patch | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 target/linux/sunxi/patches-3.13/151-9-stmmac-fixup-9.patch (limited to 'target/linux/sunxi/patches-3.13/151-9-stmmac-fixup-9.patch') diff --git a/target/linux/sunxi/patches-3.13/151-9-stmmac-fixup-9.patch b/target/linux/sunxi/patches-3.13/151-9-stmmac-fixup-9.patch new file mode 100644 index 0000000000..5d6e6a5bbf --- /dev/null +++ b/target/linux/sunxi/patches-3.13/151-9-stmmac-fixup-9.patch @@ -0,0 +1,73 @@ +From 89f7f2cfdd7ade55d5230501c21271690790ceda Mon Sep 17 00:00:00 2001 +From: Srinivas Kandagatla +Date: Thu, 16 Jan 2014 10:53:00 +0000 +Subject: [PATCH] net: stmmac: notify the PM core of a wakeup event. + +In PM_SUSPEND_FREEZE and WOL(Wakeup On Lan) case, when the driver gets a +wakeup event, either the driver or platform specific PM code should notify +the pm core about it, so that the system can wakeup from low power. + +In cases where there is no involvement of platform specific PM, it +becomes driver responsibility to notify the PM core to wakeup the +system. + +Without this WOL with PM_SUSPEND_FREEZE does not work on STi based SOCs. + +Signed-off-by: Srinivas Kandagatla +Acked-by: Giuseppe Cavallaro +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 + + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 +++++++-- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h +index 027f1dd..73709e9 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h +@@ -105,6 +105,7 @@ struct stmmac_priv { + unsigned int default_addend; + u32 adv_ts; + int use_riwt; ++ int irq_wake; + spinlock_t ptp_lock; + }; + +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +index df7d8d6..cddcf76 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +@@ -2320,6 +2320,9 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id) + struct net_device *dev = (struct net_device *)dev_id; + struct stmmac_priv *priv = netdev_priv(dev); + ++ if (priv->irq_wake) ++ pm_wakeup_event(priv->device, 0); ++ + if (unlikely(!dev)) { + pr_err("%s: invalid dev pointer\n", __func__); + return IRQ_NONE; +@@ -2861,9 +2864,10 @@ int stmmac_suspend(struct net_device *ndev) + stmmac_clear_descriptors(priv); + + /* Enable Power down mode by programming the PMT regs */ +- if (device_may_wakeup(priv->device)) ++ if (device_may_wakeup(priv->device)) { + priv->hw->mac->pmt(priv->ioaddr, priv->wolopts); +- else { ++ priv->irq_wake = 1; ++ } else { + stmmac_set_mac(priv->ioaddr, false); + pinctrl_pm_select_sleep_state(priv->device); + /* Disable clock in case of PWM is off */ +@@ -2891,6 +2895,7 @@ int stmmac_resume(struct net_device *ndev) + */ + if (device_may_wakeup(priv->device)) { + priv->hw->mac->pmt(priv->ioaddr, 0); ++ priv->irq_wake = 0; + } else { + pinctrl_pm_select_default_state(priv->device); + /* enable the clk prevously disabled */ +-- +1.8.5.5 + -- cgit v1.2.3