From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org, Jiang Liu <jiang.liu@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/irq: Do not touch IRQ chip_data if it does not belong to x86_vector_domain
Date: Mon, 3 Oct 2016 16:37:20 +0300 [thread overview]
Message-ID: <57F25F10.50007@linux.intel.com> (raw)
In-Reply-To: <20161003101708.34795-1-mika.westerberg@linux.intel.com>
Hi Mika,
On 10/03/16 13:17, Mika Westerberg wrote:
> When a CPU is about to be offlined we call fixup_irqs() that resets IRQ
> affinities related to the CPU in question. The same thing is also done when
> the system is suspended to S-states like S3 (mem).
>
> For each IRQ we try to complete any on-going move regardless whether the
> IRQ is actually part of x86_vector_domain. For each IRQ descriptor we fetch
> its chip_data, assume it is of type struct apic_chip_data and manipulate it
> by clearing old_domain mask etc. For irq_chips that are not part of the
> x86_vector_domain, like those created by various GPIO drivers, will find
> their chip_data being changed unexpectly.
>
> Below is an example where GPIO chip owned by pinctrl-sunrisepoint.c gets
> corrupted after resume:
>
> # cat /sys/kernel/debug/gpio
> gpiochip0: GPIOs 360-511, parent: platform/INT344B:00, INT344B:00:
> gpio-511 ( |sysfs ) in hi
>
> # rtcwake -s10 -mmem
> <10 seconds passes>
>
> # cat /sys/kernel/debug/gpio
> gpiochip0: GPIOs 360-511, parent: platform/INT344B:00, INT344B:00:
> gpio-511 ( |sysfs ) in ?
>
> Note '?' in the output. It means the struct gpio_chip ->get function is
> NULL whereas before suspend it was there.
>
> Fix this by first checking that the IRQ belongs to x86_vector_domain before
> we try to use the chip_data as struct apic_chip_data.
>
> Reported-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Thanks for debugging this! I've tested it on the laptop where the SD
card is no longer detected after suspend; with this patch it works fine.
Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
--
Sakari Ailus
sakari.ailus@linux.intel.com
next prev parent reply other threads:[~2016-10-03 13:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-03 10:17 [PATCH] x86/irq: Do not touch IRQ chip_data if it does not belong to x86_vector_domain Mika Westerberg
2016-10-03 13:37 ` Sakari Ailus [this message]
2016-10-04 11:18 ` [tip:x86/urgent] x86/irq: Prevent force migration of irqs which are not in the vector domain tip-bot for Mika Westerberg
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=57F25F10.50007@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jiang.liu@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 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.