Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp84689rdb; Wed, 14 Feb 2024 13:33:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWLQnK2vrlCr2oNBAnVzXQn7L0/H619S+VamlNQlgjW0ZxOsMHnINQvRJ7ITVTQiknl2E+NjUOIglj263yJf3AXLsnuIygPvI+uL1nfGQ== X-Google-Smtp-Source: AGHT+IFKG/CtN7os6IFmheFJ8PYPLofYdu9A33IESk/Ks3uyK/aB4nmD4SajGwGaclgwa7jysF+u X-Received: by 2002:a05:6808:229e:b0:3c0:370c:69bb with SMTP id bo30-20020a056808229e00b003c0370c69bbmr86650oib.9.1707946416303; Wed, 14 Feb 2024 13:33:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707946416; cv=pass; d=google.com; s=arc-20160816; b=POgNjsgUI0eQcdOYYJJmaPpGLcrmFs3BYYS2MhuY/ueqrkS1pR1dedHfbvrCN1aL1e ThssFuKni7GY0d+Bfvt8ygsKI0eYeQ9pYWLadmS0cSauOroxJF9RLy4UF1kGR9Ho56gr cH3xSPwuTUJ0P8C05MeMw+YV4Y5SWU4567D8rPQS7PVCKh10+JkS1WteYpEjtE9Yu0dq pPPml0sdwbV73ANJQtDK5Dpaa04Xe0jL65swMhtf7Z1L8eqTPmiPGci+nkadFW12spOm kywIM5eazf9T4tfJRSx3HaEzPaktjdN2iSsBpd7ykoJ9Fc7WIsy3H6kWY7jZUNDBJnY6 gd2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=FUHzAymlINFHw4AT1ThDN8yqkHJxGPn+LrVpBC58mtc=; fh=hCMBPgqQbcXT2rlXElaXZF4dlZO9NanbicDEsUeHSkE=; b=g3gozNoZipinONafa6armSQGFP8dIFIFrLGfSaNkHH7iFvnvUnzLM6lPxAl7ywx0Qa qSLK3PONncLYyzwHuJ28FprK1cjYOhJfG5spkhFKphsnr2MuepCly/2JRWjKcz8fNdxb giIMWpXIH1lL11sHaYkx+5e/n2NQGGL0w59YoHIRTMSbEG7p9INSPDAyC0vi6MTFbcl7 OxnmCk3q5BFGmDoQBsYHFIYSWbC6JUVbJpWPB1A0Kd/I7ClIFCqGuCcnH10a0m2KRtuX 5CdLe4n8fVpbZ6b5Y4tIqKAkTi5UqaqcOp9RK/K4qL7WZnI3iKEQg6L2LZe70IXhWu1I gn2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ui2XcTJW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-65989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCWrwOMWJwwqTVFp1lUJZCbViZJBsIuGECuvK2k7VT64QzsSLqEQWTJ4ZASlSFvK8WlOJJDcPqEljdXjFjyEFisHd/pxWNDCBQ3eGnYu/g== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e4-20020a0562140d8400b0068cb0aa2ec6si6221397qve.518.2024.02.14.13.33.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 13:33:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ui2XcTJW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-65989-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BD1E81C222F6 for ; Wed, 14 Feb 2024 21:33:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47B0013F001; Wed, 14 Feb 2024 21:33:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ui2XcTJW" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A18513EFEE for ; Wed, 14 Feb 2024 21:33:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707946405; cv=none; b=Tx81KDLUS93ZiAF6EPmVDXaz5wnjJdsIqK6nrCB6Gib9ln+ZJOPonj3COQrVb7SNlU072/S8d2bCYl63XgkuDiVApVWRBmqiXTHwCT5MfPT17otxepreLJFjHsJGXSB4BqMu2jZrYyoCKl0bSGxGdKzPZDUmG5Bm+eJ3YWeZBJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707946405; c=relaxed/simple; bh=xxyACrWt2PwJkS0pdU4dWiP6K7ZzMm9WVJSfh/427dM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N9icroBE8k/w55amJB691kPhunjAeSKULcorOQFMUKfsaUyY+HuBHEZEPnOpu8pLGuyoBIOnPx4RCxuX85bDp+krroA7GxiF4CfKt45K/r6qfZ+bLkIR3yi/xHhFp53d8XJJcf1qrwXpZb2ZcsKvHGMW46IszBPpzTDXA8BCzMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ui2XcTJW; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5638447af43so289286a12.1 for ; Wed, 14 Feb 2024 13:33:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707946402; x=1708551202; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=FUHzAymlINFHw4AT1ThDN8yqkHJxGPn+LrVpBC58mtc=; b=Ui2XcTJWlnCKiCK9wTmt1fClG1Jr0CCieLV3JxtESualYR86iXtTFwFFyu1rF49Cnh ATns1+2nPxkeGfxaCVZcfJwFWgGRD19ihTAe7zZ7tAq75OFdR4oCAAvGlfd+Hq3kGmj0 GvWWVbZ5knc+p2ZtHT30Ey+8Yd2BzQ5F5Y5U4eKzB3e6pdJjckD//HJdMkSa94cqdX/I +NBwo8QH1NWhvi1w+NX4er7eHMpAk/t1pNZ8Rj6FaxYp64Oyuf9TojLEifHDc9GqDMs+ tsDJ8/H1PcgGZNhEIRliKMeCATbSEpaftuGDM///VWkh5zMVaXvUCWWGmEJrnPhKw6x2 cRxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707946402; x=1708551202; h=content-transfer-encoding:in-reply-to:autocrypt: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=FUHzAymlINFHw4AT1ThDN8yqkHJxGPn+LrVpBC58mtc=; b=Z5ADtQQKSB5c8l7QxKXI1YrXFusZCe6M3aGLeOWRe5vMupg1zOFwk6GIiCDPq4wkHx kai2ZGfO0u3agyHOv6lJrdD8woBCgfv0vc+xcOPWGq4wbTNOCUQR1y7+IBAZjRPqOC7c KQ25qBvG4em3i8JaFRKeiV5U6ekFY7EROW/iqwjiO7GO1cahhu+jMSOeLhfSZP8nIzbJ zw7ljn8rlUU6t1eTK5eQQE7Ivhc+DuntY1yqsy6PI8cb5u2/rlDM1DcZdyj4vtamg1Jf 6BT2qerl/M9mg/v2HkMHUDG7+6bjnObOpPROLJk/089cj1zwd93Naki3IyjAq1Gs2W2r wXHA== X-Forwarded-Encrypted: i=1; AJvYcCVTwPdepANWHQ1BMJQ3CfZJO2NhyzeUt72GoQKKJAB40Cb1kjEdIjoyeNI1Apl2EN4LaKyAoH41dAKrB4ogpcad/Bu/HpIAZ2BWVXsq X-Gm-Message-State: AOJu0YyISvMP/BSqtJADTqnRGxlfRT1qD0aJnHLmNtm3sAu9gVTPCOY7 aAS6uRyd7s8x9fjv0qP1XxBPoAX1GdlZc8hyQ2Y6bdSlzmzcPITL3I2IDWDnYIA= X-Received: by 2002:a05:6402:22ca:b0:562:9e4f:6bd1 with SMTP id dm10-20020a05640222ca00b005629e4f6bd1mr2095725edb.9.1707946401721; Wed, 14 Feb 2024 13:33:21 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV+Y3B+Y40sfv2m3w7vtPBrJH3hXIBXNY7dZUsceCxzt2z7Qps2IJ5AGUnvODHwj98JB3VjhvYKqM71fmtxpXg1rUG1Arb8RWZKUy+NmIrRyxSTTjR3rf0QEobGyFkEd4Kgeocr4k6LZ3XPbYLbEWuIHSjC1rX4LMggc4DQ40q9EMmeNC/ECJwwsIMZSIkTRB5RElp8O1ys8vJjAB8iQ0pdYTKPxT5y2boe7u8LZn2B+EwzJdJq9SMzQkiXOxRz8DaqrWVV1Ir8nJijSaE86v2gWveuXfinBfWQKGTReb8OcV9dBdwt7PmcyaY5hZzkxPFgdFy9Eb3UfYJwNbTIly213RGojN27SSoedBHOEWSfAM+RX6wHEtMI8PvoJK63TuXqfmrLJC5nDI2GfnyfsOQOI6V9kV8SdnZQHgZD0/Xp Received: from [192.168.192.135] (078088045141.garwolin.vectranet.pl. [78.88.45.141]) by smtp.gmail.com with ESMTPSA id j2-20020aa7de82000000b005621b45daffsm1159426edv.28.2024.02.14.13.33.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Feb 2024 13:33:21 -0800 (PST) Message-ID: <27560098-ced3-4672-bc60-6c1b7c0dc807@linaro.org> Date: Wed, 14 Feb 2024 22:33:19 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] PCI: qcom: properly implement RC shutdown/power up Content-Language: en-US To: Bjorn Helgaas Cc: Bjorn Andersson , Manivannan Sadhasivam , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Philipp Zabel , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Bjorn Andersson References: <20240212213216.GA1145794@bhelgaas> From: Konrad Dybcio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IDLAXmW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <20240212213216.GA1145794@bhelgaas> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12.02.2024 22:32, Bjorn Helgaas wrote: > "Properly" is a noise word that suggests "we're doing it right this > time" but doesn't hint at what actually makes this better. > > On Sat, Feb 10, 2024 at 06:10:07PM +0100, Konrad Dybcio wrote: >> Currently, we've only been minimizing the power draw while keeping the >> RC up at all times. This is suboptimal, as it draws a whole lot of power >> and prevents the SoC from power collapsing. > > Is "power collapse" a technical term specific to this device, or is > there some more common term that could be used? I assume the fact > that the RC remains powered precludes some lower power state of the > entire SoC? That's spot on, "power collapse" commonly refers to shutting down as many parts of the SoC as possible, in order to achieve miliwatt-order power draw. > >> Implement full shutdown and re-initialization to allow for powering off >> the controller. >> >> This is mainly indended for SC8280XP with a broken power rail setup, >> which requires a full RC shutdown/reinit in order to reach SoC-wide >> power collapse, but sleeping is generally better than not sleeping and >> less destructive suspend can be implemented later for platforms that >> support it. > > s/indended/intended/ > >> config PCIE_QCOM >> bool "Qualcomm PCIe controller (host mode)" >> depends on OF && (ARCH_QCOM || COMPILE_TEST) >> + depends on QCOM_COMMAND_DB || QCOM_COMMAND_DB=n > > Just out of curiosity since I'm not a Kconfig expert, what does > "depends on X || X=n" mean? "not a module" > > I guess it's different from > "depends on (QCOM_COMMAND_DB || !QCOM_COMMAND_DB)", which I also see > used for QCOM_RPMH? Yep > > Does this reduce compile testing? I see COMPILE_TEST mentioned in a > few other QCOM_COMMAND_DB dependencies. I can add "&& COMPILE_TEST", yeah > >> + ret_l23 = readl_poll_timeout(pcie->parf + PARF_PM_STTS, val, >> + val & PM_ENTER_L23, 10000, 100000); > > Are these timeout values rooted in some PCIe or Qcom spec? Would be > nice to have a spec citation or other reason for choosing these > values. > >> + reset_control_assert(res->rst); >> + usleep_range(2000, 2500); > > Ditto, some kind of citation would be nice. Both are magic values coming from Qualcomm BSP, that we suppose we can safely assume (and that's a two-level assumption at this point, I know..) is going to work fine, as it does so on millions of shipped devices. Maybe Mani or Bjorn A can find something interesting in the documentation. Konrad