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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 B1E65C433DF for ; Fri, 29 May 2020 17:53:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91273206E2 for ; Fri, 29 May 2020 17:53:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UHgWYH6W" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726944AbgE2RxB (ORCPT ); Fri, 29 May 2020 13:53:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbgE2RxB (ORCPT ); Fri, 29 May 2020 13:53:01 -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 19EBBC03E969 for ; Fri, 29 May 2020 10:53:01 -0700 (PDT) Received: by mail-ua1-x941.google.com with SMTP id z12so1090789uap.6 for ; Fri, 29 May 2020 10:53:01 -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=mXouIx5WMRfY8w9hWVivEqxw6CeWAJ8tU5AUL0ftr0c=; b=UHgWYH6We6HynzL26DIG9y/wKuyOjYnXyQVbzX1eR7m7DNouwHSPro7wd2ZVIfDcLh delkUc2rpChJ76CzVAtqkYqUKG8JzL49FCiymRse13GqVozituA3LV1anhsI71dnw9te TSWoo7jARxDanxDtkdrq4UpySKLXD4TSwtdF4= 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=mXouIx5WMRfY8w9hWVivEqxw6CeWAJ8tU5AUL0ftr0c=; b=Ekm8XjikjC64w9KYDX6wCyaq+T0BEvCP/etk3NFNAPL+72y+ccmyp0ukGYba/xhge4 r6qfaCYyRe2QrGnN3V92B3SVbN4hUzEq4zKoMAWiVDhJjFo3CvEHJtoUXX4XFc/uZQMo +IY9ZUDUw8M7n2ZhJ0qPXhOilniFeCWjFfEPC1fVLLiauq9lejY93FmE4mHsH0yibzIe lF5rJhetGug00kR9FwW7e7a0zGocyQ9J5UdXHdkCNvVmQDjVHJ2QcS0KjUGBZQ23XtBb O7SrnaJQIPkoYh9mgr8qRpUBNcsM4c2/IwTbAHLMuoGJ1TjePYyU0Ff0REU17aagBt2P PSqA== X-Gm-Message-State: AOAM530YcTzC55iujvU2uYYFmU6jn2dBTIbHOc9n7g8mSi4dODbuxYsB knfv5i6k5698yo2O+PDhIecG6NIfAD4= X-Google-Smtp-Source: ABdhPJzJQfmpDpQtAvkY+7tAnZsPI8SQZNA6woQOEc6aY+Kfjiz9FJi2tfUzVfeIPO1iS8RvR4DSBQ== X-Received: by 2002:ab0:4a81:: with SMTP id s1mr7064457uae.108.1590774779638; Fri, 29 May 2020 10:52:59 -0700 (PDT) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com. [209.85.217.48]) by smtp.gmail.com with ESMTPSA id a202sm1307726vke.43.2020.05.29.10.52.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 May 2020 10:52:58 -0700 (PDT) Received: by mail-vs1-f48.google.com with SMTP id l15so2006217vsr.3 for ; Fri, 29 May 2020 10:52:58 -0700 (PDT) X-Received: by 2002:a67:b14b:: with SMTP id z11mr6770843vsl.109.1590774778291; Fri, 29 May 2020 10:52:58 -0700 (PDT) MIME-Version: 1.0 References: <1d3bae1b3048f5d6e19f7ef569dd77e9e160a026.1590753016.git.hminas@synopsys.com> <0f6b1580-41d8-b7e7-206b-64cda87abfd5@synopsys.com> In-Reply-To: From: Doug Anderson Date: Fri, 29 May 2020 10:52:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] usb: dwc2: Fix shutdown callback in platform To: Frank Mori Hess Cc: Minas Harutyunyan , John Youn , Felipe Balbi , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , Felipe Balbi , =?UTF-8?Q?Heiko_St=C3=BCbner?= , "# 4.0+" 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 10:45 AM Frank Mori Hess wrote: > > On Fri, May 29, 2020 at 12:37 PM Doug Anderson wrote: > > > > I'm not sure I understand. Are you saying that you'll just add > > shutdown callbacks to all the drivers using this IRQ and call > > disable_irq() there? That seems like the best solution to me. > > I don't get it. A hypothetical machine could have literally anything > sharing the IRQ line, right? It's not a real physical line, though? I don't think it's common to have a shared interrupt between different IP blocks in a given SoC. Even if it existed, all the drivers should disable their interrupts? > If it is important to call disable_irq > during shutdown (I have no idea if it is) then shouldn't the kernel > core just disable all irqs after calling all the driver shutdown > callbacks? It seems like a reasonable idea for this to be in the core but I haven't dug into whether the core has enough knowledge or if there would be other problems. > Anyways, my screaming interrupt occurs after a a new kernel has been > booted with kexec. In this case, it doesn't matter if the old kernel > called disable_irq or not. As soon as the new kernel re-enables the > interrupt line, the kernel immediately disables it again with a > backtrace due to the unhandled screaming interrupt. That's why the > dwc2 hardware needs to have its interrupts turned off when the old > kernel is shutdown. Isn't that a bug with your new kernel? I've seen plenty of bugs where drivers enable their interrupt before their interrupt handler is set to handle it. You never know what state the bootloader (or previous kernel) might have left things in and if an interrupt was pending it shouldn't kill you. -Doug