From: Thierry Reding <thierry.reding@gmail.com>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
Wolfram Sang <wsa@the-dreams.de>,
linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/3] i2c: tegra: Support atomic transfers
Date: Fri, 13 Dec 2019 16:12:08 +0100 [thread overview]
Message-ID: <20191213151208.GC222809@ulmo> (raw)
In-Reply-To: <20191212233428.14648-2-digetx@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2728 bytes --]
On Fri, Dec 13, 2019 at 02:34:26AM +0300, Dmitry Osipenko wrote:
> System shutdown may happen with interrupts being disabled and in this case
> I2C core rejects transfers if atomic transfer isn't supported by driver.
>
> There were several occurrences where I found my Nexus 7 completely
> discharged despite of being turned off and then one day I spotted this in
> the log:
>
> reboot: Power down
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 1 at drivers/i2c/i2c-core.h:40 i2c_transfer+0x95/0x9c
> No atomic I2C transfer handler for 'i2c-1'
> Modules linked in: tegra30_devfreq
> CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.4.0-next-20191202-00120-gf7ecd80fb803-dirty #3195
> Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
> [<c010e4b5>] (unwind_backtrace) from [<c010a0fd>] (show_stack+0x11/0x14)
> [<c010a0fd>] (show_stack) from [<c09995e5>] (dump_stack+0x85/0x94)
> [<c09995e5>] (dump_stack) from [<c011f3d1>] (__warn+0xc1/0xc4)
> [<c011f3d1>] (__warn) from [<c011f691>] (warn_slowpath_fmt+0x61/0x78)
> [<c011f691>] (warn_slowpath_fmt) from [<c069a8dd>] (i2c_transfer+0x95/0x9c)
> [<c069a8dd>] (i2c_transfer) from [<c05667f1>] (regmap_i2c_read+0x4d/0x6c)
> [<c05667f1>] (regmap_i2c_read) from [<c0563601>] (_regmap_raw_read+0x99/0x1cc)
> [<c0563601>] (_regmap_raw_read) from [<c0563757>] (_regmap_bus_read+0x23/0x38)
> [<c0563757>] (_regmap_bus_read) from [<c056293d>] (_regmap_read+0x3d/0xfc)
> [<c056293d>] (_regmap_read) from [<c0562d3b>] (_regmap_update_bits+0x87/0xc4)
> [<c0562d3b>] (_regmap_update_bits) from [<c0563add>] (regmap_update_bits_base+0x39/0x50)
> [<c0563add>] (regmap_update_bits_base) from [<c056fd39>] (max77620_pm_power_off+0x29/0x2c)
> [<c056fd39>] (max77620_pm_power_off) from [<c013bbdd>] (__do_sys_reboot+0xe9/0x170)
> [<c013bbdd>] (__do_sys_reboot) from [<c0101001>] (ret_fast_syscall+0x1/0x28)
> Exception stack(0xde907fa8 to 0xde907ff0)
> 7fa0: 00000000 00000000 fee1dead 28121969 4321fedc 00000000
> 7fc0: 00000000 00000000 00000000 00000058 00000000 00000000 00000000 00000000
> 7fe0: 0045adf0 bed9abb8 004444a0 b6c666d0
> ---[ end trace bdd18f87595b1a5e ]---
>
> The atomic transferring is implemented by enforcing PIO mode for the
> transfer and by polling interrupt status until transfer is completed or
> failed.
>
> Now system shuts down properly every time.
>
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
> drivers/i2c/busses/i2c-tegra.c | 95 +++++++++++++++++++++++++++++++---
> 1 file changed, 88 insertions(+), 7 deletions(-)
I ran this on the test farm and the results are all green, so:
Tested-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-12-13 15:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 23:34 [PATCH v1 0/3] Tegra I2C: Support atomic transfers and correct suspend/resume Dmitry Osipenko
2019-12-12 23:34 ` [PATCH v1 1/3] i2c: tegra: Support atomic transfers Dmitry Osipenko
2019-12-13 14:36 ` Dmitry Osipenko
2019-12-13 15:12 ` Thierry Reding [this message]
2019-12-13 15:15 ` Dmitry Osipenko
2019-12-13 15:20 ` Thierry Reding
2019-12-13 15:25 ` Dmitry Osipenko
2019-12-12 23:34 ` [PATCH v1 2/3] i2c: tegra: Rename I2C_PIO_MODE_MAX_LEN to I2C_PIO_MODE_PREFERRED_LEN Dmitry Osipenko
2019-12-13 15:12 ` Thierry Reding
2019-12-12 23:34 ` [PATCH v1 3/3] i2c: tegra: Fix suspending in active runtime PM state Dmitry Osipenko
2019-12-12 23:43 ` Dmitry Osipenko
2019-12-13 13:47 ` Thierry Reding
2019-12-13 14:04 ` Dmitry Osipenko
2019-12-13 18:01 ` Dmitry Osipenko
2019-12-19 22:58 ` Dmitry Osipenko
2019-12-27 13:47 ` Dmitry Osipenko
2019-12-13 14:29 ` Dmitry Osipenko
2019-12-13 14:55 ` Dmitry Osipenko
2019-12-27 13:55 ` Dmitry Osipenko
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=20191213151208.GC222809@ulmo \
--to=thierry.reding@gmail.com \
--cc=digetx@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@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 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.