Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4592320rdb; Fri, 29 Dec 2023 07:01:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCk7Nbyw0MjdaIf4vwxSIQ90JbsFIcDi3zBKDnwqHMHDzVnZg+uIkBljlo0a/u8kn2wD7d X-Received: by 2002:a05:6102:4708:b0:466:fa29:cd15 with SMTP id ei8-20020a056102470800b00466fa29cd15mr2895495vsb.23.1703862102684; Fri, 29 Dec 2023 07:01:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703862102; cv=none; d=google.com; s=arc-20160816; b=lx6DxIS4lXpjcZoNluuDvbkq23UO0HxMzFdK9gLCGgvpLKzedD46WrJY5kMjSbAxV3 X5BPCeiw35MRuEWM2B+yN2+0jaUXkbVkZTF0P/vIkdxK90/l4sRtujruwUgLKbRxOPTY uRyd6D0+KZmCbo77lfwcCyN6EIezX1/uXLStea0kQRomu/NlSOphVPsp4MgGbHXil/3O tHcOWAAcDDFeJv7V2TmChlFddjIhzfmM/ZPlwM3zaHVyIkzcowCRQlvZr51Nwx4JCWSi xzZ/RSUXS/Fd2ZmOiAKGEPhzPvdjCTX6Hq/yd6sQ5ep2Dfn2AGhy8VqsK5ClnB1IXytp e4yg== ARC-Message-Signature: i=1; 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=OJGAbTsJuV5c3Gk6VGVnHrcLGAJpmZfominI1jRqdbY=; fh=j+hk/3OfcCktVjNP31WnQB3oXNShaPLiiRzszZelSYw=; b=gSbKD4FUlY+U/3cqjovt1DV61RVdyfbhcgdW6ZLxz2QWms/Mty+c4XwjrJvXFgdrpk UEFiY2fd4LcaKQKZ+IkUBTxbiDkGB1r38r/G/sN6XpfufImNNDTdFAVENj66r4cc5A0l nfTqTIyjpDVUuWHnGIlRcaObowahUaHryaGAbMj2F9VJLlpJlZ3bs+nio64P/lm9mwAh jzDwTTxiPsdzPNw3hNRZpRMNbVlki6JuqPrWmnTHNrICYunUlmOaq1SpNiZbgNf95YBo rx7OYtvu36Jzzd9j2+PhGMEqT+1TuRzMR70rPrOVlaZs6YmobXIMGKZBhS/xrz+AK/9L i7aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cuDvjIx/"; spf=pass (google.com: domain of linux-kernel+bounces-13127-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13127-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d15-20020a67e40f000000b00466dd79721fsi2027747vsf.442.2023.12.29.07.01.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 07:01:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13127-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cuDvjIx/"; spf=pass (google.com: domain of linux-kernel+bounces-13127-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13127-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 56AD91C219A4 for ; Fri, 29 Dec 2023 15:01:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CACCD125A7; Fri, 29 Dec 2023 15:01:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cuDvjIx/" X-Original-To: linux-kernel@vger.kernel.org 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 6DCDA11CB9 for ; Fri, 29 Dec 2023 15:01:32 +0000 (UTC) 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-555aa7fd668so1156128a12.0 for ; Fri, 29 Dec 2023 07:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703862091; x=1704466891; 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=OJGAbTsJuV5c3Gk6VGVnHrcLGAJpmZfominI1jRqdbY=; b=cuDvjIx/AaPwCvtsVoX9cVFHQNjHNMs8TqNApLoK6NLIb8L1uBgsYnL1KXUMykvEqv 9SQAu/YsY2PHRS3LJlHvc4KPTK/vwkuxCWSM9gnqxX9LBSN87lho+fJQP5ekRJXbNpJO ShFB2Js6fNiUif0a6nCZXsKF7fROLkNpaaqob1UfHSGgwUY94WWwRmYUl6bNrqwky/Hm RLbyIJfVYF8BqiAnfZDiQja/SblNTJqYCLJCvsIqiu0TaAmJQuDEIRn0aXVSjTP7mS/m M6Ji50QAlzE+YdHPWicHlmN3i8DMJOsNBKes7bg+QCzr8xUBfqUjgT233u+epHD/3RDq PaTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703862091; x=1704466891; 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=OJGAbTsJuV5c3Gk6VGVnHrcLGAJpmZfominI1jRqdbY=; b=Y+2hFynBJ+mxDS+nWus+ZXMMURxcGjPCaTQoLOF4xgSsi3OCvzooS0cjW9YxgUt29w Pyw2ceQtU+TL3haKXhnmzGDV5qgUMIl5OlPjUoX2RcC5G4CtsQ+SeJKpFJn5XJ/7fcbq 9A5ZO8OzsSUNYsj3U1x3+lYT9P2Ya1AkxY784qYX3d2GAreQ4mMT71z1bfAlOQ9H6OGF FRVfwhLtj5I29ODalHcbDW67wlBCGVHKOz8VfFLED8MOqmoRKa2QjV1MAR7fG/zXg8D+ q4VLVFsbJA90Ew69ct9q/mjnNRrlb+EEESex8G8No/RyoQfoldCMCiBZgsbaT4QNcba0 rpNA== X-Gm-Message-State: AOJu0YxLj1o9paSuLcY+ewM9ukIF/cs7EmhOU0ZbHYZuIUH5+iMVASZ2 sZlqVLKQTZDCoS5t02GHnonSyo7So98CQQ== X-Received: by 2002:a50:ccd9:0:b0:553:a5e5:78d8 with SMTP id b25-20020a50ccd9000000b00553a5e578d8mr8073190edj.26.1703862090577; Fri, 29 Dec 2023 07:01:30 -0800 (PST) Received: from [192.168.199.125] (178235179036.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.36]) by smtp.gmail.com with ESMTPSA id ek19-20020a056402371300b0055383eb043csm11193743edb.56.2023.12.29.07.01.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Dec 2023 07:01:30 -0800 (PST) Message-ID: Date: Fri, 29 Dec 2023 16:01:27 +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 1/4] PCI: qcom: Reshuffle reset logic in 2_7_0 .init Content-Language: en-US To: Johan Hovold Cc: Manivannan Sadhasivam , Bjorn Andersson , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Philipp Zabel , Stanimir Varbanov , Andrew Murray , Vinod Koul , Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231227-topic-8280_pcie-v1-0-095491baf9e4@linaro.org> <20231227-topic-8280_pcie-v1-1-095491baf9e4@linaro.org> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+RvadOVi6CoUDqALsmfS3MUG5Pj2Ne9+0jRg4hEnB92AyF9rW2G3qisFcwPgvatt7 TXD5E38mLyOPOUyXNj9XpDbt1hNwKQfiidmPh5e7VNAWRnW1iCMMoKqzM1Anzq7e5Afyeifz zRcQPLaqrPjnKqZGL2BKQSZDh6NkI5ZLRhhHQf61fkWcUpTp1oDC6jWVfT7hwRVIQLrrNj9G MpPzrlN4YuAqKeIer1FMt8cq64ifgTzxHzXsMcUdclzq2LTk2RXaPl6Jg/IXWqUClJHbamSk t1bfif3SnmhA6TiNvEpDKPiT3IDs42THU6ygslrBxyROQPWLI9IL1y8S6RtEh8H+NZQWZNzm UQ3imZirlPjxZtvz1BtnnBWS06e7x/UEAguj7VHCuymVgpl2Za17d1jj81YN5Rp5L9GXxkV1 aUEwONM3eCI3qcYm5JNc5X+JthZOWsbIPSC1Rhxz3JmWIwP1udr5E3oNRe9u2LIEq+wH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M 8arzfyiB5wJ9tb9U/nZvhhdfilEDLe0jKJY0RJErbdRHsalwQCrtq/1ewQpMpsRxXzAjgfRN jc4tgxRWmI+aVTzSRpywNahzZBT695hMz81cVZJoZzaV0KaMTlSnBkrviPz1nIGHYCHJxF9r cIu0GSIyUjZ/7xslxdvjpLth16H27JCWDzDqIQMtg61063gNyEyWgt1qRSaK14JIH/DoYRfn jfFQSC8bffFjat7BQGFz4ZpRavkMUFuDirn5Tf28oc5ebe2cIHp4/kajTx/7JOxWZ80U70mA cBgEeYSrYYnX+UJsSxpzLc/0sT1eRJDEhI4XIQM4ClIzpsCIN5HnVF76UQXh3a9zpwh3dk8i bhN/URmCOTH+LHNJYN/MxY8wuukq877DWB7k86pBs5IDLAXmW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 29.12.2023 15:04, Johan Hovold wrote: > On Wed, Dec 27, 2023 at 11:17:19PM +0100, Konrad Dybcio wrote: >> At least on SC8280XP, if the PCIe reset is asserted, the corresponding >> AUX_CLK will be stuck at 'off'. > > No, this path is exercised on every boot without the aux clock ever > being stuck at off. So something is clearly missing in this description. That's likely because the hardware has been initialized and not cleanly shut down by your bootloader. When you reset it, or your bootloader wasn't so kind, you need to start initialization from scratch. >> Assert the reset (which may end up being a NOP if it was previously >> asserted) and de-assert it back *before* turning on the clocks to avoid >> such cases. >> >> In addition to that, in case the clock bulk enable fails, assert the >> RC reset back, as the hardware is in an unknown state at best. > > This is arguably a separate change, and not necessarily one that is > correct either If the clock enable fails, the PCIe hw is not in reset state, ergo it may be doing "something", and that "something" would eat non-zero power. It's just cleaning up after yourself. > so should at least go in a separate patch if it should > be done at all. I'll grumpily comply.. >> Fixes: ed8cc3b1fc84 ("PCI: qcom: Add support for SDM845 PCIe controller") > > I think you're being way to liberal with your use of Fixes tags. To > claim that this is a bug, you need to make a more convincing case for > why you think so. The first paragraph describes the issue that this patch fixes. > Also note Qualcomm's vendor driver is similarly asserting reset after > enabling the clocks. It's also not asserting the reset on suspend, see below. > That driver does not seem to reset the controller on resume, though, in > case that is relevant for your current experiments. I know, the vendor driver doesn't fully shut down the controller. This is however the only sequence that we (partially) have upstream, and the only one that is going to work on SC8280XP (due to hw design). On other platforms, a "soft shutdown" (i.e. dropping the link, cutting clocks but not fully resetting the RC state) should be possible, but that's not what this patchset concerns. Konrad