From patchwork Mon Jun 19 15:04:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 13284690 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75FC2EB64D9 for ; Mon, 19 Jun 2023 15:06:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbjFSPGL (ORCPT ); Mon, 19 Jun 2023 11:06:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbjFSPFV (ORCPT ); Mon, 19 Jun 2023 11:05:21 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE33E10E3 for ; Mon, 19 Jun 2023 08:04:48 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-39eab4bbe8aso2185407b6e.1 for ; Mon, 19 Jun 2023 08:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687187088; x=1689779088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bkQkFXSrqR5MDMbqBcH7Nxin9P2rGGa9soJkqC/yxfY=; b=KL7WH9esTs7EFOrJOLlQDJsDcT/mfXXCsaCZDtwfYT+K05rl4Y0uOKqA/nDRWmM1Ay P0taJUuvOsjTeEXMez6C0nO7L1aJAoU0K3Fjc1lJVCl9ASZJCTyRjDx39SMKsSJgVjUI +nC498m4/o4uDShwgfyz9btY1mBsJhpn64wArvb82L+zGlP/PL09DQBvIavoKC1TNLcW MjtJF09kB4h01Yrj1fX0TNT3dROZOVwuDdNOAdKCMjF44SHOpvkte9RU97YN3M86+26U H5k9xq1Fmw/9RrXcAqB2TlMbGi9Ht0McM5hkCefS5MAV4huKmK5Oyu37azQTD3PDoCKG AzHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687187088; x=1689779088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bkQkFXSrqR5MDMbqBcH7Nxin9P2rGGa9soJkqC/yxfY=; b=Uz4Qz3KnSsOeUTpIxcQQCjddWjjCvbKsll/Uy4PfvlwGG+WNWe45LC0aKpdn8OAhk5 rLtMAK11oc6ARvF9jAvWry+MnwCxpKlyyHoQYsQccJkGoZbp6J4lEYEgr147ebPkizpp LO1C08qXUzlCqUmXE9fxKWDuek2jIP4fAPpxAJ8/+HqI/F1zDB+VpLesKMEwPlWXw3HW 7mj+TOnkUe4nuefIfOFd1VS9n4suoPlNfKsGTYRK4hEhn9dpUST+mRNqaTPOMahBJ5qn wgIeIKkmZAoIYvsWni2yHSI9za30o/hsH7fd3tNaLhgOf563sR4unjcyZgfp9gZaMUuh ZqgQ== X-Gm-Message-State: AC+VfDwLMLix6d20Rm0kfuvUvYsUdxsoYy/cyE6uog0/53SixVWYHwYC MkffX4bN1svsX1Ra9gkg6VkY X-Google-Smtp-Source: ACHHUZ6jYi9B9kO4LbGSPIQT3nzgy6RoEcq55MHd7+0LtTnVlE8m58y0+GdIRnKABb/+X0ocxXlQNQ== X-Received: by 2002:a05:6808:301:b0:3a0:35c5:f79d with SMTP id i1-20020a056808030100b003a035c5f79dmr9833oie.36.1687187088151; Mon, 19 Jun 2023 08:04:48 -0700 (PDT) Received: from localhost.localdomain ([117.217.183.37]) by smtp.gmail.com with ESMTPSA id 10-20020a17090a19ca00b0025efaf7a0d3sm2765480pjj.14.2023.06.19.08.04.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 08:04:47 -0700 (PDT) From: Manivannan Sadhasivam To: lpieralisi@kernel.org, kw@linux.com, bhelgaas@google.com Cc: robh@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, steev@kali.org, quic_srichara@quicinc.com, Manivannan Sadhasivam Subject: [PATCH v4 8/9] PCI: qcom: Do not advertise hotplug capability for IP v1.0.0 Date: Mon, 19 Jun 2023 20:34:07 +0530 Message-Id: <20230619150408.8468-9-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230619150408.8468-1-manivannan.sadhasivam@linaro.org> References: <20230619150408.8468-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org SoCs making use of Qcom PCIe controller IP v1.0.0 do not support hotplug functionality. But the hotplug capability bit is set by default in the hardware. This causes the kernel PCI core to register hotplug service for the controller and send hotplug commands to it. But those commands will timeout generating messages as below during boot and suspend/resume. [ 5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago) [ 5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago) [ 7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago) [ 7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago) This not only spams the console output but also induces a delay of a couple of seconds. To fix this issue, let's clear the HPC bit in PCI_EXP_SLTCAP register as a part of the post init sequence to not advertise the hotplug capability for the controller. Signed-off-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-qcom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index e6db9e551752..612266fb849a 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -521,6 +521,8 @@ static int qcom_pcie_post_init_1_0_0(struct qcom_pcie *pcie) writel(val, pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT); } + qcom_pcie_clear_hpc(pcie->pci); + return 0; }