Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752537AbdHPS2W (ORCPT ); Wed, 16 Aug 2017 14:28:22 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:10088 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751611AbdHPS2T (ORCPT ); Wed, 16 Aug 2017 14:28:19 -0400 X-IronPort-AV: E=Sophos;i="5.41,383,1498489200"; d="scan'208";a="254759655" From: Chris Brandt To: Nicolas Pitre , Alexander Viro CC: "linux-fsdevel@vger.kernel.org" , "linux-embedded@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v2 1/5] cramfs: direct memory access support Thread-Topic: [PATCH v2 1/5] cramfs: direct memory access support Thread-Index: AQHTFrYig+Bcvc0Q3kGKZ9XTyotxsKKHRztw Date: Wed, 16 Aug 2017 18:28:15 +0000 Message-ID: References: <20170816173536.1879-1-nicolas.pitre@linaro.org> <20170816173536.1879-2-nicolas.pitre@linaro.org> In-Reply-To: <20170816173536.1879-2-nicolas.pitre@linaro.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Chris.Brandt@renesas.com; x-originating-ip: [4.59.13.106] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SG2PR06MB1744;20:RsEBZ2ebpAdRMET3ipWHu2GhiARlUgmj81JVrCCRbE7WaA/we0qyzjblu+Az4K2g1JQ3VJaYCG0RYKJfi0J0WJoyAY05aGKWshO1hJMG6ELX3MHB/EeSIceGOpBjYGVSZdp+8vT1XmiAUXAi8pNc6AdzTXSmszY82mwDc7lxckk= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 6eb1e83e-7e49-4e1b-b165-08d4e4d48f32 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SG2PR06MB1744; x-ms-traffictypediagnostic: SG2PR06MB1744: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123555025)(20161123564025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SG2PR06MB1744;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SG2PR06MB1744; x-forefront-prvs: 0401647B7F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(189002)(24454002)(199003)(9686003)(3846002)(5660300001)(55016002)(54906002)(5250100002)(14454004)(2900100001)(6506006)(53936002)(6436002)(72206003)(99286003)(66066001)(6116002)(4326008)(97736004)(7696004)(3280700002)(478600001)(3660700001)(25786009)(105586002)(102836003)(6246003)(2906002)(305945005)(106356001)(68736007)(229853002)(101416001)(74316002)(8936002)(86362001)(189998001)(7736002)(2950100002)(33656002)(50986999)(54356999)(81166006)(76176999)(81156014)(8676002);DIR:OUT;SFP:1102;SCL:1;SRVR:SG2PR06MB1744;H:SG2PR06MB1165.apcprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2017 18:28:15.1496 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1744 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v7GISRW2032687 Content-Length: 3062 Lines: 84 On Wednesday, August 16, 2017, Nicolas Pitre wrote: > Small embedded systems typically execute the kernel code in place (XIP) > directly from flash to save on precious RAM usage. This adds the ability > to consume filesystem data directly from flash to the cramfs filesystem > as well. Cramfs is particularly well suited to this feature as it is > very simple and its RAM usage is already very low, and with this feature > it is possible to use it with no block device support and even lower RAM > usage. > > This patch was inspired by a similar patch from Shane Nay dated 17 years > ago that used to be very popular in embedded circles but never made it > into mainline. This is a cleaned-up implementation that uses far fewer > memory address at run time when both methods are configured in. In the > context of small IoT deployments, this functionality has become relevant > and useful again. > > To distinguish between both access types, the cramfs_physmem filesystem > type must be specified when using a memory accessible cramfs image, and > the physaddr argument must provide the actual filesystem image's physical > memory location. > > Signed-off-by: Nicolas Pitre > --- > fs/cramfs/Kconfig | 30 ++++++- > fs/cramfs/inode.c | 264 +++++++++++++++++++++++++++++++++++++++++++------ > ----- > 2 files changed, 242 insertions(+), 52 deletions(-) > > diff --git a/fs/cramfs/Kconfig b/fs/cramfs/Kconfig > index 11b29d491b..5eed4ad2d5 100644 > --- a/fs/cramfs/Kconfig > +++ b/fs/cramfs/Kconfig > @@ -1,6 +1,5 @@ > config CRAMFS > tristate "Compressed ROM file system support (cramfs) (OBSOLETE)" > - depends on BLOCK > select ZLIB_INFLATE > help > Saying Y here includes support for CramFs (Compressed ROM File > @@ -20,3 +19,32 @@ config CRAMFS > in terms of performance and features. > > If unsure, say N. > + > +config CRAMFS_BLOCKDEV > + bool "Support CramFs image over a regular block device" if EXPERT > + depends on CRAMFS && BLOCK > + default y > + help > + This option allows the CramFs driver to load data from a regular > + block device such a disk partition or a ramdisk. > + trailing whitespace > +config CRAMFS_PHYSMEM > + bool "Support CramFs image directly mapped in physical memory" > + depends on CRAMFS > + default y if !CRAMFS_BLOCKDEV > + help > + This option allows the CramFs driver to load data directly from > + a linear adressed memory range (usually non volatile memory > + like flash) instead of going through the block device layer. > + This saves some memory since no intermediate buffering is > + necessary. > + > + The filesystem type for this feature is "cramfs_physmem". > + The location of the CramFs image in memory is board > + dependent. Therefore, if you say Y, you must know the proper > + physical address where to store the CramFs image and specify > + it using the physaddr=0x******** mount option (for example: > + "mount -t cramfs_physmem -o physaddr=0x100000 none /mnt"). > + > + If unsure, say N. > + new blank line at EOF -Chris