Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6530575ybc; Thu, 28 Nov 2019 00:44:17 -0800 (PST) X-Google-Smtp-Source: APXvYqw1LCJHGJaslJ5nAeRPf7UjBC8a35Pi9y2S8VxF6YWFl2vOoIPHCK+y4X3WOoUdYzZMaXzH X-Received: by 2002:aa7:cf19:: with SMTP id a25mr30532881edy.237.1574930657817; Thu, 28 Nov 2019 00:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574930657; cv=none; d=google.com; s=arc-20160816; b=MylPccRPlKjCkHv8B1qu5FmgLy2v+smtN5eJdStCoMUViPCbZuV4bC79bHJuCKRvA7 viOgyA5/9mT+LzeOAJxKulSem4ZHSdcl4oSo/9dBdu0c8ukQdL6Qid7TFbTTT6zGOUZs 4b4H5Y5rnZQ9XwXcVAISerDX28IEoCJrg6pEmc3gFYTIgDLhxWhaLlSoP5f+5nBrdTpj ff2nsL66MvSSGZRa78/vqIfHr0gZ9tThQnurQgfsPBLbz6o65/I6MCgP0V2SjL8mYXuN tIdNCbDQAfHcPEopOnJH6sybsStVP9ubp125DJo1XTxTjnP7r1CR0A4A9CJb/BCQjiQC wdZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+JqMG1d/lOL1srD0/KuAfIZSpr9D48XI4hlM2DvA188=; b=uXxNJFVfsWLprTMSjVogQ3KTdW+qrU7XI/+hfqsO1+7TM6Kxk/L31VgJ4sRySfJ0Sj KlbGCuIeKLhQjF5Tc84Sg2SLOIBkNs1WsApDEoyj+GErvPztnnI0Gx+5cyg9Lq9lUaDu ojs51As6MaiHrbnh2zTCl+PS+tBe7iwBVEDRl+Gxv8hkVCEoj88DXhULnK2961H+9RNf i1MNzrfDuDWacduED84FwNjDgFaQ60hde+8uSf0ZdnqxrNWiFYjuMAXwgKZW2lFR8nem SNlmfZZB2NerF2hI5GVYr5jRTOBV/jWBYk97x0SqcfhuiZOjzI2j7L7s+RPSbOQx15CC TqhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bZEuPxzn; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jr23si11183192ejb.369.2019.11.28.00.43.54; Thu, 28 Nov 2019 00:44:17 -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=@linaro.org header.s=google header.b=bZEuPxzn; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727438AbfK1IkS (ORCPT + 99 others); Thu, 28 Nov 2019 03:40:18 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:39450 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726301AbfK1IkS (ORCPT ); Thu, 28 Nov 2019 03:40:18 -0500 Received: by mail-lf1-f68.google.com with SMTP id f18so19367613lfj.6 for ; Thu, 28 Nov 2019 00:40:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+JqMG1d/lOL1srD0/KuAfIZSpr9D48XI4hlM2DvA188=; b=bZEuPxznYkkUMn6qZgpnuvM4gNag52WWCk/RUTwcK007r3a7ezGpkJ+hXLG8VnipQe tbqFGhp2tyCkXFj1Pc4BF0pO+lQGc6wCc9gWTYbSBR2qvBv0i0wuv5FMBkVuA79+Hawi Czl2kNrVhM7xEMRkSFc81ooawACro7k2n2UQ9WJWwY9UD/2G0s78VvjqKXtCUXSCIZ3+ GYcFYDf5b/9VDnpfUz0w2lj14wRRLGGbkcnb32aAXQdgNww0u+ALp9B7mlDguNXxtU41 pEZnCG7TjEIE32fOOYuqPLkxo4JrV9w+FakvpbwfTFutOZFAgRyS9fDItvfyWCrtnmKo pw3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+JqMG1d/lOL1srD0/KuAfIZSpr9D48XI4hlM2DvA188=; b=dJzoIKwUyrNyae5iDmwOLv3lLVxPDl74MM9VVq7Y/1ON6DwbK2RmlLBrrU4OXIuSSa MbEwhR1UX3zQuIQj+N7qMP8W7wUvcqlIgQm3oH9IEsBfvYHy/WI8GQLk+lWu2EIrU8jg fWKftLqS9IazxOD7pAo6Kl9PMNVJ5xKlSl865Vh9N+R7LzhjXz7t2HM8e+0V8aq9LdPx aa0woO1qm4u4l+ibS4Wk/fMLdITl2kFYOQZ7a1pAdGRzFz+RupZ5hIbAIaShYgSu0pJN mEvPpBhH3Lb27gfHUdzX9Cgi1l5z9qY+i9z1t+fgcAcCxup1AjETJmUThhyZBT8+qZtC GWxA== X-Gm-Message-State: APjAAAU0hBlyKRK6JLU055PWepC1BHlG1thrF5jHlcP4iuklHOLnSgYa wRPXxdVYe7NSTttuW+E/GguDGj0udHh0CuVFS42iwQ== X-Received: by 2002:ac2:410a:: with SMTP id b10mr4280450lfi.135.1574930415765; Thu, 28 Nov 2019 00:40:15 -0800 (PST) MIME-Version: 1.0 References: <20191127153936.29719-1-ckeepax@opensource.cirrus.com> In-Reply-To: <20191127153936.29719-1-ckeepax@opensource.cirrus.com> From: Linus Walleij Date: Thu, 28 Nov 2019 09:40:04 +0100 Message-ID: Subject: Re: [PATCH] spi: dw: Correct handling of native chipselect To: Charles Keepax Cc: Mark Brown , Gregory Clement , linux-spi , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 27, 2019 at 4:39 PM Charles Keepax wrote: > This patch reverts commit 6e0a32d6f376 ("spi: dw: Fix default polarity > of native chipselect"). > > The SPI framework always called the set_cs callback with the logic > level it desired on the chip select line, which is what the drivers > original handling supported. commit f3186dd87669 ("spi: Optionally > use GPIO descriptors for CS GPIOs") changed these symantics, but only > in the case of drivers that also support GPIO chip selects, to true > meaning apply slave select rather than logic high. This left things in > an odd state where a driver that only supports hardware chip selects, > the core would handle polarity but if the driver supported GPIOs as > well the driver should handle polarity. At this point the reverted > change was applied to change the logic in the driver to match new > system. > > This was then broken by commit 3e5ec1db8bfe ("spi: Fix SPI_CS_HIGH > setting when using native and GPIO CS") which reverted the core back > to consistently calling set_cs with a logic level. > > This fix reverts the driver code back to its original state to match > the current core code. This is probably a better fix as a) the set_cs > callback is always called with consistent symantics and b) the > inversion for SPI_CS_HIGH can be handled in the core and doesn't need > to be coded in each driver supporting it. > > Fixes: 3e5ec1db8bfe ("spi: Fix SPI_CS_HIGH setting when using native and GPIO CS") > Signed-off-by: Charles Keepax Thanks for looking into this Charles!! Acked-by: Linus Walleij I think we should have all regressions covered with these two patches. Yours, Linus Walleij