Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5986040imu; Wed, 30 Jan 2019 06:58:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN7z4bw9PxwVUIwOvZCh0EfsWMdqJeMf5/BR3OXib8mxr6o587KQrD+dcAptvY013FbcIQbL X-Received: by 2002:a63:bf0b:: with SMTP id v11mr28459258pgf.302.1548860312494; Wed, 30 Jan 2019 06:58:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548860312; cv=none; d=google.com; s=arc-20160816; b=pLmvLqtvdJ9ApanbOdgc83igsDCbS6GhIWa0fVzOWJ9RUVEXKe3keY6HAOR7ILCi5m OpbBfysXTr7nECurV9klWjr/OVtyhD9Q9VH6enAvaspoWu9QrWVtBpV9jXA0BpkK1oV3 7tzdaiOmROvti0fq3eOLtJ5UVEJbLz4oral7E50uBUpCgYqfp79C6zhDhAcQvpslekS/ 4sVYMDGKf4DXjM43Ls/9SgmFCUvQRnS+Tour0uP30ZPs3T18nkkF1e4QpQdvfNdL/Mkc Hkv4waIErY3kaFZZqmCtpUf5YwQAkQORNrOJ+cT2ZdcJzBeWmLMR+bxiFhUZGJdFWjXq gWPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=rmeEOYQi6agFje32ieYTIfT8KGI5JNyp0SYuiU7+RCo=; b=W+3K+SwF80gqAT7THqgpVihT6+8WPjYeJQC9bxmtjV01DZzKJFu5YIVqsMIFDFHBWF zWnsEZS4o90+PrKLjoHjGbe17T0NrHhvTvnSRnzWDpSzzmkZ20qjvaCrQ6lXxkEFV8e1 ggMyDdge4uvvPRHQyOX5RPWrd7M2Wp9JpshFzTGpGqlUNdEG0ldtuLYQFB8xvnvZcaMP oFpWSZERqWafjhuZf1h3Q1AcwAb97ev231HnAoHHe4JbV7AuMSD2TDmJCqgS4DOWdVoi sRo444gtWcuC+xz6/tDMH/F7S7qq/dWfGDPATOOStT/8aY20ZJJn0Po5t5Xm2KMA44yJ x0ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qYrh5hlh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si1576887pgr.285.2019.01.30.06.58.13; Wed, 30 Jan 2019 06:58:32 -0800 (PST) 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=pass header.i=@kernel.org header.s=default header.b=qYrh5hlh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731409AbfA3Ozy (ORCPT + 99 others); Wed, 30 Jan 2019 09:55:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:51884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbfA3Ozx (ORCPT ); Wed, 30 Jan 2019 09:55:53 -0500 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 26E6720882; Wed, 30 Jan 2019 14:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548860153; bh=7G5T/KsM8XC2WiSdPDQavJovP2/zcBe1Um2PBAdj+3U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qYrh5hlh2iq0rXjNpgxGqwFfe9+n0Q19rZ5e+wKjmh5QIhPMaXcuVuFbSBk/3FuvK Fnvwybt9jQXos2z9hGma+lbCo+R52J7f1m/uVb3zORhES0EJtEUxNuLeQ2VnS9MZ90 m57b0AF9SbonKN69LhTV7QsYGSpIO6amJ3+I6f48= Date: Wed, 30 Jan 2019 15:55:43 +0100 From: Boris Brezillon To: Geert Uytterhoeven Cc: Geert Uytterhoeven , Arnd Bergmann , Greg Kroah-Hartman , MTD Maling List , Nguyen An Hoan , Linux Kernel Mailing List , linux-spi Subject: Re: [PATCH v2 0/2] eeprom: at25: SPI transfer improvements Message-ID: <20190130155543.5ab749b5@bbrezillon> In-Reply-To: References: <20190118140525.29189-1-geert+renesas@glider.be> <20190118230740.44239fcf@bbrezillon> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Jan 2019 20:02:37 +0100 Geert Uytterhoeven wrote: > Hi Boris, > > On Fri, Jan 18, 2019 at 11:07 PM Boris Brezillon wrote: > > Did you consider converting this driver to spimem? Looks like the > > protocol used to communicate with the memory resembles the one used on > > SPI NANDs/NORs and fits pretty well in the spi_mem_op representation. > > > > By doing this conversion you'd allow people to connect an AT25 EEPROM > > to an advanced SPI controller that does not support regular SPI > > transfers and you wouldn't have to forge SPI messages manually. > > > > Here is a patch (only compile tested) doing that. The diffstat is not in > > favor of this conversion, but I find the resulting code cleaner and more > > future proof. > > Thanks, seems to work fine, with the 512-byte 25LC040 I have! > > Tested-by: Geert Uytterhoeven > > I did notice that the first two-byte transfer (command+offset) of each > message is now split in two one-byte transfers, though. That's something we can optimize in drivers/spi/spi-mem.c if you think it makes a difference.