From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonas Gorski Subject: [PATCH V2 0/2] spi/bcm63xx: fix multi transfer messages Date: Sun, 3 Feb 2013 15:15:11 +0100 Message-ID: <1359900913-4472-1-git-send-email-jogo@openwrt.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Maxime Bizon , Mark Brown , Florian Fainelli , Kevin Cernekee To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org The bcm63xx SPI controller does not support keeping CS up after doing a transfer. Since this is problematic for most typical use cases, this patchset introduces a workaround by combining small enough messages to one transfer, rejecting anything that can't be fulfilled with the hardware. Patch one properly rejects anything impossible to transfer with these limitations. Patch two introduces logic for combining transfers to one to be able to use it for typical use cases (register accesses and flash access). Build and run tested on a BCM6368 with a SPI controlled switch attached requiring write-then-read with CS asserted. Changes V1 -> V2: * split into two patches * fixed return type of bcm63xx_txrx_bufs() * slightly reworked bcm63xx_txrx_bufs, obsoleting one local variable * added a bit more comments in the code * added error messages indicated why transfers were rejected Jonas Gorski (2): spi/bcm63xx: reject transfers unable to transfer spi/bcm63xx: work around inability to keep CS up drivers/spi/spi-bcm63xx.c | 179 +++++++++++++++++++++++++++++++-------------- 1 file changed, 125 insertions(+), 54 deletions(-) -- 1.7.10.4 ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_jan