All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuba Kicinski <kubakici@wp.pl>
To: Josh Cartwright <joshc@ni.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sean Nyekj?r <sean.nyekjaer@prevas.dk>,
	linux-serial@vger.kernel.org, linux-rt-users@vger.kernel.org,
	Jon Ringle <jringle@gridpoint.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] tty: serial: sc16is7xx: use threaded interrupts instead of homegrow
Date: Fri, 26 Feb 2016 13:26:27 -0500	[thread overview]
Message-ID: <835668C1-5DDB-4495-AD00-4EE8DDD0D146@wp.pl> (raw)
In-Reply-To: <20160226165228.GA17178@jcartwri.amer.corp.natinst.com>

On 26 February 2016 11:52:28 GMT-05:00, Josh Cartwright <joshc@ni.com> wrote:
>On Fri, Feb 26, 2016 at 09:34:57AM -0500, Kuba Kicinski wrote:
>> On 26 February 2016 06:48:09 GMT-05:00, Sebastian Andrzej Siewior
><bigeasy@linutronix.de> wrote:
>> >This ONESHOT + workqueue combo is something that is not required
>> >because
>> >we have infrastrucure for this kind of things: threaded interrupts.
>> >
>> >This is compile tested only due to -ENODEV.
>> >Now that we that sc16is7xx_irq() is an actual interrupt handler
>> >sc16is7xx_port_irq() could be improved so the former can return
>> >IRQ_NONE
>> >if nothing has been done.
>> >
>> >Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>>
>> The reason why this driver is not using threaded irqs is that it
>> already has a kthread to handle other things.
>
>The core problem here is still the use of IRQF_ONESHOT.  The semantics
>of IRQF_ONESHOT are only defined w.r.t. the irq core's threaded
>interrupt handling.
>
>If the driver isn't going to make use of the existing irqthread
>functionality, then it _also_ should not be making use of IRQF_ONESHOT.

Yes, I definitely dropped the ball there.

>Instead, the driver needs to implement it's own oneshot-like handling
>at
>the device-level: in the registered irq handler, capture triggered
>interrupt state, squelch/mask, and enqueue the kthread_work.  In the
>tail-end of the kthread_work, re-enable interrupts at the device level.

The problem there being IIRC that i2c doesn't provide async writes so we can't mask from irq callback. The only option would be disable_irq/enable_irq, right?


  reply	other threads:[~2016-02-26 18:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <56CDCCE6.5020801@prevas.dk>
2016-02-24 17:39 ` sc16is7xx: a lot of time is spend in sc16is7xx_port_irq Sean Nyekjær
2016-02-24 17:39   ` Sean Nyekjær
2016-02-24 22:35   ` Josh Cartwright
2016-02-26 11:43     ` Sebastian Andrzej Siewior
2016-02-26 11:48       ` [PATCH] tty: serial: sc16is7xx: use threaded interrupts instead of homegrow Sebastian Andrzej Siewior
2016-02-26 14:34         ` Kuba Kicinski
2016-02-26 16:52           ` Josh Cartwright
2016-02-26 18:26             ` Kuba Kicinski [this message]
2016-02-26 19:00               ` Josh Cartwright
2016-03-07 16:41                 ` Sebastian Andrzej Siewior
2016-03-07 16:58                   ` Josh Cartwright
2016-03-07 17:22                     ` Sean Nyekjær
2016-03-08 21:18                     ` Jakub Kicinski
2016-03-09  7:03                       ` Sean Nyekjær
2016-03-09  7:03                         ` Sean Nyekjær
2016-03-09 11:13                         ` Jakub Kicinski
2016-03-09 11:13                           ` Jakub Kicinski
2016-03-09 12:04                           ` Sebastian Andrzej Siewior
2016-03-09 14:06 Maarten Brock

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=835668C1-5DDB-4495-AD00-4EE8DDD0D146@wp.pl \
    --to=kubakici@wp.pl \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=joshc@ni.com \
    --cc=jringle@gridpoint.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sean.nyekjaer@prevas.dk \
    --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 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.