All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Vladimir Zapolskiy <vz@mleia.com>, Andrew Lunn <andrew@lunn.ch>,
	Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	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 19:18:28 +0300	[thread overview]
Message-ID: <af16fdce-427e-c73a-b18b-d5f1c1d9d624@cogentembedded.com> (raw)
In-Reply-To: <2bf96562-e402-d797-31e6-ba7e262e5637@mleia.com>

Hello!

On 05/24/2018 05:11 PM, 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.

  You don't say that *not* grabbing the spinlock is safe... 

>>> Another note is that the change implicitly replaces phy_start_aneg()
>>> with a newer phy_restart_aneg().

   Hm, perphaps this could be a material for a separate patch? 

>>>
>>> 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.

   The -stable fixes can vary from version to version, IIUC. You could be
asked to backport your patch if Greg KH (or somebody else from the -stable
kernel maintainers) gets in trouble backporting your patch. 

> Hopefully Sergei as the driver maintainer can verify the fixes on

   I'm *not* a maintainer, just a humble reviewer! :-)

> older kernels and suggest the right kernel versions for backporting.

   This would be asking too much from me, I'm afraid...
   Still, Dave, could you please give me a couple of days to spend on
this series?

> --
> With best wishes,
> Vladimir

MBR, Sergei

  reply	other threads:[~2018-05-24 16:18 UTC|newest]

Thread overview: 40+ 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
2018-05-24 14:11       ` Vladimir Zapolskiy
2018-05-24 16:18       ` Sergei Shtylyov [this message]
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-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-24 14:06       ` Vladimir Zapolskiy
2018-05-26 19:50   ` Sergei Shtylyov
2018-05-28  9:51     ` Vladimir Zapolskiy
2018-05-28  9:51       ` Vladimir Zapolskiy
2018-06-03 15:42       ` Sergei Shtylyov
2018-06-04 11:07         ` Vladimir Zapolskiy
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-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=af16fdce-427e-c73a-b18b-d5f1c1d9d624@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vladimir_zapolskiy@mentor.com \
    --cc=vz@mleia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.