All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Keir Fraser <keir@xen.org>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] irq: Remove irqaction.free_on_release
Date: Tue, 9 Oct 2012 15:38:53 +0100	[thread overview]
Message-ID: <507436FD.5000700@citrix.com> (raw)
In-Reply-To: <CC99CCC8.4E6A2%keir@xen.org>

On 09/10/12 12:44, Keir Fraser wrote:
> But reasoning behind c/s 20153, which introduced it, still applies? Callers
> using setup_irq() don't want their passed-in irqaction to be xfree()ed?
>
>  -- Keir

Yikes - yes it does.  My original reading of the code was that it was
being set, hence the patch, but upon closer reading I am wrong.

As for grep'ing, it is only ever implicitly set to 0 by compound struct
initialisation with { 0 }

Furthermore, there is now a case where an ns16550 uart->irq can be set
higher than nr_irqs_gsi, although it is unclear whether this will
actually cause a problem and hit the unconditional xfree(action) in
dynamic_irq_cleanip(), which is only protected by BUG()'ing if the irq
index is within the gsi range.

~Andrew

>
> On 08/10/2012 14:09, "Andrew Cooper" <andrew.cooper3@citrix.com> wrote:
>
>> It is always set to 1, and only checked on some of the codepaths which free an
>> irqaction.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> --
>> This patch does touch common code as well as x86 and arm architectures,
>> so probably needs quite a few acks.
>>
>> diff -r 5fbdbf585f5f -r 37f1afbec80b xen/arch/arm/gic.c
>> --- a/xen/arch/arm/gic.c
>> +++ b/xen/arch/arm/gic.c
>> @@ -373,7 +373,7 @@ void __init release_irq(unsigned int irq
>>      /* Wait to make sure it's not being used on another CPU */
>>      do { smp_mb(); } while ( desc->status & IRQ_INPROGRESS );
>>  
>> -    if (action && action->free_on_release)
>> +    if ( action )
>>          xfree(action);
>>  }
>>  
>> diff -r 5fbdbf585f5f -r 37f1afbec80b xen/arch/arm/irq.c
>> --- a/xen/arch/arm/irq.c
>> +++ b/xen/arch/arm/irq.c
>> @@ -97,7 +97,6 @@ int __init request_irq(unsigned int irq,
>>      action->handler = handler;
>>      action->name = devname;
>>      action->dev_id = dev_id;
>> -    action->free_on_release = 1;
>>  
>>      retval = setup_irq(irq, action);
>>      if (retval)
>> diff -r 5fbdbf585f5f -r 37f1afbec80b xen/arch/x86/irq.c
>> --- a/xen/arch/x86/irq.c
>> +++ b/xen/arch/x86/irq.c
>> @@ -952,7 +952,6 @@ int __init request_irq(unsigned int irq,
>>      action->handler = handler;
>>      action->name = devname;
>>      action->dev_id = dev_id;
>> -    action->free_on_release = 1;
>>  
>>      retval = setup_irq(irq, action);
>>      if (retval)
>> @@ -979,7 +978,7 @@ void __init release_irq(unsigned int irq
>>      /* Wait to make sure it's not being used on another CPU */
>>      do { smp_mb(); } while ( desc->status & IRQ_INPROGRESS );
>>  
>> -    if (action && action->free_on_release)
>> +    if ( action )
>>          xfree(action);
>>  }
>>  
>> diff -r 5fbdbf585f5f -r 37f1afbec80b xen/include/xen/irq.h
>> --- a/xen/include/xen/irq.h
>> +++ b/xen/include/xen/irq.h
>> @@ -13,7 +13,6 @@ struct irqaction {
>>      void (*handler)(int, void *, struct cpu_user_regs *);
>>      const char *name;
>>      void *dev_id;
>> -    bool_t free_on_release;
>>  };
>>  
>>  /*
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

      reply	other threads:[~2012-10-09 14:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 13:09 [PATCH] irq: Remove irqaction.free_on_release Andrew Cooper
2012-10-09 11:44 ` Keir Fraser
2012-10-09 14:38   ` Andrew Cooper [this message]

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=507436FD.5000700@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.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.