Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp84530pxb; Mon, 25 Oct 2021 04:24:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxikJX8Me30bX37ZySG/5nLZuYXyNXUnPsnyfRC5e7Gi8tBMv2k6ieltjzhThTILW/IP94D X-Received: by 2002:a17:906:1957:: with SMTP id b23mr8358899eje.516.1635161073601; Mon, 25 Oct 2021 04:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635161073; cv=none; d=google.com; s=arc-20160816; b=y4muf5Mv67m8I98J1z2mZR+UqaIRNZVRyEsCIB+Ygap04QCpddENGySvsd9SQQeHVi kxZxEkGf52iBrEYJX+LsxvZXlVEZIfP6ORsrPtIGbXoqbOCYmS19XPs/R2OW9q+pFlN6 cqiMtiOrbkOweFMlbRINrIhVHTT0mNulTMJdHKXU8XWI8m41bm0TadUSNO7+tGhLeA1G jhnXsChrBOwFah8QUQu0kZPd5stC6Wq1P89oZo+jEdY8yenDuKhvFY90qweJ70mv22JM ZSDq1DKbctVLc1tYOhMS/MFCvzTAC8GdJJOpAXQdxUxAg4hmGGYMAevJgWVfufVTbYHs R+IA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=U+rzWPfofzZBPkoIbG5Uh7+acLRKlrYjb20E7lR7OSQ=; b=iDkhjJUWgXlVByOryoaD+zZg+/ykXA1iNtNBLQ0WnbR5WPtbXugcD4DDBceUHcQpM6 sTh3ZCbPy0++yZsb+mfoBIrriYhRijtg5ifDn1rr+AZBlTz69s++5Bv3/1xzsJwezMwA 9dB3ugevrwgU/Oa2l3g4HkcjJ/lBnxA7WgVyKtoRlzJuR7MRO7+zajeUZ7kTMP1/QtSo 1JLmjFWF6gNNlwt6yOAcXoteppNfb7nyZ2DsB+nem7B8qFe0BC8UdAD4PvDjyTBZ1cTe MKJRkLhEUOOagiz8yR60SpVbEqs63/5NSkG7mggDy4UDsKlKXI4W9llNJBWOJySEPzxA k7Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@geanix.com header.s=first header.b=fa+sTdsH; 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 cw1si22212881ejc.750.2021.10.25.04.24.07; Mon, 25 Oct 2021 04:24:33 -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=fa+sTdsH; 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 S232502AbhJYJaU (ORCPT + 99 others); Mon, 25 Oct 2021 05:30:20 -0400 Received: from first.geanix.com ([116.203.34.67]:37398 "EHLO first.geanix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbhJYJaU (ORCPT ); Mon, 25 Oct 2021 05:30:20 -0400 Received: from zen.. (unknown [185.17.218.86]) by first.geanix.com (Postfix) with ESMTPSA id F1DF0CC792; Mon, 25 Oct 2021 09:27:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=geanix.com; s=first; t=1635154076; bh=tSBMD275WXCEMSU2orDsuQBV3IoPAOXeW1te0qIiFJM=; h=From:To:Cc:Subject:Date; b=fa+sTdsHhuW7MLwLs5MBPAhj43D+f+vNpYvqzmHDJtYK0OFfBU2NhUICeebtJqvwV Ewq0MT1AhlDRhUzHgTsPwDkTL8F4Ez/4ksG/9gNwrPOMvV1ZnvZ6FN7YOWytS9kjFP TfQtIuECdOtEe+V7hh18FHB2vG4CGc1LXi3hqvHHVtD/Qt/qAOfB9QafZLU+Ii9vGW HCz26KRORMamPjAtLhQczi3SILF5bKSAr8KMgsHY7fucMzTRQ0ajApzb9Wh3SiTaCZ ZTI+S0Idj6nyZUNBz9AQAfYlY9kqKs5+Hreix/vUiE/Wwj+URAE2DfSRB5vIdmkO11 9P/Sp5cB9LnAQ== 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 v3 0/4] mtd: core: protect access to mtd devices while in suspend Date: Mon, 25 Oct 2021 11:27:48 +0200 Message-Id: <20211025092752.2824678-1-sean@geanix.com> X-Mailer: git-send-email 2.33.0 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 Follow-up on discussion in: https://lkml.org/lkml/2021/10/4/41 https://lkml.org/lkml/2021/10/11/435 Changes since v2: - added signoff's to patch from Boris - removed accidential line break - kept tests consistent: master->master.suspended == 0 -> !master->master.suspended - added comments to mtdconcat patch - moved mtdconcat before ('mtd: core: protect access to MTD devices while in suspend') Changes since v1: - removed __mtd_suspend/__mtd_resume functions as they are not used by mtdconcat anymore. - only master mtd_info is used for mtd_{start,end}_access(). Warn if we got mtd's. - added Boris patch for using uninitialized _suspend/_resume hooks when bbt scanning - mtdconcat uses device _suspend/_resume hooks - I don't really like the macro proposal from Boris mtd_no_suspend_void_call()/mtd_no_suspend_ret_call() I think they make the code complex to read and the macro's doesn't fit every where anyway... Changes since from rfc v1/v2: - added access protection for all device access hooks in mtd_info. - added Suggested-by to [1/3] patch. - removed refereces to commit ef347c0cfd61 ("mtd: rawnand: gpmi: Implement exec_op") from commit msg as commit 013e6292aaf5 ("mtd: rawnand: Simplify the locking") is to be blamed. - tested on a kernel with LOCKDEP enabled. Boris Brezillon (1): mtd: rawnand: nand_bbt: hide suspend/resume hooks while scanning bbt Sean Nyekjaer (3): mtd: mtdconcat: add suspend lock handling mtd: core: protect access to MTD devices while in suspend mtd: rawnand: remove suspended check drivers/mtd/mtdconcat.c | 15 +++- drivers/mtd/mtdcore.c | 124 +++++++++++++++++++++++++++---- drivers/mtd/nand/raw/nand_base.c | 52 ++++--------- drivers/mtd/nand/raw/nand_bbt.c | 28 ++++++- include/linux/mtd/mtd.h | 81 ++++++++++++++++---- include/linux/mtd/rawnand.h | 5 +- 6 files changed, 230 insertions(+), 75 deletions(-) -- 2.33.0