The if-clause is correct as bge works differently from other drivers.
Details of the issue can be found from this CR:
http://bugs.opensolaris.org/view_bug.do?bug_id=6794654
CR 6794654: bge relies on software interrupt to refresh buffers
while setting MTU
Regards
Crisson
On Fri, 2009-01-16 at 11:18 +0800, Crisson Hu wrote:
> Sure, this piece of code has some problem. The logic should be just as
> your description, the IF-condition is entered because there was an error
> when setting the MTU. It should be:
> if (err != 0)
>
> Your concern of the interrupts is resolved by calling of
> bge_wake_factotum(bgep). It will trigger an soft interrupt and call
> bge_chip_factotum(caddr_t arg), then call bge_intr_enable(bgep) to
> re-enable interrupts.
>
>
> Regards,
> Crisson
> On Thu, 2009-01-15 at 15:14 -0500, Girish Moodalbail wrote:
> > Folks,
> >
> > While scrutinizing heavily on the 'bge' driver, I found the following issue.
> >
> > In bge_main2.c in bge_m_setprop() @ line 827 for MAC_PROP_MTU case we
> > have.
> >
> > Case: MAC_PROP_MTU:
> >
> > .............
> > .............
> > err = mac_maxsdu_update(bgep->mh, maxsdu);
> > if (err == 0) { <---------------- (a)
> > bgep->bge_dma_error = B_TRUE;
> > bgep->manual_reset = B_TRUE;
> > bge_chip_stop(bgep, B_TRUE); <---- TRUE here means fault
> > ------ (b)
> > bge_wake_factotum(bgep);
> > err = 0; <-------------- (c)
> > }
> > break;
> >
> > (a) and (c) are quite not right. At (a) it should be if (err !=0).
> >
> > The issue is (b) calls bge_chip_stop(..., fault = B_TRUE) which disable
> > the interrupts and when you do bge_m_start() immediately since the
> > interrupts are disabled, it returns EIO.
> >
> > appreciate quick help!
> >
> > thanks
> > ~Girish
> > _______________________________________________
> > driver-discuss mailing list
> > [email protected]
> > http://mail.opensolaris.org/mailman/listinfo/driver-discuss
--
*************************************
* Guang-Hao, Crisson Hu *
* China ERI, Sun Microsystems, Inc. *
* Tel: +86-10-62673095 *
*************************************
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss