Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1287165pxb; Wed, 20 Oct 2021 01:57:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbFkmyS5QwS2AJue+YgEA9P9T0eUGFZjmBFu4AMMvKKvA0M4+A6KFQlA4xeL0UpvrfR+lJ X-Received: by 2002:a63:af59:: with SMTP id s25mr18339872pgo.109.1634720233326; Wed, 20 Oct 2021 01:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634720233; cv=none; d=google.com; s=arc-20160816; b=e/V2wihK8EXWKc0Qyg1KgfuYQR4/vf3Y6HK+CYKbbtxc56BYjp713SzG8FGHmYuW4K AeIaDFEgY1wMYj8SmKFPzobMG9M4BnI+w8RwGuTSzONlvzJR33lPZx9cY2g1kVm5H8dV aC6GapcGZy+zLUETqOfnTQZx+qfvvf0gYFj31f8hQ2TtVA4BNWdaGSC4zXcn7MO7uaKA Pm2P3et8WJP9vs76S1TpqGEnKCKkhvFl+i0RKamb6XzO7bV5k3f5lcVVg4GMp253Rw0T O2BbaY72U9xgEbq1KAbtP1iwkUNi+Wd49oWMioqfkRO7p/t1i6vU7ED7+bfzKcPKNcd/ Il4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=/ueo0lYsaP5+eWsbjonL/dnrlTgpZcJZOY4DeEebAXg=; b=int5U4ZDw2ijUuLNQffn6wjDaO0ODn2cJi1ZUifekrjUdRa+xngN1vkXoFDAIx8PUQ lAt7+K/wd4/u3oH1/udV7lFz9nWXo3V8Io+hUk3Q5KNx2ksm4WXFL4gzPrKoHvVdwsTi kp3XzxaQ8+EFuvKhqWEQSopb4PfGnk3XQ7dd8AxFmhBFbfXq4+kifMGhIYpp14dX7Re0 rJqVwLFCre4hpsbqVZuK4Z7kXiiJi0inKKFodvHQrCtcX0Wzsuc+Q4kNaxP3GAfHTqav IQx8rXUOj8itZs8cYy8wiP/Dllcp+uU/JklJjEoDr9eES2qiJI+0uIWidGTAoBiYgleZ 2ecA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si2143286plp.180.2021.10.20.01.57.00; Wed, 20 Oct 2021 01:57:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbhJTI6G (ORCPT + 99 others); Wed, 20 Oct 2021 04:58:06 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:57742 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbhJTI6F (ORCPT ); Wed, 20 Oct 2021 04:58:05 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 88FAC1F43D73; Wed, 20 Oct 2021 09:55:50 +0100 (BST) Date: Wed, 20 Oct 2021 10:55:47 +0200 From: Boris Brezillon To: Sean Nyekjaer Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Boris Brezillon , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] mtd: mtdconcat: add suspend lock handling Message-ID: <20211020105547.23ed9324@collabora.com> In-Reply-To: <20211020084534.2472305-5-sean@geanix.com> References: <20211020084534.2472305-1-sean@geanix.com> <20211020084534.2472305-5-sean@geanix.com> Organization: Collabora X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Oct 2021 10:45:34 +0200 Sean Nyekjaer 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 > Signed-off-by: Sean Nyekjaer 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. > } > } >