Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1685184
| From | Tony Lindgren <tony@atomide.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [GIT pull] irq updates for 4.13 |
| Date | 2017-07-11 18:20 +0200 |
| Message-ID | <u263g-4Bc-27@gated-at.bofh.it> (permalink) |
| References | (3 earlier) <u1Xjl-7kC-21@gated-at.bofh.it> <u1ZXQ-zq-7@gated-at.bofh.it> <u23RP-31D-137@gated-at.bofh.it> <u24Ea-3xP-15@gated-at.bofh.it> <u25Ae-48y-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
* Linus Torvalds <torvalds@linux-foundation.org> [170711 08:40]:
> On Tue, Jul 11, 2017 at 7:41 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > Ah. Now that makes sense.
> >
> > Unpatched the ordering is:
> >
> > chip_bus_lock(desc);
> > irq_request_resources(desc);
>
> I *looked* at that ordering and then went "Naah, that makes no sense".
>
> But if that's the only issue, how about we just re-order those things
> - we still don't need to move the irq_request_resources() into the
> spinlock, we just move it to below the chip_bus_lock().
>
> IOW, something like the (COMPLETELY UNTEESTED!) attached patch.
Yeah that fixes the issue:
Tested-by: Tony Lindgren <tony@atomide.com>
> This assumes that the chip_bus_lock() thing is still ok for the RT
> case, but it looks like it might be: the only other one I looked at
> (apart from the gpio-omap one) used a mutex.
Yeah and the ordering below makes more sense to me at least. That is
assuming we want to call chip_bus_lock() before we start calling the
chip functions :)
Regards,
Tony
> kernel/irq/manage.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 5624b2dd6b58..ea1b9404c041 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -1168,17 +1168,17 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
> new->flags &= ~IRQF_ONESHOT;
>
> mutex_lock(&desc->request_mutex);
> + chip_bus_lock(desc);
> +
> if (!desc->action) {
> ret = irq_request_resources(desc);
> if (ret) {
> pr_err("Failed to request resources for %s (irq %d) on irqchip %s\n",
> new->name, irq, desc->irq_data.chip->name);
> - goto out_mutex;
> + goto out_unlock_chip_bus;
> }
> }
>
> - chip_bus_lock(desc);
> -
> /*
> * The following block of code has to be executed atomically
> */
> @@ -1385,12 +1385,11 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
> out_unlock:
> raw_spin_unlock_irqrestore(&desc->lock, flags);
>
> - chip_bus_sync_unlock(desc);
> -
> if (!desc->action)
> irq_release_resources(desc);
>
> -out_mutex:
> +out_unlock_chip_bus:
> + chip_bus_sync_unlock(desc);
> mutex_unlock(&desc->request_mutex);
>
> out_thread:
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-09 11:00 +0200
Re: [GIT pull] irq updates for 4.13 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-10 15:40 +0200
Re: [GIT pull] irq updates for 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-10 19:10 +0200
Re: [GIT pull] irq updates for 4.13 Pavel Machek <pavel@ucw.cz> - 2017-07-10 21:40 +0200
Re: [GIT pull] irq updates for 4.13 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-10 22:20 +0200
Re: [GIT pull] irq updates for 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-10 23:30 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 09:00 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 11:50 +0200
Re: [GIT pull] irq updates for 4.13 Tony Lindgren <tony@atomide.com> - 2017-07-11 16:00 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 16:50 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 17:10 +0200
Re: [GIT pull] irq updates for 4.13 Tony Lindgren <tony@atomide.com> - 2017-07-11 17:50 +0200
Re: [GIT pull] irq updates for 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-11 17:50 +0200
Re: [GIT pull] irq updates for 4.13 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-11 18:20 +0200
Re: [GIT pull] irq updates for 4.13 Tony Lindgren <tony@atomide.com> - 2017-07-11 18:20 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 19:20 +0200
Re: [GIT pull] irq updates for 4.13 Tony Lindgren <tony@atomide.com> - 2017-07-11 19:40 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 18:30 +0200
Re: [GIT pull] irq updates for 4.13 Tony Lindgren <tony@atomide.com> - 2017-07-11 18:40 +0200
Re: [GIT pull] irq updates for 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-11 18:40 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 20:00 +0200
Re: [GIT pull] irq updates for 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-11 20:20 +0200
Re: [GIT pull] irq updates for 4.13 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-11 23:40 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@tglx.de> - 2017-07-12 00:10 +0200
Re: [GIT pull] irq updates for 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-12 00:10 +0200
Re: [GIT pull] irq updates for 4.13 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-12 01:00 +0200
Re: [GIT pull] irq updates for 4.13 Tony Lindgren <tony@atomide.com> - 2017-07-12 07:30 +0200
Re: [GIT pull] irq updates for 4.13 Pavel Machek <pavel@ucw.cz> - 2017-07-15 22:30 +0200
Re: [GIT pull] irq updates for 4.13 Tony Lindgren <tony@atomide.com> - 2017-07-17 08:30 +0200
Re: [GIT pull] irq updates for 4.13 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-17 22:10 +0200
Re: [GIT pull] irq updates for 4.13 Pavel Machek <pavel@ucw.cz> - 2017-07-17 23:40 +0200
Re: [GIT pull] irq updates for 4.13 Grygorii Strashko <grygorii.strashko@ti.com> - 2017-07-11 17:50 +0200
Re: [GIT pull] irq updates for 4.13 Tony Lindgren <tony@atomide.com> - 2017-07-11 18:20 +0200
Re: [GIT pull] irq updates for 4.13 Geert Uytterhoeven <geert@linux-m68k.org> - 2017-07-12 10:10 +0200
Re: [GIT pull] irq updates for 4.13 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-11 16:50 +0200
Re: [GIT pull] irq updates for 4.13 Tony Lindgren <tony@atomide.com> - 2017-07-11 18:30 +0200
Re: [GIT pull] irq updates for 4.13 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-11 18:40 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 12:00 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 13:00 +0200
Re: [GIT pull] irq updates for 4.13 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-11 13:30 +0200
Re: [GIT pull] irq updates for 4.13 Thomas Gleixner <tglx@linutronix.de> - 2017-07-11 15:30 +0200
Re: [GIT pull] irq updates for 4.13 Marc Zyngier <marc.zyngier@arm.com> - 2017-07-11 16:00 +0200
Re: [GIT pull] irq updates for 4.13 Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-11 16:50 +0200
csiph-web