lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8a8797e-a8ef-6d22-be76-97c27cea6819@gmail.com>
Date:   Thu, 8 Oct 2020 16:11:10 +1100
From:   Brad Harper <bjharper@...il.com>
To:     Jerome Brunet <jbrunet@...libre.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ulf Hansson <ulf.hansson@...aro.org>
Cc:     Kevin Hilman <khilman@...libre.com>,
        "open list:ARM/Amlogic Meson..." <linux-amlogic@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Marc Zyngier <maz@...nel.org>
Subject: Re: [PATCH] mmc: meson-gx: remove IRQF_ONESHOT

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@...libre.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@...il.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;
}

---

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ