From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1881C433E1 for ; Fri, 29 May 2020 14:49:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F28520721 for ; Fri, 29 May 2020 14:49:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="TTNgrE0f" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727063AbgE2Otm (ORCPT ); Fri, 29 May 2020 10:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726838AbgE2Otl (ORCPT ); Fri, 29 May 2020 10:49:41 -0400 Received: from mail-ua1-x941.google.com (mail-ua1-x941.google.com [IPv6:2607:f8b0:4864:20::941]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A22F6C03E969 for ; Fri, 29 May 2020 07:49:40 -0700 (PDT) Received: by mail-ua1-x941.google.com with SMTP id k3so875525ual.8 for ; Fri, 29 May 2020 07:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nPyJC3VeuXg+H4EiFhdOWQz8oRE+V996il06Y+eqzcw=; b=TTNgrE0fEe/q3F/coMGbxfkgkX50UYx1VgY7fEF/oknOvyTTvhLP7jRbPpUO/oFeJm 3LbB3rTbTpYIQXlCjvlv4abFocWq80dQLWLfiD3DrvzXVGJiH14O9GyY2phHKt7CtrUi 6Rin5OH80b64AijExWRmKBFeEHebz2xmbWMt8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nPyJC3VeuXg+H4EiFhdOWQz8oRE+V996il06Y+eqzcw=; b=J3O7fsat5CcmrK5hWHLIv10rWktN9EjtMC1vBTzrHPsCujSyVUFpiBCaGRlKvdsJ8b /6892mTDTlQR/PWmkaLOc6I7sYdzJW95MJshlcKQfuv5bthdH1fb6D1RsYEMPV1GUjE9 bBWKuUpraYDV2B0K4Oc9VfymkpPxXcwU0bRL7t5BCr7o0v/Woz+0KN5AadGuqgJiI2ON SMtTYnnDji3bFyMe9fXqLM2sQ4K8+5P7641q2qaK8KfIQUbGXI+nHyQUpICBKZnQDHEd jjwIyZXLm0YY3CQ/1SJ7c5VkB5ALQXo3wZXioHMr2Vc6p7fQlIfOFo1pqKy8uYfrobbw Dg4w== X-Gm-Message-State: AOAM531PYyjpgm7ngEBCCPm6zY2zy7CiaPUKitYUJ5ozkzchuLEsTUBF LYir3iHhZOjc1UaaT+DyYkLrpYyfcz8= X-Google-Smtp-Source: ABdhPJxZWjMUGZRW2Tg7DKFIR0AJ7ZomoL9tNKDhBPkCoGKq7dEFEzbE3NJIoLijBuu/SHQBaWmYwg== X-Received: by 2002:ab0:5909:: with SMTP id n9mr6527391uad.12.1590763779557; Fri, 29 May 2020 07:49:39 -0700 (PDT) Received: from mail-vk1-f180.google.com (mail-vk1-f180.google.com. [209.85.221.180]) by smtp.gmail.com with ESMTPSA id k68sm923463vsc.32.2020.05.29.07.49.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 May 2020 07:49:38 -0700 (PDT) Received: by mail-vk1-f180.google.com with SMTP id t23so734542vkt.5 for ; Fri, 29 May 2020 07:49:38 -0700 (PDT) X-Received: by 2002:a1f:5cd0:: with SMTP id q199mr6343966vkb.34.1590763778261; Fri, 29 May 2020 07:49:38 -0700 (PDT) MIME-Version: 1.0 References: <1d3bae1b3048f5d6e19f7ef569dd77e9e160a026.1590753016.git.hminas@synopsys.com> In-Reply-To: <1d3bae1b3048f5d6e19f7ef569dd77e9e160a026.1590753016.git.hminas@synopsys.com> From: Doug Anderson Date: Fri, 29 May 2020 07:49:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] usb: dwc2: Fix shutdown callback in platform To: Minas Harutyunyan Cc: John Youn , Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Felipe Balbi , =?UTF-8?Q?Heiko_St=C3=BCbner?= , "# 4.0+" , Frank Mori Hess Content-Type: text/plain; charset="UTF-8" Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Hi, On Fri, May 29, 2020 at 4:51 AM Minas Harutyunyan wrote: > > To avoid lot of interrupts from dwc2 core, which can be asserted in > specific conditions need to disable interrupts on HW level instead of > disable IRQs on Kernel level, because of IRQ can be shared between > drivers. > > Cc: stable@vger.kernel.org > Fixes: a40a00318c7fc ("usb: dwc2: add shutdown callback to platform variant") > Tested-by: Frank Mori Hess > Signed-off-by: Minas Harutyunyan > --- > drivers/usb/dwc2/platform.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c > index e571c8ae65ec..ada5b66b948e 100644 > --- a/drivers/usb/dwc2/platform.c > +++ b/drivers/usb/dwc2/platform.c > @@ -342,7 +342,7 @@ static void dwc2_driver_shutdown(struct platform_device *dev) > { > struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); > > - disable_irq(hsotg->irq); > + dwc2_disable_global_interrupts(hsotg); > } I could be wrong, but I think it would be better to instead end up with both calls, like: dwc2_disable_global_interrupts(hsotg); disable_irq(hsotg->irq); To some extent it's slightly overkill, but the disable_irq() function has the nice "and wait for completion" bit. Your new call doesn't do this. That being said, though, you still won't wait for the completion of the IRQ handler for the "other drivers" you reference, right. Maybe a better fix would be to add a shutdown callback for those other drivers and just keep relying on disable_irq()? -Doug