Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3243918pxb; Mon, 9 Nov 2020 06:26:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5aaJza92eam4pJpe/zGGqc6WcMRzb1/UdEPLrgdD1a9jSbp6uKZWM9f828h9pxBKLvoFY X-Received: by 2002:a17:906:1f86:: with SMTP id t6mr14863788ejr.325.1604931972042; Mon, 09 Nov 2020 06:26:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604931972; cv=none; d=google.com; s=arc-20160816; b=qzxM2GR1/qvxb34kZOVlLAoLjeCppO/mnu3HAeFL0JlmQJJHCJY8ylRQZqyRn9BpSm 60FPYf09jZKnD3czxBGVZhjERxGXHLxfnMF1exkz9N0+rBE1tLJlOlYMz3qz54bCh1OK pMQLQZd+7GWg8dpIdJxtRpP3F7CZmL1Xs6KCrnD9+oePZ6nuOYVFi5OladqYAkcKYwLO +4+GdDxPHOott59cxIQnBh+1jhq4w7MXUEguDR3I8sBnPCx5SEjmFpWxOQiuP5it2inU PBLr/9JS79vIkOslHSGt/FZ6e6haLN2YdVGKKUuykRTERRMvu9NVnte21r33VNamuZZE p7yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=I0JWH1SE4fNuIvP9pni+ltgPPpUk5UXe6Ja6Dl7UHNM=; b=C9m1EbfWD6dDbnQKqAt7onKak6Rf6M+GvsshIDlix1lDjKj0OYHtpJUx7yWxHTFAAc DU0Q9U4pHMoZwdImcwPn/hiiWC2so1B3BFeBw9+9eP+aOO9CrB9itBxopVXnW91Lekfe maR3gPOfkIP7eqcoiRZURDYrSc5SdGZBL0SSGCQNU1Hh7Qwpo6sw8w9WM4QOUoj1OB8s LG0hKiEzBRqDbegVxtzVCP+dUijvZYdHwhsDUqLWP42TBeNFOGPVDqnjljs9/hF5GHNQ Hl9v2VbwPUIgf/2FnxBB9RGoQLoNypc2ViMjwjthvJG/lfZtu+7CuwA3InQa+ViTnlzj i6lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jevuavzx; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n22si7024644ejk.683.2020.11.09.06.25.47; Mon, 09 Nov 2020 06:26:12 -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=@gmail.com header.s=20161025 header.b=jevuavzx; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730477AbgKIOYW (ORCPT + 99 others); Mon, 9 Nov 2020 09:24:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730035AbgKIOYW (ORCPT ); Mon, 9 Nov 2020 09:24:22 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5647BC0613CF; Mon, 9 Nov 2020 06:24:22 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id r186so7296852pgr.0; Mon, 09 Nov 2020 06:24:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I0JWH1SE4fNuIvP9pni+ltgPPpUk5UXe6Ja6Dl7UHNM=; b=jevuavzxcW3HQorjQwheDNNI2A/fFPMvKDn0mcJGqAZBwBmCKwMTdKJpXVkQPCC+xc 0wzcYAZ5Q9lDDiVmS1vQywVJM7xxtr6bERgHvaw2TEYngDMWsfm/UvAbGMQVmFwZV6AE lsMhtSpPyA8oDLU44HCn1M8NMYKKMjwqaHtlsW2DLk/QnsFFxCiUlGtC6gh6DgouC3yv ZuWZI00QluQK5J/HrBKfORylQVbU6tR9TYZ61UkFhd1dTptjTzMHdN3pV6bzUplif+Sy B0mjgvK9zvjtFqHsvXmc3piUc2zpJLAweR5Z9rqfcxL7qRHQeczNP/gpziee4ovyEAeC SdMA== 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=I0JWH1SE4fNuIvP9pni+ltgPPpUk5UXe6Ja6Dl7UHNM=; b=HmhhnF8mLX8j7KnSWena5LS4wePUGslk2xCmf8mrR4XxvwYe3hCd4UeDIuPlOR0E7w yuBdI01C1WRWTlTsvjoHngUU+G4XZHY2lZ8W0ivja1L/xLpC00sXYTe/drf1GJ99yf7Q Is0FWJwtrUg2HOALoHX/82FF30aPPEomlm+zZVv5M6iCLk25iq/PFdpoM/AwJa34LNWc j4MeWH/SERu4BdsoAsFfbm5rBuUkYSJSE+ypH4tgo7oDgR4xRURaDUz3KOSUNUJaXA/r UsKWQ/i+zzf03Z1dSzI33t5sVG90OTdsR71L3hiCKUgPmdyeCUEmVfr5ixttSycMvPIa ObZg== X-Gm-Message-State: AOAM530vNtA7ozUJYR6RKN91xGbSbD6ntA9HYPDVG3yXD+kNAqg6MjdH 1UTxGHPXkH4rMh4BGTtp7Of1IJrrQK8470JmPoM= X-Received: by 2002:a63:4511:: with SMTP id s17mr13018417pga.4.1604931861810; Mon, 09 Nov 2020 06:24:21 -0800 (PST) MIME-Version: 1.0 References: <20201106150706.29089-1-TheSven73@gmail.com> In-Reply-To: <20201106150706.29089-1-TheSven73@gmail.com> From: Andy Shevchenko Date: Mon, 9 Nov 2020 16:25:10 +0200 Message-ID: Subject: Re: [PATCH v1] spi: fix client driver breakages when using GPIO descriptors To: Sven Van Asbroeck Cc: Mark Brown , Linus Walleij , Jonathan Cameron , Simon Han , Lukas Wunner , linux-spi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 6, 2020 at 5:08 PM Sven Van Asbroeck wrote: > > From: Sven Van Asbroeck > > Commit f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs") > introduced the optional use of GPIO descriptors for chip selects. > > A side-effect of this change: when a SPI bus uses GPIO descriptors, > all its client devices have SPI_CS_HIGH set in spi->mode. This flag is > required for the SPI bus to operate correctly. > > This unfortunately breaks many client drivers, which use the following > pattern to configure their underlying SPI bus: > > static int client_device_probe(struct spi_device *spi) > { > ... > spi->mode = SPI_MODE_0; > spi->bits_per_word = 8; > err = spi_setup(spi); > .. > } > > In short, many client drivers overwrite the SPI_CS_HIGH bit in > spi->mode, and break the underlying SPI bus driver. Sounds like "many SPI drivers have to be fixed". -- With Best Regards, Andy Shevchenko