From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: "Nori, Sekhar" <nsekhar@ti.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: phylib: kernel oops on resume with 2.6.33-rc4
Date: Sun, 17 Jan 2010 01:37:03 +0300 [thread overview]
Message-ID: <20100116223703.GA13190@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB59301E2025EA9@dbde02.ent.ti.com>
Hello,
On Sat, Jan 16, 2010 at 09:38:34PM +0530, Nori, Sekhar wrote:
> Hello all,
>
> I am hitting a kernel oops when resuming from suspend-to-RAM on 2.6.33-rc4
> kernel.
>
> The MAC is TI DaVinci EMAC and PHY is SMSC LAN8710. However, I also hit the
> issue even when using generic PHY driver (CONFIG_SMSC_PHY turned off).
>
> On reverting commit 541cd3e "phylib: Fix deadlock on resume" which was
> introduced in 2.6.33-rc4, the issue doesn't come about. So far, I haven't
> figured out how this particular commit is causing the oops. Full oops report
> is attached. Appreciate any help in debugging this.
It seems phy_start_machine() needlessly reinitialized work
struct. This is OK for ucc_geth and gianfar driver because
these drivers do not detach PHYs on suspend, but TI davinci
does. :-/
Can you try the patch down below?
Thanks!
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index b0e9f9c..0295097 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -410,7 +410,6 @@ EXPORT_SYMBOL(phy_start_aneg);
static void phy_change(struct work_struct *work);
-static void phy_state_machine(struct work_struct *work);
/**
* phy_start_machine - start PHY state machine tracking
@@ -430,7 +429,6 @@ void phy_start_machine(struct phy_device *phydev,
{
phydev->adjust_state = handler;
- INIT_DELAYED_WORK(&phydev->state_queue, phy_state_machine);
schedule_delayed_work(&phydev->state_queue, HZ);
}
@@ -761,7 +759,7 @@ EXPORT_SYMBOL(phy_start);
* phy_state_machine - Handle the state machine
* @work: work_struct that describes the work to be done
*/
-static void phy_state_machine(struct work_struct *work)
+void phy_state_machine(struct work_struct *work)
{
struct delayed_work *dwork = to_delayed_work(work);
struct phy_device *phydev =
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 8212b2b..adbc0fd 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -177,6 +177,7 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
dev->state = PHY_DOWN;
mutex_init(&dev->lock);
+ INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine);
return dev;
}
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 7968def..6a7eb40 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -485,6 +485,7 @@ void phy_driver_unregister(struct phy_driver *drv);
int phy_driver_register(struct phy_driver *new_driver);
void phy_prepare_link(struct phy_device *phydev,
void (*adjust_link)(struct net_device *));
+void phy_state_machine(struct work_struct *work);
void phy_start_machine(struct phy_device *phydev,
void (*handler)(struct net_device *));
void phy_stop_machine(struct phy_device *phydev);
next prev parent reply other threads:[~2010-01-16 22:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-16 16:08 phylib: kernel oops on resume with 2.6.33-rc4 Nori, Sekhar
2010-01-16 22:37 ` Anton Vorontsov [this message]
2010-01-17 8:28 ` Nori, Sekhar
2010-01-18 3:23 ` David Miller
2010-01-18 15:37 ` [PATCH] phylib: Move workqueue initialization to a proper place Anton Vorontsov
2010-01-19 10:00 ` David Miller
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=20100116223703.GA13190@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=netdev@vger.kernel.org \
--cc=nsekhar@ti.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).