All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hanjun Guo <hanjun.guo at linaro.org>
To: devel@acpica.org
Subject: Re: [Devel] [PATCH 1/5] ACPICA: Add acpi_dev_present
Date: Tue, 24 Nov 2015 14:54:43 +0000	[thread overview]
Message-ID: <56547A2B.8030401@linaro.org> (raw)
In-Reply-To: 2460979.tXaWt9xg5Q@vostro.rjw.lan

[-- Attachment #1: Type: text/plain, Size: 1173 bytes --]

On 11/24/2015 10:22 PM, Rafael J. Wysocki wrote:
> On Tuesday, November 24, 2015 12:40:51 PM Hanjun Guo wrote:
>> On 2015/11/24 7:32, Lukas Wunner wrote:
>>> Hi Robert,
>>>
>>> On Mon, Nov 23, 2015 at 10:22:27PM +0000, Moore, Robert wrote:
>>>>>> acpi_dev_present
>>>> Do you really want to be walking the ACPICA namespace for every call?
>>> That's what the drivers currently do. Typically this is called only once
>>> on initialization by the driver's ->probe callback.
>>>
>>> What did you have in mind instead, cache the result? Or store the HIDs
>>> in the namespace in a hash that can be queried faster?
>>
>> Will those drivers be loaded before the acpi namespace is scanned? if not, I think
>> those IDs already cached, in acpi_init_device_object(),
>>
>> INIT_LIST_HEAD(&device->pnp.ids);
>> ...
>> acpi_set_pnp_ids(handle, &device->pnp, type);
>>
>> please see API acpi_device_hid(), so I think you can introduce a API with
>> acpi_device and HID passed as arguments in scan.c
>
> I'd prefer that to go to utils.c to be honest, even if the namespace needs to
> be walked.

I agree, utils.c is the better place to go.

Thanks
Hanjun

WARNING: multiple messages have this Message-ID (diff)
From: Hanjun Guo <hanjun.guo@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Hanjun Guo <guohanjun@huawei.com>
Cc: Lukas Wunner <lukas@wunner.de>,
	"Moore, Robert" <robert.moore@intel.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"devel@acpica.org" <devel@acpica.org>,
	"platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	Darren Hart <dvhart@infradead.org>,
	Corentin Chary <corentin.chary@gmail.com>,
	"Lee, Chun-Yi" <jlee@suse.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Takashi Iwai <tiwai@suse.de>, Hui Wang <hui.wang@canonical.com>,
	Mark Brown <broonie@kernel.org>, "Zheng, Lv" <lv.zheng@intel.com>,
	David Box <david.e.box@linux.intel.com>
Subject: Re: [PATCH 1/5] ACPICA: Add acpi_dev_present
Date: Tue, 24 Nov 2015 22:54:35 +0800	[thread overview]
Message-ID: <56547A2B.8030401@linaro.org> (raw)
In-Reply-To: <2460979.tXaWt9xg5Q@vostro.rjw.lan>

On 11/24/2015 10:22 PM, Rafael J. Wysocki wrote:
> On Tuesday, November 24, 2015 12:40:51 PM Hanjun Guo wrote:
>> On 2015/11/24 7:32, Lukas Wunner wrote:
>>> Hi Robert,
>>>
>>> On Mon, Nov 23, 2015 at 10:22:27PM +0000, Moore, Robert wrote:
>>>>>> acpi_dev_present
>>>> Do you really want to be walking the ACPICA namespace for every call?
>>> That's what the drivers currently do. Typically this is called only once
>>> on initialization by the driver's ->probe callback.
>>>
>>> What did you have in mind instead, cache the result? Or store the HIDs
>>> in the namespace in a hash that can be queried faster?
>>
>> Will those drivers be loaded before the acpi namespace is scanned? if not, I think
>> those IDs already cached, in acpi_init_device_object(),
>>
>> INIT_LIST_HEAD(&device->pnp.ids);
>> ...
>> acpi_set_pnp_ids(handle, &device->pnp, type);
>>
>> please see API acpi_device_hid(), so I think you can introduce a API with
>> acpi_device and HID passed as arguments in scan.c
>
> I'd prefer that to go to utils.c to be honest, even if the namespace needs to
> be walked.

I agree, utils.c is the better place to go.

Thanks
Hanjun

         reply	other threads:[~2015-11-24 14:54 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 14:34 [PATCH 0/5] Add acpi_dev_present Lukas Wunner
2015-11-23 14:35 ` [Devel] " Lukas Wunner
2015-11-23 14:34 ` [Devel] [PATCH 2/5] eeepc-wmi: Use acpi_dev_present Lukas Wunner
2015-11-23 14:34   ` Lukas Wunner
2015-11-23 19:04   ` Darren Hart
2015-11-23 19:55     ` [Devel] " Lukas Wunner
2015-11-23 19:55       ` Lukas Wunner
2015-11-23 21:00       ` Darren Hart
2015-11-23 22:35     ` Rafael J. Wysocki
2015-11-24 17:08       ` Darren Hart
2015-11-23 14:34 ` [Devel] [PATCH 4/5] ALSA: hda - " Lukas Wunner
2015-11-23 14:34   ` Lukas Wunner
2015-11-24  1:51   ` [alsa-devel] " Hui Wang
2015-11-23 14:34 ` [PATCH 1/5] ACPICA: Add acpi_dev_present Lukas Wunner
2015-11-23 14:35   ` [Devel] " Lukas Wunner
2015-11-23 22:34   ` Rafael J. Wysocki
2015-11-23 22:22     ` Moore, Robert
2015-11-23 22:22       ` [Devel] " Moore, Robert
2015-11-23 23:32       ` Lukas Wunner
2015-11-23 23:32         ` [Devel] " Lukas Wunner
2015-11-24  4:40         ` Hanjun Guo
2015-11-24 14:15           ` Moore, Robert
2015-11-24 14:15             ` [Devel] " Moore, Robert
2015-11-24 14:22           ` Rafael J. Wysocki
2015-11-24 14:54             ` Hanjun Guo [this message]
2015-11-24 14:54               ` [Devel] " Hanjun Guo
2015-11-23 14:34 ` [Devel] [PATCH 5/5] ASoC: Intel: Use acpi_dev_present Lukas Wunner
2015-11-23 14:34   ` Lukas Wunner
2015-11-23 14:48   ` Mark Brown
2015-11-23 22:37     ` Rafael J. Wysocki
2015-11-23 14:34 ` [Devel] [PATCH 3/5] acer-wmi: " Lukas Wunner
2015-11-23 14:34   ` Lukas Wunner
2015-11-23 19:06   ` Darren Hart

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=56547A2B.8030401@linaro.org \
    --to=devel@acpica.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.