Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3882045pxu; Mon, 30 Nov 2020 12:16:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPof+nwbNTLvkIyHYUuj7oTh2KLBHor9P4GdJIUXt7OOneAW3hBWC4BhkEml5rfKAvxmIi X-Received: by 2002:a17:906:3153:: with SMTP id e19mr22800546eje.17.1606767384294; Mon, 30 Nov 2020 12:16:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606767384; cv=none; d=google.com; s=arc-20160816; b=u6T5+zZgMzBOHz9ICfUi63idN+hCCXOcVqznxVZl9jD4SPWQBaXg8+09aG65Xf5n7a f7oepmZ+Xp4uciSZEO3zn0Z0TWG0vQ7oj75t+ZCUVR6VXXTBloWhMoe3uCw6iyF0sKg/ 59LQ1oawvT49Haf2vJ3aEu3kMeumT5Ng0e3VdyAJc0Oqh6DeQkYjgGASkCPVtRdX4x62 +66pHXN5DP6mZeNBf/8c4Wsdwkb1e9RRDpR1akEsLr93jPG1/ILGlZGlr6RAyWOtiVoO 6kMzunP4FqaFYYfiy5ju0s0CHuHzFcOHcz1qJx2To2BKjhuNPODQGmA5cJIE+ZHSnwr4 5xGg== 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=KNqM/C8eL45x9LNKyk86/gn0/dc3HpN6rTLp60H8hWQ=; b=OxspaPKhyninEgw/DGOFTp1OiM+PzLS5qBxlZjnj4b6x/+T2fRP6i2scfm5h/XPX7W 8aop+PGvdD+0jqEPFhLb+9PGB6KeoRKM/3rHAYGYMtuJaI57we/UPZrgW54K6WgnwkYf u/V8YpdnwDEdv3wSZZdCfBtsOWUmFM+lXVo+JoYDtYWnB8ceEV8f2fOozHi/lTUUwArQ rU58Skghk/ttfoWRBfmVkpM4T4ray2x6yXO90cTho285EHHYwwUSLMeSOR9urr98Ib/G ImqZUNvOYxFlgBFvhL5j7sg2z3mnDTLpVEeIq+i1OZjOQKj6u7P3x0yB8O6uTHH1oLex Y5yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Vq0OS8S8; 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 dm3si9219164edb.547.2020.11.30.12.16.01; Mon, 30 Nov 2020 12:16:24 -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=Vq0OS8S8; 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 S1730016AbgK3UNz (ORCPT + 99 others); Mon, 30 Nov 2020 15:13:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729952AbgK3UNy (ORCPT ); Mon, 30 Nov 2020 15:13:54 -0500 Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A540CC0613D2 for ; Mon, 30 Nov 2020 12:13:14 -0800 (PST) Received: by mail-vk1-xa43.google.com with SMTP id m6so3028969vkl.2 for ; Mon, 30 Nov 2020 12:13:14 -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=KNqM/C8eL45x9LNKyk86/gn0/dc3HpN6rTLp60H8hWQ=; b=Vq0OS8S8QXQplFzhvSngxUne0rTUSvj1r2no9nGC+YhPX4w6H1iUWzAStM2+tXFEul Ted40Zr5ZUL53ooRcvb7OpxTEa1IFf53x9Ws6GL/leS2QM7IpV5dSjc5XCN3cKZPuDZk iAi4CapWv33D/JN77dul4CJkEzcdZado6aqqIZHKdiKwnBv150EAX7D1eqebmdjLwGW4 yZ4TP7GYG32knC9mGosk6flndLsv63NLToCtjnU/NVoNzGdvNor/VSU52ZxsKwc2HgFz ZW0Fw3ZBRqZUNYI/GDcooKzYl2NzIGP6oxQVsSAbEY3DrYn804UU8kUa8MozfAuJ3UZr 52Zw== 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=KNqM/C8eL45x9LNKyk86/gn0/dc3HpN6rTLp60H8hWQ=; b=kfPSg5b5RGfo7QGLbYdrKNUjtgQj6ooRCzW5RhLU6+zU8Ei9kL8ifqMPCXro9drG5M U01RpbA/sjn0ZA6/+T48OyF/M+qBM1IM8FLb+uGPqZw3O9m1kbbxjjTq/JCW5wyzlF8/ WRI4Wjbji6IuO5SViS1eo2/f4n6tK+ZDi1+rQ5ff4YYVk8mQpuwEBm3Z3yvDuI5Y98pl FzdYg7jJ8zgDzdxbbR2KXc91DNOdxHU7T2jsQ4bHwB+1/phW8VCV0kWJT/RFeyRblhY4 B9kgAFCiqRJhnGtEtCuBq0Lo6NM/VLUEPTHCeU0sVLsQBvFG4MOFQcVox5KKvizkWshU n/uw== X-Gm-Message-State: AOAM532mUB5DZqfTd5AFr+m0OSAKbBsjNXuZ/gTTIwMG5NTffIJ69av1 MCGksZPLii7UHHhdUFIAKFh2h/AX7BadfZT+3M3cY6nGVQo= X-Received: by 2002:a1f:5587:: with SMTP id j129mr17952226vkb.0.1606767193811; Mon, 30 Nov 2020 12:13:13 -0800 (PST) MIME-Version: 1.0 References: <2D7916FA-678F-4236-B478-C953CADF2FFA@goldelico.com> In-Reply-To: <2D7916FA-678F-4236-B478-C953CADF2FFA@goldelico.com> From: Sven Van Asbroeck Date: Mon, 30 Nov 2020 15:13:02 -0500 Message-ID: Subject: Re: [BUG] SPI broken for SPI based panel drivers To: "H. Nikolaus Schaller" Cc: Linus Walleij , Mark Brown , kernel list , Laurent Pinchart , Discussions about the Letux Kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nikolaus, thank you for reaching out ! On Mon, Nov 30, 2020 at 2:06 PM H. Nikolaus Schaller wrote: > > But reverting your patch brings back the display. So it appears as if it does not > fix a breakage, rather breaks a previously working setup. The patch in question fixes an important breakage: before the patch, literally hundreds of SPI drivers no longer worked - only if the SPI bus master driver was using gpio descriptors. We knew that there was a chance that our fix would break something else. But hopefully "it fixes more than it breaks" > > What should we do? > Can you try the following patch ? diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 7ceb0ba27b75..c173d7de73b3 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c @@ -208,8 +208,8 @@ static void spi_gpio_chipselect(struct spi_device *spi, int is_active) if (spi_gpio->cs_gpios) { struct gpio_desc *cs = spi_gpio->cs_gpios[spi->chip_select]; - /* SPI chip selects are normally active-low */ - gpiod_set_value_cansleep(cs, (spi->mode & SPI_CS_HIGH) ? is_active : !is_active); + /* SPI chip select polarity handled by gpiolib*/ + gpiod_set_value_cansleep(cs, is_active); } }