Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3095057pxb; Mon, 1 Nov 2021 07:47:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvK84zkT1o2QLqBRYT0XWkzN+j99Y35R1vTVAaEtHxfUm4EDg4qkdDcHx3STPqvt3HNa4F X-Received: by 2002:a17:906:478e:: with SMTP id cw14mr21003263ejc.46.1635778040693; Mon, 01 Nov 2021 07:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635778040; cv=none; d=google.com; s=arc-20160816; b=jCz3LwUdByBO74d2enPg7kTOqjr2HIavzW4ocUzCJYCllYaATP8zwx8xr0/z+AZ43u 6AoTa14FDeT+S3cDj8piQsv8omFfyV1c9EeUI21WAaFdET/U9/3uz/+H3Sa1W3GqjuD7 oQjJTrk4eIhud5a3j+esph+GwZtVPlnQBlY7rlwXIeRB3hfAdYnqnzkBVaBqi8BEYj3O shDLe+NnCFpCn82CwnQxiHP1e5O5GQZdo8pUYoiOg1pCQoojH7lllwNp5Pu6n0SvtNKQ udAfP7S6+1zZC+54aaC41NmBeEXqnA2bWsbQ7zYcds5E425afeBJMJtXFyTzJ3hkd4JA LJzQ== 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=nTgNimfUoPCIrDoKeVyIYbRT+tZhs8KL4QGLyrkvSyA=; b=PAb44AZltS0l6DnBX1dCrVhIWG75WjqJwYh81lL0MmJKDjAti/vEDZ1e4cA1o2Q7mQ AhxS/6Ubneyb2NWn1MwjTXvLwjM4+u7tqqb4Do/oV/TdF4ygyAUYY1f+wux8vS2THRCH gL9vyQ2Lbez48lYs9Gs71qzUSt5D4PAj7fqb1xXATt6RkObrd8EbXU8wlXSQOQAtY0ap LtSXpzRKBrERiJ6slny0Oxji4bo/M/DiQL5+ZS4GV+urg0ywtvmUioD1lqx8kPGU10Z8 L7cv2IDR9cbGe9MkjrcI25eBGRJCTt5gu8afld9YaqYzQ4+Xw/z1fsRIrzwQb9yedC3V TDnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@usp.br header.s=usp-google header.b=HUIod4TG; 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=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si6886535edj.610.2021.11.01.07.46.57; Mon, 01 Nov 2021 07:47:20 -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=@usp.br header.s=usp-google header.b=HUIod4TG; 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=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbhKAOrb (ORCPT + 99 others); Mon, 1 Nov 2021 10:47:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230261AbhKAOra (ORCPT ); Mon, 1 Nov 2021 10:47:30 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CBFDC061714 for ; Mon, 1 Nov 2021 07:44:57 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id h2so18643470ili.11 for ; Mon, 01 Nov 2021 07:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp.br; s=usp-google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nTgNimfUoPCIrDoKeVyIYbRT+tZhs8KL4QGLyrkvSyA=; b=HUIod4TGIvbg2CAZjR6JNNaCMdnX5/bkqP4kNIF0LVxCuVID9ki4COu7zCxwssTtTy VBNfkoQMyU/3BGKPEVQK1LBad1U8IGk7KqBOqnvZVLjrPg4EZeSWl7JxKKpZtWE2Afc+ qqNC5zGw0uhf74khGk8+FYKmSpRv7gekc2Nxp5aXZL635PtmeYgpiMCWv+G/+XMu7wOG e/WhZu466u1PGtEs9tLkd5z1eAakwRYLu4FGsJxTbVk5lcVPw45bBRLWO7L92r63oYu4 4rE0NFJ9llVksLpFqeEfJMf57pbkGFOnEardVRmFbMyJpv8d3/rVxMiulQqPsgN7fjfN TVHw== 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:content-transfer-encoding; bh=nTgNimfUoPCIrDoKeVyIYbRT+tZhs8KL4QGLyrkvSyA=; b=hHfyInHHVrmmvd3v/cmkmnixWn3ttelCru5qyXUqQGWflkd8q31KlMz6rZ2fxhw55p zzXRHiZ0U8POcUxv8BGYx/onPbDk07cLqkfiUMqepjcs2b8zIlcALYicziZdPtYGwfJs CyXeZQMgFosGVOneXZEvTR1v7qiQ6CV7lJ/iGd1P8Y44X6lnXo/n+qN/fbX89bS7bZBP 5x89Py5NX2lV3SA+9dO2LR2TfUvlFxLcO5W4SL1wvVaKaUIswes1bOO9ZoMyQCmjFdOQ 2yCHcxgjTnLdXKG5do596ihF/zLjibC1s7D8gTPhhilVstgAf+Hg7M0/We0u5wxjD5d5 SMYg== X-Gm-Message-State: AOAM531JsCCqgdaVymU5TfHmyBpwcLCIMQLqOMbGeT8JK/efaFM92ljf ia4QFNNy9L3NLFjsae6Z8PJAVbzcGEfbnttdWXSJeQ== X-Received: by 2002:a05:6e02:1bcb:: with SMTP id x11mr16355301ilv.94.1635777896880; Mon, 01 Nov 2021 07:44:56 -0700 (PDT) MIME-Version: 1.0 References: <4f1b60bab451b219c7139e2204eb5b9f462ee4e0.camel@pengutronix.de> In-Reply-To: <4f1b60bab451b219c7139e2204eb5b9f462ee4e0.camel@pengutronix.de> From: =?UTF-8?B?TWHDrXJhIENhbmFs?= Date: Mon, 1 Nov 2021 11:44:45 -0300 Message-ID: Subject: Re: [PATCH v2 RESEND] PCI: imx6: Replace legacy gpio interface for gpiod interface To: Lucas Stach Cc: hongxing.zhu@nxp.com, lorenzo.pieralisi@arm.com, robh@kernel.org, Bjorn Helgaas , Bjorn Helgaas , 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" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ? > > /* Some boards don't have PCIe reset GPIO. */ > > - if (gpio_is_valid(imx6_pcie->reset_gpio)) { > > - gpio_set_value_cansleep(imx6_pcie->reset_gpio, > > + if (imx6_pcie->reset_gpio) { > > + gpiod_set_value_cansleep(imx6_pcie->reset_gpio, > > imx6_pcie->gpio_active_high); > > msleep(100); > > - gpio_set_value_cansleep(imx6_pcie->reset_gpio, > > + gpiod_set_value_cansleep(imx6_pcie->reset_gpio, > > !imx6_pcie->gpio_active_high); > > I don't think this is correct. gpiod_set_value sets the logical line > state, so if the GPIO is specified as active-low in the DT, the real > line state will be negated. The only reason why the reset-gpio-active- > high property even exists is that old DTs might specify the wrong GPIO > polarity in the reset-gpio DT description. I think you need to use to > gpiod_set_raw_value API here to get the expected real line state even > with a broken DT description. > > Regards, > Lucas > I'm a beginner in kernel development, so I'm sorry for the question. If I change gpiod_set_value_cansleep for gpiod_set_raw_value, wouldn't I change the behavior of the driver? I replaced gpio_set_value_cansleep for gpiod_set_value_cansleep because they have the same behavior and I didn't change the logic states. Thank you for the feedback! Regards, Ma=C3=ADra