From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Chen-Yu Tsai <wens@csie.org>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: BUG?: kernel does not (re)set irq smp_affinity to reboot_cpu
Date: Mon, 27 Jun 2016 12:46:21 +0100 [thread overview]
Message-ID: <20160627114621.GG1041@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20160627113143.GF1041@n2100.armlinux.org.uk>
On Mon, Jun 27, 2016 at 12:31:43PM +0100, Russell King - ARM Linux wrote:
> On Mon, Jun 27, 2016 at 12:55:26PM +0200, Hans de Goede wrote:
> > Hi Russel,
Btw, please take note of how my name is spelt. Thanks.
> Only if we accept that pm_power_off() should be called with IRQs
> enabled, which we haven't ascertained yet.
>
> Even on x86, pm_power_off() is generally called with IRQs disabled,
> and more - the APICs are disabled along with the system IOMMU in the
> case of x86_64. These are only avoided if the reboot mode is set to
> "force" (reboot_force).
>
> Now, we could do as you are suggesting, and route IRQs to the
> remaining CPU via all shutdown paths, but that would be papering over
> the fundamental bug here: if a function is called with IRQs disabled,
> it (or any called function) has no business re-enabling IRQs.
More to that, the I2C core layer is setup to allow i2c_transfer() to
be called from non-schedulable contexts:
if (in_atomic() || irqs_disabled()) {
ret = adap->trylock_bus(adap, I2C_LOCK_SEGMENT);
if (!ret)
/* I2C activity is ongoing. */
return -EAGAIN;
prior to calling into the adapters ->master_xfer() function. This
acknowledges that, if i2c_transfer() is called in a context which
is not schedulable or IRQs are disabled, the adapters ->master_xfer()
needs to handle this situation. This was added by this commit:
commit cea443a81c9c6257bf2d00f1392f7d1d4ce03b75
Author: Mike Rapoport <mike@compulab.co.il>
Date: Sun Jan 27 18:14:50 2008 +0100
i2c: Support i2c_transfer in atomic contexts
Allow i2c_transfer to be called in contexts where sleeping is not allowed.
It is the reponsability of the caller to ensure that the underlying i2c bus
driver will not sleep either.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
So... I wonder if you have CONFIG_DEBUG_ATOMIC_SLEEP set in your kernel
configuration - if not, I suspect if you do enable it, you'll get a
warning from the kernel when trying to power off, pointing out that
there's a problem in the I2C driver sleeping in an invalid context.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2016-06-27 11:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-26 16:00 BUG?: kernel does not (re)set irq smp_affinity to reboot_cpu Hans de Goede
2016-06-27 9:13 ` Marc Zyngier
2016-06-27 9:45 ` Russell King - ARM Linux
2016-06-27 10:55 ` Hans de Goede
2016-06-27 11:31 ` Russell King - ARM Linux
2016-06-27 11:46 ` Russell King - ARM Linux [this message]
2016-06-27 12:53 ` Hans de Goede
2016-06-27 13:57 ` Russell King - ARM Linux
2016-06-27 14:37 ` Hans de Goede
2016-06-27 14:54 ` Mark Rutland
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=20160627114621.GG1041@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=hdegoede@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=maxime.ripard@free-electrons.com \
--cc=tglx@linutronix.de \
--cc=wens@csie.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox