Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp662111pxv; Thu, 24 Jun 2021 17:11:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd4AFUhzyzpMf6YUkzqn6B6yIwV4JHwBk+439z+Np//hs8BLDzODlZhaTslTDFRflSNRdI X-Received: by 2002:a6b:f20c:: with SMTP id q12mr6141909ioh.72.1624579866985; Thu, 24 Jun 2021 17:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624579866; cv=none; d=google.com; s=arc-20160816; b=ryy42+Y//c5a5a+i1iiDHUMDic9kVg4c0s7EqMuLXxOqju53hUJvFWGN0LAFT2ylzp RnG/82168Nwdd7ZxNnTDAUWsBxR/ZcVOoEYBXffmbxIaEkFzFROUr0BXTgSxQ8kYfoKG txOAeTbl3tvPQUafcRKUGL2xr0L7GrGqCdfCmu+KneLA85uMBECuQlcgMVq5vop0bF5T VGwh8/dmPszsXc3EX6xbQwF49mJ9AUKRhTUSYsx5vXkiWgENPMghv8ep8CpJpfvf322p AXszqkW2QUVaU5dE4CltZll3K10zyJnz4fzofp6+1JEpM3+RfqL/OxqpA4IJWmNmwO20 pPvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=FNTTrJ3FL1iq3YniplXZ8119Emiw8hp3FUgBfyLOtsY=; b=qusDO+nZ4LAC7ktgJDOjEsS1lHFTAlWPauz8NNVodOsfKVXAHZPwEsFAK8Q81Wuyg+ Ea3BiM4Gdri3MrZhsW33lVQDGVRApcaG88dvBCOExYnAl2qRM6YSTHDOCAFShSS/nyRH b+uGDhIoWW0+G8qo4agbVWc3GscqEoqJl6Jbu65+6JK5XvXKELeEWtUUKyo6GHAJ3PX5 xrgn1KzwEePc28ieFdK5vWMaXtD9yTXJbgGnO5b4YYPSfQqXVV7p0GUv8DOHabv+rBek yB343HUl3SHmr+HdmiqQ5EXke8mSJ67d3+4wnYR4us/n+GB/fHjlNo5MJkfDLXQc2Goq Q2uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="H/gWxWmh"; 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 l4si5374753jad.123.2021.06.24.17.10.55; Thu, 24 Jun 2021 17:11:06 -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; dkim=pass header.i=@linaro.org header.s=google header.b="H/gWxWmh"; 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 S232911AbhFYAMl (ORCPT + 99 others); Thu, 24 Jun 2021 20:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233026AbhFYAM3 (ORCPT ); Thu, 24 Jun 2021 20:12:29 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAA10C06175F for ; Thu, 24 Jun 2021 17:10:09 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id a11so13265122lfg.11 for ; Thu, 24 Jun 2021 17:10:09 -0700 (PDT) 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:content-transfer-encoding; bh=FNTTrJ3FL1iq3YniplXZ8119Emiw8hp3FUgBfyLOtsY=; b=H/gWxWmhKDTGjRX15XTwo2KDADDg2PfwLeK8QAkQyJmNyuli18P+1mAV6lo10NgW+y VPNgQmBidtxHzk1bciUp4km2D5CazJCt/SL3vWjLfdaXvJzxdJF2c4PhoyuvQCxOl4tF KHhJXfveAViSCT4QZ6IH6n2KCo0MwAKTJD5uByEFEoi+heEJi9+R4v44lNRxE9hv+8yx uh0aMKqEBItpBCuLvmKqzUT8DCqEypJSLjGaUEIQgjyaDVfWYcazrjn2uDN0vLp0WRdg jynSvZhtlLomKu7cFBoX/D11D+s0FCTlyPJiVbsDYM4dHFTXWgrCCPfI8EIVLqWYuT7E yztQ== 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:content-transfer-encoding; bh=FNTTrJ3FL1iq3YniplXZ8119Emiw8hp3FUgBfyLOtsY=; b=ZokBrMaOb7BbybcUAYpfxNZvEFRk1rDc0Z6xzrGWxmEf8YpQ82IhYbPEgjvnd6MJrb EGLmiKkW3CsMh+kUghTlkDZ29oHLf6IaMRZgKFTQOR0cG95F2Z3zuOIBsCn3CN+cd6t1 wDcZTcqfVh+oSJ+pzHipvUPyY82KPrwv9vdjNTTUCCh+T/LYYLlsBxpF+yfvjuzPUGBG tQtaQwkrEWC4cqPOu95W4SXWTMK+47DjvogAMH/7IAgxEpfqWRR5mAxMktf3dEAE4fDS 9Djg6Of7fQ31dObug6MffoSh9jXKgFXFlMilWq/lvZt9lNduoNhpfnuQKgTYneawqm9J xX6g== X-Gm-Message-State: AOAM531g40k3BK9C+TmTuEwthjK0rRYes85xdvqX6Ai6qUeyBunQ1yL+ Cme9f9bJHVEma7DiW1rK3ywrnRqZMzkqAFDNp7MCGg== X-Received: by 2002:a05:6512:3f08:: with SMTP id y8mr5640261lfa.649.1624579808001; Thu, 24 Jun 2021 17:10:08 -0700 (PDT) MIME-Version: 1.0 References: <20210622115604.GA25503@lpieralisi> <20210622121649.ouiaecdvwutgdyy5@pali> <18a104a9-2cb8-7535-a5b2-f5f049adff47@lucaceresoli.net> <4d4c0d4d-41b4-4756-5189-bffa15f88406@ti.com> <20210622205220.ypu22tuxhpdn2jwz@pali> <2873969e-ac56-a41f-0cc9-38e387542aa1@lucaceresoli.net> <20210622211901.ikulpy32d6qlr4yw@pali> <588741e4-b085-8ae2-3311-27037c040a57@lucaceresoli.net> <20210622222328.3lfgkrhsdy6izedv@pali> <20210624233448.ouvczfbogmtnbrye@pali> In-Reply-To: <20210624233448.ouvczfbogmtnbrye@pali> From: Linus Walleij Date: Fri, 25 Jun 2021 02:09:56 +0200 Message-ID: Subject: Re: [PATCH v2] PCI: dra7xx: Fix reset behaviour To: =?UTF-8?Q?Pali_Roh=C3=A1r?= , Bartosz Golaszewski Cc: Luca Ceresoli , Kishon Vijay Abraham I , Lorenzo Pieralisi , linux-pci , Linux-OMAP , Linux ARM , linux-kernel , Rob Herring , Bjorn Helgaas , "open list:GPIO SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 25, 2021 at 1:34 AM Pali Roh=C3=A1r wrote: > > gpiod_set_value(gpiod, 1) =3D=3D assert the line > > gpiod_set_value(gpiod, 0) =3D=3D de-assert the line > > Problem is that some pci controller drivers (e.g. pci-j721e.c or > pcie-rockchip-host.c) expects that gpiod_set_value_cansleep(gpiod, 1) > de-asserts the line and it is already used in this way. > > Which is opposite of the behavior which you wrote above. I sketched a way out of the problem using a quirk in gpiolib in another response. We have a few of these cases where we have to code our way out of mistakes, such things happen. The problem is common, and due to the fact that device tree authors ignores the flag GPIO_ACTIVE_HIGH (which has been around since the early days of device tree on PowerPC) instead they opt to do the inversion in code. Which violates the contract that the DT should describe the hardware. The ambition of the DT specifications/schemas are to be operating system independent, and this kind of stuff creates a situation where other operating systems can't use the specification without also going and looking at how Linux has implemented stuff. Which is against the ambition of the device tree work. > I would suggest to define enum/macro with word ASSERT and DEASSERT in > its name instead of just true/false boolean or 0/1 int. > > In case of this PERST# misunderstanding, having assert/deassert in name > should really help. Hm that looks useful, Bart &co what do you think? #define GPIOD_ASSERTED 1 #define GPIOD_DEASSERTED 0 in consumer.h, would that be helpful for users? Yours, Linus Walleij