On Fri, Apr 12, 2013 at 10:27 AM, hiren panchasara
<hiren.panchas...@gmail.com> wrote:
> On Fri, Apr 12, 2013 at 8:42 AM, John Baldwin <j...@freebsd.org> wrote:
>>
>> On Monday, April 08, 2013 3:30:01 pm hiren panchasara wrote:
>> > The following reply was made to PR kern/163268; it has been noted by GNATS.
>> >
>> > From: hiren panchasara <hiren.panchas...@gmail.com>
>> > To: bug-follo...@freebsd.org, yuri.pan...@gmail.com
>> > Cc:
>> > Subject: Re: kern/163268: [acpi_hp] [patch] fix driver detach in absence of
>> CMI
>> > Date: Mon, 8 Apr 2013 12:29:11 -0700
>> >
>> >  I do not see any apparent problem in the proposed patch. Unfortunately
>> >  I do not have an hp to play with.
>> >
>> >  Can someone look at the patch and try or approve so that we can make
>> >  progress on this?
>>
>> The current patch would incorrectly remove the notification handler if it
>> failed with EBUSY.  I'm compiling the following to see if it builds.  I also
>> think it is a bit less invasive.  I have no way to test it however:
>
> Just got an HP elitebook. I am not sure if it has the same cmi
> interface or not to reproduce the problem. I am setting up X and all
> at the moment. Once that's done, I can give this patch a try.

John,

I do not see myself trying this out anytime soon so please go ahead
and commit the patch if you think this is the correct way. Do not want
to keep you waiting on my testing.

cheers,
Hiren
>
> Thanks,
> Hiren
>>
>> Index: dev/acpi_support/acpi_hp.c
>> ===================================================================
>> --- dev/acpi_support/acpi_hp.c  (revision 248326)
>> +++ dev/acpi_support/acpi_hp.c  (working copy)
>> @@ -574,28 +574,26 @@
>>  static int
>>  acpi_hp_detach(device_t dev)
>>  {
>> -       int     ret;
>> +       struct acpi_hp_softc *sc;
>>
>>         ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
>> -       struct acpi_hp_softc *sc = device_get_softc(dev);
>> -       if (sc->has_cmi && sc->hpcmi_open_pid != 0) {
>> -               ret = EBUSY;
>> -       }
>> -       else {
>> -               if (sc->has_notify) {
>> -                       ACPI_WMI_REMOVE_EVENT_HANDLER(dev,
>> -                           ACPI_HP_WMI_EVENT_GUID);
>> -               }
>> +       sc = device_get_softc(dev);
>> +       if (sc->has_cmi && sc->hpcmi_open_pid != 0)
>> +               return (EBUSY);
>> +
>> +       if (sc->has_notify)
>> +               ACPI_WMI_REMOVE_EVENT_HANDLER(dev, ACPI_HP_WMI_EVENT_GUID);
>> +
>> +       if (sc->has_cmi) {
>>                 if (sc->hpcmi_bufptr != -1) {
>>                         sbuf_delete(&sc->hpcmi_sbuf);
>>                         sc->hpcmi_bufptr = -1;
>>                 }
>>                 sc->hpcmi_open_pid = 0;
>>                 destroy_dev(sc->hpcmi_dev_t);
>> -               ret = 0;
>>         }
>>
>> -       return (ret);
>> +       return (0);
>>  }
>>
>>  static int
>>
>> --
>> John Baldwin
_______________________________________________
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to "freebsd-acpi-unsubscr...@freebsd.org"

Reply via email to