From: Dejin Zheng <zhengdejin5@gmail.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-fbdev@vger.kernel.org, tsbogend@alpha.franken.de,
FlorianSchandinat@gmx.de, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Andy Shevchenko <andy.shevchenko@gmail.com>,
ralf@linux-mips.org, tglx@linutronix.de
Subject: Re: [PATCH v2] console: console: Complete exception handling in newport_probe()
Date: Thu, 23 Apr 2020 15:51:16 +0000 [thread overview]
Message-ID: <20200423155116.GA2247@nuc8i5> (raw)
In-Reply-To: <081f8192-1708-80ff-6eef-885d72bdf5c5@samsung.com>
On Thu, Apr 23, 2020 at 04:55:35PM +0200, Bartlomiej Zolnierkiewicz wrote:
>
> Hi,
>
> I believe that the patch summary line should be:
>
> "[PATCH v2] console: newport_con: ..."
>
OK, thanks!
> On 4/23/20 4:26 PM, Dejin Zheng wrote:
> > A call of the function ¡°do_take_over_console¡± can fail here.
> > The corresponding system resources were not released then.
> > Thus add a call of the function ¡°iounmap¡± together with the check
> > of a failure predicate.
> >
> > Fixes: e84de0c6190503 ("MIPS: GIO bus support for SGI IP22/28")
>
> I cannot see how this patch fixes commit e84de0c6190503
> (AFAICS npregs has also been leaked on error before)?
>
yes, you are right, the commit should be e86bb8acc0fdca82d2
("[PATCH] VT binding: Make newport_con support binding")
- move register ioremap from newport_startup() to newport_console_init()
> > CC: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> > ---
> > v1 -> v2:
> > - modify the commit comments by Markus'suggestion.
> >
> > drivers/video/console/newport_con.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
> > index 00dddf6e08b0..6bfc8e3ffd4a 100644
> > --- a/drivers/video/console/newport_con.c
> > +++ b/drivers/video/console/newport_con.c
> > @@ -720,6 +720,9 @@ static int newport_probe(struct gio_device *dev,
> > console_lock();
> > err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> > console_unlock();
> > +
> > + if (err)
> > + iounmap((void *)npregs);
>
> Looks OK but while you are at it, could you please also add missing
> release_mem_region() on error and on device removal:
>
Ok, Thanks, I will send the patch v3 for it.
> newport_addr = dev->resource.start + 0xF0000;
> if (!request_mem_region(newport_addr, 0x10000, "Newport"))
> return -ENODEV;
>
> npregs = (struct newport_regs *)/* ioremap cannot fail */
> ioremap(newport_addr, sizeof(struct newport_regs));
> console_lock();
> err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> console_unlock();
> return err;
> }
>
> static void newport_remove(struct gio_device *dev)
> {
> give_up_console(&newport_con);
> iounmap((void *)npregs);
> }
>
> ?
>
> > return err;
> > }
> >
>
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
WARNING: multiple messages have this Message-ID (diff)
From: Dejin Zheng <zhengdejin5@gmail.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-fbdev@vger.kernel.org, tsbogend@alpha.franken.de,
FlorianSchandinat@gmx.de, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Andy Shevchenko <andy.shevchenko@gmail.com>,
ralf@linux-mips.org, tglx@linutronix.de
Subject: Re: [PATCH v2] console: console: Complete exception handling in newport_probe()
Date: Thu, 23 Apr 2020 23:51:16 +0800 [thread overview]
Message-ID: <20200423155116.GA2247@nuc8i5> (raw)
In-Reply-To: <081f8192-1708-80ff-6eef-885d72bdf5c5@samsung.com>
On Thu, Apr 23, 2020 at 04:55:35PM +0200, Bartlomiej Zolnierkiewicz wrote:
>
> Hi,
>
> I believe that the patch summary line should be:
>
> "[PATCH v2] console: newport_con: ..."
>
OK, thanks!
> On 4/23/20 4:26 PM, Dejin Zheng wrote:
> > A call of the function ¡°do_take_over_console¡± can fail here.
> > The corresponding system resources were not released then.
> > Thus add a call of the function ¡°iounmap¡± together with the check
> > of a failure predicate.
> >
> > Fixes: e84de0c6190503 ("MIPS: GIO bus support for SGI IP22/28")
>
> I cannot see how this patch fixes commit e84de0c6190503
> (AFAICS npregs has also been leaked on error before)?
>
yes, you are right, the commit should be e86bb8acc0fdca82d2
("[PATCH] VT binding: Make newport_con support binding")
- move register ioremap from newport_startup() to newport_console_init()
> > CC: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> > ---
> > v1 -> v2:
> > - modify the commit comments by Markus'suggestion.
> >
> > drivers/video/console/newport_con.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
> > index 00dddf6e08b0..6bfc8e3ffd4a 100644
> > --- a/drivers/video/console/newport_con.c
> > +++ b/drivers/video/console/newport_con.c
> > @@ -720,6 +720,9 @@ static int newport_probe(struct gio_device *dev,
> > console_lock();
> > err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> > console_unlock();
> > +
> > + if (err)
> > + iounmap((void *)npregs);
>
> Looks OK but while you are at it, could you please also add missing
> release_mem_region() on error and on device removal:
>
Ok, Thanks, I will send the patch v3 for it.
> newport_addr = dev->resource.start + 0xF0000;
> if (!request_mem_region(newport_addr, 0x10000, "Newport"))
> return -ENODEV;
>
> npregs = (struct newport_regs *)/* ioremap cannot fail */
> ioremap(newport_addr, sizeof(struct newport_regs));
> console_lock();
> err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> console_unlock();
> return err;
> }
>
> static void newport_remove(struct gio_device *dev)
> {
> give_up_console(&newport_con);
> iounmap((void *)npregs);
> }
>
> ?
>
> > return err;
> > }
> >
>
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Dejin Zheng <zhengdejin5@gmail.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: gregkh@linuxfoundation.org, tglx@linutronix.de,
FlorianSchandinat@gmx.de, ralf@linux-mips.org,
tsbogend@alpha.franken.de, dri-devel@lists.freedesktop.org,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v2] console: console: Complete exception handling in newport_probe()
Date: Thu, 23 Apr 2020 23:51:16 +0800 [thread overview]
Message-ID: <20200423155116.GA2247@nuc8i5> (raw)
In-Reply-To: <081f8192-1708-80ff-6eef-885d72bdf5c5@samsung.com>
On Thu, Apr 23, 2020 at 04:55:35PM +0200, Bartlomiej Zolnierkiewicz wrote:
>
> Hi,
>
> I believe that the patch summary line should be:
>
> "[PATCH v2] console: newport_con: ..."
>
OK, thanks!
> On 4/23/20 4:26 PM, Dejin Zheng wrote:
> > A call of the function ¡°do_take_over_console¡± can fail here.
> > The corresponding system resources were not released then.
> > Thus add a call of the function ¡°iounmap¡± together with the check
> > of a failure predicate.
> >
> > Fixes: e84de0c6190503 ("MIPS: GIO bus support for SGI IP22/28")
>
> I cannot see how this patch fixes commit e84de0c6190503
> (AFAICS npregs has also been leaked on error before)?
>
yes, you are right, the commit should be e86bb8acc0fdca82d2
("[PATCH] VT binding: Make newport_con support binding")
- move register ioremap from newport_startup() to newport_console_init()
> > CC: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> > ---
> > v1 -> v2:
> > - modify the commit comments by Markus'suggestion.
> >
> > drivers/video/console/newport_con.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
> > index 00dddf6e08b0..6bfc8e3ffd4a 100644
> > --- a/drivers/video/console/newport_con.c
> > +++ b/drivers/video/console/newport_con.c
> > @@ -720,6 +720,9 @@ static int newport_probe(struct gio_device *dev,
> > console_lock();
> > err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> > console_unlock();
> > +
> > + if (err)
> > + iounmap((void *)npregs);
>
> Looks OK but while you are at it, could you please also add missing
> release_mem_region() on error and on device removal:
>
Ok, Thanks, I will send the patch v3 for it.
> newport_addr = dev->resource.start + 0xF0000;
> if (!request_mem_region(newport_addr, 0x10000, "Newport"))
> return -ENODEV;
>
> npregs = (struct newport_regs *)/* ioremap cannot fail */
> ioremap(newport_addr, sizeof(struct newport_regs));
> console_lock();
> err = do_take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
> console_unlock();
> return err;
> }
>
> static void newport_remove(struct gio_device *dev)
> {
> give_up_console(&newport_con);
> iounmap((void *)npregs);
> }
>
> ?
>
> > return err;
> > }
> >
>
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
next prev parent reply other threads:[~2020-04-23 15:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200423142637eucas1p2ea543e281d96c75aa4292b49756f2146@eucas1p2.samsung.com>
2020-04-23 14:26 ` [PATCH v2] console: console: Complete exception handling in newport_probe() Dejin Zheng
2020-04-23 14:26 ` Dejin Zheng
2020-04-23 14:26 ` Dejin Zheng
2020-04-23 14:52 ` Andy Shevchenko
2020-04-23 14:52 ` Andy Shevchenko
2020-04-23 14:52 ` Andy Shevchenko
2020-04-23 16:03 ` Dejin Zheng
2020-04-23 16:03 ` Dejin Zheng
2020-04-23 16:03 ` Dejin Zheng
2020-04-23 14:55 ` Bartlomiej Zolnierkiewicz
2020-04-23 14:55 ` Bartlomiej Zolnierkiewicz
2020-04-23 14:55 ` Bartlomiej Zolnierkiewicz
2020-04-23 15:05 ` Andy Shevchenko
2020-04-23 15:05 ` Andy Shevchenko
2020-04-23 15:05 ` Andy Shevchenko
2020-04-23 15:25 ` Bartlomiej Zolnierkiewicz
2020-04-23 15:25 ` Bartlomiej Zolnierkiewicz
2020-04-23 15:25 ` Bartlomiej Zolnierkiewicz
2020-04-23 15:51 ` Dejin Zheng [this message]
2020-04-23 15:51 ` Dejin Zheng
2020-04-23 15:51 ` Dejin Zheng
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=20200423155116.GA2247@nuc8i5 \
--to=zhengdejin5@gmail.com \
--cc=FlorianSchandinat@gmx.de \
--cc=andy.shevchenko@gmail.com \
--cc=b.zolnierkie@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=tglx@linutronix.de \
--cc=tsbogend@alpha.franken.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.