Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1670407

Re: [PATCH] phy: brcm-sata: fix a timeout test in init

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Vivek Gautam <vivek.gautam@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH] phy: brcm-sata: fix a timeout test in init
Date Tue, 20 Jun 2017 10:30:02 +0200
Message-ID <tUmHT-6aA-1@gated-at.bofh.it> (permalink)
References <tU2zv-1xF-1@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1497947200; bh=9hYhgLZiWn4++Wy/zdqnNGbg9znklnKNDZ6u5LbNdvM=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=AWktnf9TMTNi/4q10Xv1DH9HtwtyLVT9Y4BzTzrLfEItoUnYmwvYIasWJvxlJA3bd tnvuO2CuejG/01ToOTSr5Oi+mO5zPt53OgvfIB/JfVAK93dq934wVtU3Sy4SzHsKYG e9aSOIxypuN/kToLrZufFxwXbzJtwViKEtybELGc=
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1497947199; bh=9hYhgLZiWn4++Wy/zdqnNGbg9znklnKNDZ6u5LbNdvM=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=D9jIvWRjTa2gRthpNzJiTXJ6AhvOesYZnc/IaCofODVjs9ZhIeB7HOqfZAEQ5A3is 8DWqdE43Ei8uOk3ru3txAryruRgWho7wH49Iti4S8SrLqaNp87X1bNtSagv9CGqqwC Mowpy2C3ur5MpoVFAFHYZzF5Gae9z1zK9A25Tdfc=
Dmarc-Filter OpenDMARC Filter v1.3.2 smtp.codeaurora.org BC0BA60AEE
Authentication-Results pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org
Authentication-Results pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vivek.gautam@codeaurora.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 32
Organization linux.* mail to news gateway
X-Original-Cc Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>, Heiko Stuebner <heiko@sntech.de>, Florian Fainelli <f.fainelli@gmail.com>, Axel Lin <axel.lin@ingics.com>, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
X-Original-Date Tue, 20 Jun 2017 13:56:35 +0530
X-Original-Message-ID <69b479f4-8939-4c11-2c16-2e188e02a625@codeaurora.org>
X-Original-References <20170619105251.GA23911@elgon.mountain>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1670407

Show key headers only | View raw



On 06/19/2017 04:26 PM, Dan Carpenter wrote:
> We want to timeout with try set to zero so this should be a pre-op
> instead of post-op.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/phy/broadcom/phy-brcm-sata.c b/drivers/phy/broadcom/phy-brcm-sata.c
> index ccbc3d994998..48fb016ce689 100644
> --- a/drivers/phy/broadcom/phy-brcm-sata.c
> +++ b/drivers/phy/broadcom/phy-brcm-sata.c
> @@ -329,7 +329,7 @@ static int brcm_nsp_sata_init(struct brcm_sata_port *port)
>   
>   	/* Wait for pll_seq_done bit */
>   	try = 50;
> -	while (try--) {
> +	while (--try) {

Do we want to try reading the status 50 times? If yes, won't your change
break that? It will rather run the loop 49 times.

Thanks
Vivek

>   		val = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
>   					BLOCK0_XGXSSTATUS);
>   		if (val & BLOCK0_XGXSSTATUS_PLL_LOCK)

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] phy: brcm-sata: fix a timeout test in init Dan Carpenter <dan.carpenter@oracle.com> - 2017-06-19 13:00 +0200
  Re: [PATCH] phy: brcm-sata: fix a timeout test in init Vivek Gautam <vivek.gautam@codeaurora.org> - 2017-06-20 10:30 +0200
    Re: [PATCH] phy: brcm-sata: fix a timeout test in init Dan Carpenter <dan.carpenter@oracle.com> - 2017-06-20 10:50 +0200
      Re: [PATCH] phy: brcm-sata: fix a timeout test in init Vivek Gautam <vivek.gautam@codeaurora.org> - 2017-06-20 11:00 +0200

csiph-web