From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>,
Wolfram Sang <wsa@the-dreams.de>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>
Cc: linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c: i2c-designware-platdrv: Allow a dynamic adap. nr without an ACPI fwnode
Date: Tue, 12 Mar 2019 16:47:48 +0200 [thread overview]
Message-ID: <c519b0ea-670d-defe-5870-c6258c19ff74@linux.intel.com> (raw)
In-Reply-To: <20190311112216.31391-2-hdegoede@redhat.com>
Hi
On 3/11/19 1:22 PM, Hans de Goede wrote:
> Before this commit the i2c-designware-platdrv assumes that if the pdev
> has an apci-companion it should use a dynamic adapter-nr and otherwise
> it will use pdev->id as adapter-nr.
>
> On some devices e.g. the Apollo Lake using Acer TravelMate Spin B118,
> some of the LPSS i2c-adapters are enumerated through PCI and do not have
> an ACPI fwnode. These devices are handled as mfd devices so they end up
> using the i2c-designware-platdrv driver.
>
> This results in the i2c-adapter being registered with the mfd generated
> pdev->id as adapter-nr, which conflicts with existing adapters, triggering
> a WARN(id < 0, "couldn't get idr") in i2c-core-base.c and causing the
> adapter registration to fail.
>
I went thinking would we get a regression if we switch the
i2c-designware-platdrv to dynamic numbering unconditionally?
Only drivers/mfd/intel-lpss.c and drivers/mfd/intel_quark_i2c_gpio.c
register platform device "i2c_designware" and otherwise in the driver
itself for known ACPI IDs and device tree bindings.
Things should be fine for ACPI cases if slave devices are also described
in ACPI tables. As far as I've understood with device tree matching
adapter number is irrelevant in slave device registration?
Andy: could you tell by commit 918fe70cf475 ("mfd: intel_quark_i2c_gpio:
support devices behind i2c bus") are those devices described in ACPI or
in some i2c_board_infos with referring to fixed adapter number either in
or out of kernel tree code?
Then drivers/platform/chrome/chromeos_laptop.c is the only code
searching for adapter named as "Synopsys DesignWare I2C adapter" without
assuming any fixed adapter numbering.
What's unclear to me can there be device tree cases where i2c-designware
probing comes with pdev->id not starting from zero or in different
order? I.e. would it make difference do we use pdev->id or dynamic
adapter numbering?
--
Jarkko
next prev parent reply other threads:[~2019-03-12 14:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-11 11:22 [PATCH 0/2] intel-lpss-pci-i2c: Fix oops when there is no ACPI fwnode Hans de Goede
2019-03-11 11:22 ` [PATCH 1/2] i2c: i2c-designware-platdrv: Allow a dynamic adap. nr without an " Hans de Goede
2019-03-11 12:52 ` Andy Shevchenko
2019-03-12 14:49 ` Hans de Goede
2019-03-12 14:47 ` Jarkko Nikula [this message]
2019-03-12 14:51 ` Hans de Goede
2019-03-12 15:05 ` Andy Shevchenko
2019-03-11 11:22 ` [PATCH 2/2] mfd: intel-lpss: Add "linux,use-dynamic-adapter-nr" device-prop to i2c-devices Hans de Goede
2019-03-11 19:15 ` Wolfram Sang
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=c519b0ea-670d-defe-5870-c6258c19ff74@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=lee.jones@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--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).