From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755186AbbIHOXd (ORCPT ); Tue, 8 Sep 2015 10:23:33 -0400 Received: from mga11.intel.com ([192.55.52.93]:38139 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754933AbbIHOXa (ORCPT ); Tue, 8 Sep 2015 10:23:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,490,1437462000"; d="scan'208";a="764706618" Date: Tue, 8 Sep 2015 17:21:18 +0300 From: Mika Westerberg To: Thomas Gleixner Cc: Jiang Liu , jarkko.nikula@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: Question related to patch: x86/irq: Remove x86_io_apic_ops.set_affinity and related interfaces Message-ID: <20150908142118.GD12118@lahna.fi.intel.com> References: <20150908104048.GB12118@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 08, 2015 at 04:02:29PM +0200, Thomas Gleixner wrote: > On Tue, 8 Sep 2015, Mika Westerberg wrote: > > It says that there are no users for x86_io_apic_ops.set_affinity but then > > it does this: > > > > - x86_io_apic_ops.set_affinity(idata, mask, false); > > + irq_set_affinity(irq, mask); > > > > The difference is that x86_io_apic_ops.set_affinity() programs affinity > > directly to the hardware (if I understand it right) but irq_set_affinity() > > calls irqd_set_move_pending() which defers programming the hardware later. > > > > Now when an interrupt triggers we end up calling irq_move_masked_irq() with > > unlocked descriptor. > > > > Without the above change we never do that and the crash does not happen. > > Right. Patch below should fix that issue. > > Thanks, > > tglx > > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c > index 38a76f826530..d2ea50c5e936 100644 > --- a/arch/x86/kernel/apic/io_apic.c > +++ b/arch/x86/kernel/apic/io_apic.c > @@ -2522,6 +2522,7 @@ void __init setup_ioapic_dest(void) > int pin, ioapic, irq, irq_entry; > const struct cpumask *mask; > struct irq_data *idata; > + struct irq_chip *chip; > > if (skip_ioapic_setup == 1) > return; > @@ -2545,9 +2546,9 @@ void __init setup_ioapic_dest(void) > else > mask = apic->target_cpus(); > > - irq_set_affinity(irq, mask); > + chip = irq_data_get_chip(idata); There seems to be no irq_data_get_chip() helper in current mainline. So I replaced this with: chip = idata->chip; > + chip->irq_set_affinity(idata, mask, false); > } > - > } > #endif With the above change the patch fixes the problem, thanks! Tested-by: Mika Westerberg