Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp1278111rba; Fri, 22 Mar 2024 09:08:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDeNI1UAwmo/3VX2dOPq4jBewpHmIhrFlLCTbtOWG0GN9zAHFAvlcX4u7zD+8eHNf3QAJaQKZeFprELI43cyL7pCO2f4YB9/TgTwjOQg== X-Google-Smtp-Source: AGHT+IEGrbll76Fi7RXK4BNl1QEJfQcIDWXAC15ay+FxyZkNeuVkFQ9O1IFVKyajMLkyEF4BYJaA X-Received: by 2002:a05:6830:104b:b0:6e5:21f0:d028 with SMTP id b11-20020a056830104b00b006e521f0d028mr78798otp.28.1711123720974; Fri, 22 Mar 2024 09:08:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711123720; cv=pass; d=google.com; s=arc-20160816; b=Gd9jQ19bBN/qriIyA8BvdOpn5fu4R296PTwVpSjka1JfP19aY9o+8t+3vhgDQrYhVs mEcOTaB/dulpZI+KVMM6Kca7ckhxD5dXuUYxglmpUQTMGk2IE0Y38CYExugO2swPX614 GeClB37H/JkWWSH3YfZnKmSYTnMl+KNMIoqvMEKCMn6hoKc/48v6jOlNgNAqRJz2bF8w krRVl7hQT8H/7ahlzM1fNMqY2kXU7PtEkxICmUIAovBYrnPNQjf0Gi22DO6WW8YCEdOO gwhoJIgki9mCDrkB45bbVH6WgAKTC9C1XA9Mik8AEfeQH+Hh51UTOd3KCtnW5ge/UeRo 1XmA== 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=pVVitWGOXwswJwIv5qQFj7wea1PTTu0D1c2Ee1H47cM=; fh=0tIhEViLo7PUpyJI/8YvAfn7aU9qwVOIrJ6jkc06K5o=; b=jWhfSSPx8ob/GPhqqPgC6WydBJI46muzntHBs8HV9QaiRabDcIra6G0d0BD8xEZfPj asqb+2Diexr/uFPBzAdIAR4+0AhvX53vAcf0sn1soBaW3JRqcrdk4QgghL3983ECuIco 6vV/yD7iLCcAsMWzBaUN/55b6X555McN5YSC6KFXivmw3yAIowmqVanA+iN8Nd0FO4on kDlM96kkiIEvxDdjpcYNPncv5rmaO1GD6fk9T9JYaOCQ04JP9rr5mTqvyOjpOitotL4c 5R0RXkmRI/08CAcGpA137/aRs/WDSnXOC6dkDFZR73wczdB2NVHidS1pNdC1TVqAUidL 7y4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NY1UovC2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111749-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ey2-20020a0562140b6200b0068f44e6cc33si2228452qvb.10.2024.03.22.09.08.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 09:08:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NY1UovC2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111749-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B0C861C221E7 for ; Fri, 22 Mar 2024 16:08:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CBBA59176; Fri, 22 Mar 2024 16:08:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NY1UovC2" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AC2513F9FE; Fri, 22 Mar 2024 16:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711123709; cv=none; b=ByUzsH3wdXyGiE2t5cGmWhtQ9Jc+5r1NmAifIkyfc2KrgxAfkgmfM2BRKv/ZS19dUawuhmJqFmD7CsvsvzcHFxORIFhg8XznjQWu7gfErNBplkUvFij3Kz5rHw3NNdNvwoELjzrXZOQ9n+Qvhdugoh07fXYy3IOT8qoofCWhszE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711123709; c=relaxed/simple; bh=bXA2mHbCtGGlTTTDyyu+fASvyS/0DESgskmYDPSjP3g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pjmqrbbI+VzPsVLcrR4oJvumWZZSp+FUm3VEkXsl9wbGaf+dcvqkB3Va47JWiFxHwFY7Aiq5s7ZJUXqabOB+KKBkYesi03TH8zfTOomjCjZThWob9W/zVrgtIaWVrl73uHaTI4aQLYaWL2u3mfy0E7z54s56ovcoHNWJpFx2fWc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NY1UovC2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 010A8C433F1; Fri, 22 Mar 2024 16:08:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711123709; bh=bXA2mHbCtGGlTTTDyyu+fASvyS/0DESgskmYDPSjP3g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NY1UovC2N8ZgBi6I91h5VbIGAIVOhY6OV5XRTKcHbi1wadkhuCCjT5pG7pRTrl78n dtBy7NRiqKKC5jJjiaTPFvqj2quyjW3e/uurmEbpfUZol6CWKg/CSg4O8Lmo8MebZN EYohdTBXj1aLRL4iIHxMpX/z+q1wN1gEhYwz5p2SusghG1mqNkQPyFxvzncGlpnVcA WIimKfepgyslqQL/Pt3+UL7T9pJkrGE30BCRnZsEB08v6SxJjbJqebaPOQ9/DVhfye 4ABJVhOd82DN02sL1RN81oPHDxf5NQr+vM8U15wubQ25JyzRFy+nDggrV8jrpHgz9I J0ewnVMswKlmg== Date: Fri, 22 Mar 2024 17:08:22 +0100 From: Niklas Cassel To: Manivannan Sadhasivam Cc: Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Kishon Vijay Abraham I , Thierry Reding , Jonathan Hunter , Jingoo Han , Gustavo Pimentel , linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, mhi@lists.linux.dev, linux-tegra@vger.kernel.org Subject: Re: [PATCH 01/11] PCI: qcom-ep: Disable resources unconditionally during PERST# assert Message-ID: References: <20240314-pci-epf-rework-v1-0-6134e6c1d491@linaro.org> <20240314-pci-epf-rework-v1-1-6134e6c1d491@linaro.org> 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: <20240314-pci-epf-rework-v1-1-6134e6c1d491@linaro.org> On Thu, Mar 14, 2024 at 08:53:40PM +0530, Manivannan Sadhasivam wrote: > All EP specific resources are enabled during PERST# deassert. As a counter > operation, all resources should be disabled during PERST# assert. There is > no point in skipping that if the link was not enabled. > > This will also result in enablement of the resources twice if PERST# got > deasserted again. So remove the check from qcom_pcie_perst_assert() and > disable all the resources unconditionally. > > Fixes: f55fee56a631 ("PCI: qcom-ep: Add Qualcomm PCIe Endpoint controller driver") > Signed-off-by: Manivannan Sadhasivam > --- > drivers/pci/controller/dwc/pcie-qcom-ep.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c > index 2fb8c15e7a91..50b1635e3cbb 100644 > --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c > +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c > @@ -500,12 +500,6 @@ static int qcom_pcie_perst_deassert(struct dw_pcie *pci) > static void qcom_pcie_perst_assert(struct dw_pcie *pci) > { > struct qcom_pcie_ep *pcie_ep = to_pcie_ep(pci); > - struct device *dev = pci->dev; > - > - if (pcie_ep->link_status == QCOM_PCIE_EP_LINK_DISABLED) { > - dev_dbg(dev, "Link is already disabled\n"); > - return; > - } > > dw_pcie_ep_cleanup(&pci->ep); > qcom_pcie_disable_resources(pcie_ep); Are you really sure that this is safe? I think I remember seeing some splat in dmesg if some clks, or maybe it was regulators, got disabled while already being disabled. Perhaps you could test it by simply calling: qcom_pcie_disable_resources(); twice here, and see if you see and splat in dmesg. Kind regards, Niklas