Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp726587ybi; Wed, 3 Jul 2019 03:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyY+zyppH69eqzXeMYQc6pOlDb0s+xeF5aTAtzO+PNsUSdbVvXaoS760bOVFnkAVvyvADa0 X-Received: by 2002:a17:90a:898e:: with SMTP id v14mr11931977pjn.119.1562150675340; Wed, 03 Jul 2019 03:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562150675; cv=none; d=google.com; s=arc-20160816; b=rxc/hNeXIg5hq56bexgzPdk9EWe1G5Hohlsmga2qlq3mflskSyHCgYIRqgr6kskBsI RXrd9V904hlRjo4FfybF2ZCQ3DWLhCRcvx/EpAJsDYjZDyExgP2A/bArQmGwYVrxx0kn FmxIDICAF7dtKutzwNqwZZybmC5V18iQ9Z0BIKzvSDAknfynLeftT06TbLxO5fOS3uQN r5VAuuipbWSJCDUbk5oAjaZ0ytHNzF37Bn4rzlUzZ307InwDb8yLtRFx+YDCyFg7+7Ws ffl9ZfHfpWxjIF+JCN77Mj0ObGfDfUSGE9oDo8Z1mJieE/s5yEi2wmaEz8DRXkXEGatw gi7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=k/+IoPQ9XSY5a0CtS1e8cUHZqlswTQqeoiTnKG4QRC4=; b=PsK4cXqLsPEvVthIPMVkpg3AlVGQCTRqkgxBdg1eZYlbslO0dCWGbiRy/Yi4FM44ec RfXhr8/Kd7i9dacKdqI6Y4mu5bLg7AJvJr/kh/ACcAag0Flq75H8z2UkkfzhiyCGau73 672JK32CThRN14VtnA+p2qIYkIT1zWNYPiz7lErYEd4sMwg3Ef7+sSdKvCX/DQVcrm5h VKLU46Myv37zKERrKPn5MUEqIUB1S3orMcOxVPDhysocd7Fr4RtUO13WRu1KDy0nrxp0 4FZjjcBoX9tXhmkA5hjR/T1hC/9OWAtf8VGqs3QJRu1kxyhRQluxjNQXd5o0LVRXrGjT 7Txg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si2219358pfj.93.2019.07.03.03.44.20; Wed, 03 Jul 2019 03:44:35 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727146AbfGCKnm (ORCPT + 99 others); Wed, 3 Jul 2019 06:43:42 -0400 Received: from bmailout3.hostsharing.net ([176.9.242.62]:40633 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbfGCKnl (ORCPT ); Wed, 3 Jul 2019 06:43:41 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 2A99E100AF5F7; Wed, 3 Jul 2019 12:43:39 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id CCA622F790B; Wed, 3 Jul 2019 12:43:38 +0200 (CEST) Date: Wed, 3 Jul 2019 12:43:38 +0200 From: Lukas Wunner To: "Sa, Nuno" Cc: "linux-spi@vger.kernel.org" , "bcm-kernel-feedback-list@broadcom.com" , "broonie@kernel.org" , "kernel@martin.sperl.org" , "linux-kernel@vger.kernel.org" , "sbranden@broadcom.com" , "wahrenst@gmx.net" , "f.fainelli@gmail.com" , "linux-rpi-kernel@lists.infradead.org" , "eric@anholt.net" , "rjui@broadcom.com" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] spi: spi-bcm2835.c: Fix 3-wire mode Message-ID: <20190703104338.m5vfkbyq4fhqmjh4@wunner.de> References: <20190628123023.4696-1-nuno.sa@analog.com> <1b932c61-982b-aae0-1fef-3c574e7d17eb@gmx.net> <20190628190022.vya4h2lihm6x2xpb@wunner.de> <54323339606a36febc6a8633a8d3a7db84b975c4.camel@analog.com> <20190701115506.42rr4o4hbuvwytjc@wunner.de> <42a533cbf1e47ab8c8a44c5e865ec15193a2e956.camel@analog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42a533cbf1e47ab8c8a44c5e865ec15193a2e956.camel@analog.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 01, 2019 at 02:21:21PM +0000, Sa, Nuno wrote: > On Mon, 2019-07-01 at 13:55 +0200, Lukas Wunner wrote: > > I see. In that case, try: > > > > /* handle all the 3-wire mode */ > > - if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf)) > > + if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf != ctlr->dummy_rx)) > > cs |= BCM2835_SPI_CS_REN; > > else > > cs &= ~BCM2835_SPI_CS_REN; > > This worked fine. Also, I did a quick backport of the state of your > driver's (both spi-bcm2835 and bcm2835-dma) in revpi_staging and it > also worked fine with my device. > So, as far as I understand, the above suggestion (or my patch) is not > intended to be upstreamed, right? It is just a temporary fix that I can > use while your patchset gets upstream. Thanks for testing. I've just submitted the above as a fix for 5.3. (Actually with a small change, the check for (tfr->rx_buf) needs to be preserved in case DMA is disabled.) The patch can be backported to 5.2 and older stable kernels if "ctlr" is replaced by "master", we can inform Greg about that once the patch lands in Linus' tree. And I've amended my patch set to revert this patch when dropping MUST_RX. Thanks, Lukas