From: joeyli <jlee@suse.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] acpi: handle the acpi hotplug schedule error
Date: Wed, 7 Jun 2017 23:39:33 +0800 [thread overview]
Message-ID: <20170607153933.GY30622@linux-l9pv.suse> (raw)
In-Reply-To: <CAHp75VcBG-gHEOPkPBHMXzpY7G3hJxtXKKAjPesjBHVW-gx6qA@mail.gmail.com>
On Wed, Jun 07, 2017 at 01:46:37PM +0300, Andy Shevchenko wrote:
> On Wed, Jun 7, 2017 at 1:18 PM, joeyli <jlee@suse.com> wrote:
> > On Wed, Jun 07, 2017 at 11:36:55AM +0300, Andy Shevchenko wrote:
> >> On Wed, Jun 7, 2017 at 9:05 AM, Lee, Chun-Yi <joeyli.kernel@gmail.com> wrote:
> >> > Kernel should decrements the reference count of acpi device
> >> > when scheduling acpi hotplug work is failed, and also evaluates
> >> > _OST to notify BIOS the failure.
>
> > So, do you mean like this?
>
> Yes, see below.
>
> >
> > - if (hotplug_event && ACPI_SUCCESS(acpi_hotplug_schedule(adev, type)))
> > - return;
> > + if (hotplug_event) {
>
> > + if (ACPI_SUCCESS(acpi_hotplug_schedule(adev, type)))
> > + return;
>
> > + else
>
> It's redundant...
>
Oh~ Yes, you are right. The 'else' can be removed
> > + goto err_put_device;
>
> ...perhaps
>
> if (ACPI_FAILURE(acpi_hotplug_schedule(adev, type)))
> goto err_put_device;
> return;
>
I think normally it should be success. So how about:
if (hotplug_event) {
if (ACPI_SUCCESS(acpi_hotplug_schedule(adev, type)))
return;
goto err_put_device;
}
> >
> > acpi_bus_put_acpi_device(adev);
> > return;
> >
> > +err_put_device:
> > + acpi_bus_put_acpi_device(adev);
> > err:
> > acpi_evaluate_ost(handle, type, ost_code, NULL);
> > }
Thanks a lot!
Joey Lee
next prev parent reply other threads:[~2017-06-07 15:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-07 6:05 [PATCH] acpi: handle the acpi hotplug schedule error Lee, Chun-Yi
2017-06-07 8:36 ` Andy Shevchenko
2017-06-07 10:18 ` joeyli
2017-06-07 10:46 ` Andy Shevchenko
2017-06-07 15:39 ` joeyli [this message]
2017-06-07 16:55 ` Andy Shevchenko
-- strict thread matches above, loose matches on Subject: below --
2017-06-03 7:38 Lee, Chun-Yi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170607153933.GY30622@linux-l9pv.suse \
--to=jlee@suse.com \
--cc=andy.shevchenko@gmail.com \
--cc=joeyli.kernel@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox