In-Reply-To: <[EMAIL PROTECTED]>; from [EMAIL PROTECTED] on Mon, 
Jul 23, 2001 at 01:37:59PM -0700

On Mon, Jul 23, 2001 at 01:37:59PM -0700, Mike Smith wrote:
> > > > 1. Acpica modules hangs in
> > > >     AcpiRsCalculateByteStreamLength() called from
> > > >     AcpiRsCreateByteStream() called from
> > > >     AcpiRsSetSrsMethodData() called from
> > > >     AcpiSetCurrentResources() from somewhere in acpi_pcib.c .
> > > >
> > > >     The hang itself occurs at LinkedList->Id == 9 and LinkedList->Length 
> > == 0
> > > > .
> > >
> > > Can you replace &crsbuf with crsbuf in acpi_pcib.c at line 484?
> > > I think I should be passing a pointer to the buffer, not a pointer to a
> > > pointer.
> > 
> > There's no &crsbuf in line 484 (not in rev 1.10, nor 1.11).
> > 
> > Assuming you're talking about the one in line 478, it doesn't compile if you
> > change it to crsbuf from &crsbuf, since crsbuf is an ACPI_BUFFER, not
> > an (ACPI_BUFFER *).
> 
> Um.  Sorry about the line numbers, and yes, sorry about the confusion 
> there; I just looked at it and it seemed wrong.
> 
> I'd still like to know the allocation length for that buffer though; my 
> last suspicion is that it doesn't contain any resources at all, and so 
> we're overrunning it when we go to try to stuff an interrupt resource 
> into it.  If that's the case, it's easy to fix.  If not, then we will 
> have to go hunting snarks.

Mike,
Seems like I managed to solve my problem. Attached is to be applied against
sys/dev/acpica/acpi_pcib.c, rev 1.10 .

First of all, the list returned in crsbuf was terminated with an element
with its Length field equal to zero (and Id field was ACPI_RSTYPE_IRQ).
Since AcpiRsCalculateByteStreamLength() expects ACPI_RSTYPE_END_TAG as
terminator and doesn't check the validity of Length field (or, in other words,
this function doesn't treat it as terminator), the function never returned.

And as you suggested, AcpiGetCurrentResources() returned an IRQ resource
with no interrupts(NumberOfInterrupts = 0, and no room for
Data.Irq.Interrupts[0]). Thus the line 476 in acpi_pcib.c was overwriting
the Id field in the next element.

The patch tries to allocate another buffer to resize the list, and to modify the
last element's Id to ACPI_RSTYPE_END_TAG.
I think AcpiRsCalculateByteStreamLength() should just exit the while loop
when it found an element with Length = 0, rather than wait for the end tag
forever.

Thanks.


------------------------------------------------------------
Shop Smart Compare Prices on Name-Brand Products from Name-Brand Stores!!
http://www.smartshop.com/cgi-bin/main.cgi?ssa=4099

acpi_pcib.c.diff

Reply via email to