From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Han Xu <han.xu@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>,
Fabio Estevam <fabio.estevam@nxp.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] mtd: nand: gpmi: Release DMA channels on failure
Date: Wed, 10 Jan 2018 23:04:26 +0100 [thread overview]
Message-ID: <20180110230426.59e9f001@bbrezillon> (raw)
In-Reply-To: <VI1PR0401MB2221AF8D517BDDC52F5B550497110@VI1PR0401MB2221.eurprd04.prod.outlook.com>
Hi Han,
On Wed, 10 Jan 2018 21:50:41 +0000
Han Xu <han.xu@nxp.com> wrote:
> ________________________________________
> From: Fabio Estevam <festevam@gmail.com>
> Sent: Thursday, December 28, 2017 12:07 PM
> To: boris.brezillon@free-electrons.com
> Cc: Han Xu; linux-mtd@lists.infradead.org; Fabio Estevam
> Subject: [PATCH] mtd: nand: gpmi: Release DMA channels on failure
>
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> release_dma_channels() should be called in the case of error in
> gpmi_init() or bch_set_geometry(), because acquire_dma_channels() has
> been called previously.
>
> Handle the error cases correctly.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> index 2ef8979..acfa5f5 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -2137,20 +2137,25 @@ static int gpmi_pm_resume(struct device *dev)
> ret = gpmi_init(this);
> if (ret) {
> dev_err(this->dev, "Error setting GPMI : %d\n", ret);
> - return ret;
> + goto release_dma_channels;
> }
>
> /* re-init the BCH registers */
> ret = bch_set_geometry(this);
> if (ret) {
> dev_err(this->dev, "Error setting BCH : %d\n", ret);
> - return ret;
> + goto release_dma_channels;
> }
>
> /* re-init others */
> gpmi_extra_init(this);
>
> return 0;
> +
> +release_dma_channels:
> + release_dma_channels(this);
> + return ret;
> +
> }
> #endif /* CONFIG_PM_SLEEP */
>
> Acked-by: Han Xu <han.xu@nxp.com>
Did you read my comment on v2 of this patch?
next prev parent reply other threads:[~2018-01-10 22:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-28 18:07 [PATCH] mtd: nand: gpmi: Release DMA channels on failure Fabio Estevam
2018-01-10 21:50 ` Han Xu
2018-01-10 22:04 ` Boris Brezillon [this message]
2018-01-10 22:30 ` Han Xu
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=20180110230426.59e9f001@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=fabio.estevam@nxp.com \
--cc=festevam@gmail.com \
--cc=han.xu@nxp.com \
--cc=linux-mtd@lists.infradead.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