mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Fabio Estevam <festevam@gmail.com>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	kernel-janitors@vger.kernel.org, Jiri Slaby <jslaby@suse.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] serial: sccnxp: convert devm irq to non devm version
Date: Mon, 14 Sep 2015 20:45:29 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1509142045250.2048@localhost6.localdomain6> (raw)
In-Reply-To: <CAOMZO5BPUPW_DerteqxjMLRn-y8jaw149-3ogeq7OHO6uS=TFg@mail.gmail.com>



On Mon, 14 Sep 2015, Fabio Estevam wrote:

> On Sun, Sep 13, 2015 at 10:44 AM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> 
> > --- a/drivers/tty/serial/sccnxp.c
> > +++ b/drivers/tty/serial/sccnxp.c
> > @@ -963,11 +963,9 @@ static int sccnxp_probe(struct platform_device *pdev)
> >         sccnxp_write(&s->port[0], SCCNXP_IMR_REG, 0);
> >
> >         if (!s->poll) {
> > -               ret = devm_request_threaded_irq(&pdev->dev, s->irq, NULL,
> > -                                               sccnxp_ist,
> > -                                               IRQF_TRIGGER_FALLING |
> > -                                               IRQF_ONESHOT,
> > -                                               dev_name(&pdev->dev), s);
> > +               ret = request_threaded_irq(s->irq, NULL, sccnxp_ist,
> > +                                          IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> > +                                          dev_name(&pdev->dev), s);
> >                 if (!ret)
> >                         return 0;
> >
> > @@ -994,7 +992,7 @@ static int sccnxp_remove(struct platform_device *pdev)
> >         struct sccnxp_port *s = platform_get_drvdata(pdev);
> >
> >         if (!s->poll)
> > -               devm_free_irq(&pdev->dev, s->irq, s);
> > +               free_irq(s->irq, s);
> 
> Couldn't we just remove the devm_free_irq() and keep using
> devm_request_threaded_irq()?
> 
> Like this:

I assumed that if the person went to the trouble of putting it there, it 
was because the interrupt handler needs some data that is freed later in 
the remove function and interrupts have to be turned off at this point.  I 
can look into it more though, but the interactions are not always easy to 
spot.

julia


> 
> --- a/drivers/tty/serial/sccnxp.c
> +++ b/drivers/tty/serial/sccnxp.c
> @@ -993,9 +993,7 @@ static int sccnxp_remove(struct platform_device *pdev)
>         int i;
>         struct sccnxp_port *s = platform_get_drvdata(pdev);
> 
> -       if (!s->poll)
> -               devm_free_irq(&pdev->dev, s->irq, s);
> -       else
> +       if (s->poll)
>                 del_timer_sync(&s->timer);
> 
>         for (i = 0; i < s->uart.nr; i++)
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      reply	other threads:[~2015-09-14 18:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-13 13:44 Julia Lawall
2015-09-14 16:19 ` Fabio Estevam
2015-09-14 18:45   ` Julia Lawall [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=alpine.DEB.2.02.1509142045250.2048@localhost6.localdomain6 \
    --to=julia.lawall@lip6.fr \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®