mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: dillon min <dillon.minfei@gmail.com>
Cc: Alexandre TORGUE <alexandre.torgue@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Erwan Le Ray <erwan.leray@foss.st.com>,
	Gerald Baeza <gerald.baeza@st.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH 2/3] serial: stm32: fix threaded interrupt handling
Date: Fri, 16 Apr 2021 16:46:02 +0200	[thread overview]
Message-ID: <YHmjKhH7xWz0BxEv@hovoldconsulting.com> (raw)
In-Reply-To: <CAL9mu0KwgOFQfa8ft4rB6+F=KLd1gZLYDvwpAW72zPAFntehVw@mail.gmail.com>

On Fri, Apr 16, 2021 at 10:35:25PM +0800, dillon min wrote:
> Hi Johan
> 
> Thanks for share your patch.
> 
> Johan Hovold <johan@kernel.org>于2021年4月16日 周五22:11写道:
> 
> > When DMA is enabled the receive handler runs in a threaded handler, but
> > the primary handler up until very recently neither disabled interrupts
> > in the device or used IRQF_ONESHOT. This would lead to a deadlock if an
> > interrupt comes in while the threaded receive handler is running under
> > the port lock.
> >
> Greg told me there was a patch fixed this case. In case hard irq &
> threaded_fn both offered. The local_irq_save() will be executed before call
> driver’s threaded handler.
> 
> Post the original mail from Greg
> 
> Please see 81e2073c175b ("genirq: Disable interrupts for force threaded
> handlers") for when threaded irq handlers have irqs disabled, isn't that
> the case you are trying to "protect" from here?
> 
> Why is the "threaded" flag used at all?  The driver should not care.
> 
> Also see 9baedb7baeda ("serial: imx: drop workaround for forced irq
> threading") in linux-next for an example of how this was fixed up in a
> serial driver.

Neither of these commits are (directly) related to the problem this
patch addresses (they are about force-threaded handlers, this is about a
normal threaded handler which run with interrupts enabled).

Johan

  parent reply	other threads:[~2021-04-16 14:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 14:05 [PATCH 0/3] serial: sysrq cleanup and stm32 fixes Johan Hovold
2021-04-16 14:05 ` [PATCH 1/3] serial: do not restore interrupt state in sysrq helper Johan Hovold
2021-04-16 14:05 ` [PATCH 2/3] serial: stm32: fix threaded interrupt handling Johan Hovold
2021-04-16 14:19   ` Johan Hovold
     [not found]   ` <CAL9mu0KwgOFQfa8ft4rB6+F=KLd1gZLYDvwpAW72zPAFntehVw@mail.gmail.com>
2021-04-16 14:46     ` Johan Hovold [this message]
2021-04-22  9:34   ` Valentin CARON - foss
2021-04-16 14:05 ` [PATCH 3/3] serial: stm32: defer sysrq processing Johan Hovold
2021-04-22  9:36   ` Valentin CARON - foss

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=YHmjKhH7xWz0BxEv@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=alexandre.torgue@st.com \
    --cc=dillon.minfei@gmail.com \
    --cc=erwan.leray@foss.st.com \
    --cc=gerald.baeza@st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=stable@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

all inboxes | Powered by JetHome®