public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* smc91x and ifplugd
@ 2009-10-12 10:07 tike64
  0 siblings, 0 replies; only message in thread
From: tike64 @ 2009-10-12 10:07 UTC (permalink / raw)
  To: linux-kernel

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-12 10:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-12 10:07 smc91x and ifplugd tike64

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox