From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQtaG-0003NJ-MO for linux-mtd@lists.infradead.org; Thu, 07 Jun 2018 12:00:06 +0000 Date: Thu, 7 Jun 2018 13:59:42 +0200 From: Boris Brezillon To: Prabhakar Kushwaha Cc: "linux-mtd@lists.infradead.org" , "marek.vasut@gmail.com" , Poonam Aggrwal , Ashish Kumar , Ying Zhang , Alban Bedel , Srinivas Kandagatla Subject: Re: Accessing mtd partitions from driver/i2c Message-ID: <20180607135942.436a374d@bbrezillon> In-Reply-To: References: <20180606092250.2d600a89@bbrezillon> <20180606155629.2c2a2e45@bbrezillon> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, 7 Jun 2018 11:50:51 +0000 Prabhakar Kushwaha wrote: > Hi Boris, > > > -----Original Message----- > > From: Boris Brezillon [mailto:boris.brezillon@bootlin.com] > > Sent: Wednesday, June 6, 2018 7:26 PM > > To: Prabhakar Kushwaha > > Cc: linux-mtd@lists.infradead.org; marek.vasut@gmail.com; Poonam Aggrwal > > ; Ashish Kumar ; Ying > > Zhang ; Alban Bedel ; Srinivas > > Kandagatla > > Subject: Re: Accessing mtd partitions from driver/i2c > > > > +Alban and Srinivas > > > > On Wed, 6 Jun 2018 13:44:32 +0000 > > Prabhakar Kushwaha wrote: > > > > > Dear Borris, > > > > > > > -----Original Message----- > > > > From: Boris Brezillon [mailto:boris.brezillon@bootlin.com] > > > > Sent: Wednesday, June 6, 2018 12:53 PM > > > > To: Prabhakar Kushwaha > > > > Cc: linux-mtd@lists.infradead.org; marek.vasut@gmail.com; Poonam > > > > Aggrwal ; Ashish Kumar > > > > ; Ying Zhang > > > > Subject: Re: Accessing mtd partitions from driver/i2c > > > > > > > > Hi Prabhakar, > > > > > > > > On Wed, 6 Jun 2018 05:02:47 +0000 > > > > Prabhakar Kushwaha wrote: > > > > > > > > > Hi All, > > > > > > > > > > We have a requirement of using(read/write) one mtd partition from > > > > > driver/i2c. > > > > > > > > > > As per my googling mtd->_read, mtd->_write APIs has not been used > > > > anywhere other than driver/mtd layer. > > > > > > > > It's used by at least one filesystem (JFFS2). And you should not > > > > look for mtd- > > > > >_xxx() users but mtd_xxx() users. You should never access the mtd > > > > >hooks > > > > directly but the wrappers that are exposed by the MTD API > > > > (mtd_read(), mtd_write(), mtd_erase(), ...). > > > > > > > > > > I can find it's usage in driver/firmware/ folder. Looks like it is > > > using nvram. > > > > > > > BTW, what's your use case? If it's about reading a piece of > > > > information from a RO partition, then the work initiated by Alban > > > > [1] and exposing some MTD parts are NVMEM providers should be a > > > > better match. > > > > > > Currently, Linux has i2c slave framework. It is reading/writing to DDR > > > emulated as EEPROM (drivers/i2c/i2c-slave-eeprom.c). We want something > > > similar, where DDR will be replaced by MTD partitions for read/write. > > > > Then NVMEM is the solution you're looking for. Alban, Srinivas, can you agree > > on something regarding the DT bindings so that we can finally get this feature > > merged? > > > > Patch set[1] shared by you, only supports read. > Can this framework also support write? The NVMEM framework already supports write, you just need to add write support to the nvmem -> MTD implementation.