Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2863656pxb; Mon, 19 Apr 2021 16:24:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvR0UHLbu6e0D40nNfwIpBUH2YYtDbn3e+QwI1MmrsQgckdHMs0W0JZSDgMhtRsjmgm617 X-Received: by 2002:a05:6402:42c9:: with SMTP id i9mr28817673edc.35.1618874647913; Mon, 19 Apr 2021 16:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618874647; cv=none; d=google.com; s=arc-20160816; b=a5EQj5R0UvT9S5yn7xmY5JPrzfPnCqvEC9kTAYnfVs0EWpnaRKL0gUzY5GqcNVPqhG LVcBhY34hN1+bp1Te4aguWqMfpKzw3D0Efnn6rctTRTyyhl31j4OfaQNC31OHppszTVL 6eBFoyIPvjmiBw/93beFTVDBySeugYx7ZKfJeWh6SdZ7O3BwQqpaexZkfn37za0BqfDF 3zSmgeoJLyf8N1zBAMhND9NKfySuY+eLV7usRH//bqTtes47W6JSPrWantW6SRwQHUV8 igZ6wXuiJ7A6jO7fA0l+og5BCNxWAct8JQ7Qm8vXJUd1AZfXkuDU66BZ49IcCOZPdzMO NIfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/fdThcIRrgscrujltUhnPe8L2i3scdC7Fzwjbgg461M=; b=DVqG9DRAZnMrpyLjWvtF9+xUdOZBWL3W0ua4cARIJfnixnGMbdk4lsl00iT6TXx3AV zPBD1jgL7mgsJSFSYmTfoqAygFhqrCh9m/7p3GS6NOZLecu4ScXUhXHKrkBzf4wjMzvE FVPWocqxgvwSAQCBuvzdwYDeQpE9We6LMRAsUkrmOUdpM0OzdoHWfW3p9BtHbUrNx9dq Ep/8Fd9BW6pVSbHhhnpJlvfKYftE9Ky0a/65/hILfZ57mLP6fBmaPuNVqwAOECuA0XOq ZEx5g/4BUZqBmWF7Zku/q4kdZKbSSjWhUjuuluWVqpUrvnccTqfOtprKx8AFvxLmdMlt nqxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="jwSp/gqH"; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k13si13386118ejg.416.2021.04.19.16.23.44; Mon, 19 Apr 2021 16:24:07 -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=@chromium.org header.s=google header.b="jwSp/gqH"; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231302AbhDSXXQ (ORCPT + 99 others); Mon, 19 Apr 2021 19:23:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbhDSXXP (ORCPT ); Mon, 19 Apr 2021 19:23:15 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FE5EC06138A for ; Mon, 19 Apr 2021 16:22:44 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id cu16so16806312pjb.4 for ; Mon, 19 Apr 2021 16:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/fdThcIRrgscrujltUhnPe8L2i3scdC7Fzwjbgg461M=; b=jwSp/gqHOdqZnEbozWAZEAN6sUBPw3p0kdBD4kEFPJ2qPbPIo0w5a1ro5wjXpOfv0c dX5KAVPxGJQQchm/i53s/eCyaoX73fE0+kP9fUMaw8N7zFSz6rTl/tq2ox+KgplCAI7t e+vNgJucfVRKqlMMFTZeHImcxrM+SCWphw5iU= 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; bh=/fdThcIRrgscrujltUhnPe8L2i3scdC7Fzwjbgg461M=; b=cak9sDCbtW4HTeYQ6mEYAT4HBF9a6WdCzNDdiA/Yplih5Ci28nSi0qciVCQg8wmI+L 6kpIHglC+BigLzdvJz4cDmbpGMJK8LtBuD1ZMGHz0OhlWaeGWTPJZI/FxNGIwHXeE/bt 4zaP+JcqXDHocbQwOLHGywvVj8LFSUVB25OMYc8RRbRZTO/F3RvWSSaEwMregNY0leu1 nhK0ruoB/oiP9eCNo7PtG7c633O6cnjn+ErNsqBsb6vHb2wh1WYoYqSGKdgFrpfxvc2v 8kTmIUJxalkPY7dk9BqSdbnh8ij4FjF6H8WZcF7fOdNGDj3QP78PT228VF/JxYkWgL6x 6v+A== X-Gm-Message-State: AOAM532IHrFW4+gEJxbW/z2Ua0Nye56O9rgWY1DyiD+Sy+Ol1h7fCKkS XQumI0zu2INJYs8oI0HuRObapg== X-Received: by 2002:a17:902:a70f:b029:ea:d4a8:6a84 with SMTP id w15-20020a170902a70fb02900ead4a86a84mr26025712plq.42.1618874564051; Mon, 19 Apr 2021 16:22:44 -0700 (PDT) Received: from localhost ([2620:15c:202:201:7401:678f:e510:6700]) by smtp.gmail.com with UTF8SMTPSA id f2sm13623847pfe.177.2021.04.19.16.22.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Apr 2021 16:22:43 -0700 (PDT) Date: Mon, 19 Apr 2021 16:22:42 -0700 From: Matthias Kaehlcke To: Sandeep Maheswaram Cc: Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Manu Gautam Subject: Re: [PATCH v6 4/5] usb: dwc3: qcom: Configure wakeup interrupts during suspend Message-ID: References: <1618567313-25373-1-git-send-email-sanm@codeaurora.org> <1618567313-25373-5-git-send-email-sanm@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1618567313-25373-5-git-send-email-sanm@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 03:31:52PM +0530, Sandeep Maheswaram wrote: > Configure interrupts based on hs_phy_mode to avoid triggering of > interrupts during system suspend and suspend the device successfully. > > Signed-off-by: Sandeep Maheswaram > --- > drivers/usb/dwc3/dwc3-qcom.c | 26 ++++++++++++++++++++------ > 1 file changed, 20 insertions(+), 6 deletions(-) > > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c > index 66183c6..b1e9061 100644 > --- a/drivers/usb/dwc3/dwc3-qcom.c > +++ b/drivers/usb/dwc3/dwc3-qcom.c > @@ -316,22 +316,36 @@ static void dwc3_qcom_disable_wakeup_irq(int irq) > > static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom) > { > - dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq); > + struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); > > - dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); > + dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq); > > - dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); > + if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_LS) > + dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); > + else if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_HS) > + dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); > + else { > + dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); > + dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); > + } nit: 'if' and 'else if' branches should also have curly braces since 'else' has them. > dwc3_qcom_disable_wakeup_irq(qcom->ss_phy_irq); > } > > static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom) > { > - dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq); > + struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); > > - dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); > + dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq); > > - dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); > + if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_LS) > + dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); > + else if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_HS) > + dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); > + else { > + dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); > + dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); > + } ditto > dwc3_qcom_enable_wakeup_irq(qcom->ss_phy_irq); > } Other than the nits: Reviewed-by: Matthias Kaehlcke