Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3106690ybz; Mon, 27 Apr 2020 10:04:35 -0700 (PDT) X-Google-Smtp-Source: APiQypJhcX8qyb/MQvBpCdK1swS6UeeioGNhytdByUEb1P9eWT9cJ216hOejpGUw9lDgkQPgcurF X-Received: by 2002:a50:d98b:: with SMTP id w11mr18048053edj.196.1588007075798; Mon, 27 Apr 2020 10:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588007075; cv=none; d=google.com; s=arc-20160816; b=hSkwhsorly0YkUuMXe5B2HF7qesaPBWM1cq16TnW4czr4U3pNrz56N88hE9EdBfs5t ySMW7Co2g/kNMHLImFk4LOatX9kH5x3s9zCwHVGzTyGmEBjX8edS0ygbP6z7H1xbFEyI qQ45Iz1Y60MdFmRkViyVe3bgvZeAnP52Hsuvs61yusCwlQqlq2FKiwnmontrn3Bf7Xp/ YymJ/aV7LxtrTqE600awAEDKx4EZbj6X/aqu351luGc+veA32CX0CB2sARjWYvsGQP/B x5Q0CPbMSCFU5pboeI0l0tEh+uXgBpSbcsLYcnsIK0LQFa4zB7ShWde46R0Ejkka8KoM 497g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=h7dSHbvTxZhkFzEUgF2sZej+gbP6YhpBhkF8ExvrxGU=; b=XOnK0WUv76uWZCv9PzsdfDhIcW02o+ufbK4GdDFS1K2PPyjDNoEt41obbR0AWHOOag Fp4jTZk3GloQkQ29JrALQaS+JQS5p+YtwLBjM6p3uxsl/HdpXrJoqNsAF3zOevp3TmjX 65lLZKlFLmlMpCGniGG3/MOP8qMK3gGbK522Ou7l0hLUJI/7P/1JqF/+PyuxHN4L+WRz hFyAVAIqiRry3buYUfK0isIFaU9t64YF2v7umn/26W5wDD7B3D4a/EDEeNtuGTpV5mZV m2mjkQlCjr63XPKJAtBKh0gBqyfVXc3e74YsL6yN5AFAWy0z+bRU2mcvfS4bgpxdSutR 7lRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ItM+qEI4; 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 h23si114892ejq.206.2020.04.27.10.04.00; Mon, 27 Apr 2020 10:04:35 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ItM+qEI4; 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 S1726329AbgD0Q70 (ORCPT + 99 others); Mon, 27 Apr 2020 12:59:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:36842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbgD0Q7Z (ORCPT ); Mon, 27 Apr 2020 12:59:25 -0400 Received: from localhost (unknown [171.76.79.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8EDD2206B9; Mon, 27 Apr 2020 16:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588006765; bh=/dqFyvgTMr7/GP4hysHTzeyCgcVIbSNQGjRnh7yYytk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ItM+qEI46/NGazMa3t/sxUsrW0dOpgOGRdxhfenznQYkIPv7iu2aMVvRdW77ExxDa k0ItWZ8tZ/4/wqYC1lzTh7JnEH5gWCvqao4usBSJGu1w6YjogIqoq4Fv4xpucK/WG8 sQFfgIOn7svWAecOjefan+HfthYwCuzzh9QyAGuU= Date: Mon, 27 Apr 2020 22:29:19 +0530 From: Vinod Koul To: Wesley Cheng Cc: agross@kernel.org, bjorn.andersson@linaro.org, kishon@ti.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] phy: qcom-snps: Add runtime suspend and resume handlers Message-ID: <20200427165919.GR56386@vkoul-mobl.Dlink> References: <1587662818-4461-1-git-send-email-wcheng@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1587662818-4461-1-git-send-email-wcheng@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23-04-20, 10:26, Wesley Cheng wrote: > +static int qcom_snps_hsphy_suspend(struct qcom_snps_hsphy *hsphy) > +{ > + if (hsphy->suspended) > + return 0; > + > + dev_dbg(&hsphy->phy->dev, "Suspend QCOM SNPS PHY, mode = %d \n", hsphy->mode); > + > + if (hsphy->mode == PHY_MODE_USB_HOST) { > + /* Enable auto-resume to meet remote wakeup timing */ > + qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_CTRL2, > + USB2_AUTO_RESUME, USB2_AUTO_RESUME); > + usleep_range(500, 1000); > + qcom_snps_hsphy_write_mask(hsphy->base, USB2_PHY_USB_PHY_HS_PHY_CTRL2, > + 0, USB2_AUTO_RESUME); Kernel has a coding guideline where we try to "stick" to 80 char limit and is sometimes okay like debug logs. Above is not okay. Please fix it and run ./scripts/checkpatch.pl --strict on your patch and fix all errors. Warning and checks at your discretion using common sense. When in doubt do ask :) > + } > + > + clk_disable_unprepare(hsphy->cfg_ahb_clk); > + hsphy->suspended = true; why do you need to track this? > + > + return 0; > +} > + > +static int qcom_snps_hsphy_resume(struct qcom_snps_hsphy *hsphy) > +{ > + int ret = 0; superfluous init.. > static int qcom_snps_hsphy_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > @@ -251,6 +333,14 @@ static int qcom_snps_hsphy_probe(struct platform_device *pdev) > return ret; > } > > + pm_runtime_set_active(dev); > + pm_runtime_enable(dev); would it not make sense to enable this after pjy in initialized? -- ~Vinod