Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp188244rwb; Thu, 27 Jul 2023 11:09:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlHzpQBoGQ+MjmStRxw+hDQVJ7psDcCQmaooRFpBJn6s2h1zr0JqZcbRDvA6eDxS5J+A6Xcw X-Received: by 2002:a05:6a20:a114:b0:12e:92c1:b1c8 with SMTP id q20-20020a056a20a11400b0012e92c1b1c8mr5702055pzk.47.1690481347642; Thu, 27 Jul 2023 11:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690481347; cv=none; d=google.com; s=arc-20160816; b=TnNRkZCQoYPSqd/jOdA1R2bmzmSWkmsnKuVrIubYm1D1npGGuyaoGrlPhZ3EdcYaFB imHwQASyE6SU+Vf7bUvvp6KfQV32tHSKBJYkSJlw7PMcjqelVfIns1fkH3BlcFXKo+1h HtF9dOIeE1xxo7x2KH3hAOkroljX+EPRWiyhBMOKsCnsbsHSUK0KUaJeVTrfBtE9akkx YUyXYipkyEnpDFbRuJ9fKinfLfbSl+oBKLVad2PPm6JQ0npwA3VD7Jq20gr0ClHb/BbX eBjwJJWruwS16sLhRQOGFXt8bDz3jSKkQqNlSJ+7NU3/dk/Kwj/Ud9294R4JuN2tcmUZ i24Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=iSpTHH/r1JxU23dgkFFzwt7+DPhsvuwAB7Ss8YvVGLg=; fh=aPH9evBIXksq47QVc8sbcWRLKV1PEuKX/gfq3oF1plI=; b=JnGlzf9iLYcSKlUhxsFH288E/62qK8EboOOjgtObvKhfyb19N/HXrN0kFBYERYuNvb CY1KzpmBouZ9CUHJQp3vmNZoaj28rYcWuJLlqshfZQxnYQHsIkhO2sX7RHSfeJrOBTBk jVfVLsK4Ftnpn+TqOaM6qcEAIbYGMVveDjH3V8fMpojsMcgZIBsKQAQZ43/PJH95r9MB zDKbqhSDZpl+nvlp9qNek+xI+bxP4s+h+gA+zY34LJzLaWl+v6aigS+6HqFkJWN9lf2J FbYxCkN7qznxt9x/bOHuiEzNZozEpX+l11UFNifX/WNWfQURWJUfkJcIdHRLy8P2FB11 5iag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qv+50epR; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o2-20020a63a802000000b0055b1327cd9asi1554370pgf.175.2023.07.27.11.08.54; Thu, 27 Jul 2023 11:09:07 -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=qv+50epR; 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 S232845AbjG0RPS (ORCPT + 99 others); Thu, 27 Jul 2023 13:15:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233024AbjG0RPB (ORCPT ); Thu, 27 Jul 2023 13:15:01 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64B7F3A98 for ; Thu, 27 Jul 2023 10:14:55 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4fb863edcb6so2155261e87.0 for ; Thu, 27 Jul 2023 10:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690478093; x=1691082893; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=iSpTHH/r1JxU23dgkFFzwt7+DPhsvuwAB7Ss8YvVGLg=; b=qv+50epRJW2m0RTQy24stBR7Ea6w4jVRUZlsjKhN/t5rJRrulcqqJzDeLkWfL/8N1X Cl86IJZG5FGTz6SXAIncvYXWm6Fm8DbuUSk/5ojAr4dJ/0c5YPKN2I6D7Iy5w+stYGGA Skqu66Q4X7EmBIQ5811GQNsamCAzKoDbW0XUAePqr506lMRvMD49+YE16ZJv6pIeTpyP KYyXjBdWoJrZeZf/IQSRMqXdNzmuc1/PQnQ/E+8NFnZwR2+Mj8JkbdPchwB+Hxt/Frnn DLH/CdihVw0vlyWRR+SLWw+wqP5VzgNaaiE6ojbWk4sF4N346J3LLACw8rnAafKh2Cnc bqww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690478094; x=1691082894; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iSpTHH/r1JxU23dgkFFzwt7+DPhsvuwAB7Ss8YvVGLg=; b=As18HAuPUL7Ukx6xkYg8Niw5nMKhfcrUh4/cMr4JMJx/AKUPEDSW9neTbYcSAqAlef 9R07KJj60qLM3VNqKQyhnkbVcuvflMqHzePtls8x0g5DLQZKV1eKKhpOgDl48yV+WR3W oUFkzAQRBsQWGUnBTa6qGdJH8SkSVzh6myJ+QI1zGAcUfJSqgcSLBKtZbt96P0VWzSVD G0xdOEFmNfuiZdx1E1MTJtNow/M4ZrMCYwT36wmDBZkbMOqMRAZbBBGbTDUbonlGnscg Mp66ydkrsSyklnRvT6HVWrEo94cTrwTGX0zM2vu0bkIqKe5Syky2kAUznEC8LoF1QNp1 lbLg== X-Gm-Message-State: ABy/qLZOlEj8Vp1rRML7Z8PFZMEqYjozQGZ8cXf603GkcXf2WYaRBOc/ zg/8010OrSHnkyzwIsDM9L9r9g== X-Received: by 2002:a05:6512:31c8:b0:4fb:79b5:5512 with SMTP id j8-20020a05651231c800b004fb79b55512mr2543259lfe.66.1690478093616; Thu, 27 Jul 2023 10:14:53 -0700 (PDT) Received: from [192.168.1.101] (abxi99.neoplus.adsl.tpnet.pl. [83.9.2.99]) by smtp.gmail.com with ESMTPSA id w3-20020ac25983000000b004fb745fd22fsm396321lfn.32.2023.07.27.10.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 10:14:53 -0700 (PDT) From: Konrad Dybcio Date: Thu, 27 Jul 2023 19:14:52 +0200 Subject: [PATCH v2] clk: qcom: reset: Use the correct type of sleep/delay based on length MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230726-topic-qcom_reset-v2-1-4a6e1b1d0439@linaro.org> X-B4-Tracking: v=1; b=H4sIAAumwmQC/32NQQ6CMBAAv2J6dk0phIIn/2GIKcsKm2CLWyQaw t+tPMDjTDKZVUUSpqjOh1UJLRw5+ATmeFA4ON8TcJdYGW1ybU0Jc5gY4YnhcROKNENRVLZGnVc WS5Wy1kWCVpzHIYX+NY5JTkJ3fu+fa5N44DgH+ezbJfvZP4clAw216ajscirQ4mVk7yScgvSq2 bbtC7Upw0XGAAAA 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=1690478092; l=1491; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=xqeqeSVrD0FBd4SOIFWeQ28YnpPrZTJ5YRxUYScajcU=; b=9sr4XmOp/nvWERoHxxSOCtWnpIp7SRhiQaK9RL70JkydIWtsE/EDWgOxa94U8MeYcBjq8s8gf OtpNeD7j0kWCvQVcTDzKi+WnZU6s51PcElo3QvVSYPF9YTxz86PEvdT 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 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 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: 2cb8a39b6781 ("clk: qcom: reset: Allow specifying custom reset delay") Signed-off-by: Konrad Dybcio --- Let the toggle include a bigger delay and make sure it's using the correct function to achieve that. --- Changes in v2: - Drop the "allow bigger delay" until there's a user - Use fsleep instead of open-coding effectively the same - Fix the fixes tag - Link to v1: https://lore.kernel.org/r/20230726-topic-qcom_reset-v1-0-92de6d3e4c7c@linaro.org --- drivers/clk/qcom/reset.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/reset.c b/drivers/clk/qcom/reset.c index 0e914ec7aeae..e45e32804d2c 100644 --- a/drivers/clk/qcom/reset.c +++ b/drivers/clk/qcom/reset.c @@ -16,7 +16,8 @@ static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id) struct qcom_reset_controller *rst = to_qcom_reset_controller(rcdev); rcdev->ops->assert(rcdev, id); - udelay(rst->reset_map[id].udelay ?: 1); /* use 1 us as default */ + fsleep(rst->reset_map[id].udelay ?: 1); /* use 1 us as default */ + rcdev->ops->deassert(rcdev, id); return 0; } --- base-commit: 451cc82bd11eb6a374f4dbcfc1cf007eafea91ab change-id: 20230726-topic-qcom_reset-44879c0387c6 Best regards, -- Konrad Dybcio