From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2 1/2] i2c: core: ACPI: Properly set status byte to 0 for multi-byte writes
Date: Mon, 13 Aug 2018 12:38:37 +0300 [thread overview]
Message-ID: <20180813093837.GY2343@lahna.fi.intel.com> (raw)
In-Reply-To: <20180812105321.2668-1-hdegoede@redhat.com>
On Sun, Aug 12, 2018 at 12:53:20PM +0200, Hans de Goede wrote:
> acpi_gsb_i2c_write_bytes() returns i2c_transfer()'s return value, which
> is the number of transfers executed on success, so 1.
>
> The ACPI code expects us to store 0 in gsb->status for success, not 1.
>
> Specifically this breaks the following code in the Thinkpad 8 DSDT:
>
> ECWR = I2CW = ECWR /* \_SB_.I2C1.BAT0.ECWR */
> If ((ECST == Zero))
> {
> ECRD = I2CR /* \_SB_.I2C1.I2CR */
> }
>
> Before this commit we set ECST to 1, causing the read to never happen
> breaking battery monitoring on the Thinkpad 8.
>
> This commit makes acpi_gsb_i2c_write_bytes() return 0 when i2c_transfer()
> returns 1, so the single write transfer completed successfully, and
> makes it return -EIO on for other (unexpected) return values >= 0.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
next prev parent reply other threads:[~2018-08-13 9:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-12 10:53 [PATCH v2 1/2] i2c: core: ACPI: Properly set status byte to 0 for multi-byte writes Hans de Goede
2018-08-12 20:39 ` Peter Rosin
2018-08-13 8:44 ` Hans de Goede
2018-08-13 9:38 ` Mika Westerberg [this message]
2018-08-20 12:10 ` 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=20180813093837.GY2343@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=stable@vger.kernel.org \
--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).