Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp643174imm; Sat, 8 Sep 2018 06:15:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaDH5mLsPa/vfS6YCggGGchZ2iCD1Sj5z569WhVojXWBd3WvMGm9+43g6IrUF8spqTFal7C X-Received: by 2002:a62:20d8:: with SMTP id m85-v6mr13810013pfj.74.1536412558588; Sat, 08 Sep 2018 06:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536412558; cv=none; d=google.com; s=arc-20160816; b=Qr2dmvPpSyKXohE74FiDk8gewlDXYf7m73KMSPIKOY7IiB+3mz99vIcVfrdMAL+F7I jcMBiZ1kukm6xDeR2Bu5tnbemw7Xq5gf27LPu1JApjr9OBHiMdEf1fU4QGhTH7wOzWwU Ir8noR4QKOcrdmJnKFhvXpaPazLpj9dOYrEMUi959TPX9qIq9ZpPeqxYE3hzvbqI5YW+ xpeI1KOcMXyndTQt1GgDHEoztKkqKYIay4BFqxfgJPREvXIcJeroo0b7v6XkkxSxncoj PObMT6M3Lrd+U3Qr4hVcEx364ZSgoE8yCTYOt1CA7XhvRx+svPZuPKkR67vbFdF2ITRU Z+kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=4LYnJKN3RypvOqGGkGutjgpp46TBCgCqN/j+QiBoP4E=; b=XzKgr9XZdWtfQ2/Z+AkZO7Bv4azQ6qfo/4PS+cOC4Hndlx6kuy848PkedNDp66IKoW LKcKTGBfJXcj1BfmqG7cXtdlEzZTlgYAEr6dDlyj2LlfONyzG++A8hsKf0UF4uy4NH2b +xk+68UjZnsHkjskQUK8wVIOermg2QMfCTk1MDZeRFpuinWvQ1HfQll2r5Qix+RAMJSC +SBvHmlUM6eO1eBvJvoO+WLA8tbgEC/NPQcGGCn54Pj4nLa0PYu58B4xa4qAZESskt+2 03TnTvmFKr715xa83Qb8lFQndfSYssE9EyBIjbA/CWuV5gTpuWSjafuEr+Vb5AZ72yN7 rgtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@obeliks.de header.s=jul2017 header.b=N2wSLhVX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=obeliks.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c9-v6si11373907pgj.654.2018.09.08.06.15.43; Sat, 08 Sep 2018 06:15:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@obeliks.de header.s=jul2017 header.b=N2wSLhVX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=obeliks.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726679AbeIHR7t (ORCPT + 99 others); Sat, 8 Sep 2018 13:59:49 -0400 Received: from scopuli.esotechnik.de ([79.143.188.15]:46652 "EHLO mail.esotechnik.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726351AbeIHR7t (ORCPT ); Sat, 8 Sep 2018 13:59:49 -0400 Received: by mail.esotechnik.net (Postfix) with ESMTPSA id 8C970AE0B80; Sat, 8 Sep 2018 15:14:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=obeliks.de; s=jul2017; t=1536412441; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=4LYnJKN3RypvOqGGkGutjgpp46TBCgCqN/j+QiBoP4E=; b=N2wSLhVXFYeIq0OniZuSAg7/yuODkDGiyqcSXwU+ZxivnUUoPDAECger5DUBi1m5n4H/rw Za0+ZWQW/SJU/2QINVoTxWviHZYzzt2uj/V94RqgTmzkQFwOMyJfhrngHc+lBELFxvDX7R 71lgqqlavdvmT8C+CvLxVd6KYFpQYdRXMDmBlV+URFXkJ1nd/wqjfR0BJOK/seOxrcJTyc TWZZtbyKzIz5S56/+aRV2Y1bvFYUfVpsLlBq63o4rWmD1k/g76Riexohz52OFpxNHdVyGa 0Zh/Rbt1LPFUQ5G8BKDaiurcFn5/6+OsdHV5daUrl/ArQqBQzbLaCrsx9IUsuA== From: Bernhard Frauendienst To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Rob Herring , Mark Rutland Cc: Bernhard Frauendienst , Miquel Raynal , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/3] mtd concat device driver Date: Sat, 8 Sep 2018 15:13:42 +0200 Message-Id: <20180908131345.8145-1-kernel@nospam.obeliks.de> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi everybody, my router firmware concatenates two identical flash chips into a single mtd using mtd_concat_create(), and sets up partitions in a way where one of them crosses the chip boundary. When porting OpenWRT support for the board from a mach-file based setup to a device-tree based one, I found that there is no generic way to create a mtd_concat device from within the dts. The following patches attempt to provide that possibility. This is a third roll of that patch series, the first one can be seen at [1]. The second one [2] was a blunder of my own making. Apologies for not being able to address the correct recipients two times in a row. In the first discussion, concerns were raised that a driver for a "virtual" device like this might have no place in the device tree system. However, I would argue that specifying a composite device is very similar to specifying the partitions of a mtd, which can also done in the device tree. In fact, I believe this is the only way to be able to specify the partitions of such a concat device in the dts file (but I'm happy to be corrected if I'm mistaken). I have made the example in the dt-binding documentation a bit more expressive in this detail. In the second roll I have also addressed all issues that reviewers have brought up so far, hopefully to their satisfaction. These were mainly whitespace fixes and improved comments. Best regards, Bernhard [1] http://lists.infradead.org/pipermail/linux-mtd/2018-September/083832.html [2] https://lkml.org/lkml/2018/9/7/1015 Bernhard Frauendienst (3): mtd: core: add get_mtd_device_by_node dt-bindings: add bindings for mtd-concat devices mtd: mtdconcat: add dt driver for concat devices .../devicetree/bindings/mtd/mtd-concat.txt | 36 +++++ drivers/mtd/Kconfig | 2 + drivers/mtd/Makefile | 3 + drivers/mtd/composite/Kconfig | 12 ++ drivers/mtd/composite/Makefile | 6 + drivers/mtd/composite/virt_concat.c | 128 ++++++++++++++++++ drivers/mtd/mtdcore.c | 38 ++++++ include/linux/mtd/mtd.h | 2 + 8 files changed, 228 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/mtd-concat.txt create mode 100644 drivers/mtd/composite/Kconfig create mode 100644 drivers/mtd/composite/Makefile create mode 100644 drivers/mtd/composite/virt_concat.c -- 2.18.0