From patchwork Tue Nov 4 16:54:32 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Gala X-Patchwork-Id: 7156 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 00700DDF06 for ; Wed, 5 Nov 2008 03:56:19 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1D8F1DDEF4 for ; Wed, 5 Nov 2008 03:55:02 +1100 (EST) Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id mA4GsW24014180; Tue, 4 Nov 2008 10:54:33 -0600 Date: Tue, 4 Nov 2008 10:54:32 -0600 (CST) From: Kumar Gala X-X-Sender: galak@blarg.am.freescale.net To: Linus Torvalds Subject: [PATCH 1/1][resend] irq: Maintain user set affinity Message-ID: MIME-Version: 1.0 Cc: Andrew Morton , linuxppc-dev@ozlabs.org, tglx@linutronix.de, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org This addresses a regression in that if a user specified an affinity for an interrupt that affinity information would get reset between a request_irq(), free_irq() and request_irq() for the same irq. On example of this is bringing up an ethernet interface, taking it down and bringing it back up again. Instead of always using the irq_default_affinity we use the previous setting of the IRQs affinity with the assumption that at boot the IRQs affinity will be set to irq_default_affinity. Signed-off-by: Kumar Gala --- reposting since the first patch I forgot to cull some header info from the body of the emai. - k kernel/irq/manage.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index c498a1b..ea7d11b 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -115,9 +115,12 @@ int irq_select_affinity(unsigned int irq) if (!irq_can_set_affinity(irq)) return 0; - cpus_and(mask, cpu_online_map, irq_default_affinity); - desc = irq_to_desc(irq); + + mask = desc->affinity; + + cpus_and(mask, cpu_online_map, mask); + desc->affinity = mask; desc->chip->set_affinity(irq, mask);