From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5095FC433E0 for ; Fri, 3 Jul 2020 16:45:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1CC70207FF for ; Fri, 3 Jul 2020 16:45:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cwyCZvt8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CC70207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mk4iwY0UER2m0XMgbu1Izem7xTSRogiY31V20O5OD4Q=; b=cwyCZvt8fOLlQC1N1n8pfqRCD Dim5MOLzZhJwpx6ty/8xZe322/dWT0Qb8NA2TgbB20gcgWh6WZ1UzzH+tY0/nd6p2+0Qgadvkh4R6 gS7pLAV/eHJ+FjohHk3iniLCuX4IlOy+ff3j3OB4HQye4jmAXE4oNTjH9p55DnYp6FGN/LhXW3nrs Jw3DPAI0LvD6thj31JmjZvrtIefeA4kgKhhIeZzVipOYeZbPZMNkTd2rgNhYKNp7UNkIYUXORdIWv XWlbhHZsfifla5KhEEI8K3fKgGKhlWw1eNNJGT4k6AAyKA2pcH7tl/HgjzQ59GYJNKGE4+blMlyFv SF800VxzA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrOn6-00088w-Pj; Fri, 03 Jul 2020 16:43:56 +0000 Received: from mail-ej1-f66.google.com ([209.85.218.66]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrOn4-00088J-EJ for linux-arm-kernel@lists.infradead.org; Fri, 03 Jul 2020 16:43:55 +0000 Received: by mail-ej1-f66.google.com with SMTP id w6so34935866ejq.6 for ; Fri, 03 Jul 2020 09:43:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Rkk6OrgsOeSgtd2LsYzmaJPd2S3kmEEwYFVFbwumjEo=; b=XxzLxOVTun9wihreJ8VBjfdqHujPRrfyftwPOM9gpVypuXUC+EpLgqsCJEOp+Iw3Ho dO7+pPAWAu1onUoAC3iHRmu0dn8eTe/cp4Dz/NThNmRA0vBeWG+fgBXPxqlgTUyrHhZd VYrJfSu31jt95rLiNIcLeUjuPERhNwvp/aoaQIGYzNx2jjYabc1oD35ZVJEnrMhxmCy/ RxUhLTXKrP3XDvCVXcGMPuXx0Rr9+8x4pKZGGaI5+WMlcnnfWkDEL5zPlQgIrc8JnTTO jaq1w23R7ASpVDTlY+YDEl7PKrNdqFNM/+dmZ00CA9PT/rANq20N+CZWaI2EMTp3UZe3 txNQ== X-Gm-Message-State: AOAM533ta8FoPtgiloSXNmIOgmuRS86pCui9u1YW28J1IpeVGW1XIrlw dGeKGZI3qvdhno1oW0P4gdU= X-Google-Smtp-Source: ABdhPJxSig7o5zgKxKiDVXDwxMN/PbN7CZaC4mj/1cwidQ/8xnp0CyN1AS5npbV5bwvuESV662XTHg== X-Received: by 2002:a17:906:3a0d:: with SMTP id z13mr25390578eje.109.1593794631769; Fri, 03 Jul 2020 09:43:51 -0700 (PDT) Received: from kozik-lap ([194.230.155.195]) by smtp.googlemail.com with ESMTPSA id o18sm9722250ejr.45.2020.07.03.09.43.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Jul 2020 09:43:51 -0700 (PDT) Date: Fri, 3 Jul 2020 18:43:49 +0200 From: Krzysztof Kozlowski To: Anand Moon Subject: Re: [PATCH] phy: samsung: Use readl_poll_timeout function Message-ID: <20200703164349.GA2914@kozik-lap> References: <20200703132012.579-1-linux.amoon@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200703132012.579-1-linux.amoon@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200703_124354_507980_037557B0 X-CRM114-Status: GOOD ( 17.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , Vinod Koul , Kukjin Kim , linux-arm-kernel@lists.infradead.org, Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 03, 2020 at 01:20:12PM +0000, Anand Moon wrote: > User readl_poll_timeout function instead of open > coded handling in crport_handshake function. > > Signed-off-by: Anand Moon > --- > drivers/phy/samsung/phy-exynos5-usbdrd.c | 37 +++++++++--------------- > 1 file changed, 13 insertions(+), 24 deletions(-) > > diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c > index e510732afb8b..83274c5e3820 100644 > --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c > +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -556,40 +557,28 @@ static int exynos5_usbdrd_phy_power_off(struct phy *phy) > static int crport_handshake(struct exynos5_usbdrd_phy *phy_drd, > u32 val, u32 cmd) > { > - u32 usec = 100; > + u32 timeout_us = 1000, sleep_us = 10; > unsigned int result; You silently (without mentioning in commit msg and explaining why) changed both the sleep time and total timeout. Nope, please explain why you chosen such values and change them in separate patch. > + int err; > > writel(val | cmd, phy_drd->reg_phy + EXYNOS5_DRD_PHYREG0); > > - do { > - result = readl(phy_drd->reg_phy + EXYNOS5_DRD_PHYREG1); > - if (result & PHYREG1_CR_ACK) > - break; > - > - udelay(1); > - } while (usec-- > 0); > - > - if (!usec) { > - dev_err(phy_drd->dev, > - "CRPORT handshake timeout1 (0x%08x)\n", val); > + err = readl_poll_timeout(phy_drd->reg_phy + EXYNOS5_DRD_PHYREG1, > + result, (result & PHYREG1_CR_ACK), sleep_us, timeout_us); > + if (err) { > + dev_err(phy_drd->dev, "CRPORT handshake timeout1 (0x%08x)\n", val); > return -ETIME; > } > > - usec = 100; > + timeout_us = 1000; > + sleep_us = 10; The same. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel