Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp176407pxk; Wed, 9 Sep 2020 02:21:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws/yrpdBeou0UiMUuR+1ob2taMMBVU9BbpVERHFpqFDlWb///REHccX2ZR1OFmZdeAaLh5 X-Received: by 2002:a17:906:72d2:: with SMTP id m18mr2654668ejl.220.1599643316181; Wed, 09 Sep 2020 02:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599643316; cv=none; d=google.com; s=arc-20160816; b=R6sBQduh7L3W90g9+/L976evwZQUTsnBU+Y47g2K5IZYMIaBbHyWMOAwBNqx4pH3CM rB70bdBHfQzfl96qz6yx8Gv0UwWrWTnCiu6n41CTMOQu+Q3UUzhnbzz3BncyvXoBsgYU 1rHVKnFgA8P8zpzOqNBlsRf/t17Fw0KtrJgCWiYTJVTxhaKjIZX57gB1HwNqRIlun8YR MXyiRMAEp7FCe4b6hartbTKjUCE92MgU2JAmntLlWEwErhVwfxf5jdY33ZG0fpdWnwvY PVSCbJfqhwzQipXqbqL6n/auKTOkupjmPPXpWxpg3B51I/FEvsaM0hceEs4qYXN7Twx3 1UGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PNmAfjU4H8Zs5sT50QV1b9clmpM+rEqrxgMSd1310HY=; b=UlRO82SkswwPotmrATW1T0J1MA29eY/QrZMl59BgyYFPy0DwRCgfz1dx3Jl1Tidxsb DoRN48rXmAzujNDlDovQaNfLvpE5fopGmAZaCkmlDMxW5sHaQ/VbFDyX4fHpqlljJFtq chM0I2SkyuIJbSVgxBPnzJTw7u+5/i0LcIoycORCDVBuuXHCgnr1u6eh249+xxCc1xxl c0D2WtnPFojLp3+RFYldU9LGLsQnurbGe3m03gtAI0Fm8ydiirTQoQq661+KQCKNO0J9 MNZ7tENGFqseAy0/6/cHY4rEhlwS9rDlfk3No5M4Pvg1/vwDopo/cy22k7VNxwA6SAMm Nk9g== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si1188151edq.314.2020.09.09.02.21.32; Wed, 09 Sep 2020 02:21:56 -0700 (PDT) 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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbgIIJUx (ORCPT + 99 others); Wed, 9 Sep 2020 05:20:53 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:43396 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbgIIJUw (ORCPT ); Wed, 9 Sep 2020 05:20:52 -0400 Received: by mail-ed1-f66.google.com with SMTP id n13so1886316edo.10; Wed, 09 Sep 2020 02:20:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PNmAfjU4H8Zs5sT50QV1b9clmpM+rEqrxgMSd1310HY=; b=DLA3Vrq01UT2vsRpkdsbBH1ScpPCezhLJy8R0iucwWzvHO232sc4JrgI17NyaiILZW SlE9yesYUJwJmUGb9jzqjWQxkrVbPRy5FPy8cesarw+lFXqPXj5112jPohaAoUkbWdqp bzhZUMuimnjbBfD3zfwaKxQImKwVCEElsvQZoeiwdFOSSAt/2r//LbGKq28vZZLLDryB iHiCJacpKKdIB8B1oHM0ndwdKJDrXjQo36XTTnZhAT+Zw68YeIsMCOdISp6lPNmic8pV vlywY9GzgAWKxyhYAyc+RKkio+CT6MdSuLdWFM3hy6NvMr/7t/AHV/tJk1f128KaN1jl n0Vg== X-Gm-Message-State: AOAM5325QuZpnTNH4h9koyPuGiwhfSZJj3foRZHBSPn0eKREf7VaoEnW k4/c41kaluMPsgtyZs/95aw= X-Received: by 2002:a50:e70e:: with SMTP id a14mr3019138edn.93.1599643250032; Wed, 09 Sep 2020 02:20:50 -0700 (PDT) Received: from kozik-lap ([194.230.155.174]) by smtp.googlemail.com with ESMTPSA id r15sm1435034edv.94.2020.09.09.02.20.48 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Sep 2020 02:20:49 -0700 (PDT) Date: Wed, 9 Sep 2020 11:20:47 +0200 From: "krzk@kernel.org" To: "Vaittinen, Matti" Cc: "robh+dt@kernel.org" , linux-power , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "tharvey@gateworks.com" , "lee.jones@linaro.org" , "rjones@gateworks.com" Subject: Re: [PATCH] dt-bindings: mfd: Correct interrupt flags in examples Message-ID: <20200909092047.GA4184@kozik-lap> References: <20200908145900.4423-1-krzk@kernel.org> <5ea2a75a873b6291962f6b6a7949e9d185187911.camel@fi.rohmeurope.com> <20200909081716.GA11775@kozik-lap> <745c815f716fa8245f17cb2e189529e382df63da.camel@fi.rohmeurope.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <745c815f716fa8245f17cb2e189529e382df63da.camel@fi.rohmeurope.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 09, 2020 at 08:57:36AM +0000, Vaittinen, Matti wrote: > Hello Krzysztof, > > On Wed, 2020-09-09 at 10:17 +0200, krzk@kernel.org wrote: > > On Wed, Sep 09, 2020 at 06:30:44AM +0000, Vaittinen, Matti wrote: > > > On Tue, 2020-09-08 at 16:59 +0200, Krzysztof Kozlowski wrote: > > > > GPIO_ACTIVE_x flags are not correct in the context of interrupt > > > > flags. > > > > These are simple defines so they could be used in DTS but they > > > > will > > > > not > > > > have the same meaning: > > > > 1. GPIO_ACTIVE_HIGH = 0 = IRQ_TYPE_NONE > > > > 2. GPIO_ACTIVE_LOW = 1 = IRQ_TYPE_EDGE_RISING > > > > > > > > Correct the interrupt flags, assuming the author of the code > > > > wanted > > > > some > > > > logical behavior behind the name "ACTIVE_xxx", this is: > > > > ACTIVE_LOW => IRQ_TYPE_LEVEL_LOW > > > > > > > > Signed-off-by: Krzysztof Kozlowski > > > > > > For BD70528: > > > Acked-By: Matti Vaittinen > > > > > > > --- > > > > Documentation/devicetree/bindings/mfd/act8945a.txt | 2 > > > > +- > > > > Documentation/devicetree/bindings/mfd/gateworks-gsc.yaml | 3 > > > > ++- > > > > Documentation/devicetree/bindings/mfd/rohm,bd70528-pmic.txt | 2 > > > > +- > > > > 3 files changed, 4 insertions(+), 3 deletions(-) > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd70528- > > > > pmic.txt b/Documentation/devicetree/bindings/mfd/rohm,bd70528- > > > > pmic.txt > > > > index c3c02ce73cde..386eec06cf08 100644 > > > > --- a/Documentation/devicetree/bindings/mfd/rohm,bd70528-pmic.txt > > > > +++ b/Documentation/devicetree/bindings/mfd/rohm,bd70528-pmic.txt > > > > @@ -39,7 +39,7 @@ pmic: pmic@4b { > > > > compatible = "rohm,bd70528"; > > > > reg = <0x4b>; > > > > interrupt-parent = <&gpio1>; > > > > - interrupts = <29 GPIO_ACTIVE_LOW>; > > > > + interrupts = <29 IRQ_TYPE_LEVEL_LOW>; > > > > > > This is how it should have been from the beginning :) Thanks! > > > > I start to wonder now. It seems some boards do not configure a pull > > up > > there, so IRQ_TYPE_LEVEL_LOW is wrong - causes the line to stay in > > low > > state. But actually this maybe is a problem of missing pull up, not > > the > > IRQ flag? > > The BD70528 is designed so that it will use level active interrupts - > and line is pulled down when IRQ is active. Thus the example should > have IRQ_TYPE_LEVEL_LOW - and your fix is correct. > > After that being said - I can't comment on actual board using BD70528 > (or other ROHM ICs) - even less I can comment boards using other ICs. > > After that being said - it's not a rare mistake to configure level > active IRQs to be triggered at edge - it actually works most of the > time - untill they deadlock at the race of generating new IRQ between > reading the status and acking the line... I've debugged way too many > such cases... > > Anyways, for BD70528 DTS example your fix looks correct. Thanks. Thanks. I found this error in multiple DTS files - most probably a copy paste from example or from evalkit (e.g. imx8mm-evk.dts). The trouble is that I don't have the schematics for them and at least in one hardware (Variscite VAR-SOM-MX8M which I am using) it looks like logic got reversed... Best regards, Krzysztof