lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 24 May 2008 23:34:33 +0100
From:	"Tom Spink" <tspink@...il.com>
To:	"Thomas Gleixner" <tglx@...utronix.de>
Cc:	"Greg KH" <gregkh@...e.de>, "Hans J. Koch" <hjk@...utronix.de>,
	"Uwe Kleine-K??nig" <Uwe.Kleine-Koenig@...i.com>,
	linux-kernel@...r.kernel.org,
	"Jan Altenberg" <jan.altenberg@...utronix.de>,
	"Magnus Damm" <magnus.damm@...il.com>
Subject: Re: [PATCH 1/1] UIO: Add a write() function to enable/disable interrupts

2008/5/24 Thomas Gleixner <tglx@...utronix.de>:
> On Fri, 23 May 2008, Greg KH wrote:
>
>> On Fri, May 23, 2008 at 01:55:57PM +0200, Hans J. Koch wrote:
>> > Sometimes it is necessary to enable/disable the interrupt of a UIO device
>> > from the userspace part of the driver. With this patch, the UIO kernel driver
>> > can implement an "irqcontrol()" function that does this. Userspace can write
>> > an s32 value to /dev/uioX (usually 0 or 1 to turn the irq off or on). The
>> > UIO core will then call the driver's irqcontrol function.
>>
>> Why not just a new sysfs file for the uio device, irq_enabled, or
>> something like that?  That way our main read/write path is left alone.

Hi,

> It makes a certain amount of sense to use write. You hold the device
> file descriptor anyway for the read (wait for interrupt) operation,
> so using the same file descriptor is not a too bad idea:

What do you think about my ioctl idea, earlier in the thread?

>    while (!stop) {
>
>        /* wait for interrupt */
>        read(fd);
>
>        do_stuff();
>
>        /*reenable interrupt */
>        write(fd);
>    }

So, instead of write, you'd use ioctl(fd, ...).

> I thought about using a sysfs entry for a while, but looking at the
> actual use case made the write() solution a more natural choice.

I thought ioctl would be more natural, as [en,dis]abling interrupts is
a "controlling" operation :-)

> Thanks,
>
>        tglx

-- 
Tom Spink
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ