diff options
author | Shawn Guo <shawn.guo@freescale.com> | 2014-05-14 23:27:18 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@freescale.com> | 2014-05-16 04:19:13 -0400 |
commit | 5cd6333a44b48ff0b6e291c3ce88d6f9f288b7f9 (patch) | |
tree | b0f23b580b3b4109a2c96ead3e55f9bab158f6ea | |
parent | 1f8ccdc824b89cd3a090d70c73bdcf95d45a6c9c (diff) |
ENGR00313685-14 net: fec: check workaround for FEC_QUIRK_BUG_WAITMODE
For bug ERR006687 (ENET: Only the ENET wake-up interrupt request can
wake the system from Wait mode.), some board designs may choose to work
around it by routing the ENET interrupts to pad GPIO6, and the resulting
GPIO interrupt will wake the system from Wait mode.
The patch adds a check for such workaround and skip the
pm_qos_add_request(..., 0) call if the workaround is applied.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 165310209fe6..63b4244df33b 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -2188,6 +2188,23 @@ static int fec_enet_alloc_buffers(struct net_device *ndev) | |||
2188 | return 0; | 2188 | return 0; |
2189 | } | 2189 | } |
2190 | 2190 | ||
2191 | static inline bool fec_enet_irq_workaround(struct fec_enet_private *fep) | ||
2192 | { | ||
2193 | struct device_node *np = fep->pdev->dev.of_node; | ||
2194 | struct device_node *intr_node; | ||
2195 | |||
2196 | intr_node = of_parse_phandle(np, "interrupts-extended", 0); | ||
2197 | if (intr_node && !strcmp(intr_node->name, "gpio")) { | ||
2198 | /* | ||
2199 | * If the interrupt controller is a GPIO node, it must have | ||
2200 | * applied the workaround for WAIT mode bug. | ||
2201 | */ | ||
2202 | return true; | ||
2203 | } | ||
2204 | |||
2205 | return false; | ||
2206 | } | ||
2207 | |||
2191 | static int | 2208 | static int |
2192 | fec_enet_close(struct net_device *ndev); | 2209 | fec_enet_close(struct net_device *ndev); |
2193 | 2210 | ||
@@ -2229,7 +2246,8 @@ fec_enet_open(struct net_device *ndev) | |||
2229 | fec_reset_phy(fep->pdev); | 2246 | fec_reset_phy(fep->pdev); |
2230 | 2247 | ||
2231 | pm_runtime_get_sync(ndev->dev.parent); | 2248 | pm_runtime_get_sync(ndev->dev.parent); |
2232 | if (id_entry->driver_data & FEC_QUIRK_BUG_WAITMODE) | 2249 | if ((id_entry->driver_data & FEC_QUIRK_BUG_WAITMODE) && |
2250 | !fec_enet_irq_workaround(fep)) | ||
2233 | pm_qos_add_request(&ndev->pm_qos_req, | 2251 | pm_qos_add_request(&ndev->pm_qos_req, |
2234 | PM_QOS_CPU_DMA_LATENCY, | 2252 | PM_QOS_CPU_DMA_LATENCY, |
2235 | 0); | 2253 | 0); |