Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp756242ybi; Fri, 14 Jun 2019 02:51:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2hqEiExlqUEln3SVL7DyEnTmGy9WT2JfvITt/n2uVPCmRpV6sVfKXH75PBIa7mnwwo2tP X-Received: by 2002:a65:5685:: with SMTP id v5mr35452999pgs.184.1560505913314; Fri, 14 Jun 2019 02:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560505913; cv=none; d=google.com; s=arc-20160816; b=bG5G+GusMqGTfeTq/Zoyds1PIEi9hdslzxksAD5VcHstbnG1d9E8OntNyOmANRrGM3 SgGy6cIcIWBmP3zdzvJIESM/V82gLolJ7Adxrpv+2cjMYyUOYfEIuss30yRMga7ZT+En FNoI0tEvZg3Hyb/KIfbsnCQthcK8IzObMsA+jGsLVq+56dDfu9F64yRggbJooERP1IYQ 5zKR4FGeOk9Rn1qY8h0VgsS13r6dw9vEAXT83UwyRWqy9GgjjSBsNYwU5cI3rGfGpxh4 o1gRUmb4YosZTckj8/U1gbUHdN7LNLdTT0TEquIK4IYoWTkk4PAW9yBNUQPkJCcy4B4p FY5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=ZP5ge0i01sDcvm95gyRERuNwIaw+wOdTMdPlVlO1uEE=; b=uZNdt84Fd5dsRiXyw+sjZJV92iaUBV6ZiHpY7MX1UGq3HyAn301/NsznhseJON63xu qs6RPM0Siv+DQZq4S5EbsJxnu/gJJkuCCeHOK3eTCxLwl9Cb0sCTFoYAEpsVC3yBRavp 6pRLLCJEKpR9RCrnnW5irGtNuwsVrmE9kXxYWvimy6yPu4xZcseeJ/OEjWviPZlArqCC KIj9yAkS7HN3x6tC7B5EtQML4K6rsEg8HZooitdczYyzQ1s4ve6lt4hYxX+qClo6EMUM ISIQPGP3d69NbQgKKFOD7CGWH5DU4kFLegETF3qKATSHPG2njYtZBgU7Yypn/HFqkIfi 7LLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="m/leHmXo"; dkim=pass header.i=@codeaurora.org header.s=default header.b="m/leHmXo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si2090126pgi.38.2019.06.14.02.51.37; Fri, 14 Jun 2019 02:51:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="m/leHmXo"; dkim=pass header.i=@codeaurora.org header.s=default header.b="m/leHmXo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727243AbfFNJuN (ORCPT + 99 others); Fri, 14 Jun 2019 05:50:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35496 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbfFNJuM (ORCPT ); Fri, 14 Jun 2019 05:50:12 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B994960795; Fri, 14 Jun 2019 09:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560505811; bh=MyOIZxRkGgLbqjLqfPrshqHSuC7b4kOHm7rZYQQkQKY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=m/leHmXoxScKBERlX6fPGhe2ZFYsH3hQ9qj0K/po0300bKDBye7axc6BzTkakWdSk ZLj6eD0SY4Xohy6ebZ1VFJKJZs48Y7uQ1/TLgXOyQccyoOq7FzjBaEn6U6bDYmQK3t Ko9RY92ncSk8R8v/n1s08fWMqkzmDnRWqNvWgy0g= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from [10.79.128.120] (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vivek.gautam@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id F09EA60265; Fri, 14 Jun 2019 09:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560505811; bh=MyOIZxRkGgLbqjLqfPrshqHSuC7b4kOHm7rZYQQkQKY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=m/leHmXoxScKBERlX6fPGhe2ZFYsH3hQ9qj0K/po0300bKDBye7axc6BzTkakWdSk ZLj6eD0SY4Xohy6ebZ1VFJKJZs48Y7uQ1/TLgXOyQccyoOq7FzjBaEn6U6bDYmQK3t Ko9RY92ncSk8R8v/n1s08fWMqkzmDnRWqNvWgy0g= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F09EA60265 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 Subject: Re: [PATCH v1] phy: qcom-qmp: Raise qcom_qmp_phy_enable() polling delay To: Marc Gonzalez , Kishon Vijay Abraham , Bjorn Andersson Cc: MSM , LKML References: <92d97c68-d226-6290-37d6-f46f42ea604b@free.fr> From: Vivek Gautam Message-ID: Date: Fri, 14 Jun 2019 15:20:07 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <92d97c68-d226-6290-37d6-f46f42ea604b@free.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 6/13/2019 5:02 PM, Marc Gonzalez wrote: > readl_poll_timeout() calls usleep_range() to sleep between reads. > usleep_range() doesn't work efficiently for tiny values. > > Raise the polling delay in qcom_qmp_phy_enable() to bring it in line > with the delay in qcom_qmp_phy_com_init(). > > Signed-off-by: Marc Gonzalez > --- > Vivek, do you remember why you didn't use the same delay value in > qcom_qmp_phy_enable) and qcom_qmp_phy_com_init() ? phy_qcom_init() thingy came from the PCIE phy driver from downstream msm-3.18 PCIE did something as below: ----- do {         if (pcie_phy_is_ready(dev))                 break;         retries++;         usleep_range(REFCLK_STABILIZATION_DELAY_US_MIN,                                  REFCLK_STABILIZATION_DELAY_US_MAX); } while (retries < PHY_READY_TIMEOUT_COUNT); REFCLK_STABILIZATION_DELAY_US_MIN/MAX ==> 1000/1005 PHY_READY_TIMEOUT_COUNT ==> 10 ----- phy_enable() from the usb phy driver from downstream.  /* Wait for PHY initialization to be done */  do {          if (readl_relaxed(phy->base +                  phy->phy_reg[USB3_PHY_PCS_STATUS]) & PHYSTATUS)                  usleep_range(1, 2); else break;  } while (--init_timeout_usec); init_timeout_usec ==> 1000 ----- USB never had a COM_PHY status bit. So clearly the resolutions were different. Does this change solves an issue at hand? > --- > drivers/phy/qualcomm/phy-qcom-qmp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c > index bb522b915fa9..34ff6434da8f 100644 > --- a/drivers/phy/qualcomm/phy-qcom-qmp.c > +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c > @@ -1548,7 +1548,7 @@ static int qcom_qmp_phy_enable(struct phy *phy) > status = pcs + cfg->regs[QPHY_PCS_READY_STATUS]; > mask = cfg->mask_pcs_ready; > > - ret = readl_poll_timeout(status, val, val & mask, 1, > + ret = readl_poll_timeout(status, val, val & mask, 10, > PHY_INIT_COMPLETE_TIMEOUT); > if (ret) { > dev_err(qmp->dev, "phy initialization timed-out\n");