From patchwork Tue May 7 14:14:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13657176 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38DFEC10F1A for ; Tue, 7 May 2024 14:15:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8h2rglMTQgzZrV85lnUeQZBDv9LnvNA9+sanY6KkiJE=; b=nrtvmOSrlaaupB HrY8YKubL1397wWVSsRRsS4ctOrRdFkEp2rY3VHCKzPlaFgiB5fOibm2MB4Yzuwgg+S60FYGEEeN5 M8tPfDfBUrX2L3J96Q1j6qN1ORSomQqTfMquMxJ1ENGlWRzT7jAlzJskMgSvIaogrIInmZBTe76bR 3el1L5i0rkxOGQyhsaJwaSmwMpo1lLJC3L81T426FHaOPggN+UCLzYBn7LKx7xcZHM9jdCMUBiDSS SSrv9neiBGt5EkVdeELKtKhju1K9uklXDJqr+UNZpLluBHF1hb8+4EE0G3gjdlnMSGMUueZZHq9E9 SNnJJYSHx8MX61+nA6TQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Laz-0000000BQct-0Wku; Tue, 07 May 2024 14:15:05 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Laq-0000000BQRm-3TI6 for linux-phy@lists.infradead.org; Tue, 07 May 2024 14:15:00 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-572a06e47a7so224078a12.3 for ; Tue, 07 May 2024 07:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715091287; x=1715696087; darn=lists.infradead.org; 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=5eNwp1KeR6q1csnKLq9DFYvN46m+YqLkkQLc199nW5E=; b=IDnKevXcqBx+Jz1whFIQGFQid8dHrkWgk77CN/looAcpHUBKx1rr4Z6fD0ahNXWAw6 IDwWkgHpVVR8C65hymsAcwUfH6WNKIM77ySsPbxowY1IEMYlAAleOzBy5V/K0o1xEPgI X+8qIdhYKtqcSJgCz7t8WkDn7ex75gUO8hnX0Gvllo+M72BvfHyWH6hnmpyoOQ+bmLcF 1utNDJfPq+vUQfRDqczgTZk/IBmXk5RsV0GH+egH6pTbOo37a5op3h93fFDnHWK48EH7 K0jgIVBGRO6/QeOrSFEH6ZIscadJ7rGD6JMm1/8YpUrJvJt7ZdRyrnDkJNFPNEY+6IX1 KIOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715091287; x=1715696087; 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=5eNwp1KeR6q1csnKLq9DFYvN46m+YqLkkQLc199nW5E=; b=MNAPivdVLhZ2Y9z8jWGavxGh8AQYBNNfWQMhoBXgo5juPWqZB9lS2CNO82lOtnSp7d nMsBbpHwiuMIMVhoRb8rsFihPhjnfxXnfssVXiK/D6GPfjwCegDS1Qy30JGC+lnQg4cz s6mLkalxnDzWVaqxLqFdZEXp153iR/4rFTACS0Rk3l0bh1xPsJKg7odeWvZh4i75j0m6 eealoNYWq7YIBBEFm95HElkZ6obdQ5xaBjpEHSkZCbnJagwGzgXYUk5xCHyzsIuJ/H58 BJfR5OJA4sZ4aTIBYC6RxcoJ4nI08SIAVzQBBNyg10BZiOjruqMeJ2myC6eDgBkF6X62 n24g== X-Forwarded-Encrypted: i=1; AJvYcCVN+eqc7OkR1zKx1Yp3F1fFOZxkEa5sJF3j7iySopPka82JZ+QsUjDtRuoA/QOnL3MwoeR6EWnJ6ZH+FHJd6PWitwIxT4n8frcfphQG7Q== X-Gm-Message-State: AOJu0YzmecB87wHWr+jd/D1PRzFaPsdDzq8gswGhJqLn4lpU+EMn8Fg7 6xQnyRQOUSh2ZseX5EV2RXn3Gu1fzUVUWmAmbLUNZfJrKGoxi/ecsicCv/mBaTw= X-Google-Smtp-Source: AGHT+IFlhgpaj8s7Ylef1U/lb5hV3d+hj+0ADsOWoK2vF6wUkDdpIOR9A24GskIxbkz+a/2MUnIIDg== X-Received: by 2002:a50:8d16:0:b0:572:6ab0:6afc with SMTP id s22-20020a508d16000000b005726ab06afcmr9113193eds.33.1715091286727; Tue, 07 May 2024 07:14:46 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id x2-20020a056402414200b00572cf08369asm5621928eda.23.2024.05.07.07.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:14:46 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Tue, 07 May 2024 15:14:45 +0100 Subject: [PATCH 2/5] phy: exynos5-usbdrd: convert udelay() to fsleep() MIME-Version: 1.0 Message-Id: <20240507-samsung-usb-phy-fixes-v1-2-4ccba5afa7cc@linaro.org> References: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> In-Reply-To: <20240507-samsung-usb-phy-fixes-v1-0-4ccba5afa7cc@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Krzysztof Kozlowski , Alim Akhtar , Sam Protsenko Cc: Peter Griffin , Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9?= =?utf-8?q?_Draszik?= X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_071456_988518_57D99B7D X-CRM114-Status: GOOD ( 10.77 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org The timers-howto recommends using usleep_range() and friends anytime waiting for >= ~10us is required. Doing so can help the timer subsystem a lot to coalesce wakeups. Additionally, fsleep() exists as a convenient wrapper so we do not have to think about which exact sleeping function is required in which case. Convert all udelay() calls in this driver to use fsleep() to follow the recommendataion. Signed-off-by: André Draszik Reviewed-by: Peter Griffin --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index 2af192c15d78..1b209ab7a268 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -448,7 +448,7 @@ static int exynos5_usbdrd_phy_init(struct phy *phy) writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYCLKRST); - udelay(10); + fsleep(10); reg &= ~PHYCLKRST_PORTRESET; writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYCLKRST); @@ -779,11 +779,11 @@ static void exynos850_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd) writel(reg, regs_base + EXYNOS850_DRD_HSP_TEST); /* Finish PHY reset (POR=low) */ - udelay(10); /* required before doing POR=low */ + fsleep(10); /* required before doing POR=low */ reg = readl(regs_base + EXYNOS850_DRD_CLKRST); reg &= ~(CLKRST_PHY_SW_RST | CLKRST_PORT_RST); writel(reg, regs_base + EXYNOS850_DRD_CLKRST); - udelay(75); /* required after POR=low for guaranteed PHY clock */ + fsleep(75); /* required after POR=low for guaranteed PHY clock */ /* Disable single ended signal out */ reg = readl(regs_base + EXYNOS850_DRD_HSP); @@ -836,7 +836,7 @@ static int exynos850_usbdrd_phy_exit(struct phy *phy) reg = readl(regs_base + EXYNOS850_DRD_CLKRST); reg |= CLKRST_LINK_SW_RST; writel(reg, regs_base + EXYNOS850_DRD_CLKRST); - udelay(10); /* required before doing POR=low */ + fsleep(10); /* required before doing POR=low */ reg &= ~CLKRST_LINK_SW_RST; writel(reg, regs_base + EXYNOS850_DRD_CLKRST);