Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1281022pxb; Wed, 20 Oct 2021 01:47:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtj/HnIWjcdGZwI6NPt8dk9rEbV+vhHJzRBeWBP6lqIcM9SmP3w6obFy//K5zYNgMWUqLP X-Received: by 2002:a63:1a1b:: with SMTP id a27mr32279051pga.220.1634719645745; Wed, 20 Oct 2021 01:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634719645; cv=none; d=google.com; s=arc-20160816; b=THOHLE0ypF/27iMnZVXiVfapIJyaU9UtWldVqNP4CK5kLDg7JEWYuJDXJP+rKg4HgT /6L4h9S7Mph49odRfvNN0o0dOipLe2i0nfSEPVU1vAgAB71oSlR9ECwqKGpLdr5RBt1m pzqKqR1WicZPVajAbFvTm+HryMDBN8JQFxgvlpTYzEAk91nfsDgQ1ryAOI2K0tP7JGoS vsVSoYkqe2tZtZGUFDdDbri2hHEghIzXMDC4rYYkHJqXlnTSLBrEISBtvkzCE2Po5vDX PlxH/OnS1UDv7fWdkPHprF6QV0MOpxE/1yHF9pm1JS3JNcco8rUVBF0qAKauVD09I3Ze FJoQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SX5jsh/8bShMB4zMxUGkQJU2HlklTdVaDtNYiBZQBu0=; b=0CBKjc2h3WjEmqNJF+9c/sN0hB6QzC5nYBo4/Rr2PxcJLn9Na3uA7SghAVPo8WRYHa NbCO6P80j+xH7dZqBEwNlS3/sQAu1VC9P2siHaGCpKLcH1bC12go7pgeI5ljdAW/eJt8 K5mQrGV/HwiHCLu0WNyOlliyxrkhwwx9bwbMmrO6Pff1+jBBkCdubox9UDHBB7Tmjkmi iXspdnE7Jxn5foVZ4yNskypeij0KGvRTQmRdakpr+LudsVsF9eqIC+yFC5JqAYh004tR IH93Yj1nFc2IN2IJUnZP7z2IEnRvQZQ/mzFkUmParPU1OT+P0UndHqUAKLdpx4vNZIrj DmQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@geanix.com header.s=first header.b=NB3xri6B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si2610411plc.118.2021.10.20.01.47.13; Wed, 20 Oct 2021 01:47:25 -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; dkim=pass header.i=@geanix.com header.s=first header.b=NB3xri6B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230092AbhJTIsD (ORCPT + 99 others); Wed, 20 Oct 2021 04:48:03 -0400 Received: from first.geanix.com ([116.203.34.67]:37392 "EHLO first.geanix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbhJTIr7 (ORCPT ); Wed, 20 Oct 2021 04:47:59 -0400 Received: from zen.. (unknown [185.17.218.86]) by first.geanix.com (Postfix) with ESMTPSA id 78DA5C7EC7; Wed, 20 Oct 2021 08:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=geanix.com; s=first; t=1634719543; bh=i/8+adCTB/1ZY8UzLuJ8XezBVVwGeL0INtp1R95tHKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NB3xri6B/AeZ8R2UuxkpLkaqp9aASu4mLmRDqZjFzNy2vR3adoreX2oMxtv/vFZa3 0NPVRfxL+8A5RWZMNmcNV2q/oORfUrYoPVbyEQdgbWQYIjyD/yDhTM+1ny5bj6kPd2 RDuRNp+UxHXBxWKeAZuM53uAzM36HtQhk1CWFTwjFU9TswGBtIhtnRTWvcmUqZsF+4 GgRvM8IHJdNX4lQtxZrI6yIVbcMNeWdIdDvB2YDoBK/4kFYufFde96afFKhmoetMQ0 SRISQw6B8ZTOe2vgX+aCzqcd55r2+pFdiFP2jOBlwOL2TKMsfTB4iCDTBk2iRoxjGE dt3x86RIvf1jw== From: Sean Nyekjaer To: Boris Brezillon Cc: Sean Nyekjaer , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Boris Brezillon , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] mtd: mtdconcat: add suspend lock handling Date: Wed, 20 Oct 2021 10:45:34 +0200 Message-Id: <20211020084534.2472305-5-sean@geanix.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211020084534.2472305-1-sean@geanix.com> References: <20211020084534.2472305-1-sean@geanix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=4.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=disabled version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 13e2a5895688 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use MTD hooks to control suspend/resume of MTD devices. Fixes: 013e6292aaf5 ("mtd: rawnand: Simplify the locking") Suggested-by: Boris Brezillon Signed-off-by: Sean Nyekjaer --- 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; } + 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); } } -- 2.33.0