From patchwork Wed Jul 26 13:26:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 126390 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp428049vqo; Wed, 26 Jul 2023 07:07:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlH6qM75kQpVUHPpBvqqN3iLRpk1S9T7KCAkapmp07lhCzadfb9FOXrXbOwDt2zaO5ebiFB6 X-Received: by 2002:a17:902:934c:b0:1b8:954c:1f6 with SMTP id g12-20020a170902934c00b001b8954c01f6mr1971174plp.36.1690380454801; Wed, 26 Jul 2023 07:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690380454; cv=none; d=google.com; s=arc-20160816; b=fnOht889ciFvBYh8DR1wuUO/WLuX6A7eZDvGxVtCdrhg7j0NshbUwy/6pVjYgfEUyS SCX35REUUAJhDysnTfbAFqIxmvhFe1vL7/LB0Slla/QtVAKDmaJvT7RWjtMCpDMZN+ht j8OBW4qgqTnyrdGcu//Y81jIStC6gM+99mSV4eKxhcMd/MU6eWwS3TriB/ynZE22GhHS B/jcperf+vLzlr//+r6ODNMEYmYGrhvUwXQ6OjYV245UDJNv8KzFkkJL14z86qNMjNth 9dzz+Qdy2YrgpI5Nwr+uj0cgJFwVDV4ZnT0g+b2ohKD8J2fP6/apcnQvVaJ6+058ul2f eCqA== 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=XwjQCpCfOEJj4nimKSDJjPHZcz9ikZvmWQ7qOX3431M=; fh=aPH9evBIXksq47QVc8sbcWRLKV1PEuKX/gfq3oF1plI=; b=hldQcPzVY4GSDvzSSGyh1NiNI6psijzh6ojHYX/9Q/N2Dd0u/BNU4nqL1v3V4Obinv egdSbOcWv8Y7G2xfKG3jY+TYlkgVTfIP6bLKpOZN9frEKTxJLnFqJt2q/RxHyGyIU7Q5 vdToAQTsRmr891nK6+PJnwa9wQl4Wzb/CFKvvv1TLF5XcHzqyujdQbkJ7NDhFn5dJsGi TuhBXLL5e1hKR+ffxbG6lbLaNcw0EwZg8P88239bUGbebYha77vMLyIs+GZ+fU3kQQGG CLdrONQ0EXsEMlJbWhYRo7eWyO2574KUykgQxTXUOmvjCWmidew0zl0JapAMayWofgKn LCqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zT/i9uuR"; 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 z2-20020a170903018200b001a6ade4c8c2si14273212plg.142.2023.07.26.07.07.19; Wed, 26 Jul 2023 07:07:34 -0700 (PDT) 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="zT/i9uuR"; 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 S234116AbjGZN0e (ORCPT + 99 others); Wed, 26 Jul 2023 09:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234073AbjGZN02 (ORCPT ); Wed, 26 Jul 2023 09:26:28 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9573128 for ; Wed, 26 Jul 2023 06:26:26 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4fba8f2197bso10765991e87.3 for ; Wed, 26 Jul 2023 06:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690377985; x=1690982785; 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=XwjQCpCfOEJj4nimKSDJjPHZcz9ikZvmWQ7qOX3431M=; b=zT/i9uuRDt+yId4R1ojSpNSvcir6tRZadDAbV6Wny2zZu0Lyv3Wv+qbzRW5a8XiB4A ZvF2LIdzy8OE0XVEGVU0tDXtZjZQnJKlV+XxK/97TN3oTlKMkPy51JDAQxE8M8HhQfFL jRUDCgvwqMi+Cpd+6Ka9T7e9YiRY0rNwwFJphX4b8amOR6SUFJ8lCLiNzPEvVHtKSGP4 S+QwI73+2ZhZcQmEEYq1HzjiE8SCNEzQJRXDUyZdolOFo6Ai4jtgX7tTpwxTgIMkf09X sNBzxZdAgeutTn55bW9KECHSF6Sf9qzfIt2g65GJbCi5vNZrZcOvqhof8MDPwdS7CvOF UVOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690377985; x=1690982785; 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=XwjQCpCfOEJj4nimKSDJjPHZcz9ikZvmWQ7qOX3431M=; b=eRWKLaSDWsTmF4fDWHj4O47dk31/NMvrYQrqQbJQ1Mu3RkNPAmfSX0IXDBzgK891/R KPVM0N/Dow72AQd77gSEgSZT+bjMGJ2m8N4NlsB7DfmkAqos5urHSN+ZTN1bRUMmCHKK xU+4b4RPESEKNd8sEA+XHNq7vD/5zXJ54cqxmYmCgT5Fgp5dMbEAx9HpbASwu1KOqYiP MRuF7PVteTH3o2BJgmc6oP7sYeRoNz5SnEw0UWDIT9NFYNC2e5oYKdKuCKP7WpryChWX VOlsjPbNAyvWU3O/EHH8A0NOIWY9ejJBq5iwLCgI/lqpFXqXibbwNOl0Sg2cBuSWgOXu 9Blw== X-Gm-Message-State: ABy/qLb9960/8Z+kOG964RhzDVvz5dolLzIxyCkybQnZzFviKJr4AfkD AUF0jDdeiAiDw5AbKpPn1vbK5IohVbafRBh3bxowHw== X-Received: by 2002:ac2:47e9:0:b0:4fd:d08c:fa3e with SMTP id b9-20020ac247e9000000b004fdd08cfa3emr1296999lfp.42.1690377984838; Wed, 26 Jul 2023 06:26:24 -0700 (PDT) Received: from [192.168.1.101] (abyl59.neoplus.adsl.tpnet.pl. [83.9.31.59]) by smtp.gmail.com with ESMTPSA id q20-20020ac24a74000000b004fe08e7dfbdsm742265lfp.44.2023.07.26.06.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 06:26:23 -0700 (PDT) From: Konrad Dybcio Date: Wed, 26 Jul 2023 15:26:19 +0200 Subject: [PATCH 1/2] clk: qcom: reset: Increase max reset delay MIME-Version: 1.0 Message-Id: <20230726-topic-qcom_reset-v1-1-92de6d3e4c7c@linaro.org> References: <20230726-topic-qcom_reset-v1-0-92de6d3e4c7c@linaro.org> In-Reply-To: <20230726-topic-qcom_reset-v1-0-92de6d3e4c7c@linaro.org> To: Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Mike Turquette Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Boyd , Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690377980; l=566; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3BR/u3fZ23sS3+cIHldabWhPszlrqMwlNCmlfPyu0J8=; b=Mn8YoTIjy0jBDF1F4mmrxLegHBGFymzW0x8yviOJWut/dGKoR7DuQtPkKRGA5V7MYFxpTQACp 2hzWsnFMoijAgoHUDZIvSRJ3l04idJiHatC6NuG1IqwsnnSRDCz5Ux9 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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: INBOX X-GMAIL-THRID: 1772492375469576874 X-GMAIL-MSGID: 1772492375469576874 u8 limits us to 255 microseconds of delay. Promote the delay variable to u16 to hold bigger values. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/reset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/qcom/reset.h b/drivers/clk/qcom/reset.h index 9a47c838d9b1..fe0561bf53d4 100644 --- a/drivers/clk/qcom/reset.h +++ b/drivers/clk/qcom/reset.h @@ -11,7 +11,7 @@ struct qcom_reset_map { unsigned int reg; u8 bit; - u8 udelay; + u16 udelay; u32 bitmask; }; From patchwork Wed Jul 26 13:26:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 126387 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp417700vqo; Wed, 26 Jul 2023 06:53:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmL+wf4tQXQNorfxjNCegNt1gVHA5ayoFwZ2luxgyp+e8Ogvou1o9breH+TFILbxpaWbyJ X-Received: by 2002:a17:906:51d3:b0:992:b020:ce4 with SMTP id v19-20020a17090651d300b00992b0200ce4mr1830357ejk.51.1690379589717; Wed, 26 Jul 2023 06:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690379589; cv=none; d=google.com; s=arc-20160816; b=wBfyCOgcQIskd9JXIjn3Ycx9E02E6NQyGGiQIFLEMikc9NXvVY1SW5hKjdIgqy8yyj TImelCBBQUrNn42+RBmzLnEl76poUrPGXMBL7zlXS7Mn0YyHYBsbT1tCMoEnQArGOJ7/ liQAGtGTTfrgsHZXKxso8g3kzTRFv94CNykZYT6XUMp0DsLI6pz2mkic4H37qICI6Yo/ Zzu2XV9EsoMHhbg0hjSYjT+8sPM6IcR5yVzsCtmwVpKe28+tIHF7Xj9LSoSvN9j75rnu 0bW13Cv0fWiJrhvXOQ3JaoIRusgXglaYs79cvysWbKQG2GHvLy8uBJUQXtuvlQtgJJqm RYIg== 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=FlYno703h9Rc07Q4o0xGriJ575A5cS8B+AAXSkAUxQ0=; fh=aPH9evBIXksq47QVc8sbcWRLKV1PEuKX/gfq3oF1plI=; b=DVArFm2DuBZAkX8nGv2/fmCU4SIAjtBdD+6bQ9KrdfvnZQycrNVeev8bNHDPdcBqdV OGgvnTYqq0nViL/X+v1eBS1Mw0TtoFBGOlJrLT6omeSLjijko5nbXfVr2aSniY1MqswN rvxxuZH3jdcG5SzHBbEE6lz/tkOODrqEHf96oowYGRIaV5ToJlp6lhCHJwTrBHAt47vh Zj6oFv/PMls/G6CQI8Yaz9d6ebLMjzmtb9Y66gUmJTzsOSe9gK/5QRw2m7iDFkSaiBTf xtcB+ZL0fKDmJR9h0YnoPWdsUb0V2TNrXOH2q995x1iu64oNVzQId/+9nDgFojXEsLSb QvWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u0gVsT2J; 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 dk12-20020a170906f0cc00b0099302221714si10203741ejb.790.2023.07.26.06.52.44; Wed, 26 Jul 2023 06:53:09 -0700 (PDT) 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=u0gVsT2J; 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 S232432AbjGZN0i (ORCPT + 99 others); Wed, 26 Jul 2023 09:26:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231579AbjGZN03 (ORCPT ); Wed, 26 Jul 2023 09:26:29 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6078B1FEC for ; Wed, 26 Jul 2023 06:26:28 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4fb73ba3b5dso10770348e87.1 for ; Wed, 26 Jul 2023 06:26:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690377986; x=1690982786; 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=FlYno703h9Rc07Q4o0xGriJ575A5cS8B+AAXSkAUxQ0=; b=u0gVsT2JW2shLoA3VJTEMT68XNaOEiMPGz0lsmF3Xn1zRArnR5Iellu+Yu3PdmWRTm IxwO+ywuyR5QWy8G2v2Li0dUNsH1z6Fp7kwBP301kLjlSMfbsS610P1c5shjPX/stse1 H1jf1MtER0NCWBFDg/fvxEq7Zzog5hpcTiwmuumR9pQEasSOJiGycTr0EuoU+ItXEkGJ +u+UY1uvuiAfzT41lNBJOW9IOCppqP6jLNGi/8shD+3JEvCA5WVVka8eparOOgSdAsws LsQPDchnI9IoJeYnjSX5wcu59UdrT1VfbWj9Ogpqo4AmDcdGumetwFywhaIw7cOXvcvo Bsqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690377986; x=1690982786; 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=FlYno703h9Rc07Q4o0xGriJ575A5cS8B+AAXSkAUxQ0=; b=RKqhR3xJzY4YJJRA80NWUaL5Wo/YnjDW6qnMvVs0xN9gILfBVB3b+4MI8zNG8iVd8P NPbzYuCZ885pyDdzAjU07hXLWLdpfJlRGgzRED8Sb0fbaSHsSkHcC+V/gLJaHO7mJ1Z+ Luzf36cN87/hSHj9pkS3PrDnjfhBJ48WvHRlbrdARqj5iDNptU/MJv92QkyIRCt5yRKg 3tKfSU0h7zMm4mEraanVpJz8TQ+mbgrO3S1NeE7vc+CPHm/8+zd0MxMmh2QzEejru+2a xgUB5EmewKsJCgoZmzpztMeEndqIbFxEnkMPSjOWTz+YhD+jaHiq1hxb7rrU+TnMPRpk Usog== X-Gm-Message-State: ABy/qLYTRLuWKOQcbsA8n69sWlgpZUxD3YBNNrtOmSpxd0FVgGMJgjAw MwJQazXDKn3i1fS1QLWed//feEuh23pidZfmyD6/wQ== X-Received: by 2002:ac2:5f81:0:b0:4f8:49a8:a0e2 with SMTP id r1-20020ac25f81000000b004f849a8a0e2mr1380217lfe.16.1690377986567; Wed, 26 Jul 2023 06:26:26 -0700 (PDT) Received: from [192.168.1.101] (abyl59.neoplus.adsl.tpnet.pl. [83.9.31.59]) by smtp.gmail.com with ESMTPSA id q20-20020ac24a74000000b004fe08e7dfbdsm742265lfp.44.2023.07.26.06.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 06:26:25 -0700 (PDT) From: Konrad Dybcio Date: Wed, 26 Jul 2023 15:26:20 +0200 Subject: [PATCH 2/2] clk: qcom: reset: Use the correct type of sleep/delay based on length MIME-Version: 1.0 Message-Id: <20230726-topic-qcom_reset-v1-2-92de6d3e4c7c@linaro.org> References: <20230726-topic-qcom_reset-v1-0-92de6d3e4c7c@linaro.org> In-Reply-To: <20230726-topic-qcom_reset-v1-0-92de6d3e4c7c@linaro.org> To: Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Mike Turquette Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Boyd , Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690377980; l=1045; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3sxskWG1FiMzGN6odih/2AzgyX1UlY1CqV7tLRwSv/4=; b=saOq9jwbZrvjAwZ97NcbMwHI/ViisOkxLpymdQaHubISBRKSsBjABT2TlxD70zhxtbW37nY7H 7yxUvSV7wOhAYT6i2QpsmQex8EMcwjNG+8KGbr+FDpAO4oYeqoTm2os 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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: INBOX X-GMAIL-THRID: 1772491468925039471 X-GMAIL-MSGID: 1772491468925039471 Based on the length of the delay (see: [1]), use the correct sleep/delay functions. [1] https://www.kernel.org/doc/Documentation/timers/timers-howto.txt Fixes: b36ba30c8ac6 ("clk: qcom: Add reset controller support") Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/reset.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/reset.c b/drivers/clk/qcom/reset.c index 0e914ec7aeae..928995c3f369 100644 --- a/drivers/clk/qcom/reset.c +++ b/drivers/clk/qcom/reset.c @@ -14,9 +14,15 @@ static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id) { struct qcom_reset_controller *rst = to_qcom_reset_controller(rcdev); + u16 delay_us = rst->reset_map[id].udelay ?: 1; rcdev->ops->assert(rcdev, id); - udelay(rst->reset_map[id].udelay ?: 1); /* use 1 us as default */ + + if (delay_us < 10) + udelay(delay_us); + else + usleep_range(delay_us, delay_us + 5); + rcdev->ops->deassert(rcdev, id); return 0; }