From patchwork Fri Feb 17 10:46:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 58484 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp816820wrn; Fri, 17 Feb 2023 02:48:09 -0800 (PST) X-Google-Smtp-Source: AK7set9yegSJqXf8v5h7r2NmeB+STYShgGMgirmqMzB213aOFouLv35lnvFkaJXZlPK5AcYCNBUs X-Received: by 2002:a17:90a:1ce:b0:234:8950:6d1f with SMTP id 14-20020a17090a01ce00b0023489506d1fmr6365791pjd.11.1676630889511; Fri, 17 Feb 2023 02:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676630889; cv=none; d=google.com; s=arc-20160816; b=QRf5fGQGAIeUXPwqlKpfgBTnBbf1BntCKClSrsHGfrc/wpNvLr6+7qPPuoVLvB8Hz+ lZH6t5Vnc0Dquf+59Ls0XG0UtguWqjkvXDvjj1/5eDsJOrCsmA0T3k50mO44sP0l/ahx ZA/2t9RcpDK1BkxfINTQihA8k360gaB2R4tdXsfq8PdQmwiBfuK0ofSJOapx3HIJDA+y Aoqngj/56nPtdpQwNP58Ps9N0iu2zp4sNUoqWF9KKEXw7GcLMyPCimY15N/OUwajhHdj A8M+tmP7lo1hPqAlgEIXpni7c4wKeMbhXqKsvC6WpLnBW5uDUHo9rFfNAQUnXab/jpSF dTOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=EoiQaMMXwDXYQsRgtWV4mTA63/tUIiHdh1PBizMV2mE=; b=ZA1fMDqraUU6OiaDeHzvn+EDPX90IILLMT1U2yBHORiFm5J8waPZZQW7bapyekQS/f R5jklPPnihI7V5RxQhKIIVgDTpOBsYac7Td3uyaFeb6cA+bM2PoNbg00//pi3n2BiYnT wVmW88dB0gSm+jitnufinJobL/cg2vSlO8U6FX4d6bB+jnpk6W3lmeOMBVzbwOOgM4o1 mRyj33lio4WPf8X7Fu/4Mb2UbQ6UVWdzfLKuLlPYEqaq2M3ai3O5iDDVZdwRXw2q5VQu VokMs5LiGBS33Ntv9pY9dlxO2zNOvsoh+vrTLRfPZXURhWjzQA2Rfkl7yv3drl19XQi4 6TlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q/Tk77C7"; 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 x126-20020a633184000000b004ee642e01bfsi4689380pgx.214.2023.02.17.02.47.57; Fri, 17 Feb 2023 02:48:09 -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="q/Tk77C7"; 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 S230029AbjBQKrE (ORCPT + 99 others); Fri, 17 Feb 2023 05:47:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjBQKqq (ORCPT ); Fri, 17 Feb 2023 05:46:46 -0500 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C6C1644C1 for ; Fri, 17 Feb 2023 02:46:43 -0800 (PST) Received: by mail-lj1-x22a.google.com with SMTP id bx13so681500ljb.3 for ; Fri, 17 Feb 2023 02:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EoiQaMMXwDXYQsRgtWV4mTA63/tUIiHdh1PBizMV2mE=; b=q/Tk77C78rdYacg8u6jmhO6XQ8QhPm8IuVF1gXA7/t4slxvyDOUATh9eTr9WZMm3x2 JmGB+dCuADdZBX+izzyPfR146hCh1b71sq1JvooAFIydPEPgS9iXxf0GtEQ7P+kqZaUF 21B1ZDShbKjGjRGZot8kZIvdJ8VQTvkUnnabYiA1306obHAW1kHoMi7PhrMPrjSNl2Ws 53okno+fyjuKh7nSSxEOsjmUCM0rqbjVGxi4CraLS9bTSjNp1iq2eHTOpDbuiVCft3yx PnSK+P9r2F9cXP9VXD2dcKmDpNCg+npqD2aLi63AF7nQdyIr10fY1j/JoXZND53rhA3e EeYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EoiQaMMXwDXYQsRgtWV4mTA63/tUIiHdh1PBizMV2mE=; b=DDQgqVwa8ZkFJiYxSTRTO7fhaqsQM0w2f7EiKk0xwm45Dq0RH/5/DWTHNNdVnNj6Mo RDx6K5lgJBngGqqkr+y6f0GTHnuGXaySi5VYzcguO507iBijCt0P5939DwDldMGlhxS5 adg1EJAX7DdTtu1qZk4xRPXxJlQ6Szs8Ax+oNmyDsrlnFi8Bphcov1qfLMOm7R6L8bDB 72yBRRBZlQXnZSjP6hYUBiq2iPwLvpeUJV6U57v8FDhwmnrxD2fP+rXAsGFWDXqqIWsy 78no2TetJaq5U5+NvESNlE3zJPfwnkiOKvQvmhRTpAcugzCI4TYv3lKvzl/E74KdBmmy /wHg== X-Gm-Message-State: AO0yUKUbLv3kQeIXo9ISqMwYeBUzWlN3BusBQnvImnpjjhzQergiCDbg 9WO0eHXYBkOvhhGz0668fVmgOQ== X-Received: by 2002:a05:651c:1991:b0:293:4477:5df with SMTP id bx17-20020a05651c199100b00293447705dfmr132480ljb.37.1676630801874; Fri, 17 Feb 2023 02:46:41 -0800 (PST) Received: from [192.168.1.101] (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id c13-20020a05651221ad00b004b53eb60e3csm645940lft.256.2023.02.17.02.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:46:41 -0800 (PST) From: Konrad Dybcio Date: Fri, 17 Feb 2023 11:46:28 +0100 Subject: [PATCH v5 07/10] interconnect: qcom: icc-rpm: Allow negative num_bus_clocks MIME-Version: 1.0 Message-Id: <20230217-topic-icc-fixes-v5-v5-7-c9a550f9fdb9@linaro.org> References: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> In-Reply-To: <20230217-topic-icc-fixes-v5-v5-0-c9a550f9fdb9@linaro.org> To: Andy Gross , Bjorn Andersson , Georgi Djakov , Evan Green , Jun Nie , Greg Kroah-Hartman , Brian Masney , Dmitry Baryshkov , Yassine Oudjana Cc: Georgi Djakov , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676630791; l=1103; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=0zGQQ3Z8BxpWRbcjEih3N3lnw1JS4c/rutJ4C0HFNWc=; b=m8qeHutvzcJ9ghyjAS6EUExhare4+FDIPLNFYVJDwolT4L6g5zbqa4u9OUFWtbvi9sW/+x6qgHQm eu8r8e7JCKUQ7SUDaEv8aS/POTgMNM7b2GDVLDh5epXKrW7mS/eU 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758074911656029716?= X-GMAIL-MSGID: =?utf-8?q?1758074911656029716?= In some rare cases, buses will not have *any* bus-scaling clocks, which is "fine", as the voting can be done through RPM provided that the necessary QoS clocks are enabled. Allow specifying a negative (-1) number of clocks to make the driver accept such cases, without having to add a lot of boilerplate to all existing ICC drivers for SoCs with SMD RPM. FWIW this value was previously being assigned to a >>signed<< integer as well. Signed-off-by: Konrad Dybcio --- drivers/interconnect/qcom/icc-rpm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h index 729573f0d9fe..9dd631964b8c 100644 --- a/drivers/interconnect/qcom/icc-rpm.h +++ b/drivers/interconnect/qcom/icc-rpm.h @@ -96,7 +96,7 @@ struct qcom_icc_desc { struct qcom_icc_node * const *nodes; size_t num_nodes; const char * const *bus_clocks; - size_t num_bus_clocks; + int num_bus_clocks; const char * const *intf_clocks; size_t num_intf_clocks; bool has_bus_pd;