* [PATCH net] net: macb: ensure interface is not suspended on at91rm9200
@ 2020-02-12 16:45 Alexandre Belloni
2020-02-12 17:41 ` Claudiu.Beznea
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Alexandre Belloni @ 2020-02-12 16:45 UTC (permalink / raw)
To: David S . Miller
Cc: Nicolas Ferre, Harini Katakam, Shubhrajyoti Datta, netdev,
linux-kernel, Alexandre Belloni
Because of autosuspend, at91ether_start is called with clocks disabled.
Ensure that pm_runtime doesn't suspend the interface as soon as it is
opened as there is no pm_runtime support is the other relevant parts of the
platform support for at91rm9200.
Fixes: d54f89af6cc4 ("net: macb: Add pm runtime support")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/net/ethernet/cadence/macb_main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 4508f0d150da..def94e91883a 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3790,6 +3790,10 @@ static int at91ether_open(struct net_device *dev)
u32 ctl;
int ret;
+ ret = pm_runtime_get_sync(&lp->pdev->dev);
+ if (ret < 0)
+ return ret;
+
/* Clear internal statistics */
ctl = macb_readl(lp, NCR);
macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT));
@@ -3854,7 +3858,7 @@ static int at91ether_close(struct net_device *dev)
q->rx_buffers, q->rx_buffers_dma);
q->rx_buffers = NULL;
- return 0;
+ return pm_runtime_put(&lp->pdev->dev);
}
/* Transmit packet */
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: macb: ensure interface is not suspended on at91rm9200
2020-02-12 16:45 [PATCH net] net: macb: ensure interface is not suspended on at91rm9200 Alexandre Belloni
@ 2020-02-12 17:41 ` Claudiu.Beznea
2020-02-13 8:45 ` Nicolas Ferre
2020-02-17 2:42 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Claudiu.Beznea @ 2020-02-12 17:41 UTC (permalink / raw)
To: alexandre.belloni, davem
Cc: Nicolas.Ferre, harini.katakam, shubhrajyoti.datta, netdev, linux-kernel
On 12.02.2020 18:45, Alexandre Belloni wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Because of autosuspend, at91ether_start is called with clocks disabled.
> Ensure that pm_runtime doesn't suspend the interface as soon as it is
> opened as there is no pm_runtime support is the other relevant parts of the
> platform support for at91rm9200.
>
> Fixes: d54f89af6cc4 ("net: macb: Add pm runtime support")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
> drivers/net/ethernet/cadence/macb_main.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 4508f0d150da..def94e91883a 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -3790,6 +3790,10 @@ static int at91ether_open(struct net_device *dev)
> u32 ctl;
> int ret;
>
> + ret = pm_runtime_get_sync(&lp->pdev->dev);
> + if (ret < 0)
> + return ret;
> +
> /* Clear internal statistics */
> ctl = macb_readl(lp, NCR);
> macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT));
> @@ -3854,7 +3858,7 @@ static int at91ether_close(struct net_device *dev)
> q->rx_buffers, q->rx_buffers_dma);
> q->rx_buffers = NULL;
>
> - return 0;
> + return pm_runtime_put(&lp->pdev->dev);
> }
>
> /* Transmit packet */
> --
> 2.24.1
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: macb: ensure interface is not suspended on at91rm9200
2020-02-12 16:45 [PATCH net] net: macb: ensure interface is not suspended on at91rm9200 Alexandre Belloni
2020-02-12 17:41 ` Claudiu.Beznea
@ 2020-02-13 8:45 ` Nicolas Ferre
2020-02-17 2:42 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2020-02-13 8:45 UTC (permalink / raw)
To: Alexandre Belloni, David S . Miller
Cc: Harini Katakam, Shubhrajyoti Datta, netdev, linux-kernel
On 12/02/2020 at 17:45, Alexandre Belloni wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Because of autosuspend, at91ether_start is called with clocks disabled.
> Ensure that pm_runtime doesn't suspend the interface as soon as it is
> opened as there is no pm_runtime support is the other relevant parts of the
> platform support for at91rm9200.
>
> Fixes: d54f89af6cc4 ("net: macb: Add pm runtime support")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
> drivers/net/ethernet/cadence/macb_main.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 4508f0d150da..def94e91883a 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -3790,6 +3790,10 @@ static int at91ether_open(struct net_device *dev)
> u32 ctl;
> int ret;
>
> + ret = pm_runtime_get_sync(&lp->pdev->dev);
> + if (ret < 0)
> + return ret;
> +
> /* Clear internal statistics */
> ctl = macb_readl(lp, NCR);
> macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT));
> @@ -3854,7 +3858,7 @@ static int at91ether_close(struct net_device *dev)
> q->rx_buffers, q->rx_buffers_dma);
> q->rx_buffers = NULL;
>
> - return 0;
> + return pm_runtime_put(&lp->pdev->dev);
> }
>
> /* Transmit packet */
> --
> 2.24.1
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: macb: ensure interface is not suspended on at91rm9200
2020-02-12 16:45 [PATCH net] net: macb: ensure interface is not suspended on at91rm9200 Alexandre Belloni
2020-02-12 17:41 ` Claudiu.Beznea
2020-02-13 8:45 ` Nicolas Ferre
@ 2020-02-17 2:42 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-02-17 2:42 UTC (permalink / raw)
To: alexandre.belloni
Cc: nicolas.ferre, harini.katakam, shubhrajyoti.datta, netdev, linux-kernel
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date: Wed, 12 Feb 2020 17:45:38 +0100
> Because of autosuspend, at91ether_start is called with clocks disabled.
> Ensure that pm_runtime doesn't suspend the interface as soon as it is
> opened as there is no pm_runtime support is the other relevant parts of the
> platform support for at91rm9200.
>
> Fixes: d54f89af6cc4 ("net: macb: Add pm runtime support")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-17 2:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12 16:45 [PATCH net] net: macb: ensure interface is not suspended on at91rm9200 Alexandre Belloni
2020-02-12 17:41 ` Claudiu.Beznea
2020-02-13 8:45 ` Nicolas Ferre
2020-02-17 2:42 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).