Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp15260yba; Sat, 30 Mar 2019 13:13:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDj1nzCIlZYpaaxe6T/TReLVoHXKsEj8Zgt5fp3/rFYfcBw58w8J7YjCASaMhBZBGuQ7KM X-Received: by 2002:a17:902:9688:: with SMTP id n8mr56559377plp.133.1553976792652; Sat, 30 Mar 2019 13:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553976792; cv=none; d=google.com; s=arc-20160816; b=b3S7LTnS92xy9EZLUOMkTdk72COQZo97C3xOFL+bVoGUQLgpjlFHRM4uln39Dlm84b rE6D3Wgmzhn3uNdwUagIRKTojtZ1lZKc/2jckQmuwFHODiCdL7EDAdyJtfaB7GFwKBhF NHmIm7/DPl1AFVMOhS0k9yMVlkW2vKEZ9/Db3kEoV0qrObG1NkxuOB0Vd3JdTXSNs/zb s03nM/ol/ALC2Fg7LSV0yi4mGUVkVS+3TSeCDSABUi0quBnVkon6b7JrCmzTcee0ubFx n+YQ/PkhPOQuzE8DeAsJfFJLuat9IuJ+/vXw6BUUVNIyjgUi1gCbQ8NobmCfUGfR3Zwa MIvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=lpuCw8o2tewDWQeyzEL+Q1JSAsOU4WTSpgFXHwxUeLk=; b=g72uZk1gtsShyu20lYbBpNVI7as24FaoFPQjccrzugIsKfOHNFmiRHu9+jAr336s1Q GEDw+7zr4Q8WmryNjN3BfEeK43KHxMA5vFkaGBkoKyR52ZtrobDFMgZ0i6YaUL3mAZjE mbGACmE5ak9/2evJvtoxqneKw3IIyfFgBk6wUcI+vFek/PDUcwY10NYL/il07L9EEkKj xKRnAx6g7gihwNU8G7wPx2XpMeTDlisaBGOy0ylxYiuDmTB9PLk0+vrTch8y8Jz9IrMT l4txMxDz1ZQsLQHphAv1/L+tmR2Smf7plr2nGrfzz4GiX1CAFoc34qG5vYVrke+prBgE GvPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=k9pjHiS+; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5si5047927plr.5.2019.03.30.13.12.29; Sat, 30 Mar 2019 13:13:12 -0700 (PDT) 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=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=k9pjHiS+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730974AbfC3UK6 (ORCPT + 99 others); Sat, 30 Mar 2019 16:10:58 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([81.169.146.164]:29422 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730924AbfC3UK6 (ORCPT ); Sat, 30 Mar 2019 16:10:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1553976652; s=strato-dkim-0002; d=goldelico.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=lpuCw8o2tewDWQeyzEL+Q1JSAsOU4WTSpgFXHwxUeLk=; b=k9pjHiS+h7Tn9OIJtOPKxPJ3imkziU4vmV4T22fLztj2EfHeDq2AI9ikVLCRVs9v0Y H/EDCsfkHBC5dcv+Y3UEAKyAZc3/hnDRXHygv3qjZNpMvW6nLVvlsizvqEba27fz0qih UdQbxmmsk5hApxRrFJezVoeFFtzOnc+u7e2zV0u+xhcc/6a1TlYi7/1Z9ReDn3hbBAXP xBOo4ABRmUT+57xLNpxgOHf5FRFqG1LkMXPnb6MNYMZ+ioyVtplJ9Ztcl20DcDjFYprk Dv0uGGp7LURhzKN6JtAob8z614tJLZcGta/ZZ1lhnrKHq/Hiu4grT0ikofnIeHUarg6m p5HQ== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj4Qpw9iZeHmMlw4vkKg==" X-RZG-CLASS-ID: mo00 Received: from mbp-13-nikolaus.fritz.box by smtp.strato.de (RZmta 44.18 DYNA|AUTH) with ESMTPSA id K07648v2UKAgW0q (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sat, 30 Mar 2019 21:10:42 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [Letux-kernel] [BUG] gpiolib: spi chip select legacy support breaks modern chip select and whitens the GTA04 LCD panel From: "H. Nikolaus Schaller" In-Reply-To: <20190330193259.5054655e@aktux> Date: Sat, 30 Mar 2019 21:10:47 +0100 Cc: Discussions about the Letux Kernel , Linus Walleij , devicetree , Mark Brown , LKML , linux-spi , "open list:GPIO SUBSYSTEM" , Rob Herring , Jan Kotas , kernel@pyra-handheld.com Content-Transfer-Encoding: quoted-printable Message-Id: <14098F3F-0DDD-42AA-A7AD-DC35FD4C1F23@goldelico.com> References: <7509BFB6-36E4-441A-9F16-7A4FEE7F7CF3@goldelico.com> <5488EF42-08DB-4273-95FF-49ED31E27472@goldelico.com> <2286C331-4AFC-46A9-B8C4-8A8BA9CD33C2@goldelico.com> <20190330193259.5054655e@aktux> To: Andreas Kemnade X-Mailer: Apple Mail (2.3124) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andreas, > Am 30.03.2019 um 19:33 schrieb Andreas Kemnade : >=20 > On Sun, 24 Mar 2019 07:56:17 +0100 > "H. Nikolaus Schaller" wrote: >=20 >> Hi Linus, >>=20 >>> Am 24.03.2019 um 05:15 schrieb Linus Walleij = : >>>=20 >>> On Sat, Mar 23, 2019 at 3:40 PM H. Nikolaus Schaller = wrote: >>>=20 >>>> (1) c1c04cea13dc gpio: of: Fix logic inversion >>>>=20 >>>> together with the basic patch >>>>=20 >>>> (2) 6953c57ab172 gpio: of: Handle SPI chipselect legacy bindings >>>>=20 >>>> leads to a severe regression for our GTA04 board. =20 >>>=20 >>> Sorry! :( >>>=20 >>> I found the same problem on my Nomadik board. >>>=20 >>> But I fixed it in that case by introducing a spi-cs-high into the = DTS file: >>> https://marc.info/?l=3Dlinux-arm-kernel&m=3D155292310015309&w=3D2 =20= >>=20 >> Yes, that of course works and is our temporary solution. >>=20 >> And I see that you also have it on the controller node and not the = slave node. >>=20 > So if I get it right is a check added for undocumented properties > (nothing about spi-cs-high in controller node in the bindings > documentation, only in the slave node) in the two patches mentioned. >=20 > And then you add that undocumented property to a dts file in your = "fix". >=20 > That all sounds strange to me. >=20 >>>=20 >>>> I learned that it tries to handle a legacy "spi-cs-high" property = of SPI slaves, but was stopped >>>> from doing so by a bug (1). So only with both patches, the legacy = handler becomes active which >>>> explains why it was not noticed earlier. >>>>=20 >>>> Now, our GTA04 device tree from 2014 (v3.16-rc1) was already = written without any legacy spi properties >>>> in mind =20 >>>=20 >>> I'm sorry about that, however if you look at the DT binding = document: >>> Documentation/devicetree/bindings/spi/spi-bus.txt =20 >>=20 >> Shouldn't it be a property of the slave node and not the controller = node? >>=20 >>>=20 >>> You will see that spi-cs-high is mandatory. So these DTS files are >>> incorrect. =20 >>=20 >> How do you read that it is mandatory from >>=20 >> "All slave nodes can contain the following optional properties: >> - spi-cs-high - Empty property indicating device requires chip = select >> active high." >>=20 >> I read it as optional and indicative. Equal priority to cs-gpios. >>=20 > Well, it is in the list of optional properties. So the question is how > that "optional" is interpreted. Is it optional because you only use it > if cs is active high or is it optional because you can either indicate > that fact here or via gpio definition. >=20 > But again that flags makes no sense in the controller node. I have already prepared some fix for this controller/slave node issue = and a new CONFIG option to enable the legacy "spi-cs-high" only if needed. Seems to be common practice that legacy API support (and legacy DTB compatibility is also "API") is only enabled by CONFIGs on demand. This can then replace our current GTA04 hack. Will post ASAP to LKML. BR, Nikolaus