Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp264663rdg; Tue, 10 Oct 2023 09:34:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEczR6NdinUhLF9yIyd7n0Ecak2MR4ETqZWNTlcgH+2OSkzEH5jVy7FTkrESaUBZRTcJZU3 X-Received: by 2002:a05:6e02:149:b0:348:ba80:5a37 with SMTP id j9-20020a056e02014900b00348ba805a37mr19755608ilr.0.1696955653887; Tue, 10 Oct 2023 09:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696955653; cv=none; d=google.com; s=arc-20160816; b=xRLnC429P4l74nhcgQ9qnC/SSoGr98DPYtxbEpzZD6KQWTVsW5jOWh87vySOG8uXVx BkVDNTRkEca/c1QPYTHI/AnQpBLFOfRBrge5/TUIIthP53Jt/KyXhqPc0Hgk0+sbejf5 x8adiP3bB9NAlqNp3r9KB6nsZOTAQPEhEJZdQStx8tWIEOD96f1GqlrI2QJteVNV2wPZ EpeBz0QwCSDcO820l4KlXZqRU5oVANtPccs1nR5Rpty5+65SeKuOFFNRMBTabu1RWMZa QdMOdzlekeGRuhhbd+Jq+ExHmYGGMXxw+20zFMbNT+LQpIrqMcXLfk+NI6aqfPqtpIr5 Xvlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=rXgMbtQ30IMvVzvJ3cAQCAXyb8GEmNBTLVRPEsln6kw=; fh=oF+sfWIdjYoJmqPSuJeJka7btARmUx4DMR42zytCeqo=; b=P+yG0M1t3G1RKe1YSZF03leZVO++XtMQm0aKi06L9eBmTT8gDTRSoT09leLuorWQ5l pXw8Vyo5UoboxT3MY4WMMm4hJaXzCnVx2wk7qzeJklzhBDgaeHPCUeO8Q7xLNck8V0YT /x7Cue2fLeN42Ho36KLBK/hkfnlxMi1+uGRpSJKZJjV1Go1kwsP6HBDTjqG2jFjxaGTz xp8nq+sIHNXETasOyqT2JRUlDXa544Ux7zzbubY0NUboZt+c5/toqLISPUPAZgN+8127 osVGUv7x6BKWR6SQGhrlgEzwlSyh38hwDMofwwvCL11QMIhrqSHFO1JLLcSEAlRnfUxv Vo2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nd5RPLV5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t33-20020a634461000000b00577d99bd05esi8167573pgk.743.2023.10.10.09.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 09:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nd5RPLV5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C2B078030479; Tue, 10 Oct 2023 09:34:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233608AbjJJQeI (ORCPT + 99 others); Tue, 10 Oct 2023 12:34:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233532AbjJJQeD (ORCPT ); Tue, 10 Oct 2023 12:34:03 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929F39D for ; Tue, 10 Oct 2023 09:33:57 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c186ea81c7so75815851fa.1 for ; Tue, 10 Oct 2023 09:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696955636; x=1697560436; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=rXgMbtQ30IMvVzvJ3cAQCAXyb8GEmNBTLVRPEsln6kw=; b=Nd5RPLV5ptrXnsWQP+VThclwRYQ1puUYCEK2wlz8Q2SaYbrnYM6h2RgFQC19DKwC8D 6poYCG4XgLMFSi6ZITU5mGFv/sJ4Sr07BpLzPn9b6roHCaM+YYxKuQ5XdOh3xo5xt5GM SdUwKt6mJcnWm8XY4DNfPTr9mEqRy3PFUirYCKvmnbSNYzhXeOQvu4o/demCTjMyzOWK JoFm1bthGBbriLfhOrD191FpQi/z8ID39UkoqfmMRD1lfAhBfDIJH7Nuisa5uOXkF07n oVSFIU1e5zK5OICvvh/CFa8uC5vixFEngjVhra2DsiOoyTrgKsUZ0aje+E00DCe2/y+y vm/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696955636; x=1697560436; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rXgMbtQ30IMvVzvJ3cAQCAXyb8GEmNBTLVRPEsln6kw=; b=GO4TSU8vVoH3gJosz3TGxrCxLj1V/IcSwfopJwd0p1QI67qkbcUfDfmFt08F3OfdeJ C8Rqs3aFVh7cNOfvwv1ZhROGIFJtqMnZxLzevJoNyaXzam67El6CODFu6AIORvCLeWyl b50p1EgcZ0qE0q/2QtVnhsqzFwhoF10RYcg16c+A0hvlsEsNhRtB99w6Vvla9e3uf5DN QCWtooe9fWbPpUwJz/QMfRCh9WBIznAUK8km1+J/lAWvn2FzdT617kXvjYgsnt46Fwxw FpBuSWVNkS6FpA/237sCB7ij6X8iKLQUVWHkEU5egctAoZlc3pyPFoY70PuwfFkhFZjK 2p0w== X-Gm-Message-State: AOJu0YxOLY4GmgyFObDXIt/1JfwgWRwYy8TWdDX+z40SCfR4itUYM2hA Uro6JKlQt28CHDs9UJ9zCeObpg== X-Received: by 2002:a05:6512:ac5:b0:503:2eaf:1659 with SMTP id n5-20020a0565120ac500b005032eaf1659mr20896855lfu.41.1696955634875; Tue, 10 Oct 2023 09:33:54 -0700 (PDT) Received: from [172.30.204.182] (UNUSED.212-182-62-129.lubman.net.pl. [212.182.62.129]) by smtp.gmail.com with ESMTPSA id b10-20020ac2410a000000b004fe432108absm1877755lfi.182.2023.10.10.09.33.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Oct 2023 09:33:54 -0700 (PDT) Message-ID: Date: Tue, 10 Oct 2023 18:33:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops Content-Language: en-US To: Manivannan Sadhasivam , lpieralisi@kernel.org, kw@linux.com, bhelgaas@google.com Cc: robh@kernel.org, gustavo.pimentel@synopsys.com, jingoohan1@gmail.com, andersson@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20231010155914.9516-1-manivannan.sadhasivam@linaro.org> <20231010155914.9516-3-manivannan.sadhasivam@linaro.org> From: Konrad Dybcio In-Reply-To: <20231010155914.9516-3-manivannan.sadhasivam@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 09:34:13 -0700 (PDT) On 10/10/23 17:59, Manivannan Sadhasivam wrote: > ASPM is supported by Qcom host controllers/bridges on most of the recent > platforms and so the devices tested so far. But for enabling ASPM by > default (without Kconfig/cmdline/sysfs), BIOS has to enable ASPM on both > host bridge and downstream devices during boot. Unfortunately, none of the > BIOS available on Qcom platforms enables ASPM. Due to this, the platforms > making use of Qcom SoCs draw high power during runtime. > > To fix this power issue, users/distros have to enable ASPM using configs > such as (Kconfig/cmdline/sysfs) or the BIOS has to start enabling ASPM. > The latter may happen in the future, but that won't address the issue on > current platforms. Also, asking users/distros to enable a feature to get > the power management right would provide an unpleasant out-of-the-box > experience. > > So the apt solution is to enable ASPM in the controller driver itself. And > this is being accomplished by calling pci_enable_link_state() in the newly > introduced host_post_init() callback for all the devices connected to the > bus. This function enables all supported link low power states for both > host bridge and the downstream devices. > > Due to limited testing, ASPM is only enabled for platforms making use of > ops_1_9_0 callbacks. > > Signed-off-by: Manivannan Sadhasivam > --- [...] > +static int qcom_pcie_enable_aspm(struct pci_dev *pdev, void *userdata) > +{ > + /* Downstream devices need to be in D0 state before enabling PCI PM substates */ > + pci_set_power_state(pdev, PCI_D0); > + pci_enable_link_state(pdev, PCIE_LINK_STATE_ALL); Do we not care about retval here? > + > + return 0; > +} > + > +static void qcom_pcie_host_post_init_2_7_0(struct qcom_pcie *pcie) post_init_enable_aspm? Konrad