linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Brad Harper <bjharper@gmail.com>
To: Jerome Brunet <jbrunet@baylibre.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kevin Hilman <khilman@baylibre.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Marc Zyngier <maz@kernel.org>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>
Subject: Re: [PATCH] mmc: meson-gx: remove IRQF_ONESHOT
Date: Thu, 8 Oct 2020 16:11:10 +1100	[thread overview]
Message-ID: <c8a8797e-a8ef-6d22-be76-97c27cea6819@gmail.com> (raw)
In-Reply-To: <1jy2ki1db4.fsf@starbuckisacylon.baylibre.com>

On 7/10/2020 10:32 pm, Jerome Brunet wrote:
> With arm64 defconfig on Khadas vim3, no obvious regression. Looks good.
>
> Tested-by: Jerome Brunet <jbrunet@baylibre.com>
>
> I did not test with RT. Brad, Could you let us know is Thomas's patch
> works for you ? Thx
There was a merge conflict in applying against v5.9-rc8-rt12 with
particular this patch:
https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/kernel/irq/manage.c?h=linux-5.9.y-rt&id=18df00ef0b2b1513dc8f1a9ed26b11fff2261c30

I did manage to add the patch after attempting to resolve the conflict
which solves the deadlock issue I am seeing with mmc and works fine during
testing (a kernel compilation on preempt_rt configured kernel).

irq_thread in /kernel/irq/manage.c Looks like this (not 100% sure I
should have placed the irq_finalize_oneshot before
add_interrupt_randomness).

Based on this I can provide

Tested-by: Brad Harper <bjharper@gmail.com>

---
static int irq_thread(void *data)
{
         struct callback_head on_exit_work;
         struct irqaction *action = data;
         struct irq_desc *desc = irq_to_desc(action->irq);
         irqreturn_t (*handler_fn)(struct irq_desc *desc,
                         struct irqaction *action);

         if (force_irqthreads && test_bit(IRQTF_FORCED_THREAD,
&action->thread_flags))
                 handler_fn = irq_forced_thread_fn;
         else
                 handler_fn = irq_thread_fn;

         init_task_work(&on_exit_work, irq_thread_dtor);
         task_work_add(current, &on_exit_work, false);

         irq_thread_check_affinity(desc, action);

         while (!irq_wait_for_interrupt(action)) {
                 irqreturn_t action_ret;

                 irq_thread_check_affinity(desc, action);

                 action_ret = handler_fn(desc, action);
                 if (action_ret == IRQ_HANDLED)
                         atomic_inc(&desc->threads_handled);

                 if (action_ret == IRQ_WAKE_THREAD)
                         irq_wake_secondary(desc, action);

                 irq_finalize_oneshot(desc, action);

                 if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
                        migrate_disable();
                        add_interrupt_randomness(action->irq, 0,
                                 desc->random_ip ^ (unsigned long) action);
                        migrate_enable();
                 }
                 wake_threads_waitq(desc);
         }

         /*
          * This is the regular exit path. __free_irq() is stopping the
          * thread via kthread_stop() after calling
          * synchronize_hardirq(). So neither IRQTF_RUNTHREAD nor the
          * oneshot mask bit can be set.
          */
         task_work_cancel(current, irq_thread_dtor);
         return 0;
}

---


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2020-10-08  5:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 16:49 [PATCH] mmc: meson-gx: remove IRQF_ONESHOT Jerome Brunet
2020-10-05  8:22 ` Ulf Hansson
2020-10-05  8:55   ` Thomas Gleixner
2020-10-05 12:31     ` Jerome Brunet
2020-10-06 12:43     ` Thomas Gleixner
2020-10-06 13:45       ` Brad Harper
2020-10-06 15:33         ` Thomas Gleixner
2020-10-07 11:32           ` Jerome Brunet
2020-10-08  5:11             ` Brad Harper [this message]
2020-10-08  9:08           ` Ulf Hansson
2020-11-10 15:04             ` Jerome Brunet
2020-11-11 10:47               ` Ulf Hansson
2020-11-13 15:25                 ` Jerome Brunet

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=c8a8797e-a8ef-6d22-be76-97c27cea6819@gmail.com \
    --to=bjharper@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=ulf.hansson@linaro.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).