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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42C4DC433F5 for ; Mon, 16 May 2022 07:02:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240622AbiEPHCW (ORCPT ); Mon, 16 May 2022 03:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232584AbiEPHCS (ORCPT ); Mon, 16 May 2022 03:02:18 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DE47DFB4; Mon, 16 May 2022 00:02:17 -0700 (PDT) Date: Mon, 16 May 2022 09:02:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1652684536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BY9zh6DOrpPC4lvvoU6noyY6hJNaHrB0bXgQylzFWy4=; b=ZrbqpuwRnBT0ZUoj0KOZ9rUG5s/eSHc2X7vWVgdWAYz64FsT+7H39/Hs5LlYKtmTwNbUll KJu23dsoxM2n1tSjTjdrFssVcsltxvgq2IkFxCpRY35gdjHKtY9zQGZr7+YftlC+PYoOum ef5E6+TFyilHqZGHbiAJ7Aft0oNllM869RiVA3Eb9WGp1rVjFtzAo6hZxJ0nkU9RNNc5pY FmY+ycGzw7y4nBR+lL64otOm6cjXlZMQr6W5y3Q9RFC1/fdHmxGRqJNbkuJRRwqj0DWrwO jcfp1Ho52Mu+eTZbFLuJYYYIWp02kClFY546p6Hn0gqzWayVgI5E1ALNkjw0aw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1652684536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BY9zh6DOrpPC4lvvoU6noyY6hJNaHrB0bXgQylzFWy4=; b=saDiQLX5+7hZtOFNtF0yoT5muAi7lnc7HHnBOVrvm7pjL3t42BNr+IcmX0xVofgt0DSsNw LG7hXX7i1663uWAA== From: Sebastian Andrzej Siewior To: Thomas Gleixner Cc: Lukas Wunner , Marc Zyngier , Mark Rutland , Jakub Kicinski , Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, Octavian Purdila , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] genirq: Deduplicate WARN_ON_ONCE() in generic_handle_domain_irq() Message-ID: References: <87ilq6q87q.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87ilq6q87q.ffs@tglx> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-05-16 08:53:29 [+0200], Thomas Gleixner wrote: > > they tell you that the context is wrong. > > Why? These handlers can be called from any context, really. Yes. They > need to be called with interrupts disabled, but that's it. The warning > is checking hard interrupt context unconditionally. correct. If the context is wrong, the interrupts are usually not disabled. > > From looking at gpio-dln2 this is called from USB URB's callback which > > is softirq. In the end dln2_gpio_event() is invoked while > > dln2_dev::event_cb_lock is acquired. That lock is acquired by > > disabling interrupts which is what gets the locking right for > > generic_handle_domain_irq(). If that lock lifted to spin_lock_bh() > > (because it is always in urb's calback context and all HCDs complete > > in one context unlike now) then this breaks. > > Yes, but that's a different problem. > > > And PREEMPT_RT is broken already. Therefore, last week, I've been > > promoting generic_handle_domain_irq_safe() > > https://lkml.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de > > Well, that's just a wrapper which adds the local_irq_save(), so it's not > any different from having the local_irq_save() at the callsite, unless > I'm missing something. I haven't seen a local_irq_save() at the callsite. If it is, then it is not any different. > Thanks, > > tglx Sebastian