On Friday 31 August 2007 19:43:16 Michael Buesch wrote:
> > @@ -4164,7 +4166,6 @@ static void bcm43xx_chip_reset(struct wo
> >
> > mutex_lock(&(bcm)->mutex);
> > if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) {
> > - bcm43xx_periodic_tasks_delete(bcm);
>
> Look at the comment below. That also applies here.
> > Index: linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
> > +++ linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c
> > @@ -327,7 +327,6 @@ static ssize_t bcm43xx_attr_phymode_stor
> > goto out;
> > }
> >
> > - bcm43xx_periodic_tasks_delete(bcm);
>
> Well, this is tricky crap code.
> This breaks it.
> Look at the !err case below. We re-enable pwork there.
> We only do it for !err. So when core select failed, we
> end up without pwork, which is what we want.
> I think it might be OK to simply remove the delete _and_
> the setup below, as select core sets status to UNINIT when
> it failed. So pwork will bail out early (if you change your
> patch above as I suggested).
>
> > mutex_lock(&(bcm)->mutex);
> > err = bcm43xx_select_wireless_core(bcm, phytype);
> > if (!err)
> >
> >
I thought a bit more about this and it turns out that I was wrong.
The bcm43xx_periodic_tasks_delete() and _setup() calls must both stay there.
Otherwise you will create a race condition.
select_wireless_core() sets status to UNINIT,
pwork runs and cancels because of the UNINIT state,
select_wireless_core() sets the status to INITED again,
pwork does not rearm itself anymore.
So we must first disable pwork, then select the core,
then reenable it again.
Same goes for the chip_reset function.
--
Greetings Michael.
_______________________________________________
Bcm43xx-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev