Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4730535rwl; Mon, 3 Apr 2023 08:52:01 -0700 (PDT) X-Google-Smtp-Source: AKy350Yu+MVqrla7lDsSZXo0KyQjjN13nk8l5SWmK7p/nasNeQcMmqhCtGWSv/ILHTfeA2ESYjZy X-Received: by 2002:a17:906:3590:b0:8b1:75a0:e5c6 with SMTP id o16-20020a170906359000b008b175a0e5c6mr37463808ejb.18.1680537121673; Mon, 03 Apr 2023 08:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680537121; cv=none; d=google.com; s=arc-20160816; b=IYG68gLxEXJnlynYh/UYQVLv+0JGFGLeWQ+l8v+cBmXHf6kwBG6U7eWaa4HoiO5xGj ADH1dDdVm17ueUyroLj/3/DRvDCyaA6AemXZP6m9vMl1iEZNqRCBLplzrdSMboJtDTPG JaE64FmuCmNvgiXLViRr43E6KHiJ7Xz3G6LrhjKAbnUyyfNZtsD+X6B+TXPC7+5N2YvN ObnEQWhYEjowWNOHqUShKEjlPTyY5yW7bvpI6G2/M+1pc8EfCZfIydNw/dS3lcWilMXY QlECMmTspT8vbWqAjIjlvFCSopfrU8MubxD5xJvxBYUnRSpAAEjrmlkKTppqP6/qKPCo XNnA== 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=sjdpEr1kbdCek7+Xx4AMcpWMybctv63LfhzPtH0NYpI=; b=IYUHdzWx0hzP2RxkQlmQDX5Ijr7SnxskOwIZx9UDMjf7xze+L7CvogWkifFxQVwOO+ 2BIWawfqvAFGnAGKcVv7qjq3mA8xjlpugoZibcfOJbv0NUQbi1ABUGSfEWiAG6PxSFQC /lFBxZhhh/Q+l9YhYOUnbdUY20D/c+FO0WD/CpF0Y1BKb360rXERit1vp2wKllFlrWiw I9ExJB1VaVLnWulJlU+J6mk/O3WNNMYVUUmbUTDm44yUh6k9UpeVVY+Hm2l9yLxBrwAh JdSU3BwK9X0gkY45Zrc9NY6T5PZ/zd0/YSJoj3hCSSe5G5mfIqjlSdNJ37uRIW/Yw1ki xCzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ffq+9Ao/"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq11-20020a1709073f0b00b00948c047315bsi1326834ejc.253.2023.04.03.08.51.36; Mon, 03 Apr 2023 08:52:01 -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="Ffq+9Ao/"; 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 S232638AbjDCPuI (ORCPT + 99 others); Mon, 3 Apr 2023 11:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232554AbjDCPuA (ORCPT ); Mon, 3 Apr 2023 11:50:00 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4C902D71 for ; Mon, 3 Apr 2023 08:49:35 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id iw3so28448583plb.6 for ; Mon, 03 Apr 2023 08:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680536969; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sjdpEr1kbdCek7+Xx4AMcpWMybctv63LfhzPtH0NYpI=; b=Ffq+9Ao/yKeSVo9K+0CQxyz3aN64b8sLF8aki0lQyNqP3Rgvqt9paDWEKXq4gLoA8V fMVGj5THzkvpBXY4DRwYufLgtmUtpDtU9iIha2pb3Wo3TmV+eIQiCgMVs4AW1F1cDJcK D1pYHuFEnxhgSCTelEMYMQPBC3FGdEH1npol0woxbt/T9ry1dGMOb4/2h0zKbHTapFYE 2t8lFHKv7CUA6SqYfFMBKHwaKx3r84BAHtskBADkGyPBt5XWaJZ5uZs0c7kPT4tLyW9Z 5N6ezanrfYsWpNFrvPZjKFv8iGQWaZumMCnnChY7UNmbOkPqT6maiV5SMpldBD7U5gO0 UMHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680536969; 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=sjdpEr1kbdCek7+Xx4AMcpWMybctv63LfhzPtH0NYpI=; b=gqN6mGxetwA+wEfI/JtT2G/I3EaHBMd4JUXpfe3SHBpr1Fvqw8GhNDUBT/yASpynpw X3TuhVHRiFxFHCHB+6DFVCctEwcDk4rlN5RJwBUFaZL2WxZdnjR0emJFgB1T5jtYVEc2 IYepQI53+0dP9eiQN+kI+LNoNiCwFszV/QpfhXrLxzEYMfYl0hFJSh5eRIP66tCS9WoD u6VS1GCl3acICPygvQIoFQIentEAxFqaPvSsQ6NB8kJVtH7fniHQ4OTWjwCfcptJXXRv W2s/aedhPl385yBzbyjj/qgWXfRg8m7N5FmnbAAoZ74+gYAbV/wtibgtBs4MDOXO2fhx n+eA== X-Gm-Message-State: AAQBX9eJZm8VW5+3S+MazUXCjZS0g7PYeiirCBMxGv2+hS0/ViVZNEkB cNTGmIcncIEbzqDJhzIsAY3/pYNv1e3Fl+SM+w== X-Received: by 2002:a17:90b:1b48:b0:23d:2532:ae34 with SMTP id nv8-20020a17090b1b4800b0023d2532ae34mr18497287pjb.2.1680536968965; Mon, 03 Apr 2023 08:49:28 -0700 (PDT) Received: from localhost.localdomain ([27.111.75.109]) by smtp.gmail.com with ESMTPSA id c10-20020a17090a020a00b0023af4eb597csm9621534pjc.52.2023.04.03.08.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 08:49:28 -0700 (PDT) From: Manivannan Sadhasivam To: lpieralisi@kernel.org, kw@linux.com, robh@kernel.org Cc: andersson@kernel.org, konrad.dybcio@linaro.org, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_krichai@quicinc.com, johan+linaro@kernel.org, steev@kali.org, mka@chromium.org, Manivannan Sadhasivam Subject: [PATCH v4 0/1] PCI: qcom: Add support for system suspend and resume Date: Mon, 3 Apr 2023 21:19:21 +0530 Message-Id: <20230403154922.20704-1-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Hello, This series (a single patch) adds the system suspend and resume support to the Qualcomm PCIe RC controller. Background ========== There were previous attempts [1][2] to add system suspend and resume support to this driver. In previous versions, the controller was put into low power mode by turning OFF the resources even if there were active PCIe devices connected. Thanks to Qualcomm's internal power topology, the link did not enter L2/L3 state and the devices were still powered ON. But during very late end of suspend cycle, kernel tried to disable MSIs of the PCIe devices. This caused access violations as the resources needed to access the PCIe devices config space were turned OFF. Series [1] worked around this issue by not accessing the PCIe config space if the link was down in dw_msi_{un}mask_irq() functions. But that approach was not accepted. Then, series [2] implemented the suspend and resume operations using the syscore framework that disabled the resources at the end of the suspend cycle. But that approach also did not get much acceptance. Proposal ======== So the proposal here is to just vote for minimal interconnect bandwidth to keep the interconnect path active and not turn OFF the resources if there are active PCIe devices connected to the controllers. This avoids the access violation issue during suspend and also saves some power due to the lower interconnect bandwidth used. Then if there are no active PCIe devices connected to the controller, the resources are turned OFF completely and brought back during resume. This also saves power if there are controllers in a system without any devices connected. Testing ======= This series has been tested on Lenovo Thinkpad X13s. Thanks, Mani [1] https://lore.kernel.org/linux-pci/1656055682-18817-1-git-send-email-quic_krichai@quicinc.com/ [2] https://lore.kernel.org/linux-pci/1663669347-29308-1-git-send-email-quic_krichai@quicinc.com/ Changes in v4: * Used 1KiB interconnect bandwidth during suspend Changes in v3: * Limited comments to 80 column * Added error handling in resume_noirq() Changes in v2: * Used minimum icc vote to keep data path functional during suspend * Collected Ack Manivannan Sadhasivam (1): PCI: qcom: Add support for system suspend and resume drivers/pci/controller/dwc/pcie-qcom.c | 62 ++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) -- 2.25.1