netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Neil Armstrong <narmstrong@baylibre.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: Andrew Lunn <andrew@lunn.ch>, Guenter Roeck <linux@roeck-us.net>,
	vivien.didelot@savoirfairelinux.com,
	Fabian Frederick <fabf@skynet.be>,
	Pavel Nakonechny <pavel.nakonechny@skitlab.ru>,
	Joe Perches <joe@perches.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Frode Isaksen <fisaksen@baylibre.com>
Subject: Re: [PATCH 6/6] net: phy: Stop 'phy-state-machine' and 'phy_change' work on remove
Date: Tue, 27 Oct 2015 08:40:30 -0700	[thread overview]
Message-ID: <562F9AEE.5050708@gmail.com> (raw)
In-Reply-To: <562F8EF1.5090504@baylibre.com>

On 27/10/15 07:49, Neil Armstrong wrote:
> Avoids:
>  Unable to handle kernel NULL pointer dereference at virtual address 00000064
>  Workqueue: events_power_efficient phy_state_machine
>  PC is at phy_state_machine+0x28/0x480

Stripped down oops can sometimes be missing critical pieces of
information to help debug the problem, is there a reason why this is
being obfuscated?

You are supposed to stop the PHY state machine by calling
phy_disconnect() is it possible that this is missing?

> 
> Signed-off-by: Frode Isaksen <fisaksen@baylibre.com>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---
>  drivers/net/phy/phy_device.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 3833891..b5b6c1b 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1348,6 +1348,12 @@ static int phy_remove(struct device *dev)
>  	phydev->state = PHY_DOWN;
>  	mutex_unlock(&phydev->lock);
> 
> +	cancel_delayed_work_sync(&phydev->state_queue);
> +	flush_delayed_work(&phydev->state_queue);
> +
> +	cancel_work_sync(&phydev->phy_queue);
> +	flush_work(&phydev->phy_queue);
> +
>  	if (phydev->drv->remove)
>  		phydev->drv->remove(phydev);
>  	phydev->drv = NULL;
> 


-- 
Florian

  reply	other threads:[~2015-10-27 15:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 14:49 [PATCH 6/6] net: phy: Stop 'phy-state-machine' and 'phy_change' work on remove Neil Armstrong
2015-10-27 15:40 ` Florian Fainelli [this message]
     [not found]   ` <CAJ03sU_+nkvN1ZeqvWx56B7cb9GDCbpTFn6gJp2OmW-CKi7QFA@mail.gmail.com>
2015-10-27 15:57     ` Florian Fainelli
2015-10-27 21:20       ` Andrew Lunn
     [not found]         ` <CAJ03sU9Uw9SLXGpH9wqm+GWJtFZvcSuW=YCTZseSanpNeF_+Sw@mail.gmail.com>
2015-10-28 13:54           ` Neil Armstrong

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=562F9AEE.5050708@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=fabf@skynet.be \
    --cc=fisaksen@baylibre.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=narmstrong@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=pavel.nakonechny@skitlab.ru \
    --cc=vivien.didelot@savoirfairelinux.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).