Re: mss.c pcm fix to ' attach returned 6 ' load failure for v5.x acpi and up

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 12 Jul 2005 10:27:12 -0400
On Monday 11 July 2005 06:23 pm, Nate Lawson wrote:
> John Baldwin wrote:
> > Also, can you upload your acpidump somewhere and provide a URL?  I'm
> > curious if you have ACPI devices like thermal zones that don't have
> > _HID's and only have _CIDs.  In fact, here's a patch to fix
> > acpi_get_logicalid() in that case.  Give this a try first and let me know
> > if it fixes it.
>
> I would rather you directly call acpi_isa_get_compatid() rather than
> duplicating its logic here.  There's no guarantee that the first CID
> will match the single ID passed in.

There is no passed in ID.  For the common use of this function in almost all 
ISA drivers, it just needs to return != 0 for PNP devices.

> -Nate
>
> > Index: acpi.c
> > ===================================================================
> > RCS file: /usr/cvs/src/sys/dev/acpica/acpi.c,v
> > retrieving revision 1.214
> > diff -u -r1.214 acpi.c
> > --- acpi.c	3 Jun 2005 20:12:12 -0000	1.214
> > +++ acpi.c	11 Jul 2005 20:23:14 -0000
> > _at__at_ -1138,6 +1138,7 _at__at_
> >      ACPI_HANDLE		h;
> >      ACPI_STATUS		error;
> >      u_int32_t		pnpid;
> > +    int			i;
> >
> >      ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
> >
> > _at__at_ -1153,8 +1154,24 _at__at_
> >  	goto out;
> >      devinfo = (ACPI_DEVICE_INFO *)buf.Pointer;
> >
> > -    if ((devinfo->Valid & ACPI_VALID_HID) != 0)
> > +    if ((devinfo->Valid & ACPI_VALID_HID) != 0) {
> >  	pnpid = PNP_EISAID(devinfo->HardwareId.Value);
> > +	goto out;
> > +    }
> > +
> > +    /*
> > +     * If we don't have a HID but do have at least one CID, return the
> > first +     * CID.  This is so that ISA drivers that use
> > isa_get_logicalid() to +     * determine if a device is a PnP device or
> > not will work correctly. +     */
> > +    if ((devinfo->Valid & ACPI_VALID_CID) != 0) {
> > +	for (i = 0; i < devinfo->CompatibilityId.Count; i++) {
> > +	    if (strncmp(devinfo->CompatibilityId.Id[i].Value, "PNP", 3) != 0)
> > +		continue;
> > +	    pnpid = PNP_EISAID(devinfo->CompatibilityId.Id[i].Value);
> > +	    goto out;
> > +	}
> > +    }
> >
> >  out:
> >      if (buf.Pointer != NULL)

-- 
John Baldwin <jhb_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Tue Jul 12 2005 - 16:31:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:38 UTC