linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hjk@hansjkoch.de (Hans J. Koch)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] PRUSS UIO driver support
Date: Sat, 19 Feb 2011 19:34:27 +0100	[thread overview]
Message-ID: <20110219183427.GG4684@local> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB593024B83C108@dbde02.ent.ti.com>

On Sat, Feb 19, 2011 at 09:10:23PM +0530, TK, Pratheesh Gangadhar wrote:
> 
> For my understanding - if the interrupt is not shared and not level triggered -
> is this okay to have empty handler?

Greg already said he won't accept that. And I'm quite sure these interrupts
are level triggered, since that is the default on arch/omap.

E.g. in arch/arm/mach-omap1/irq.c, a loop sets all irqs to level triggered
handling: set_irq_handler(j, handle_level_irq); (line 234)

> In this specific case, these interrupt lines are internal to SOC and hooked to ARM INTC from PRUSS. PRUSS has another INTC to handle system events to PRUSS as well as to generate system events to host ARM. These generated events are used for IPC between user application and PRU firmware and for async notifications from PRU firmware to user space. I don't see a reason to make it shared as we have 8 lines available for use. As mentioned before ARM INTC interrupt processing logic converts interrupts to active high pulses.

What's a "pulse triggered interrupt"? I know level and edge triggered ones.

> 
> I also looked at the interrupt handling in existing UIO drivers
> 
> 
> static irqreturn_t my_uio_handler(int irq, struct uio_info *dev_info)
> {
>         if (no interrupt is enabled and no interrupt is active) /For shared interrupt handling
>                 return IRQ_NONE;
> 
>         disable interrupt; // For level triggered interrupts 
>         return IRQ_HANDLED;
> }
> 
> It's not clear how and where interrupts are re-enabled. Is this expected to be done from user space?

That's the normal case, yes. You re-enable the interrupts by accessing the irq
mask register of your chip.

> 
> Uio_secos3.c has an irqcontrol function to enable/disable interrupts. Is this the recommended approach?

No. That is a workaround for broken hardware. You need it if and only if your
chip 1) has several internal irq sources and 2) there's no possibility for
the kernel to mask the interrupt in the chip without loosing the information
which irq source actually triggered the interrupt.

If that is the case, the kernel will disable the irq line in some other way
without touching the chip. Userspace then needs a way to re-enable irqs,
and that's where the irqcontrol function is used.

Normally, you shouldn't need it.

Thanks,
Hans

  reply	other threads:[~2011-02-19 18:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-18 15:05 [PATCH 0/2] Add PRUSS UIO driver support Pratheesh Gangadhar
2011-02-18 15:05 ` [PATCH 1/2] " Pratheesh Gangadhar
2011-02-18 15:05   ` [PATCH 2/2] Defines DA850/AM18xx/OMAPL1-38 SOC resources used by PRUSS UIO driver Pratheesh Gangadhar
2011-02-21 17:10     ` Sergei Shtylyov
2011-02-22 11:38       ` TK, Pratheesh Gangadhar
2011-02-18 15:44   ` [PATCH 1/2] PRUSS UIO driver support Arnd Bergmann
2011-02-18 16:15     ` Thomas Gleixner
2011-02-18 16:31       ` Arnd Bergmann
2011-02-18 17:03         ` Thomas Gleixner
2011-02-19 15:40           ` TK, Pratheesh Gangadhar
2011-02-19 18:34             ` Hans J. Koch [this message]
2011-02-21  3:57               ` TK, Pratheesh Gangadhar
2011-02-21 19:33                 ` Hans J. Koch
2011-02-21 19:37                   ` Thomas Gleixner
2011-02-21 19:53                   ` Sergei Shtylyov
2011-02-22 12:06                     ` TK, Pratheesh Gangadhar
2011-02-19 10:19     ` TK, Pratheesh Gangadhar
2011-02-18 16:31   ` Hans J. Koch
2011-02-18 17:05     ` Greg KH
2011-02-19 16:06       ` TK, Pratheesh Gangadhar
2011-02-19 11:30     ` TK, Pratheesh Gangadhar
2011-02-18 16:51   ` Thomas Gleixner
2011-02-19 12:47     ` TK, Pratheesh Gangadhar
2011-02-19 13:26   ` Russell King - ARM Linux

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=20110219183427.GG4684@local \
    --to=hjk@hansjkoch.de \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).