Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp554914lqh; Tue, 7 May 2024 07:20:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjW6QHZP2JWSvKTeJJX9khEzOllOCYiZrCTZpyfHSdoYe4LesAOA5RlkNE6b1MJNwTpem/11snFSoyphhMrwkXZ3xopb6G6x6wRkLQ7Q== X-Google-Smtp-Source: AGHT+IGhm+O1u7s6FmV+VqLnuPOkkoVxYXabMSSaOxpkKerd+Ebi5UPuLHr1L5ig37IVRq7PqoVz X-Received: by 2002:ac2:48a5:0:b0:51d:a78e:9036 with SMTP id u5-20020ac248a5000000b0051da78e9036mr7826849lfg.69.1715091641972; Tue, 07 May 2024 07:20:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715091641; cv=pass; d=google.com; s=arc-20160816; b=oJ793RBokCGr4EB/KH8hxCMm8N1mtxmh255zsw0vk9S4xDNTWH1PT5z6vq+iF841ui n9+FBIq5MnvHpyQUqt+5qK18UJ+IztLMplBg4pXb8enntsEFv//tz/TSG06n3GQN7pRA E3xvIYRJd4jZICF6N9VEHaAepbmXDgNcJip8yBLCR4JmZ5smpMLTVPfPOl7yFQMoRbmR tvy5+9jpDhmxUB23hYs/9iDJTqeKONaZcSCAUUENMyM7oKN7IQPDe9EyFmob11mQSnpj SpgifkIv9WpD6bg6VBXd4AZd94h8smny0K1RJAjOlycaO1QlDGFUZoFiDE5y9lCxgcGN bjHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=5eNwp1KeR6q1csnKLq9DFYvN46m+YqLkkQLc199nW5E=; fh=A/7RWTJwt4eGM5QqD0+TIraozqbBoLwp4zZRbHd6z7c=; b=B3+1hCVbNX70Htg9FDkiioFcN6byH2SDHtCMKScp8rOMG2eCBPm9inEHLczJ+MvEB8 yKJHPHEQAWIjCjatXYhJlLN+Gr7jB2GxO6WraHnfzo9KQ3KYMhDR92zveo9NViAWeJw6 Ay86yncZFEKVn9mLXTB2i46kQB20iLiI7zvdG0vFi0D+e/gRSxYh7Yvjv1Y1kNzLhfnn EbXIlEnIOW6jtce5XLfmwNyZodF94C6OfwgNAsFuSbyqb+fKJzpdwplItIucoqVF6M7i Lma4ol7gToXDbqrum4xRA6mGvVo0JwcWlki/bUjSFYWWLhjMUaXh+Pydle4jW89vtwlq rwPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="k/zUVdyn"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-171550-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dk24-20020a170906f0d800b00a59b1d21c61si3825019ejb.38.2024.05.07.07.20.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171550-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="k/zUVdyn"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-171550-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AFB621F24D43 for ; Tue, 7 May 2024 14:20:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4070916F0CF; Tue, 7 May 2024 14:14:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="k/zUVdyn" Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B3A716F0CA for ; Tue, 7 May 2024 14:14:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091290; cv=none; b=bdfGHkyjiIo+re9u0LqN2OGKeamMXsOvLDdgB+KoKH6lfIxjh2TvbSMDKS7GjA2UkfnUqK0/kHKyTj343Q74gJZW+cd0pP9o7UoO97STwZCcfF6FkzbrM0RfalKr1SvsLQVHyo643VFSjDZ/LPOZYxMiNoTvAy9F/FJIEsW6cz8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091290; c=relaxed/simple; bh=ffJbZVGjXwXnNEjgm1xAfng7yUEkFKHbk0/EPzlyDd4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KgBWr5ykPm4C3J54hHeZ2Ii+UxINqldmKVBTvwD/LRli0WmIcPQNURiyjewLW23STozW5+fI4ZK1hvnGftdWUu2PcCl3GDDgHQ0JJxPI4VdLiglVGNLlfCrv0Xaz4JGwyV9slwljYB7ejDVeG6pmKwjTnYsQ0vmi/hLltbwRceo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=k/zUVdyn; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a59a17fcc6bso729567166b.1 for ; Tue, 07 May 2024 07:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715091287; x=1715696087; darn=vger.kernel.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=k/zUVdynRJLasnVkzrGxA+03vDugTnmQhIer5FYjOAsfjitSqQy0hUdVx3cgk46Rkg jZGDzfM1nApnMsigN65EglUX8I1zxB3VJblav0+IUK6hYtmmX6RCvEdoAkmb2dKtgOC0 npr+3QAucy7e2AIwuX7qONZM9Fvd15LAY7cf04QZTX76ng4WKdnrcmvMTrjxg5Xh1TTM CmQvEKd7Mf8PrIMwAsKu7E8/YIyWwcWXV8a5PjeJCAYkYpVP2xvK/WKU+sGKfHph2DoO 9+sY00Kpw8CiqMZe4XVxYdG063glwo27pCdRFGzIEzxRR/+Cd5Fl8jO4GwOZ9u5El8AV CiWA== 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=DoBUpB5/z/xAL5ihyUgUX1d90/LtHnMOWqp5NwJjWvKZRiGwXWu38vJ9KBD22fs4OK yjr0xF3KuU29fdOQkh/R+kRo6zmXXkmGJfHGA2zj5FfkVzikvJ2qvG+U6glmkGY2/cik fEKaBp0JEzmzJbYktiqBYHXHRDUaIrANC4MBkWF9ot2WtUiFcVB+a/BHCRPGbOs3a1yO QF5SB13KIBIQIZQAJ8c3bAZFptKPBo30brgETGp/D4x7LS9loZrjhZUwjwgLNxohwzMx b6Th1fwMwvDO+wJe9MoCFQYw6opyHDpPGJ/qk5gJlngnV9HIXctA74gbT7dJmv79AlRi NL5g== X-Forwarded-Encrypted: i=1; AJvYcCWbPxbOlcZIRqeAwGDyDO75aLVH3H7cxL2gcItNYNFQULcVS019kK7BWwW2TYx6NX5UXsGoYKkIPjYew0XZ+Oz8oyEQa57aRZvkkqIE X-Gm-Message-State: AOJu0Yz2aKZmZQXWYEH8Uuy/uAaGAoFNRGVaklQTC15CY3RBqh7D4DwI eSxTR+I5jdh80ZSCxRxro6bxT6KRZC2aQgYB8diin9w19HGT58iq3blXEZ+SmxQ= 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() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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_Draszik?= X-Mailer: b4 0.12.4 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 --- 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); -- 2.45.0.rc1.225.g2a3ae87e7f-goog