From: Toshi Kani <toshi.kani@hp.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH] ACPI: Do not fail acpi_bind_one() if device is already bound correctly
Date: Mon, 05 Aug 2013 16:20:19 -0600 [thread overview]
Message-ID: <1375741219.10300.172.camel@misato.fc.hp.com> (raw)
In-Reply-To: <1981183.omDzKl0aqK@vostro.rjw.lan>
On Sun, 2013-08-04 at 16:03 +0200, Rafael J. Wysocki wrote:
> On Saturday, August 03, 2013 06:32:02 PM Toshi Kani wrote:
> > On Sat, 2013-08-03 at 02:47 +0200, Rafael J. Wysocki wrote:
> > > On Friday, August 02, 2013 04:38:38 PM Toshi Kani wrote:
> > > > On Fri, 2013-08-02 at 00:33 +0200, Rafael J. Wysocki wrote:
> > > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > > >
> > > > > Modify acpi_bind_one() so that it doesn't fail if the device
> > > > > represented by its first argument has already been bound to the
> > > > > given ACPI handle (second argument), because that is not a good
> > > > > enough reason for returning an error code.
> > > >
> > > > While it seems reasonable to allow such case, I do not think we will hit
> > > > this case under the normal scenarios. So, I do not think we need to
> > > > make this change now unless it actually solves Yasuaki's issue (which I
> > > > am guessing not).
> > >
> > > In theory it should be possible to call acpi_bind_one() twice in a row
> > > for the same dev and the same handle without failure, that simply is
> > > logical. The patch may not fix any problems visible now, but returning an
> > > error code in such a case is simply incorrect.
> >
> > We changed acpi_bus_device_attach() to not call the handler or driver
> > again if it is already bound. So, I was under impression that we
> > prevent from attaching a same device twice. But I may be missing
> > something...
>
> acpi_bind_one() may be called in code paths that don't start from
> acpi_bus_device_attach(), like acpi_platform_notify(), where the result
> depends on how .find_device() is implemented by the the given bus type,
> for example.
acpi_bind_one() always returns with 0 when it sets a handle to the
device. So, acpi_platform_notify() should not call .find_device() in
this case. acpi_bus_check_add() is also protected from adding a same
device twice. But I see your point that the callers of acpi_bind_one()
could be changed / implementation dependent. So, I agree that it would
be prudent to have this change.
Acked-by: Toshi Kani <toshi.kani@hp.com>
Thanks,
-Toshi
next prev parent reply other threads:[~2013-08-05 22:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 22:33 [PATCH] ACPI: Do not fail acpi_bind_one() if device is already bound correctly Rafael J. Wysocki
2013-08-02 2:48 ` Lan Tianyu
2013-08-02 13:43 ` Rafael J. Wysocki
2013-08-02 15:16 ` Lan Tianyu
2013-08-02 22:38 ` Toshi Kani
2013-08-03 0:47 ` Rafael J. Wysocki
2013-08-04 0:32 ` Toshi Kani
2013-08-04 14:03 ` Rafael J. Wysocki
2013-08-05 22:20 ` Toshi Kani [this message]
2013-08-05 22:47 ` Rafael J. Wysocki
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=1375741219.10300.172.camel@misato.fc.hp.com \
--to=toshi.kani@hp.com \
--cc=bhelgaas@google.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/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