From: Ian Campbell Subject: Re: [PATCH] xen: events: do not free legacy IRQs Date: Thu, 3 Feb 2011 09:49:35 +0000 Message-ID: <1296726575.13091.426.camel@zakaz.uk.xensource.com> References: <1294766416-11407-3-git-send-email-ian.campbell@citrix.com> <1296721830-14669-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1296721830-14669-1-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Konrad Rzeszutek Wilk Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Thu, 2011-02-03 at 08:30 +0000, Ian Campbell wrote: > c514d00c8057 "xen: events: add xen_allocate_irq_{dynamic, gsi} and > xen_free_irq" correctly avoids reallocating legacy IRQs (which are > managed by the arch core) but erroneously did not prevent them being > freed. > > Signed-off-by: Ian Campbell > --- > drivers/xen/events.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/drivers/xen/events.c b/drivers/xen/events.c > index ff044e0..eb7d47f 100644 > --- a/drivers/xen/events.c > +++ b/drivers/xen/events.c > @@ -434,6 +434,10 @@ static int xen_allocate_irq_gsi(unsigned gsi) > > static void xen_free_irq(unsigned irq) > { > + /* Legacy IRQ descriptors are managed by the arch. */ > + if (irq < NR_IRQS_LEGACY) > + return irq; Hmm, didn't notice the warning when I compiled this... Should obviously just be "return;" Ian. 8<-------------------- >From 84cc1a94c7eec94b94f1973cd84c017ae36c3c5f Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 3 Feb 2011 08:23:10 +0000 Subject: [PATCH] xen: events: do not free legacy IRQs c514d00c8057 "xen: events: add xen_allocate_irq_{dynamic, gsi} and xen_free_irq" correctly avoids reallocating legacy IRQs (which are managed by the arch core) but erroneously did not prevent them being freed. Signed-off-by: Ian Campbell --- drivers/xen/events.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/xen/events.c b/drivers/xen/events.c index ff044e0..eb7d47f 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c @@ -434,6 +434,10 @@ static int xen_allocate_irq_gsi(unsigned gsi) static void xen_free_irq(unsigned irq) { + /* Legacy IRQ descriptors are managed by the arch. */ + if (irq < NR_IRQS_LEGACY) + return; + irq_free_desc(irq); } -- 1.5.6.5