[an error occurred while processing this directive]
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: <8658c955-eaac-f6d9-5fbe-b8542e26d141@gmail.com>
Date:   Thu, 2 Jan 2020 16:51:26 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Andrew Lunn <andrew@...n.ch>, David Miller <davem@...emloft.net>
Cc:     netdev <netdev@...r.kernel.org>, fugang.duan@....com,
        Chris Healy <Chris.Healy@....aero>
Subject: Re: [PATCH net] net: freescale: fec: Fix ethtool -d runtime PM

On 1/2/20 6:33 AM, Andrew Lunn wrote:
> In order to dump the FECs registers the clocks have to be ticking,
> otherwise a data abort occurs.  Add calls to runtime PM so they are
> enabled and later disabled.
> 
> Fixes: e8fcfcd5684a ("net: fec: optimize the clock management to save power")
> Reported-by: Chris Healy <Chris.Healy@....aero>
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 05c1899f6628..9294027e9d90 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -2199,8 +2199,14 @@ static void fec_enet_get_regs(struct net_device *ndev,
>  {
>  	struct fec_enet_private *fep = netdev_priv(ndev);
>  	u32 __iomem *theregs = (u32 __iomem *)fep->hwp;
> +	struct device *dev = &fep->pdev->dev;
>  	u32 *buf = (u32 *)regbuf;
>  	u32 i, off;
> +	int ret;
> +
> +	ret = pm_runtime_get_sync(dev);
> +	if (ret < 0)
> +		return;
>  
>  	regs->version = fec_enet_register_version;
>  
> @@ -2216,6 +2222,9 @@ static void fec_enet_get_regs(struct net_device *ndev,
>  		off >>= 2;
>  		buf[off] = readl(&theregs[off]);
>  	}
> +
> +	pm_runtime_mark_last_busy(dev);
> +	pm_runtime_put_autosuspend(dev);

This fix will do, but you should consider implementing
ethtool_ops::begin and ethtool_ops::end to make sure this condition is
resolved for all ethtool operations.

For instance the following looks possibly problematic too:
fec_enet_set_coalesce -> fec_enet_itr_coal_set
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ