linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Chris Brandt <chris.brandt@renesas.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH v2] serial: sh-sci: Do not free irqs that have already been freed
Date: Fri, 1 Feb 2019 15:18:43 +0100	[thread overview]
Message-ID: <CAMuHMdVE=ibQ3PFiwwKKS8LFfSq_6yH=Yqgm01D2VrUHuc=SvA@mail.gmail.com> (raw)
In-Reply-To: <20190128182556.34359-1-chris.brandt@renesas.com>

Hi Chris,

On Mon, Jan 28, 2019 at 7:26 PM Chris Brandt <chris.brandt@renesas.com> wrote:
> Since IRQs might be muxed on some parts, we need to pay attention when we
> are freeing them.
> Otherwise we get the ugly WARNING "Trying to free already-free IRQ 20".
>
> Fixes: 628c534ae735 ("serial: sh-sci: Improve support for separate TEI and DRI interrupts")
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
> v2:

Thanks for the update!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c

> @@ -1952,6 +1952,13 @@ static void sci_free_irq(struct sci_port *port)
>                 if (unlikely(irq < 0))
>                         continue;
>
> +               /* Check if already freed (irq was muxed) */
> +               for (j = 0; j < i; j++)
> +                       if (port->irqs[j] == irq)
> +                               j = i + 1;
> +               if (j > i)
> +                       continue;
> +
>                 free_irq(port->irqs[i], port);
>                 kfree(port->irqstr[i]);

I think the error path in sci_request_irq() needs similar handling, also for
SCIx_IRQ_IS_MUXED().

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

      parent reply	other threads:[~2019-02-01 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28 18:25 [PATCH v2] serial: sh-sci: Do not free irqs that have already been freed Chris Brandt
2019-01-30 10:04 ` Simon Horman
2019-02-01 14:18 ` Geert Uytterhoeven [this message]

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='CAMuHMdVE=ibQ3PFiwwKKS8LFfSq_6yH=Yqgm01D2VrUHuc=SvA@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=chris.brandt@renesas.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@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;
as well as URLs for NNTP newsgroup(s).