Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3134315lqo; Wed, 15 May 2024 00:05:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9OHpyn9g/+uKDTuWKwP9nCO7OiYcNuxzN4p+P3opD8zL+JZkynKvFImUyb3yFsexZKLexM2UnFg1x3P1AbIfVl6fmqPRlgWU9Y7zLwA== X-Google-Smtp-Source: AGHT+IFDX6sSn/EPEscHwX3FHImQlQFD/Z/L7XaW7jz0kUMNy6+BQm43FGg/8UHmoyK6MwLEt7Cf X-Received: by 2002:a17:902:e74a:b0:1e0:2977:9dfc with SMTP id d9443c01a7336-1ef43f4ea08mr234980665ad.55.1715756755467; Wed, 15 May 2024 00:05:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715756755; cv=pass; d=google.com; s=arc-20160816; b=IFFTwhPGuJGue+N9ougqQWYE/J9UQLcUns9xMjfk96S0F6lu2dF4Jln3XFvzQIrdAT Lh9GcGfzVtrCTqJPqT62RCNrRo/bqXbzGuHk2472XUKRV5ZVPm6cJehXqSRlBHm/edlb eAHw2CKGHDrvSbWwULvDYkIukpAGE8BXborkII23IwWbRFChcqptpwuYAffTuEu8wQ// E6Go4CXrJMfRnV6FU5twNfKN0J1Yxj9Ay8DVpMgdJFnndKV3UsmQZRjDKtRjutddE1Hd 2lQ/gSDwx5bCXJgUjfsmfX0kAmb8loTRHHv3A7QbX2Ophpo4wyF4okX71uIFfAEThqU3 4oPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ntMSL/st0iLS0tnCXAPXzy7ZhcKJCMyFAGnRoDypkYA=; fh=ayc5pweXPLryaCKmRB1Tpuxo11ECloaN+Medg4LyIfk=; b=gsUAyJWZDpT2zxqvky+QlcKw16l+UB8h+VdrogxoKiyhW2IztA1OVaGfhSGkZTgthK g/FNVY0oQ++VAuEx7r7VFX3Kdg9cOFbb0aGSJbuXaYyTUhEUiTxfcTIRiIv8KDhUjPwQ 9I8RINcdbE2sB3I8UNuTf9tlJ4mMaJCYht23pMWyW/CMD8vZyfF7ALYY4lu+lE1nu/fr xOmzI+1YHckPV4ZmRTQlf0hQD/8yOLYeVDptEMj+DJcp5ZdCS5OQvW402jLExo5xkSYS wuJzo4WMEiPxZdMFP8v1D6MM2gTkpNymSPI5xI+RIUpSJ/++xZ5aeOPpjC4NgguBwNaB E53Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HIZkmPNZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-179540-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179540-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0b9cf86asi126130045ad.16.2024.05.15.00.05.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 00:05:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179540-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HIZkmPNZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-179540-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179540-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6F9E2282AB2 for ; Wed, 15 May 2024 07:05:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E99BA43AA2; Wed, 15 May 2024 07:05:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HIZkmPNZ" Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A2E241760 for ; Wed, 15 May 2024 07:05:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715756744; cv=none; b=YcyFvUDn5574tF5N39QsQZNhzqBhkaea93Baf80h8YO2ZJbthuoyDo7ZJ0FyGXH5UvB61a+m72rE9iZZlcg8+9w2C0PkTeRRNvge6xV9ZU/ZZGrCNBWtajsSE/8cEizw3iOTwmMpIfirysAdcZgqtUOKUFSNrxEvbf6IUDaaW44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715756744; c=relaxed/simple; bh=RtKyoqiDLhVTAKC8deDb8sf4vqkR0RW+M2pcJe2zDNs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WlIhoYXCCwvmiuhe9r5LtpQ7iVuHNCPZjeUzy4SJbrTLWiaTvr9rtgHVUQOaX7PW7wdHhxfec+82qkeGmvS7tsPCVAwdman/iEH7xeNjJdNHGOU+uR1Nw3P/nUNuff9T2KyRXS4vVtgW3nhKJDAl40Gb2Sj/KRYzMCKLiSRf1oo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=HIZkmPNZ; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-42017f8de7aso19014385e9.1 for ; Wed, 15 May 2024 00:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715756741; x=1716361541; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ntMSL/st0iLS0tnCXAPXzy7ZhcKJCMyFAGnRoDypkYA=; b=HIZkmPNZ/yejRdoAx6tBdtuYpzfeaIRHuD3v5RdKFrEOA/ZZzqN2y/w0p/NcZdiwjp OUoCiMQFvHI4dNNbTO1TmCl8CZ3iXTJFFdXzRNyd7iO2sls8Q0dLiAAqbtE5wW4Lhxqs qY3RprLQQebc0ySSDenhzB5x4SL4vukhA0DRtOnppzLCd24ehUT7EPpArYRCFHe70YMT Ravyl7+G6FJCOO0fRoLKhZctx2ARm+HcztRr3K0lOCjXgrGyjRfjJW4OIoV+b/UCxH0m cXfeln6X8RogBZ8HYiEbHOxtqwFZ8ua1R6LOSv/KpegA7D9UYLHL3eG9cb+MhgOLR6a+ /M4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715756741; x=1716361541; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ntMSL/st0iLS0tnCXAPXzy7ZhcKJCMyFAGnRoDypkYA=; b=L2qNR7ZoPbegmRrxnsVJdrCC2C+ZHQ6wsfGqptjIJ7yZS1++fNpHhwJnkE6Em14ib0 9VfGQf2hdyQ1SAHt85JrSyxM5/zgx10nvH8E3Sjh+ofLDCq/qMn+FJurz3RQnpRfbLb1 FPocs3MF95ZS3cM9XHTb6oF9VcPdduPK+oSPuEtAcTvKatOmgvQDhYGEiNn20JCaBzwl JENMLjMS0svlouRmE0fiKGCcXC1T3y75JyON43RNaE6VRNh1MSFg98/KUWW8IwZjdgC2 NJn/7s2tWMYUMYgkVYd4baJJIvi4uYpOGmoMcl99v44c8kS3sue9C1GyfdE4yy8tS46A fOYQ== X-Forwarded-Encrypted: i=1; AJvYcCUcyFWc+md+dOfgUHWkv/Ks1OKG0FTQgU1MHcvVNNpL1yyJcVsDQi6vO2e0YbCsVc9c/tXysoWSYGbxiBsuumnJpTp6P4fZjkgP4glS X-Gm-Message-State: AOJu0Yxkz0PCWvqsHUYcKJ+NXc8Extk4+BoL4pcNpEs2R7IAseomf5Rz FCT5uBx9rpLhtcqRQggMg92jaPFihe1JOZiaeiPguZWFvm2wwpwnecVZDkJT5MQ= X-Received: by 2002:a05:600c:4686:b0:419:d5cd:5ba with SMTP id 5b1f17b1804b1-41feaa2f45cmr97326285e9.7.1715756740631; Wed, 15 May 2024 00:05:40 -0700 (PDT) Received: from localhost ([149.14.240.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9292sm221053815e9.37.2024.05.15.00.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 00:05:40 -0700 (PDT) Date: Wed, 15 May 2024 09:05:37 +0200 From: Dan Carpenter To: Thomas Richard Cc: Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Aaro Koskinen , Janusz Krzysztofik , Vignesh R , Andi Shyti , Peter Rosin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Siddharth Vadapalli , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com Subject: Re: [PATCH v5 05/11] PCI: cadence: Extract link setup sequence from cdns_pcie_host_setup() Message-ID: <0bee2d4b-b190-4353-ab29-003364721a3c@suswa.mountain> References: <20240102-j7200-pcie-s2r-v5-0-4b8c46711ded@bootlin.com> <20240102-j7200-pcie-s2r-v5-5-4b8c46711ded@bootlin.com> <111df2a5-7e05-480c-a5a5-57cf8d83c0d0@moroto.mountain> <56b2bbcb-7181-4640-93b3-0cf3e2029367@bootlin.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=us-ascii Content-Disposition: inline In-Reply-To: <56b2bbcb-7181-4640-93b3-0cf3e2029367@bootlin.com> On Tue, May 14, 2024 at 03:15:34PM +0200, Thomas Richard wrote: > On 4/16/24 16:16, Dan Carpenter wrote: > > On Tue, Apr 16, 2024 at 03:29:54PM +0200, Thomas Richard wrote: > >> diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c > >> index 5b14f7ee3c79..93d9922730af 100644 > >> --- a/drivers/pci/controller/cadence/pcie-cadence-host.c > >> +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c > >> @@ -497,6 +497,30 @@ static int cdns_pcie_host_init(struct device *dev, > >> return cdns_pcie_host_init_address_translation(rc); > >> } > >> > >> +int cdns_pcie_host_link_setup(struct cdns_pcie_rc *rc) > >> +{ > >> + struct cdns_pcie *pcie = &rc->pcie; > >> + struct device *dev = rc->pcie.dev; > >> + int ret; > >> + > >> + if (rc->quirk_detect_quiet_flag) > >> + cdns_pcie_detect_quiet_min_delay_set(&rc->pcie); > >> + > >> + cdns_pcie_host_enable_ptm_response(pcie); > >> + > >> + ret = cdns_pcie_start_link(pcie); > >> + if (ret) { > >> + dev_err(dev, "Failed to start link\n"); > >> + return ret; > >> + } > >> + > >> + ret = cdns_pcie_host_start_link(rc); > >> + if (ret) > >> + dev_dbg(dev, "PCIe link never came up\n"); > > > > If we're going to ignore this error the message should be a dev_err() > > at least. > > Hello Dan, > > In fact it could not be really an error. > If you physically don't have a device on the PCIe bus, > cdns_pcie_host_start_link() will not return 0. > > So if we use dev_err(), we will always have the error if there is no > device on the PCIe bus. Ah okay. Thanks for looking at this. It feels like maybe cdns_pcie_host_start_link() should just check for that at the start and return 0 instead of doing waiting 1 second and returning -ETIMEOUT. But I don't know this code well enough to say if that's even possible. regards, dan carpenter