lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a27e7d3f-b576-a90a-00c4-c5ce7bf69592@microchip.com>
Date:   Thu, 13 Feb 2020 09:45:35 +0100
From:   Nicolas Ferre <nicolas.ferre@...rochip.com>
To:     Alexandre Belloni <alexandre.belloni@...tlin.com>,
        "David S . Miller" <davem@...emloft.net>
CC:     Harini Katakam <harini.katakam@...inx.com>,
        Shubhrajyoti Datta <shubhrajyoti.datta@...inx.com>,
        <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net] net: macb: ensure interface is not suspended on
 at91rm9200

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@...tlin.com>

Acked-by: Nicolas Ferre <nicolas.ferre@...rochip.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ