From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21E95C25B6B for ; Thu, 26 Oct 2023 07:56:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344432AbjJZH4G (ORCPT ); Thu, 26 Oct 2023 03:56:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjJZH4C (ORCPT ); Thu, 26 Oct 2023 03:56:02 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70FC2C1 for ; Thu, 26 Oct 2023 00:56:00 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id A71D860006; Thu, 26 Oct 2023 07:55:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1698306958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kxdBcXYIBUZTorVYhg4RJds1Bjahgba7qpcJmqDPZ8A=; b=oDvA/UVmwTewFWFQ48H2EEQ63KtqCG30kyXD/k+4mepHQCZVcJVXw2Dj751L8dclIxHUng b1comh2Pm6UwoMStCosj6JfWVfIFnrLaWT7tF7A9uTRwKZGdd/RnIpj6TlXjW0NN7jHQCo TbJ7leKf6kvQ2yMi7DI4CEyns7v8jJBzCf/D/92iRJvqFqUKSSpFermZ/2Rewql/yIj20x JQKBNs8aQfgi1BUKV39Lm2SPxHlHLqOQqIsy+tWW7eJth/YtPMwsphW5b1VG3ojWpf3rmu zR1RKuwqH5DFexvmXbv5TaIlP3BpcuymmkCJDdrlX7aF74lbOBC8tyCtYMKh1w== Message-ID: <2a91cc9a-98ac-4751-9bdb-56d8d91c1a86@arinc9.com> Date: Thu, 26 Oct 2023 10:55:33 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2] nvmem: brcm_nvram: store a copy of NVRAM content Content-Language: en-US To: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Srinivas Kandagatla Cc: linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Florian Fainelli , Scott Branden References: <20231026073440.6724-1-zajec5@gmail.com> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: <20231026073440.6724-1-zajec5@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.10.2023 10:34, Rafał Miłecki wrote: > From: Rafał Miłecki > > This driver uses MMIO access for reading NVRAM from a flash device. > Underneath there is a flash controller that reads data and provides > mapping window. > > Using MMIO interface affects controller configuration and may break real > controller driver. It was reported by multiple users of devices with > NVRAM stored on NAND. > > Modify driver to read & cache NVRAM content during init and use that > copy to provide NVMEM data when requested. On NAND flashes due to their > alignment NVRAM partitions can be quite big (1 MiB and more) while > actual NVRAM content stays quite small (usually 16 to 32 KiB). To avoid > allocating so much memory check for actual data length. > > Link: https://lore.kernel.org/linux-mtd/CACna6rwf3_9QVjYcM+847biTX=K0EoWXuXcSMkJO1Vy_5vmVqA@mail.gmail.com/ > Fixes: 3fef9ed0627a ("nvmem: brcm_nvram: new driver exposing Broadcom's NVRAM") > Cc: Arınç ÜNAL > Cc: Florian Fainelli > Cc: Scott Branden > Signed-off-by: Rafał Miłecki Acked-by: Arınç ÜNAL Arınç