From patchwork Thu Jun 1 16:38:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 10178 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp471670vqr; Thu, 1 Jun 2023 09:51:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ65rk+Eld2KMfJJQs5j3z5/2rVAQRXnnQJpLMmM+/TZe2BPPfQ/kUsD1oiKykS2SptWvWtc X-Received: by 2002:a05:6358:787:b0:121:4bb5:3a91 with SMTP id n7-20020a056358078700b001214bb53a91mr8497693rwj.13.1685638309914; Thu, 01 Jun 2023 09:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685638309; cv=none; d=google.com; s=arc-20160816; b=C0/l7MVFfM4u+l3KApLz89bA2r4++5NQBleeRMhbjTiEVnb/dAZvECBPEzUAf4fQCA wZELHnhpqvYgY27MbvRHcYsHkVHjsPD31bdeMRP7GcKrPDsI2sdXPu/j2N2L2l2bw4ms ElRRwFZEjbEeSt3EtWd05cE+NVbKFFflo8op0+TVkP9nh5eDmoYvPfrsodEOGrTSbCLX zJbgJ/Y7xpqlmF4MqGH/V6an4nwtrwNQUvp3kCA6cJqRaYOv0oWlwxSXJjxvb7fwp0yE IRR8T//WnJzg2/DiBU7IIWBnjE/YY7Z3e6IgwDJ6kVddEQ0Eq6MMumWx+u7NUMfMwP8y RpWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sOOciFoH4cpEM1lcqTLO3ukPDE6ER2ndNsc0mysgwXc=; b=wXx6Yk1tg4nuqiGLhZZ6NnTPFyLMjcaF3CjQudkDePpJLkTCLkPyeMAE1CXm4Zk/Vc 76p9BdeQOiWdYtvEKd33yXA5VviLmf+ScmYmgghOa03iXQeL71D2qoM1i6oO5Gam8drE L5AKuX/DpVOEz0mvAoCmqqWhtjYlA0woZcbgoNzWz7wqgkJsRKuQC0C0He8YaD7vrSdT iQZkaI2KbtYH5U8Yxaa3kZSJy1vgXu8GXkNn7qzvDy6MgjWnzBMHP29AkO55rhjVJP0G Pe3QaGO2vv9O/0AD/otguw6bftot+lf1z0RptXUkgvWEJCHZ4vwVoNwdRLSv70HCqXyp QIig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K0aslblq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a17090a400200b00256917c7851si1319602pjc.107.2023.06.01.09.51.38; Thu, 01 Jun 2023 09:51:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K0aslblq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231811AbjFAQjV (ORCPT + 99 others); Thu, 1 Jun 2023 12:39:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbjFAQjQ (ORCPT ); Thu, 1 Jun 2023 12:39:16 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAB9A193 for ; Thu, 1 Jun 2023 09:39:14 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6513e7e5d44so434402b3a.0 for ; Thu, 01 Jun 2023 09:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685637554; x=1688229554; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sOOciFoH4cpEM1lcqTLO3ukPDE6ER2ndNsc0mysgwXc=; b=K0aslblqvpdTYqwkS4XYEl7gVij/GDApljQ8rkkcVbC10b2ClMbHVm3fLa5AlJcKY0 ESsZW5Sfaw5W55g+20mplkeIWb04BxIq40oWqYGl+a5622EUxNjDbcqP4HR5Jxhc5hde 06xaXqZCYud+S/5qX+Bpsr4iFUGfwH2rb8lNX/cOJRIuV7Rm2Ok2xvkYRVlOx+AbEDEa Mht+YSaXCNaDjObK1J/5lEEzqNKPnWaXM61ss6d+55y3Q0+dfLp+HrY2cMcK9x3StibI robd2eL/wWjjyb7KHT5OIUQ7OK9GFMEoqjmjDZNefM8CdQNxDYC5/hicj13ZNmGwIuF4 7+qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685637554; x=1688229554; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sOOciFoH4cpEM1lcqTLO3ukPDE6ER2ndNsc0mysgwXc=; b=USsgdmjcIIBHLQ5YY1hZFhFW0qt6631epB9AE1/2PDDIh1UnapAyZNkgakIT1Gr6wf /xc6kzjKNIdlvGmnnlTC+naf9qqSxOi4M5LYd+MGzb/4jPFsgAH2cb4JeAFeQx46enJM x2qwX9YQrWsst0kZSfmhz5fi/Ds+7wpEeh64M6zxIR421Z64TyPexnMfZshGLISJZcS7 buxy7z9ibhDbJtDsoT9BObQCSpP6n6OlS/20EDBW4tL3szSi/WFuqEGGB+51ksxzxlTz wMReEq3vcdkXBS/ySAlewEz5gAD/0xwSTH2Or9/XzKHL0qZvk+cf4lYV76727e7xggcK mXcw== X-Gm-Message-State: AC+VfDyQIdALaeRhDyph9kPAky/mlkHy3v1h1Uud5mgz4y8JdF6l0qZb oKyBDIwWk9MmCg/zX4AOGLlz X-Received: by 2002:a05:6a00:170b:b0:64d:1451:8233 with SMTP id h11-20020a056a00170b00b0064d14518233mr8621898pfc.21.1685637554416; Thu, 01 Jun 2023 09:39:14 -0700 (PDT) Received: from localhost.localdomain ([117.217.186.123]) by smtp.gmail.com with ESMTPSA id a9-20020aa78649000000b0064f83595bbcsm5273630pfo.58.2023.06.01.09.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 09:39:14 -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 v3 0/8] PCI: qcom: Do not advertise hotplug capability Date: Thu, 1 Jun 2023 22:08:52 +0530 Message-Id: <20230601163900.15500-1-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767519876051740964?= X-GMAIL-MSGID: =?utf-8?q?1767519876051740964?= Hi, The SoCs making use of Qualcomm PCIe controllers do not support the PCIe 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, this series clears the HPC bit in PCI_EXP_SLTCAP register as a part of the post init sequence for all IP versions to not advertise the hotplug capability for the controller. Testing ======= This series has been tested on DB845c (SDM845 SoC) and Lenovo Thinkpad X13s (SC8280XP SoC). Thanks, Mani Changes in v3: * Dropped double signed-off tags * Dropped Dmitry's gmail reviewed tag as per his request * Mentioned the newline change in commit log of patch 2/8 Changes in v2: * Collected tags * Moved the HPC clearing to a separate function and reused across different configs Manivannan Sadhasivam (8): PCI: qcom: Use DWC helpers for modifying the read-only DBI registers PCI: qcom: Disable write access to read only registers for IP v2.9.0 PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0 PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0 PCI: qcom: Do not advertise hotplug capability for IP v2.3.2 PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0 PCI: qcom: Do not advertise hotplug capability for IP v1.0.0 PCI: qcom: Do not advertise hotplug capability for IP v2.1.0 drivers/pci/controller/dwc/pcie-qcom.c | 73 ++++++++++++++------------ 1 file changed, 38 insertions(+), 35 deletions(-)