* Patch "mtd: nand: gpmi: Fix gpmi_nand_init() error path" has been added to the 4.4-stable tree
@ 2018-04-10 9:04 gregkh
2018-04-10 18:48 ` Amit Pundir
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2018-04-10 9:04 UTC (permalink / raw)
To: boris.brezillon, alexander.levin, gregkh, han.xu, marek.vasut
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
mtd: nand: gpmi: Fix gpmi_nand_init() error path
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mtd-nand-gpmi-fix-gpmi_nand_init-error-path.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From foo@baz Tue Apr 10 10:31:53 CEST 2018
From: Boris Brezillon <boris.brezillon@free-electrons.com>
Date: Mon, 10 Apr 2017 10:35:17 +0200
Subject: mtd: nand: gpmi: Fix gpmi_nand_init() error path
From: Boris Brezillon <boris.brezillon@free-electrons.com>
[ Upstream commit 4d02423e9afe6c46142ce98bbcaf5167316dbfbf ]
The GPMI driver is wrongly assuming that nand_release() can safely be
called on an uninitialized/unregistered NAND device.
Add a new err_nand_cleanup label in the error path and only execute if
nand_scan_tail() succeeded.
Note that we now call nand_cleanup() instead of nand_release()
(nand_release() is actually grouping the mtd_device_unregister() and
nand_cleanup() in one call) because there's no point in trying to
unregister a device that has never been registered.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Han Xu <han.xu@nxp.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1949,19 +1949,21 @@ static int gpmi_nand_init(struct gpmi_na
ret = nand_boot_init(this);
if (ret)
- goto err_out;
+ goto err_nand_cleanup;
ret = chip->scan_bbt(mtd);
if (ret)
- goto err_out;
+ goto err_nand_cleanup;
ppdata.of_node = this->pdev->dev.of_node;
ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
if (ret)
- goto err_out;
+ goto err_nand_cleanup;
return 0;
+err_nand_cleanup:
+ nand_cleanup(chip);
err_out:
- gpmi_nand_exit(this);
+ gpmi_free_dma_buffer(this);
return ret;
}
Patches currently in stable-queue which might be from boris.brezillon@free-electrons.com are
queue-4.4/mtd-nand-gpmi-fix-gpmi_nand_init-error-path.patch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Patch "mtd: nand: gpmi: Fix gpmi_nand_init() error path" has been added to the 4.4-stable tree
2018-04-10 9:04 Patch "mtd: nand: gpmi: Fix gpmi_nand_init() error path" has been added to the 4.4-stable tree gregkh
@ 2018-04-10 18:48 ` Amit Pundir
2018-04-10 21:16 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Amit Pundir @ 2018-04-10 18:48 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Boris Brezillon, alexander.levin, han.xu, marek.vasut, stable,
stable-commits
On 10 April 2018 at 14:34, <gregkh@linuxfoundation.org> wrote:
>
> This is a note to let you know that I've just added the patch titled
>
> mtd: nand: gpmi: Fix gpmi_nand_init() error path
>
> to the 4.4-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>
> The filename of the patch is:
> mtd-nand-gpmi-fix-gpmi_nand_init-error-path.patch
> and it can be found in the queue-4.4 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
>
This patch broke ARM builds at kernelci
https://kernelci.org/build/stable-rc/branch/linux-4.4.y/kernel/v4.4.127-170-g7914585b83e0/
It depends on nand_cleanup() introduced in d44154f969a4 ("mtd: nand:
Provide nand_cleanup() function to free NAND related resources")
Regards,
Amit Pundir
>
> From foo@baz Tue Apr 10 10:31:53 CEST 2018
> From: Boris Brezillon <boris.brezillon@free-electrons.com>
> Date: Mon, 10 Apr 2017 10:35:17 +0200
> Subject: mtd: nand: gpmi: Fix gpmi_nand_init() error path
>
> From: Boris Brezillon <boris.brezillon@free-electrons.com>
>
>
> [ Upstream commit 4d02423e9afe6c46142ce98bbcaf5167316dbfbf ]
>
> The GPMI driver is wrongly assuming that nand_release() can safely be
> called on an uninitialized/unregistered NAND device.
>
> Add a new err_nand_cleanup label in the error path and only execute if
> nand_scan_tail() succeeded.
>
> Note that we now call nand_cleanup() instead of nand_release()
> (nand_release() is actually grouping the mtd_device_unregister() and
> nand_cleanup() in one call) because there's no point in trying to
> unregister a device that has never been registered.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
> Acked-by: Han Xu <han.xu@nxp.com>
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -1949,19 +1949,21 @@ static int gpmi_nand_init(struct gpmi_na
>
> ret = nand_boot_init(this);
> if (ret)
> - goto err_out;
> + goto err_nand_cleanup;
> ret = chip->scan_bbt(mtd);
> if (ret)
> - goto err_out;
> + goto err_nand_cleanup;
>
> ppdata.of_node = this->pdev->dev.of_node;
> ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
> if (ret)
> - goto err_out;
> + goto err_nand_cleanup;
> return 0;
>
> +err_nand_cleanup:
> + nand_cleanup(chip);
> err_out:
> - gpmi_nand_exit(this);
> + gpmi_free_dma_buffer(this);
> return ret;
> }
>
>
>
> Patches currently in stable-queue which might be from boris.brezillon@free-electrons.com are
>
> queue-4.4/mtd-nand-gpmi-fix-gpmi_nand_init-error-path.patch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Patch "mtd: nand: gpmi: Fix gpmi_nand_init() error path" has been added to the 4.4-stable tree
2018-04-10 18:48 ` Amit Pundir
@ 2018-04-10 21:16 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2018-04-10 21:16 UTC (permalink / raw)
To: Amit Pundir
Cc: Boris Brezillon, alexander.levin, han.xu, marek.vasut, stable,
stable-commits
On Wed, Apr 11, 2018 at 12:18:43AM +0530, Amit Pundir wrote:
> On 10 April 2018 at 14:34, <gregkh@linuxfoundation.org> wrote:
> >
> > This is a note to let you know that I've just added the patch titled
> >
> > mtd: nand: gpmi: Fix gpmi_nand_init() error path
> >
> > to the 4.4-stable tree which can be found at:
> > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> >
> > The filename of the patch is:
> > mtd-nand-gpmi-fix-gpmi_nand_init-error-path.patch
> > and it can be found in the queue-4.4 subdirectory.
> >
> > If you, or anyone else, feels it should not be added to the stable tree,
> > please let <stable@vger.kernel.org> know about it.
> >
>
> This patch broke ARM builds at kernelci
> https://kernelci.org/build/stable-rc/branch/linux-4.4.y/kernel/v4.4.127-170-g7914585b83e0/
>
> It depends on nand_cleanup() introduced in d44154f969a4 ("mtd: nand:
> Provide nand_cleanup() function to free NAND related resources")
Thanks, now dropped.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-10 21:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 9:04 Patch "mtd: nand: gpmi: Fix gpmi_nand_init() error path" has been added to the 4.4-stable tree gregkh
2018-04-10 18:48 ` Amit Pundir
2018-04-10 21:16 ` Greg Kroah-Hartman
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.