public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Hans J. Koch" <hjk@linutronix.de>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-kernel@vger.kernel.org, Uwe.Kleine-Koenig@digi.com,
	gregkh@suse.de, akpm@linux-foundation.org, hjk@linutronix.de,
	lethal@linux-sh.org, tglx@linutronix.de
Subject: Re: [PATCH] uio: User IRQ Mode
Date: Wed, 2 Jul 2008 14:54:00 +0200	[thread overview]
Message-ID: <20080702125400.GC3199@local> (raw)
In-Reply-To: <20080702105951.22648.2197.sendpatchset@rx1.opensource.se>

On Wed, Jul 02, 2008 at 07:59:51PM +0900, Magnus Damm wrote:
> From: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
> 
> This patch adds a "User IRQ Mode" to UIO. In this mode the user space driver
> is responsible for acknowledging and re-enabling the interrupt.

This can easily be done without your patch.

> Shared interrupts are not supported by this mode.
> 
> Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> ---
> 
>  Similar code has been posted some time ago as:
>  "[PATCH] uio_pdrv: Unique IRQ Mode"
>  "[PATCH 00/03][RFC] Reusable UIO Platform Driver".

Yes, and in that thread I gave detailed explanations why I won't accept
that.

> 
>  Changes since Uwe's last version:
>   - flags should be unsigned long
>   - simplify uio_userirq_handler()

That's nearly nothing. All you do is sending the same stuff three weeks
later in the hope somebody will merge it this time. NAK.

Thanks,
Hans

> 
>  Needs "[PATCH 0/1] UIO: Add a write() function to enable/disable interrupts"
> 
>  include/linux/uio_driver.h |   29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> --- 0020/include/linux/uio_driver.h
> +++ work/include/linux/uio_driver.h	2008-07-02 19:45:55.000000000 +0900
> @@ -17,6 +17,7 @@
>  #include <linux/module.h>
>  #include <linux/fs.h>
>  #include <linux/interrupt.h>
> +#include <linux/bitops.h>
>  
>  struct uio_map;
>  
> @@ -63,6 +64,7 @@ struct uio_info {
>  	long			irq;
>  	unsigned long		irq_flags;
>  	void			*priv;
> +	unsigned long		flags;
>  	irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
>  	int (*mmap)(struct uio_info *info, struct vm_area_struct *vma);
>  	int (*open)(struct uio_info *info, struct inode *inode);
> @@ -92,4 +94,31 @@ extern void uio_event_notify(struct uio_
>  #define UIO_MEM_LOGICAL	2
>  #define UIO_MEM_VIRTUAL 3
>  
> +/* defines for uio_info->flags */
> +#define UIO_FLAGS_IRQDISABLED 0
> +
> +static inline irqreturn_t uio_userirq_handler(int irq,
> +		struct uio_info *dev_info)
> +{
> +	int ret = -1;
> +
> +	if (likely(dev_info->irqcontrol))
> +		ret = dev_info->irqcontrol(dev_info, 0);
> +
> +	return IRQ_RETVAL(ret == 0);
> +}
> +
> +static inline int uio_userirq_irqcontrol(struct uio_info *info, s32 irq_on)
> +{
> +	if (irq_on) {
> +		if (test_and_clear_bit(UIO_FLAGS_IRQDISABLED, &info->flags))
> +			enable_irq(info->irq);
> +	} else {
> +		if (!test_and_set_bit(UIO_FLAGS_IRQDISABLED, &info->flags))
> +			disable_irq(info->irq);
> +	}
> +
> +	return 0;
> +}
> +
>  #endif /* _LINUX_UIO_DRIVER_H_ */

  parent reply	other threads:[~2008-07-02 12:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02 10:59 [PATCH] uio: User IRQ Mode Magnus Damm
2008-07-02 11:11 ` Alan Cox
2008-07-02 11:42   ` Uwe Kleine-König
2008-07-02 11:31     ` Alan Cox
2008-07-03  5:11       ` Magnus Damm
2008-07-03 10:23   ` Magnus Damm
2008-07-02 12:54 ` Hans J. Koch [this message]
2008-07-03  7:10   ` Uwe Kleine-König
2008-07-03 12:45     ` Hans J. Koch
2008-07-03 13:23       ` Paul Mundt
2008-07-03 19:55         ` Hans J. Koch
2008-07-04  2:55           ` Magnus Damm
2008-07-04 12:44             ` Hans J. Koch
2008-07-04  4:03       ` Magnus Damm
2008-07-04  6:01         ` Uwe Kleine-König
2008-07-04  7:48           ` Magnus Damm
2008-07-04  8:11             ` Uwe Kleine-König
2008-07-04  8:29               ` Paul Mundt
2008-07-04 13:39                 ` Hans J. Koch
2008-07-04  8:16           ` Alan Cox
2008-07-04 13:32           ` Hans J. Koch
2008-07-04 13:26         ` Hans J. Koch
2008-07-04 22:51           ` Magnus Damm

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=20080702125400.GC3199@local \
    --to=hjk@linutronix.de \
    --cc=Uwe.Kleine-Koenig@digi.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox