linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: "Wolfram Sang" <wsa@the-dreams.de>,
	"Michał Kępień" <kernel@kempniu.pl>,
	"Steven Honeyman" <stevenhoneyman@gmail.com>,
	Valdis.Kletnieks@vt.edu,
	"Jochen Eisinger" <jochen@penguin-breeder.org>,
	"Gabriele Mazzotta" <gabriele.mzt@gmail.com>,
	"Andy Lutomirski" <luto@kernel.org>,
	Mario_Limonciello@dell.com, "Alex Hung" <alex.hung@canonical.com>,
	"Takashi Iwai" <tiwai@suse.de>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v4] i2c: i801: Register optional lis3lv02d I2C device on Dell machines
Date: Thu, 6 Jun 2019 19:37:15 +0200	[thread overview]
Message-ID: <20190606193715.13e239e0@endymion> (raw)
In-Reply-To: <20190606154800.dpxl7hph5535faya@pali>

On Thu, 6 Jun 2019 17:48:00 +0200, Pali Rohár wrote:
> On Thursday 06 June 2019 16:53:09 Jean Delvare wrote:
> > This is testing that *either* bit is set. Is it what you intend to
> > achieve, or would you rather want to ensure that *all* these bits are
> > set?  
> 
> Of course, it is wrong. Thanks for catch. We should ignore apci devices
> which are not present, which are disabled or which are not functioning.
> 
> Now I looked into acpi_get_devices() implementation and it call
> acpi_ns_get_device_callback() function callback for every device. At the
> end that function calls user supplied check_acpi_smo88xx_device
> function.
> 
> And acpi_ns_get_device_callback() already ignores acpi devices which do
> not have ACPI_STA_DEVICE_PRESENT or ACPI_STA_DEVICE_FUNCTIONING flag.
> 
> According to acpi documentation when ACPI_STA_DEVICE_PRESENT is not set
> then ACPI_STA_DEVICE_ENABLED also cannot be set.
> 
> So the whole acpi_bus_get_status_handle() is not needed at all as
> acpi_get_devices() via acpi_ns_get_device_callback() already filter
> unsuitable acpi devices.
> 
> I guess that I already did this investigation in past and added comment
> "exists and is enabled" which is below near acpi_get_devices() call. But
> as I wrote this patch more then year ago I forgot about it.

Sorry for confusing you :-(

> I will remove that check. Do you have any suggestion what to write into
> comment so other readers in future would know that we do not need to
> check anything with _STA acpi method?

Well, if you manage to squeeze a short version of the above explanation
at the relevant place in the driver, that should work. Doesn't have to
be verbose really, anything that says that disabled devices will be
properly skipped for us will be good enough.

-- 
Jean Delvare
SUSE L3 Support

      reply	other threads:[~2019-06-06 17:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04 22:33 [PATCH v4] i2c: i801: Register optional lis3lv02d I2C device on Dell machines Pali Rohár
2019-06-06 14:53 ` Jean Delvare
2019-06-06 15:48   ` Pali Rohár
2019-06-06 17:37     ` Jean Delvare [this message]

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=20190606193715.13e239e0@endymion \
    --to=jdelvare@suse.de \
    --cc=Mario_Limonciello@dell.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=alex.hung@canonical.com \
    --cc=gabriele.mzt@gmail.com \
    --cc=jochen@penguin-breeder.org \
    --cc=kernel@kempniu.pl \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=pali.rohar@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stevenhoneyman@gmail.com \
    --cc=tiwai@suse.de \
    --cc=wsa@the-dreams.de \
    /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;
as well as URLs for NNTP newsgroup(s).