Re: [PATCH]: Third (final?) release of Sun Neptune driver

Ingo Oeser
2007-10-05T16:50:00Z

Ingo Oeser schrieb:
> > +static void niu_init_xif(struct niu *);
> > +
> > +static int link_status_10g(struct niu *np, int *link_up_p)
> > +{
> > + unsigned long flags;
> > + int err, link_up;
> > +
> > + if (np->link_config.loopback_mode != LOOPBACK_DISABLED)
> > + return -EINVAL;
> > +
> > + link_up = 0;
> > +
> > + spin_lock_irqsave(&np->lock, flags);
> > +
> > + err = mdio_read(np, np->phy_addr, BCM8704_PMA_PMD_DEV_ADDR,
> > + BCM8704_PMD_RCV_SIGDET);
> > + if (err < 0)
> > + return err;
>
> missing spin_unlock_irqsave()?

I mean spin_unlock_irqrestore()

> > + if (!(err & PMD_RCV_SIGDET_GLOBAL))
> > + goto out;
> > +
> > + err = mdio_read(np, np->phy_addr, BCM8704_PCS_DEV_ADDR,
> > + BCM8704_PCS_10G_R_STATUS);
> > + if (err < 0)
> > + return err;
> missing spin_unlock_irqsave()?

I mean spin_unlock_irqrestore()

> > + if (!(err & PCS_10G_R_STATUS_BLK_LOCK))
> > + goto out;
> > +
> > + err = mdio_read(np, np->phy_addr, BCM8704_PHYXS_DEV_ADDR,
> > + BCM8704_PHYXS_XGXS_LANE_STAT);
> > + if (err < 0)
> > + return err;
> > +
> > + if (err != (PHYXS_XGXS_LANE_STAT_ALINGED |
> > + PHYXS_XGXS_LANE_STAT_MAGIC |
> > + PHYXS_XGXS_LANE_STAT_LANE3 |
> > + PHYXS_XGXS_LANE_STAT_LANE2 |
> > + PHYXS_XGXS_LANE_STAT_LANE1 |
> > + PHYXS_XGXS_LANE_STAT_LANE0))
> > + goto out;
> > +
> > + link_up = 1;
> > + np->link_config.active_speed = SPEED_10000;
> > + np->link_config.active_duplex = DUPLEX_FULL;
> > +
> > +out:
> > + spin_unlock_irqrestore(&np->lock, flags);
> > +
> > + *link_up_p = link_up;
> > + return 0;
> > +}
>

Ok, enough for today...

Best Regards

Ingo Oeser