Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp445567pxb; Mon, 25 Apr 2022 13:28:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDqfecdLFa/i3hCGJGINDG1YBpl4S5Pkn6ycDECoKBemBOJkV9TvcLdKlInHMepmbgAbnr X-Received: by 2002:a17:902:b58b:b0:15b:5a3f:814b with SMTP id a11-20020a170902b58b00b0015b5a3f814bmr19177250pls.154.1650918502516; Mon, 25 Apr 2022 13:28:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650918502; cv=none; d=google.com; s=arc-20160816; b=ROOhqzYDaD1nUTu3gaUcduv57HPkyWJXYsizF8vLMK74RpYauKITidlxfU8BNco4V2 NYp1ybSdejVH3YhjESLsZ5fdOhgxeD9+9xSEHXE3fd9JG1cblOLwuZEk6pNMcYH6Lf9K upv+iWTKtFb0Zqlj6QmL4SrHs1eSDjv11yh3Ns9OVpRSJCmKg737r/oTtAY3xMvA4XhL 4nA+OCWfFhmAGLlqTZfkoOpmG1XQbY2tpLqFCCDJiDATg3Sf2nTzmrVWrPO6lNmprF9E 0YE8E0PA3+xqkK8RKoxt8MAxzjPxktgJ7FMjCMzWYlgj6byG5pjDKdnX3wAW1+Xbh43N nWaw== 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=0iW0lfnOAQF5cFI1vUpJrSs+pwJtGVWKWvpMUuWdKzw=; b=ruf1It3dTf1gqxvcGUFtL+RInSM7akNzZFDyoU1SXz5Y5voCQlX/3r2FTSqIZuOugy Cd92yFxHWP4d33GweE1OPCrhVemKnGYakFPsFxFiCXQ4Al0OZTOF7NTtqNTz62Edv3F/ l3/6wfrrZ/uXC0xbdYR8yLFJ2yGpiyO3yGgcW8vGYU20MzilVm1Sj3o8zpzH9DNirhUH ryEVIlTNlAc8Yi6Q3chzIY63iV22468vnBwfNKyI9lXE2oEvZbOkrF92fILCzQDRerKq CIJfT6ULN8bC9oKf/Wug4Iib0M8sJSciQxLGIbqhC8vo9wp0UJoSuZNQoZzHWAUbRF0r gzzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a+4h19FI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u28-20020a63235c000000b00398db2165basi17167889pgm.329.2022.04.25.13.28.06; Mon, 25 Apr 2022 13:28:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a+4h19FI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S242097AbiDYNoB (ORCPT + 99 others); Mon, 25 Apr 2022 09:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242017AbiDYNn7 (ORCPT ); Mon, 25 Apr 2022 09:43:59 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CE9D49276 for ; Mon, 25 Apr 2022 06:40:55 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-2f7bb893309so68447087b3.12 for ; Mon, 25 Apr 2022 06:40:55 -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; bh=0iW0lfnOAQF5cFI1vUpJrSs+pwJtGVWKWvpMUuWdKzw=; b=a+4h19FIk30YOSOnT/EZ40c6x1uajSyiYVz5RRsTKaKN1eJGtIyF+2r5q+eNdqyBBl XIQoID+tBiBPNrscesCiG4KqQt0dg0KP03zgfjtqy8IXImQPeYwJTvXtbhdA9/9YKgVa za6lWLnHoXo+B9bQTRCOygkqQD8Uzd9Gvvxg45OueC7y69tCefIlMbj0v7FaR/0VXpqJ SRSU1QAVzrqhVDWYqVcpTwWWxpXq0DAaGj9oJyWbE8h6Ru6nmgFRoZUV5vtHrXZs0DYh Nz8aN0NZaESQOyygNvXnoDRbUCvTEuQ0xFVpJxPQpuloFRUaXbhytj2y2xhHlkWmyNu1 nNNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0iW0lfnOAQF5cFI1vUpJrSs+pwJtGVWKWvpMUuWdKzw=; b=hU927sPmPXUgH+kTtPR34uwv/3RU7YYE78EiDgL0lnaIOgfICQyZb0h50a46TnLlih eYP8jOkjPgmHHvVcA+WT1Kjm1bNeuZsiE99R1WD84x2WBzNTlgq8FcaUkMckfMOM1c6X +nSwGlC2P3cnN93Sid9SiprZ9qlpLwvUtG4ZpuSvyxT09+BWXxGXzyy8eqESG804PzIM LZDsEuUWhHEPdhbJxFuojKmn3to7LSdm3fF81rGLK238gLA0AXQTIXMhb9FRRQmz+/T8 EYb6EHxoNay9DRcsLZ0IR/svwhiJ5EbInaVZZSynPjr8AEBJurb3H4HRqZelX0RsrAKU YDVw== X-Gm-Message-State: AOAM531xpraxk5oEOX7EHPAte11Sd47j1n6K/XAFEpaUA4orN4BQ6pZX 9s6zYeIBkMzzyERmC/pzagUxzj7NLY9wr/Rh85twgg== X-Received: by 2002:a0d:c4c2:0:b0:2f1:6c00:9eb4 with SMTP id g185-20020a0dc4c2000000b002f16c009eb4mr17318800ywd.448.1650894054719; Mon, 25 Apr 2022 06:40:54 -0700 (PDT) MIME-Version: 1.0 References: <56052bc6e3b6cab6bfdfc5f706ec9984bea16bba.camel@pengutronix.de> In-Reply-To: <56052bc6e3b6cab6bfdfc5f706ec9984bea16bba.camel@pengutronix.de> From: Linus Walleij Date: Mon, 25 Apr 2022 15:40:43 +0200 Message-ID: Subject: Re: [PATCH v3] PCI: imx6: Replace legacy gpio interface for gpiod interface To: Lucas Stach Cc: =?UTF-8?B?TWHDrXJhIENhbmFs?= , hongxing.zhu@nxp.com, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, helgaas@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, linux-imx@nxp.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 25, 2022 at 2:07 PM Lucas Stach wrote: > The binding explicitly describes the GPIO as not polarity aware and has > a separate property "reset-gpio-active-high" to avoid breaking old > DTBs. I don't think it's helpful to dismiss this explicit backward > compat just because the driver code looks nicer that way. I see. We handle such things a specific way. Look in drivers/gpio/gpiolib-of.c, especially the function of_gpio_flags_quirks(). Here we special-case all bindings which for some reason introduced something necessary custom, like in this case not using the proper polarity flag. Add code to this file in the proper place to handle and hide the old style DTBs using "reset-gpio-active-high" as active high flag and assuming active low otherwise in this file. I imagine it begins with if (IS_ENABLED(CONFIG_PCI_IMX6)) { ... } Then modify the code in drivers/pci/controller/dwc/pci-imx6.c to act as if gpiolib handles polarity inversion. Include all changes to all files in the same patch so this is changed in tandem (one technical step). Yours, Linus Walleij