From: tike64@gmail.com
To: linux-kernel@vger.kernel.org
Subject: smc91x and ifplugd
Date: Mon, 12 Oct 2009 13:07:49 +0300 [thread overview]
Message-ID: <4AD2FFF5.4050809@gmail.com> (raw)
Dear linux-kernel,
I am configuring 2.6.27 kernel for a custom board with a LAN91C111 ethernet
interface. I tried to manage the interface with ifplugd but encountered a
problem: ifplugd works fine through the first event pair, one up event and then
one down event but after that the interface is dead. In the driver the carrier
presence knowledge is updated in the interrupt handler and, when the interface
is brought down, no one updates the fact that the carrier is again present.
I implemented a driver specific 'get_link' method and commented out
smc_phy_powerdown call from smc_close. Now it seems to work for me but I'm far
too uneducated to judge if this is a correct way to solve the problem or if
there is going to be ill effects.
Right away I can say that I'm not comfortable with not powering down the PHY on
interface down. Secondly this seems not to solve the problem if there is an
external PHY, right?
So, what might be the correct solution which would have a chance to be included
into the mainline?
My get_link implementation:
static u32 smc_get_link(struct net_device *dev)
{
struct smc_local *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base;
u32 carrier;
static u32 old = -1;
spin_lock_irq(&lp->lock);
SMC_SELECT_BANK(lp, 0);
carrier = mii_link_ok(&lp->mii);
SMC_SELECT_BANK(lp, 2);
spin_unlock_irq(&lp->lock);
if (old != carrier) {
old = carrier;
printk("smc_get_link carrier: %i\n", carrier); }
return carrier;
}
--
Timo
reply other threads:[~2009-10-12 10:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4AD2FFF5.4050809@gmail.com \
--to=tike64@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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