Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp282134pxb; Thu, 12 Nov 2020 03:50:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPmtswESHFnKAyBWY9AJsT183BwRec8GAxWbItTFNYY4He/k6rL8z6zvobVfD4rfL7kAau X-Received: by 2002:a17:906:6c93:: with SMTP id s19mr31130451ejr.544.1605181849866; Thu, 12 Nov 2020 03:50:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605181849; cv=none; d=google.com; s=arc-20160816; b=EE4LVves1rdRqQwrWha6keS2GUHCQlcHpQujGehklMx+z96DsiCpZtnHyDETt3/H/T emHgClz9LNWDiMQGllCnZaiESE7EaTuw5fa5Rumlvl1h4u/6h4Mww5ukDx/GlAFQjKt1 ZiQGjSY3WQoH+Puo4WdlReOTdlZ/YxMpJ2N/hCG/d+pn/IJP/va2scM97m0GERMOODq3 gU3keF0kCvtVxgYX3hi1BkBqgOjSqPHWWZJViXnKDM/YUzXSjeXYILYms8IsZvDwmS/i InzQGWcgvMuhrGr+z+R1tVexvTAGMV1DNHreCcPd+38NMwqLXdCRkligCTHtu6RqVF8c TT6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=j/1abh6t7YrrzXU1SesVqlhurYOExGuzAxH/2JLe2ws=; b=RLkzqtYP28+ttFu1plpbV5rlHBoOFyOZN8KVBXF733vT7nTuggOyqSBNR3DYvgesc1 fAgD2wQ9Y1C97U3pK6SlvCz4YIfdHqf5MpkoY/qx9GaYkAg70o8/Bqy/HudVvwvoSoKT sMgFGRe17XBqoOv6P/A5sktpvJLtvhjaUIH62PX67tQMBRLBOCABZPOqtBOE0LXG7Ruq tXaFZMIjKpp9UEpeJJQYrXb7wEeUfbumGqPViJtAk19cV+eDez7GQS84pEUyL879vzq3 NSNsBiKcj1f6igTreofj9eoztZGTvWKkuEChCUnH9NwzoUAfjN7dWUMJKE3MYnLaU4ux aw6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=E6gdlPIy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s8si3885499edc.481.2020.11.12.03.50.27; Thu, 12 Nov 2020 03:50:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=E6gdlPIy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728157AbgKLLrr (ORCPT + 99 others); Thu, 12 Nov 2020 06:47:47 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:10250 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728201AbgKLLlw (ORCPT ); Thu, 12 Nov 2020 06:41:52 -0500 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0ACBd5pe021048; Thu, 12 Nov 2020 05:41:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=PODMain02222019; bh=j/1abh6t7YrrzXU1SesVqlhurYOExGuzAxH/2JLe2ws=; b=E6gdlPIyElcjoqqMFHiI7N2SUDwd0NEVIJ9pQdaud6Al7tw8inWp8UDSv4irRqaS54Wp p1Swh03GraIF3TM9yZH9JbhvdfAI+KhTwS8WeCmPdtU0mjiYrT6YOPNazoedsIDg4pEt dhSSHWY7L7bsTujScVFKcgiUFdZwJHIhBcqBIwZZPIgiOH86IE0CwtRcnymRRPuc5xNT EcyS7hfqrXJq9WHheHBH1d79iowXh8N7mYEIH2ZdrpWCPoTnQuoY41A56uKoc6lzBYGI 8TFlYsAzGSz9fQ9+zUrz0OlChjc5Wrob+tK8g53FiRYTEWH9kArxv3vUHtyoBOpOVijw Ig== Received: from ediex02.ad.cirrus.com ([5.172.152.52]) by mx0a-001ae601.pphosted.com with ESMTP id 34rn2yh5q1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 12 Nov 2020 05:41:38 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Thu, 12 Nov 2020 11:41:36 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Thu, 12 Nov 2020 11:41:36 +0000 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 88F877C; Thu, 12 Nov 2020 11:41:36 +0000 (UTC) Date: Thu, 12 Nov 2020 11:41:36 +0000 From: Charles Keepax To: Sven Van Asbroeck CC: Mark Brown , Linus Walleij , Jonathan Cameron , Lukas Wunner , linux-spi , Simon Han , Linux Kernel Mailing List Subject: Re: [PATCH v1] spi: fix client driver breakages when using GPIO descriptors Message-ID: <20201112114136.GE10899@ediswmail.ad.cirrus.com> References: <20201106150706.29089-1-TheSven73@gmail.com> <160510968064.12304.14797288117651443603.b4-ty@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 spamscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 malwarescore=0 clxscore=1011 adultscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011120069 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 11, 2020 at 11:24:14AM -0500, Sven Van Asbroeck wrote: > On Wed, Nov 11, 2020 at 10:48 AM Mark Brown wrote: > > > > Applied to > > > > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next > > Thank you ! > > Now that our minds are still focused on this subject, should > commit 138c9c32f090 ("spi: spidev: Fix CS polarity if GPIO descriptors > are used") > be reverted? > > This fixed spidev to deal with SPI_CS_HIGH on gpiod. > But after our fix, its behaviour will probably be broken again. > > Another candidate for revert is > commit ada9e3fcc175 ("spi: dw: Correct handling of native chipselect") > although I don't understand that code well enough to be sure. > > Adding Charles Keepax. Looks like the code has changed a fair amount since my patch. The important detail from it was trying to clarify the semantics of the controller->set_cs callback. That function is called with a boolean argument and that argument could have two possible meanings: 1) True means apply a high logic level to the chip select line. 2) True mean apply chip select. Under interpretation 2) the chip select line would be set to a different logic level depending on if the device is active high or active low. If I remember correctly at the point of my patch the core had just changed between the two a couple of times but now consistently did 1) (and looks like it still does), my patch intended to updated the spi-dw driver to match that, as my SPI had stopped working. I think it then turned out, my patch broke some other use-cases and that the bit in the IP basically had 2) semantics in hardware. Which is what this patch fixed: commit 9aea644ca17b ("spi: dw: Fix native CS being unset") After that patch my patch is mostly replaced so I don't think it would make any sense to revert my patch at this point, and I don't think your patch will break the spi-dw driver. I don't have easy access to the hardware right now to test, but I will give it is quick run when that option becomes available to me again. Your fix looks good to me, but I suspect you do need to fix the spidev stuff although I have haven't looked at that in detail. Thanks, Charles