Message ID | 20230304-topic-ddr_bwmon-v1-0-e563837dc7d1@linaro.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp975804wrd; Sat, 4 Mar 2023 07:42:00 -0800 (PST) X-Google-Smtp-Source: AK7set8XPKx9tqAkHc9CMtymf0RgyUgSRkneKAx1+eSFOUcUKRN/ZrcwKVact993JWMClLw/dgky X-Received: by 2002:aa7:c1c7:0:b0:4af:63a7:769b with SMTP id d7-20020aa7c1c7000000b004af63a7769bmr5347415edp.8.1677944520271; Sat, 04 Mar 2023 07:42:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677944520; cv=none; d=google.com; s=arc-20160816; b=n/K+dZskbWkRkkSW+tYR0YFL/gd1gF2aVrjH275wzGE7Urcaw4hXgctVA8Gk/0UtIe r5xKEUN9xSFPVLhoR0PEHSbNKh2sX3t8fYq7ym7SBWmquI2fLZNJjsd5RiNwRpCK1ucr r/SsVV1Dlu3lBLXkbY0U2Pyr4oxtbXSCIfrotaD/ExWzXyZ1XOgMdPaMfoiRD+T+wwIW w5NdQwAYlJ18G69Ap03qrGYV5oaN51tqQ0aN6sdhyQvCPf/QPSp29o6CXslPpKVZH6zu eIqJ0WIyiOw6JC2tKtRWE8tWpjG+k177T7G/CmIw4JfJ6omp872nj4brds/bs6y7ohxz HHig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=9paeHp+07qtpfuYo/tQXtDjNkaBqslOTssto+pQozeo=; b=hiaGTm9ta/o1GI4RMqcWCrjmK32gfgzQO2cWcZOf7TPJV4Rp7X3c20eb80Q5KWCYC+ SOQpPq4GsFAiB6rgvjBRQ6P/xC66LiLUyS9ZtY4VQmcDIJLKzCmWvgDA5o2Xegz1QVlS 54XuJbfUCFe1vMICJVonTUjJT+IFFOoazh06liJeCZfoEoMDLEmqnip2jIS93AMSvX/q YoJFO2VkgaRO9D9m6taVLYu+V01fO/bzXIRMXvMd031nsBXbicjme/cBZBjqunzqNw/N UEkmKmntKQPTQSQxU3usgc0LpM3kTdp3NGaDdsdr8QlmSHxGVZrugAySA4gxGFEW796k xYgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CuS1rbme; 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 d9-20020aa7d689000000b004acbde75cd0si2487859edr.100.2023.03.04.07.41.36; Sat, 04 Mar 2023 07:42:00 -0800 (PST) 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=CuS1rbme; 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 S229673AbjCDPjb (ORCPT <rfc822;kernel.ruili@gmail.com> + 99 others); Sat, 4 Mar 2023 10:39:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbjCDPj3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 4 Mar 2023 10:39:29 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44FAABBBC for <linux-kernel@vger.kernel.org>; Sat, 4 Mar 2023 07:39:28 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id t11so7326017lfr.1 for <linux-kernel@vger.kernel.org>; Sat, 04 Mar 2023 07:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677944366; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=9paeHp+07qtpfuYo/tQXtDjNkaBqslOTssto+pQozeo=; b=CuS1rbmeyF9jWQnBlPitLbL8VaTcKqsbyS/ObvHmoHemsLv0X/4deI63Z1MFKXQzS1 zsbP3yW8kroFZIlmyHOgY+80/zHheHwJ/My0IRM2RfDGQwp9hItbWJPH6FUSn+1Nn98w 48HbpiT6DY/7QUEXZiAybJD+F7XHukJFXtjrDlG0JrDXRdDFkkJdnNgIKh4iSgri3iI4 x7FWPEy8HN8721gkkFqxCzm5m/45q1imdyYU40q/BJBAZCJLToXPouzfY8pa5xCywN8V Ct4GO+NXd9anikiKiym5lZbKBNciHEmTYJ9A2DTlY67X7otmp5fXExuctd6ivaVExEca Y7yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677944366; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9paeHp+07qtpfuYo/tQXtDjNkaBqslOTssto+pQozeo=; b=xRF3JWpFc2+73vMT8ljrQ+c3e2sbPv/EAma1Kml3wXPydd6wp9AHLWjDbNOaZxbZnp cl96JZcCVbSHQePnpz4nlbL9So9KQSlZJGB9YP4eu6znIwrH+TJOuITIWK376DQOD0/d LQRhOGGQrB/EK2xB/PTW77SM7X6CoPGvdm3UBcTKU8xhp4RpOT58sHiIHbB+L0KCGROT 6b+SJeOJmhFAwsI1+KE/mBcg43Hj218pZtu/WJpZFish8XTYTAf54EcBzbjAwPKgGpJx knVhoKsM8Xaa061LAcaAFYPHth0n/r3ZSBXyFm3M1mc3msQi4kjPvMdFgAzgxKJV8rCK 3s0g== X-Gm-Message-State: AO0yUKW6EDK+r1KCvm0+4Rafrglcpy6gRe1SMIePwaQvwCtmxkJszIQd 6QI1aQKLX9L2hsmsQp18A2+ujA== X-Received: by 2002:a19:c208:0:b0:4bc:af5:b8d9 with SMTP id l8-20020a19c208000000b004bc0af5b8d9mr1289964lfc.6.1677944366490; Sat, 04 Mar 2023 07:39:26 -0800 (PST) Received: from [192.168.1.101] (abym99.neoplus.adsl.tpnet.pl. [83.9.32.99]) by smtp.gmail.com with ESMTPSA id f14-20020ac2532e000000b004ab52b0bcf9sm855065lfh.207.2023.03.04.07.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Mar 2023 07:39:26 -0800 (PST) From: Konrad Dybcio <konrad.dybcio@linaro.org> Subject: [PATCH 0/3] Fix BWMONv4 for <SDM845 Date: Sat, 04 Mar 2023 16:39:18 +0100 Message-Id: <20230304-topic-ddr_bwmon-v1-0-e563837dc7d1@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIACZmA2QC/x2NWwrCQAwAr1LybWDdbQW9iojsI9pAzZZs1ULp3 Q1+zsAwGzRSpgaXbgOlDzeuYnA8dJDHKE9CLsbgnQ8uuB6XOnPGUvSevq8qeHJn530uA4UBrEq xESaNkkfr5D1NJmelB6//zfW27z/tl1ykdgAAAA== To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Georgi Djakov <djakov@kernel.org>, Rob Herring <robh+dt@kernel.org>, Thara Gopinath <thara.gopinath@gmail.com> Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio <konrad.dybcio@linaro.org> X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677944365; l=2383; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=fwdbbzi8OngqlWoVwF8HJxscMkiKpnd+ydCW2XQ3Bb4=; b=Ywxdv2lXbMrvAoH/8qjB+lGNe2qfxuooyV4dR+6Bkp7KO0Z4YC+d4Z9Zo9CnPA3P1/RwlT8SZIaK NrrcInHwB+MTJP1zEJSgXYwsJlfJtRwfX4xe9PmC3fa4uVXmJHRn X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759452353487461080?= X-GMAIL-MSGID: =?utf-8?q?1759452353487461080?= |
Series | Fix BWMONv4 for <SDM845 | |
Message
Konrad Dybcio
March 4, 2023, 3:39 p.m. UTC
BWMONv4 (the one used for DDR scaling on all SoCs from msm8998 to sm8550)
features two register regions: "monitor" and "global" with the first one
containing registers specific to the throughput monitor itself and the
second one containing some sort of a head switch.
The register layout on all BWMON versions an implementations up to that
looked like this:
|..........[GLOBAL].........[MONITOR]........|
however with SDM845 somebody thought it would be a good idea to turn it
into this:
|................[GLOBAL]....................|
|....................[MONITOR]...............|
Sadly, the existing upstream driver was architected with SDM845 in mind,
which means it doesn't support the global registers being somewhere else
than near the beginning of the monitor space. This series tries to address
that in the hopefully least painful way. Tested on msm8998 (the count unit
seems to be wrong, should probably be 1MiB and not 64 KiB but the point is
that this series makes it work at all, as without it the headswitch is
never turned on) and SM6375 (with the "combined" layout introduced in
SDM845). Equally sadly, everybody uses the qcom,msm8998-bwmon compatible
(which frankly should have been just qcom,bwmon-v4) that never actually
worked on MSM8998 , which prevents us from handling it in a simpler way..
While at it, an unused struct member is removed.
One suboptimal feature of this patchset is that it introduces an "invalid
resource" print from within devres. This could be solved with an
introduction of devm_ioremap_resource_optional or by dropping devres
functions in place of manual handling, which also doesn't sound great..
I'll leave it up to the reviewers to decide.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Konrad Dybcio (3):
dt-bindings: interconnect: qcom,msm8998-bwmon: Add global registers
soc: qcom: icc-bwmon: Handle global registers correctly
soc: qcom: icc-bwmon: Remove unused struct member
.../bindings/interconnect/qcom,msm8998-bwmon.yaml | 28 ++++-
drivers/soc/qcom/icc-bwmon.c | 137 ++++++++++++++++++---
2 files changed, 142 insertions(+), 23 deletions(-)
---
base-commit: 1acf39ef8f1425cd105f630dc2c7c1d8fff27ed1
change-id: 20230304-topic-ddr_bwmon-609022cd5e35
Best regards,