netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vz@mleia.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 1/6] ravb: remove custom .nway_reset from ethtool ops
Date: Thu, 24 May 2018 17:11:07 +0300	[thread overview]
Message-ID: <2bf96562-e402-d797-31e6-ba7e262e5637@mleia.com> (raw)
In-Reply-To: <20180524132202.GE24557@lunn.ch>

On 05/24/2018 04:22 PM, Andrew Lunn wrote:
> On Thu, May 24, 2018 at 02:11:53PM +0300, Vladimir Zapolskiy wrote:
>> The change fixes a sleep in atomic context issue, which can be
>> always triggered by running 'ethtool -r' command, because
>> phy_start_aneg() protects phydev fields by a mutex.
>>
>> Another note is that the change implicitly replaces phy_start_aneg()
>> with a newer phy_restart_aneg().
>>
>> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
>> ---
>>  drivers/net/ethernet/renesas/ravb_main.c | 17 +----------------
>>  1 file changed, 1 insertion(+), 16 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
>> index 68f122140966..4a043eb0e2aa 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>> @@ -1150,21 +1150,6 @@ static int ravb_set_link_ksettings(struct net_device *ndev,
>>  	return error;
>>  }
>>  
>> -static int ravb_nway_reset(struct net_device *ndev)
>> -{
>> -	struct ravb_private *priv = netdev_priv(ndev);
>> -	int error = -ENODEV;
>> -	unsigned long flags;
>> -
>> -	if (ndev->phydev) {
>> -		spin_lock_irqsave(&priv->lock, flags);
>> -		error = phy_start_aneg(ndev->phydev);
>> -		spin_unlock_irqrestore(&priv->lock, flags);
>> -	}
> 
> Eck! phylib assumes thread context and takes a mutex while calling
> into the PHY driver.
> 
> It would be good to add some sort of fixes: tag. Maybe for the commit
> that added the generic nway_reset? That would at least cover some
> stable kernels.
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> 

Hi Andrew, thank you for review.

generally it makes sense to add Fixes tag, but as I said in
the commit message the problem is present before reused phy_ethtool_*()
functions were added to the kernel, so some kind of juggling with
the proper kernel version would be required in assumption that
the fixes are backported as an unmodified changes.

Hopefully Sergei as the driver maintainer can verify the fixes on
older kernels and suggest the right kernel versions for backporting.

  reply	other threads:[~2018-05-24 14:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 11:11 [PATCH 0/6] ravb/sh_eth: fix sleep in atomic by reusing shared ethtool handlers Vladimir Zapolskiy
2018-05-24 11:11 ` [PATCH 1/6] ravb: remove custom .nway_reset from ethtool ops Vladimir Zapolskiy
2018-05-24 13:22   ` Andrew Lunn
2018-05-24 14:11     ` Vladimir Zapolskiy [this message]
2018-05-24 16:18       ` Sergei Shtylyov
2018-05-24 16:44         ` Andrew Lunn
2018-05-24 17:01           ` Sergei Shtylyov
2018-05-24 17:23             ` Andrew Lunn
2018-05-25  6:05             ` Vladimir Zapolskiy
2018-05-26 16:56   ` Sergei Shtylyov
2018-05-26 16:56   ` Sergei Shtylyov
2018-05-26 17:51   ` Sergei Shtylyov
2018-05-24 11:11 ` [PATCH 2/6] ravb: remove custom .get_link_ksettings " Vladimir Zapolskiy
2018-05-26 17:07   ` Sergei Shtylyov
2018-05-24 11:11 ` [PATCH 3/6] ravb: remove custom .set_link_ksettings " Vladimir Zapolskiy
2018-05-24 13:29   ` Andrew Lunn
2018-05-24 14:06     ` Vladimir Zapolskiy
2018-05-26 19:50   ` Sergei Shtylyov
2018-05-28  9:51     ` Vladimir Zapolskiy
2018-06-03 15:42       ` Sergei Shtylyov
2018-06-04 11:07         ` Vladimir Zapolskiy
2018-06-06 20:34           ` Sergei Shtylyov
2018-05-24 11:11 ` [PATCH 4/6] sh_eth: remove custom .nway_reset " Vladimir Zapolskiy
2018-05-24 13:30   ` Andrew Lunn
2018-05-26 18:46   ` Sergei Shtylyov
2018-05-26 19:22     ` Sergei Shtylyov
2018-05-24 11:14 ` [PATCH 5/6] sh_eth: remove custom .get_link_ksettings " Vladimir Zapolskiy
2018-05-24 11:14   ` [PATCH 6/6] sh_eth: remove custom .set_link_ksettings " Vladimir Zapolskiy
2018-05-24 13:31   ` [PATCH 5/6] sh_eth: remove custom .get_link_ksettings " Andrew Lunn
2018-05-24 16:40 ` [PATCH 0/6] ravb/sh_eth: fix sleep in atomic by reusing shared ethtool handlers Sergei Shtylyov
2018-05-24 17:24   ` Sergei Shtylyov
2018-05-25  6:25     ` Vladimir Zapolskiy
2018-05-26 17:31       ` Sergei Shtylyov
2018-05-25  8:11 ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2bf96562-e402-d797-31e6-ba7e262e5637@mleia.com \
    --to=vz@mleia.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=vladimir_zapolskiy@mentor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).