From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A38FC49EAB for ; Fri, 25 Jun 2021 00:10:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06E9C61220 for ; Fri, 25 Jun 2021 00:10:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233015AbhFYAMn (ORCPT ); Thu, 24 Jun 2021 20:12:43 -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-Google-Smtp-Source: ABdhPJzhpdZ+qRb8l4M1S8NIRcHZuamvKemb8/lfE8nfui9Lb+u/kx6k4mY8D8H38j6ZEeiQ6LWsZQZbCm6ko+gfuM0= 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