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: 13657202 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 08193C25B4F for ; Tue, 7 May 2024 14:15:32 +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=OdeGiD0BwrZG50/0+ebYyUl7dO8FAiq3ltcs2PLTY6U=; b=fcRql+PCiDPtDu lx7ZlkTJJO3ugoJrpQ6suaZpdQj+AugPyCcnKvYfpQ8/5wi8Z4Nk0j1LDkHVTNPglMmOiwqsH1TS6 VazZrMvo1iDQ8z7QnNnJe+8KUUQKk142qdWuVIbfamGi+LkP1UTrl0G8w3TUuKm6pt/mGgDD+86+G PnKzhXS9Lwd7syXwEcuY8KTg+SdbyoIq4JlyphZiaPi5HG7/PEAvkdp87K+h3V8ipFOYgX/98cQpa XfEKV5DfIuHiZ91gwx9WvmbAcFA8zQih1cMisqn5sxMzhPYawtvQqi9ArwIM/IM0ftOUbuzADXUKE wasvwdXAOjb9eZsuDoDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Lb7-0000000BQiP-2Vj2; Tue, 07 May 2024 14:15:13 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Laq-0000000BQRi-3nL3 for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 14:15:00 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a59a17fcc6bso729566966b.1 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=ZU2nw7OxDbtq2lrpOU2tgLJZ1F2nR9wTCcZqtTi9qmjEk1DzyNNMuz719K9dSA/1L/ LEi9QCKtPWbBbv21pae4fO9D3Pje5INTsULIYIzle+7pOM5jRtPPgVZa6jEg+SpIZMAi w3XFYoAFMJ6hCFGJjUhywp0dXh8n5R6/REPO40TV6h5KZ6NhaJCRcWgbt+x/OJUsMIA7 94n9BejYClZz4xcKufL7uMLEZAVilfS+WpwtZRqqWsTFGGkRpSVeJrVhpdf2HvGMbo5q HESonO3blSB/QQsJOWhZLQHmVnubpoxRsS+M6lp2lmBQomLdx30ePPGLjmxRp1uTKEuT 5Y0w== X-Forwarded-Encrypted: i=1; AJvYcCVXtv0o6N2HWahC78338sRJYeYitFjnixp13raipc7Mo4CSJMIRI3OLY72jUSTbtuCBCNSU8HAIHV+usJlrwJBY8HGl86boQd/0+SDyu7puSTWAi3U= X-Gm-Message-State: AOJu0YynLEVw2IKEIhbLPrB2OatVxE0pCwqTEZasw9lpjIZ+BCDpL43b a3yo5QpicDE8nS7TZNnWdpvlpdWfPU/lmtjs3holKdNnJG5CHrYe1uvjA51Z8r8= 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_071457_019338_8275048B X-CRM114-Status: GOOD ( 12.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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);