From patchwork Fri May 19 14:31:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 9581 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1282263vqo; Fri, 19 May 2023 07:33:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dpHQB8biXYs8JW7wqHdL8rSGA5bSZ2ZjmivTMt369bHtlzK0CbuzvundhJS13CrmuqztF X-Received: by 2002:a17:902:eccc:b0:1ae:8741:d1d9 with SMTP id a12-20020a170902eccc00b001ae8741d1d9mr1616067plh.17.1684506795441; Fri, 19 May 2023 07:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684506795; cv=none; d=google.com; s=arc-20160816; b=hlIy5elHWpvgHfcUtOGZW0jSbWiLBQNMk2D+cFCR98a1jZIjDCbfjmUSE+NtRKiPiw QRyXQjFLX/0DEG/8ZcPkvmNy7zdV2Vh5g60PgUyUVKZz1hrSSWq3DN5ZDF0ADp5d04cT o4ydCMTRRJHfArbfsspKchpDxkciOfCZpNbAfNWUklxD/n6dijVwGKC9U/TS0b7Yv1jk o4NvI+0pDHGltxMsAn/3Iefhm1GZBzIsVKKbNhrP9tNWkPTV6DpnEr9W1eQHg+wU9eYJ U0NNg6nOgc+Hxbi7Fw6yseBZrWY6bj+eEM9B0LPIWKxC/gnoFnJjGoCTF4cmGy7cwQ9l q1BQ== 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=2i+4jZMYyJOuLHa5p2LrqOp9rYboDhqgn1MB/sFP3Yk=; b=FtjqgqUMWqcHxl/kWyIJkVfTmZMpgHoEnCsKQtDmYB1bVlXmqfNaoaY7XU4989Utiw 04TIoMLOPCO7i8BQOzwoeORHbXLX6flEyqJcozMS9O9VxRVmboagEekPE8/hdSJtzpvs o3epskdcYAGNz+FAuJAruDQwc+XZu3dbpyXH8ers/FskGoCdWtFr45qwKXWJ6hlL3FCq 8V9bCmaz9WNGzH4VUHWDNw91M/gtkVp8OhTqfUX0VZRV4ki528fCZFqAgn60tNLLNqsU LQfIl+RcStQg5we/eAYLTljinWhFFgtSwUDHDDo+eVTi6j9DvUiOIDZ5T6Le9k/XuCKf ju2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NGH3s5VW; 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 20-20020a170902e9d400b0019e2bd0fea8si3582963plk.143.2023.05.19.07.32.58; Fri, 19 May 2023 07:33:15 -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=NGH3s5VW; 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 S232048AbjESOb3 (ORCPT + 99 others); Fri, 19 May 2023 10:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbjESOb2 (ORCPT ); Fri, 19 May 2023 10:31:28 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FB34137 for ; Fri, 19 May 2023 07:31:27 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-253570deb8dso1881945a91.1 for ; Fri, 19 May 2023 07:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684506687; x=1687098687; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2i+4jZMYyJOuLHa5p2LrqOp9rYboDhqgn1MB/sFP3Yk=; b=NGH3s5VWcjCYJ467VCymIG56S/3e59VN9TouKrORlz1kUH9pDmPg+OhKrB7IREV6Rp kyfAqSlCnfHExdp468iMVrISs6R+GMlbQ1CNIlcI1H05fV8MvYoZ8rVO2Mb4OV5wKw3v I2bZ7wlj/bmDqIN8+0fwdCIE2/PYo+5mu5RzVhFiJ2YiTMpKd4F2lH6Vtg6aFyRA4ILl rv7jDg/JBqRVP9kP83q9iGSkkC1pc5qJ8m3npI278unfvFayw6rzteHKvQ45jeEz1yel WiqQADrAXSBPKyRx3xMRGcyYlXSv51Ab5b6XCaKL0GFBrwacjOCTB2sJDic4lu1vexJt qkWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684506687; x=1687098687; 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=2i+4jZMYyJOuLHa5p2LrqOp9rYboDhqgn1MB/sFP3Yk=; b=CaORO92FG6j4OLEwqcm377+68tBzZo2yYDCE8xC++VNqgwlbJsfc/p60MG2Y1ssHK1 A9rJhX1/V+x6FBuSu/kiHgy/c3aTXUgfr2Y+Y1ju6eFUBsuYcw6HrAM+Kp+2B4e5Qq1o SeM8v/2on5d8GlUdBC/Vy0rO/OBrIpNjNWg74As1yXsQnbP5Z6DU4mWwVwF8mIuC0qgE 0KcNMzL3yrSdilphlgr3O21fJG0Dc6hd3BQa6EK9aDGPvLYA1zGDKbxz6283RY63RFA7 TTCYxiX2yChsxMGUD5FMcA4j2LjoI+5hDT66Zf/j2YpTlpPpYdrQZvgUXNiiTMuNyTLc 4Cew== X-Gm-Message-State: AC+VfDx2YMj0Rrskfx2Snydv4/gtsHUJ4xqKMsiU+E154kKKWTHpooGs F4m6OtTycb3EsXlyXNndsL+7h0DVUyCvvEIBtQ== X-Received: by 2002:a17:90a:c712:b0:250:2192:1bff with SMTP id o18-20020a17090ac71200b0025021921bffmr2556538pjt.23.1684506686731; Fri, 19 May 2023 07:31:26 -0700 (PDT) Received: from localhost.localdomain ([117.202.184.13]) by smtp.gmail.com with ESMTPSA id 30-20020a17090a09a100b00250d908a771sm1634845pjo.50.2023.05.19.07.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 07:31:26 -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, dmitry.baryshkov@linaro.org, Manivannan Sadhasivam Subject: [PATCH v2 0/8] PCI: qcom: Do not advertise hotplug capability Date: Fri, 19 May 2023 20:01:09 +0530 Message-Id: <20230519143117.23875-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,URIBL_BLOCKED autolearn=ham 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?1766333397341723936?= X-GMAIL-MSGID: =?utf-8?q?1766333397341723936?= 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 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(-)