Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp913334lqo; Wed, 8 May 2024 21:25:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVIXuV0f0llFIyvs87ZsQbOmiwJRND7DdvO7ecuAe5BQ8X8MX6PnpSMXX1kanY6GgX/NRClplMJH1POiU112v/EsW7zRpol7rxOsNJWnA== X-Google-Smtp-Source: AGHT+IHDI9C8ABp5iMrKmX+oqJS+K9dhgbe+NBFuGtfMmCiJ2bvOoHAujTohf8ACQnBOnj8SUu9L X-Received: by 2002:ac8:7c4b:0:b0:43a:88a2:ac90 with SMTP id d75a77b69052e-43dbf6217cbmr46790271cf.34.1715228704911; Wed, 08 May 2024 21:25:04 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df566fa83si5932181cf.270.2024.05.08.21.25.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 21:25:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-174122-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174122-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A20B91C21E20 for ; Thu, 9 May 2024 04:25:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B65C2148302; Thu, 9 May 2024 04:24:57 +0000 (UTC) Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9F7813C91F for ; Thu, 9 May 2024 04:24:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715228697; cv=none; b=cNYzAfwDYybv+aPa9U6S/huGVaanSk5bGbGXGuzUY06fXD31WX3p8zcEjP2LUX4yUaqqKA7HfGvd972x4g/AWzJ/1T8xJHXZHxGc/rx6jzpM3KflGXLrDrC2+fK2ASE9HQvbthQo3hgculNfKQv4Nv/l/9LhK3adYqoXXh3uPJQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715228697; c=relaxed/simple; bh=wbluDtpkgkqI4b6uOnSnk0JaOqE8O/8A4tFQH+1zXWw=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ELme65V0e8xhztSEwUTkqmFymGm/XK9xuPjhdkJ5qH101fGPbygZaaXUbNiuDxuU4iFNQtaIZLgtXAJA2zMiwo3jK+IpYBVxXi0y3P87l+Douugslm+uTI0oXrD+rQhzjwpcTtQM+UiGBpYqaU/8bZPPWGfGSdjpArZjDInJPQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-25-208.elisa-laajakaista.fi [88.113.25.208]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 14224eb4-0dbc-11ef-b972-005056bdfda7; Thu, 09 May 2024 07:24:52 +0300 (EEST) From: Andy Shevchenko Date: Thu, 9 May 2024 07:24:51 +0300 To: Hongxing Zhu Cc: Andy Shevchenko , Manivannan Sadhasivam , Frank Li , Krzysztof =?utf-8?B?V2lsY3p577+977+9c2tp?= , "linux-omap@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "imx@lists.linux.dev" , "linux-amlogic@lists.infradead.org" , "linux-arm-msm@vger.kernel.org" , "linux-tegra@vger.kernel.org" , Vignesh Raghavendra , Siddharth Vadapalli , Lorenzo Pieralisi , Krzysztof =?utf-8?B?V2lsY3p577+977+9c2tp?= , Rob Herring , Bjorn Helgaas , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Yue Wang , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Xiaowei Song , Binghui Wang , Thierry Reding , Jonathan Hunter , Thomas Petazzoni , Pali =?iso-8859-1?Q?Roh=E1r?= , Linus Walleij Subject: Re: [PATCH v4 4/5] PCI: imx6: Convert to agnostic GPIO API Message-ID: References: <20240506142142.4042810-1-andriy.shevchenko@linux.intel.com> <20240506142142.4042810-5-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Thu, May 09, 2024 at 01:24:45AM +0000, Hongxing Zhu kirjoitti: > > -----Original Message----- > > From: Andy Shevchenko > > Sent: 2024年5月6日 22:21 .. > > - imx6_pcie->gpio_active_high = of_property_read_bool(node, > > - "reset-gpio-active-high"); > > - if (gpio_is_valid(imx6_pcie->reset_gpio)) { > > - ret = devm_gpio_request_one(dev, imx6_pcie->reset_gpio, > > - imx6_pcie->gpio_active_high ? > > - GPIOF_OUT_INIT_HIGH : > > - GPIOF_OUT_INIT_LOW, > > - "PCIe reset"); > > - if (ret) { > > - dev_err(dev, "unable to get reset gpio\n"); > > - return ret; > > - } > > - } else if (imx6_pcie->reset_gpio == -EPROBE_DEFER) { > > - return imx6_pcie->reset_gpio; > > - } > Please correct me if my understand is wrong. > The "reset-gpio-active-high" property is added for some buggy board designs. > On these buggy boards, the reset gpio is active high. This is my understanding too. > In the other words, the PERST# is active and remote endpoint device would > be in reset stat when this gpio is high on these buggy boards. Yes. > I'm afraid that the PCIe would be broken on these boards, If these codes > are removed totally, No. Linus W. explained in the previous version review round how it's supposed to work. > and toggle the reset GPIO pin like below. > ... > gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0); > msleep(100); > gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1); > ... It's not the code that this patch adds. I'm not sure if I understand starting from here what you mean. > By the way, this reset GPIO pin should be high at end in > imx6_pcie_deassert_core_reset() if the imx6_pcie->gpio_active_high is zero. This seems a terminology mixup. You probably meant "inactive". And this is exactly the case with this patch. If you start thinking in terms of "active"/"inactive" you will see that there is no contradiction and no behaviour change. The quirk itself is located in gpiolib-of.c.. -- With Best Regards, Andy Shevchenko