Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4445388pxb; Tue, 10 Nov 2020 17:11:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJybRLFT6Sb8rQgLrm0woWR8LTlrXvf3EPUxMeQ3paR9b0SY44ovFHLoprO88xf4QAd9A+Rg X-Received: by 2002:aa7:c617:: with SMTP id h23mr23426907edq.154.1605057101112; Tue, 10 Nov 2020 17:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605057101; cv=none; d=google.com; s=arc-20160816; b=ecV20KWSN7N64WaNu0abSi3PDLGxgyKTAsBcAyoCEsX+SWpm0eqSQzqcDoFxqf2oLu CGwxkgcuKjaLpN0dl+IDQ80iGVTdtfrZewHAAVtgCCHNvC/8g/3C5DuD9IhUNVLxrNUK vqG9U4yfqYyWfsxvHRGCLKlC+2lBROFScSVBcQF9fd219DwQxhU0+0YBD1auXqF9HHvx NhZXEEoCquzJp5EGjAmYAZZdW2TsX47v8V4rQFTxDwJjiVcqW/Ywfboi5qiLXfh9auca gOAyonaGS64pHE7sKZTMZe2QmHt5ALkN7Z/m/wSCt8mGogUz47LdDxdnDAoksTvYjdhF GDcQ== 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=OKnTpb6WDK79h6wzA/BGMIqbAHNaR/GEp/A0ryb8Y1s=; b=cgXjsrqg9kKCFiMrV0tue5Ol23+xXk4ZtgeHiXTxHmqyP8xSAM1kkrDPOZVNzDI35s uNX/1wl6UL0xEB+6Frn7Ib1t9s45+ld7uYnJYNKSslSHSrWNYuRBwDk2mvO2CJZjEFIb +yfNr0nipHGawFQITUTat1fXybpOTC1f8Sko90eBdUUmjv8HD/bfd/ZGK8B2LKu3tC7/ 1BnW0AIixAg6w7w+P6bhiDdolR6anT6WwgPliXFRj8qp1Rx3zJSWFnoIzCkkuEPpJoQx mlVnrvMqzTAPjP1Sq0JUJgp+NM8yW0zEHG4Tzt5UfMYfGXx9R3LPP9iwd8HcOD3HFtax 7daw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ST83Kv6m; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j24si212071ejt.651.2020.11.10.17.11.08; Tue, 10 Nov 2020 17:11:41 -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=@linaro.org header.s=google header.b=ST83Kv6m; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732013AbgKKBIh (ORCPT + 99 others); Tue, 10 Nov 2020 20:08:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727275AbgKKBIh (ORCPT ); Tue, 10 Nov 2020 20:08:37 -0500 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00B44C0613D1 for ; Tue, 10 Nov 2020 17:08:34 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id i6so906980lfd.1 for ; Tue, 10 Nov 2020 17:08:34 -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=OKnTpb6WDK79h6wzA/BGMIqbAHNaR/GEp/A0ryb8Y1s=; b=ST83Kv6mMeTo+80B4tYYL95DnnqVTImdY5ZZb3uEwhr9CRDv2QHlUfRCNcmxIoMHuc +kHBzQG7KQA5gBSNNuGb9jqENXxRGimjrlkEkZ0K+lpssMvOVnK4JbS8L4O8wBgq2UNB ykrpf8YV4mHTIUtsErKhFjpGIpRNLKk3iIHMa0aXTLWvUqQTOBB8Q/2nbecCIAvjFFTg iE2FFBrv3xPe9vSOjZvcNcrzz6G4hA3JcoMq1V3P9wmmp5wy/1JmAhAQQ7FNvkoSk3KG TAOKk3y3pJJDeuO8ZU7NgyXI6ByFBJVT5cDcoMLhw1/hDGsL++oo6AgN8wxNZQrUspEh 18YQ== 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=OKnTpb6WDK79h6wzA/BGMIqbAHNaR/GEp/A0ryb8Y1s=; b=CiOYp6cZTRkVcLKkV3SLdrQdRcyIMGbWkARi7DNmYhQPhIlo2344q0GQIWv8+kZt6L yfXFYMnAjcBYV+YQKKApj15kQ8e3R9p/vjQRGBKtb/GY5I+u4VQClMtZMefBvkqphVg4 8d0+Kn47TBNciHmjE4IXodVyI0DrrDJItMF9LnUJd9Sw8EpfSZH/qAdpAgmOJxO49quZ 3T+t8Dq7w7Re2clFrhWFp6BWn9agJnB7zgzSWyF78QjS9KEG7zXWTPSCa8fMTppStqby NilWmEll6ivbC1NZ4qMMjs8JspanVuKmluDw3k+zo+C/dnmFSwsZ0kjTzyJj5pvQ17tb +RVA== X-Gm-Message-State: AOAM532upZk5bp6g4U8Hle+tnv3/33aPLCTasxZOXgFDB0qi2w6Nuq9J 6GB+0eTEDzINq7FnjCFHSlCbU1m0sNdLuky1JJrcSw== X-Received: by 2002:a19:5e0b:: with SMTP id s11mr7865088lfb.502.1605056907439; Tue, 10 Nov 2020 17:08:27 -0800 (PST) MIME-Version: 1.0 References: <20201106150706.29089-1-TheSven73@gmail.com> In-Reply-To: <20201106150706.29089-1-TheSven73@gmail.com> From: Linus Walleij Date: Wed, 11 Nov 2020 02:08:16 +0100 Message-ID: Subject: Re: [PATCH v1] spi: fix client driver breakages when using GPIO descriptors To: Sven Van Asbroeck Cc: Mark Brown , Jonathan Cameron , Simon Han , Lukas Wunner , linux-spi , "linux-kernel@vger.kernel.org" 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 4:07 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); I feel torn about it, there are so many weird corners of semantics in this code. The patch makes the code easier to understand too. If it provedly fixes more than it breaks: Acked-by: Linus Walleij Yours, Linus Walleij