From: Neil Armstrong <narmstrong@neotion.com>
To: "Hans J. Koch" <hjk@linutronix.de>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] uio: add ioctl callback
Date: Wed, 12 Nov 2008 17:43:40 +0100 [thread overview]
Message-ID: <491B07BC.1050900@neotion.com> (raw)
In-Reply-To: <20081112162333.GD2891@local>
[-- Attachment #1: Type: text/plain, Size: 2062 bytes --]
Hi,
I should have specified that I work on a SoC, which does not follow
strict rules like PCI devices.
From a hardware designer point of view, this is a "good" design
especially for this kind of device. (DVB Conditionnal Access Slave
Shared Memory)
If the code was in the kernel space, we could do some processing in irq
mode like other devices of the SoC.
Thanks for your time and comments, I will see the irqcontrol solution as
an alternative.
Just forget my patch since it's only applicable to very specific devices.
Neil
Hans J. Koch a écrit :
> On Wed, Nov 12, 2008 at 04:59:56PM +0100, Neil Armstrong wrote:
>
>> Hi Hans,
>>
>> We need an ioctl callback because we need to query some values only
>> available when the irq handler is running.
>> For example, we have 3 types of reasons why the irq is triggered and
>> these bits are no more available when the irq is cleared.
>>
>
> Ah, that one. That's why we invented the irqcontrol hook. In case of
> such broken hardware, you need to mask the irq in the kernel without
> touching the register containing those volatile bits. On a system where
> you can be sure the irq is not shared, you can simply use disable_irq().
>
> If the irq might be shared, you need to find something else. PCI cards,
> for example, often have a register within their PCI bridge that contains
> irq mask bits (that's how it is done in uio_cif.c).
>
> Userspace can then reenable the irq by writing the value 1 as a signed
> 32-bit int to /dev/uioX. You need to implement an irqcontrol() function
> in your kernel driver that does the right thing (e.g. call enable_irq()
> in the first example).
>
>
>> The cleanest way to have this very specific information is to have a
>> dirty old ioctl returning this data.
>>
>
> The cleanest way would be to throw such hardware into the trash bin :-)
>
> A chip where the irq mask register cannot be written without destroying
> the irq status register is simply broken and bad design.
>
> Thanks,
> Hans
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
prev parent reply other threads:[~2008-11-12 16:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-12 15:40 [PATCH] uio: add ioctl callback Neil Armstrong
2008-11-12 15:49 ` Hans J. Koch
2008-11-12 15:59 ` Neil Armstrong
2008-11-12 16:10 ` Greg KH
2008-11-12 16:23 ` Hans J. Koch
2008-11-12 16:43 ` Neil Armstrong [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=491B07BC.1050900@neotion.com \
--to=narmstrong@neotion.com \
--cc=gregkh@suse.de \
--cc=hjk@linutronix.de \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox