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 E397AC636CC for ; Mon, 20 Feb 2023 09:45:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231377AbjBTJpS (ORCPT ); Mon, 20 Feb 2023 04:45:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbjBTJpQ (ORCPT ); Mon, 20 Feb 2023 04:45:16 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0FDD26AF; Mon, 20 Feb 2023 01:45:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 784B660CD4; Mon, 20 Feb 2023 09:45:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84992C433D2; Mon, 20 Feb 2023 09:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1676886313; bh=4wWJoSi2kzlrvECDpu4ylkarcYS/J8ZQa3dO7cbClIA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t4vR6/QpJIYq4Iansg/lQ5ogbUJ0prpXHUY+Vqj7QhUt6UCHWJkIaIuqiUOCf2F83 gk77TBJuld9vtTflU38d5U8MxcaGGwXr7L4Ao5ZPx4juOvzy+JDGbGkMal2FnxqBEG Z6DUJP3iunfdnk349bpzyzbxIrozUObHBEm3Iq1s= Date: Mon, 20 Feb 2023 10:45:11 +0100 From: Greg KH To: Kumaravel.Thiagarajan@microchip.com Cc: arnd@arndb.de, linux-gpio@vger.kernel.org, michael@walle.cc, srinivas.kandagatla@linaro.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, Tharunkumar.Pasumarthi@microchip.com Subject: Re: [PATCH v5 char-misc-next] misc: microchip: pci1xxxx: Add OTP/EEPROM driver for the pci1xxxx switch Message-ID: References: <7276bef47792e489abd093e4bd0044de@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 20, 2023 at 09:31:45AM +0000, Kumaravel.Thiagarajan@microchip.com wrote: > > I do not recommend using a block interface for this at all.  Why not > > the > > "normal" EEPROM interface that the kernel has today (i.e. a binary > > sysfs > > file)?  That way you can mmap it and edit locations how ever you > > want. > Greg, I have one question about the sysfs interface. If OTP and EEPROM > are enumerated as two sysfs files of 8KB each, will that start > occupying the RAM permamently or is the swapping in and out of the RAM > handled automatically by the kernel based on the user trying to access > it. It depends on exactly what you are doing here with the binary sysfs file. Try it yourself and see how it works. thanks, greg k-h