[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211020105547.23ed9324@collabora.com>
Date: Wed, 20 Oct 2021 10:55:47 +0200
From: Boris Brezillon <boris.brezillon@...labora.com>
To: Sean Nyekjaer <sean@...nix.com>
Cc: Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Boris Brezillon <bbrezillon@...nel.org>,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] mtd: mtdconcat: add suspend lock handling
On Wed, 20 Oct 2021 10:45:34 +0200
Sean Nyekjaer <sean@...nix.com> wrote:
> Use MTD hooks to control suspend/resume of MTD devices.
Please explain in great details why this is needed.
>
> Fixes: 013e6292aaf5 ("mtd: rawnand: Simplify the locking")
> Suggested-by: Boris Brezillon <boris.brezillon@...labora.com>
> Signed-off-by: Sean Nyekjaer <sean@...nix.com>
This patch should be moved earlier (before 'mtd: core: protect access to
MTD devices while in suspend') in the series.
> ---
> drivers/mtd/mtdconcat.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
> index f685a581df48..1ec36890118f 100644
> --- a/drivers/mtd/mtdconcat.c
> +++ b/drivers/mtd/mtdconcat.c
> @@ -566,9 +566,11 @@ static int concat_suspend(struct mtd_info *mtd)
>
> for (i = 0; i < concat->num_subdev; i++) {
> struct mtd_info *subdev = concat->subdev[i];
> - if ((rc = mtd_suspend(subdev)) < 0)
> + rc = subdev->_suspend ? subdev->_suspend(subdev) : 0;
> + if (rc < 0)
> return rc;
Same here, you need a fat comment explaining why mtd_suspend() is not
used.
> }
> +
> return rc;
> }
>
> @@ -579,7 +581,8 @@ static void concat_resume(struct mtd_info *mtd)
>
> for (i = 0; i < concat->num_subdev; i++) {
> struct mtd_info *subdev = concat->subdev[i];
> - mtd_resume(subdev);
> + if (subdev->_resume)
> + subdev->_resume(subdev);
Ditto.
> }
> }
>
Powered by blists - more mailing lists