All of lore.kernel.org
 help / color / mirror / Atom feed
From: Esben Nielsen <nielsen.esben@googlemail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Esben Nielsen <nielsen.esben@googlemail.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [patch 3/5] [PREEMPT_RT] Changing interrupt handlers from running in thread to hardirq and back runtime.
Date: Sun, 4 Jun 2006 18:34:55 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606041834090.9391@localhost> (raw)
In-Reply-To: <1149367140.13993.119.camel@localhost.localdomain>



On Sat, 3 Jun 2006, Steven Rostedt wrote:

> On Fri, 2006-06-02 at 23:23 +0100, Esben Nielsen wrote:
>> Makes it possible for the e100 ethernet driver to have it's interrupt handler
>> in both hard-irq and threaded context under PREEMPT_RT.
>>
>> Index: linux-2.6.16-rt23.spin_mutex/drivers/net/e100.c
>> ===================================================================
>> --- linux-2.6.16-rt23.spin_mutex.orig/drivers/net/e100.c
>> +++ linux-2.6.16-rt23.spin_mutex/drivers/net/e100.c
>> @@ -530,7 +530,7 @@ struct nic {
>>   	enum ru_state ru_running;
>>
>>   	spinlock_t cb_lock			____cacheline_aligned;
>> -	spinlock_t cmd_lock;
>> +	spin_mutex_t cmd_lock;
>>   	struct csr __iomem *csr;
>>   	enum scb_cmd_lo cuc_cmd;
>>   	unsigned int cbs_avail;
>> @@ -1950,6 +1950,30 @@ static int e100_rx_alloc_list(struct nic
>>   	return 0;
>>   }
>>
>> +static int e100_change_context(int irq, void *dev_id,
>> +			       enum change_context_cmd cmd)
>> +{
>> +	struct net_device *netdev = dev_id;
>> +	struct nic *nic = netdev_priv(netdev);
>> +
>> +	switch(cmd)
>> +	{
>> +	case IRQ_TO_HARDIRQ:
>> +		if(!spin_mutexes_can_spin())
>> +			return -ENOSYS;
>> +
>> +		spin_mutex_to_spin(&nic->cmd_lock);
>> +		break;
>> +	case IRQ_CAN_THREAD:
>> +		/* Ok - return 0 */
>> +		break;
>
> Why even bother with the IRQ_CAN_THREAD.  If this would be anything
> other than OK, then we shouldn't be using that request_irq2 (yuck!) call
> in the first place.
>
Just for the sake of generality. Nothing else. It would be very unlikely, 
as you say, that it wouldn't return 0.

> -- Steve

Esben


  reply	other threads:[~2006-06-04 16:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060602165336.147812000@localhost>
2006-06-02 22:23 ` [patch 1/5] [PREEMPT_RT] Changing interrupt handlers from running in thread to hardirq and back runtime Esben Nielsen
2006-06-02 22:23 ` [patch 2/5] " Esben Nielsen
2006-06-03 20:21   ` Steven Rostedt
2006-06-04 17:33     ` Esben Nielsen
2006-06-02 22:23 ` [patch 3/5] " Esben Nielsen
2006-06-03 20:39   ` Steven Rostedt
2006-06-04 17:34     ` Esben Nielsen [this message]
2006-06-02 22:23 ` [patch 4/5] " Esben Nielsen
2006-06-03 21:30   ` Steven Rostedt
2006-06-04 22:50     ` Esben Nielsen
2006-06-02 22:23 ` [patch 5/5] " Esben Nielsen

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=Pine.LNX.4.64.0606041834090.9391@localhost \
    --to=nielsen.esben@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.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.