From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751817AbcJCNh2 (ORCPT ); Mon, 3 Oct 2016 09:37:28 -0400 Received: from mga01.intel.com ([192.55.52.88]:34124 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbcJCNhZ (ORCPT ); Mon, 3 Oct 2016 09:37:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,289,1473145200"; d="scan'208";a="886191512" Subject: Re: [PATCH] x86/irq: Do not touch IRQ chip_data if it does not belong to x86_vector_domain To: Mika Westerberg , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, Jiang Liu , linux-kernel@vger.kernel.org References: <20161003101708.34795-1-mika.westerberg@linux.intel.com> From: Sakari Ailus Message-ID: <57F25F10.50007@linux.intel.com> Date: Mon, 3 Oct 2016 16:37:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:43.0) Gecko/20100101 SeaMonkey/2.40 MIME-Version: 1.0 In-Reply-To: <20161003101708.34795-1-mika.westerberg@linux.intel.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Mika Westerberg 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 sakari.ailus@linux.intel.com