Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2467629ybt; Fri, 3 Jul 2020 09:45:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+nmOt/vIU1aiRy1fRU9y14nlSDBXq4dk0Y/a4ewEQ/grUGFzEIpxa61DCCKG7Az6oyCqg X-Received: by 2002:a17:906:e215:: with SMTP id gf21mr27256764ejb.310.1593794718169; Fri, 03 Jul 2020 09:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593794718; cv=none; d=google.com; s=arc-20160816; b=o6EXbD5y8aFunyGS+hUhTPmPuzdRPyKM1DECD/p/asRBcUhBOcyuq/3b9/SOR2E5qe xggZ7QMmWSLYNPP1sR8YTsKHwqJOCgbXHQvrnWFSf5fAIvywee/KU2vvzA0ITLTVsXK5 uNuz2A6+fmTxYsE4rbd3LDpsNtA59XuEnm/bXXj8wPpIHuGzbwYyQGvPYjiemokkk23U 6/gdxsdEVdFZHWqbJwYHdt9CGDnRUP+lvPHT+C4kQAt0o+J2iYZR30+z9flBdqJIsqxU 6wpija+YmoKYBjxW4uBEYKrornXSxVIdmUeyg1/fiLrxs8M3tN3BnMH7ttKtW+3UjAmr EMVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Rkk6OrgsOeSgtd2LsYzmaJPd2S3kmEEwYFVFbwumjEo=; b=KnOjqUgBG4WfE42AjHrhgaKhncF5zyJVwivCwU7hCayA9Lqm33DdrXRD1CRH9RYx3O mCjVckQN0f7XJ6W4bj/p12W7MPFfSvDzN/3tF4CXEfQyd3jKZ+NlyrRYmx81iMo/uEso PkfkzLUVcwOeS5U8LUPXK76AWSk+8iRmC2jdJts1pEXs6Q7WT4HFcm8l22saJD9Vtn73 f6ly4PT7h9ReZYe9jQNmMk0i9Htr21WDoOsQN84EjTba+f9SYPs9GQM4EJFdDfCpPKWC KqcykzZ6Ofn+eO/tbTRNV/XVtNuvP+kiaYHcxz083gQucijn6PbYa/s1H3BPu3LchS/9 zZBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bq21si7848531ejb.301.2020.07.03.09.44.54; Fri, 03 Jul 2020 09:45:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726484AbgGCQny (ORCPT + 99 others); Fri, 3 Jul 2020 12:43:54 -0400 Received: from mail-ej1-f68.google.com ([209.85.218.68]:37901 "EHLO mail-ej1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726108AbgGCQnx (ORCPT ); Fri, 3 Jul 2020 12:43:53 -0400 Received: by mail-ej1-f68.google.com with SMTP id w16so34920920ejj.5; 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=S+YU0dXIPsNupYIPrrDfKj7DWIYz1EeYpyrY2DnSLsG+rgH/40RKyQwanxinfioNVw 2B72tOE5J0TfoB74l+pSKr/WbuDsYG+QPWLRCxM75ziA/cLXeMbgXiZZHkUimDtBzXlw LUhHXwfuFPIEH0siefkOJpNe5ezcws7LX7QNR8lB9n0yUx2XYGH3SB8ulm5NX2KRV/hF KIhB0ej30my4vIU8pfeYcCWH7bgkrgwk9afH36/YF9KGcm7/hzIHORJQ6Za+wPFjjUW1 dRG0DafN0W/yXeLLromvcMpzyGXhJvXY3pVcADiP8W5+NhxgFxC1sJ8hfdqikHMxZgo0 EWlw== X-Gm-Message-State: AOAM532FvlK9l6ZjnAWmM04Qe+YaMAZ4pKHW5E1lX41ZZByjuImGBNYO 50cIi3AGJmgJDb4aiGg93F4= 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 Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , Vinod Koul , Kukjin Kim , Marek Szyprowski 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-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200703132012.579-1-linux.amoon@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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