Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp69660ybg; Mon, 8 Jun 2020 16:41:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi3QGJEmu8eMwU5N7TBUkquT4WV3Kopi6RGORfxbb3unLcFBAH7ZRQ6Sb+lHX7e9T53zq0 X-Received: by 2002:a17:907:369:: with SMTP id rs9mr15529603ejb.187.1591659717020; Mon, 08 Jun 2020 16:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591659717; cv=none; d=google.com; s=arc-20160816; b=dncWSf7q58j0tUflZtIW5ia3BNfUXZopDZVIK015+xEhKds/z1Pql7mW4VjZfRofBg yz7Z1yr7x3sZgOPcauNfx/EPpUvfLTGwuu3lCTb7T6wXGLkjl3nPPPi19rr57X8UDy87 jeaT+0glMYji0VfWZw2SXWvlNOnCYGy792PHF9Yke4m6KYMW5NIjAQSh3BO+0RwcsUkp ourqZJVL1CsU0baebE7djYJFsqKaw9HhnLL9qFZuiGdE6YCypGNWkaAn/nNx2HDkRN9J angopuosmIrZyHrt6cKKkgJjHCms7S+t1MY1WIdA6rVW9duIVaBHjok80elhpyBNHpfJ nvRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=PSIc4lpawNnRwu+lQjpJ9aRwG7xE99aneCSTNw2XNa4=; b=ENC+Pq9knD5fRcF3ZlwXn6+SMk4ryMppRmFYsfLXd+v56fMkc+l8pIpbZZ6ksf1Zvt 1LiFcMQ/GoyDKaFCJmaaZ3BqHHE5bUdSTkyzDRHOByb2NolUR2KPGVZbMWbdzsdbnM0P plXELUp/3awVAaMs7YwRhzCriH0ikfT+cqojTzJokjSVRVVlHvxq5L8A7aCz5+KEPF0i 1UG0Crnf6i1hI6JG4dTIKMIFhM//eWMozAkM3o+pxe7EiX7XuIBDuxyhgQFbe5yxt20b 6gK6Wv93/ayWgMPECSLXHDr0woMb0CBbSSuy0cGyX7pZED4nKIiNjS0y5EHowT9K9XQz ULGA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k24si9285333eds.422.2020.06.08.16.41.34; Mon, 08 Jun 2020 16:41:57 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730994AbgFHXgj (ORCPT + 99 others); Mon, 8 Jun 2020 19:36:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbgFHXge (ORCPT ); Mon, 8 Jun 2020 19:36:34 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F1CBC08C5C2 for ; Mon, 8 Jun 2020 16:36:34 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jiRJY-0002nN-Ul; Tue, 09 Jun 2020 01:36:25 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 65786101181; Tue, 9 Jun 2020 01:36:24 +0200 (CEST) From: Thomas Gleixner To: Benjamin Herrenschmidt , "maz\@kernel.org" , "Saidi\, Ali" Cc: "jason\@lakedaemon.net" , "linux-kernel\@vger.kernel.org" , "linux-arm-kernel\@lists.infradead.org" , "Woodhouse\, David" , "Zilberman\, Zeev" , "Machulsky\, Zorik" Subject: Re: [PATCH] irqchip/gic-v3-its: Don't try to move a disabled irq In-Reply-To: <0940571f9daa9829f70616b3036a2b3b3f25953c.camel@kernel.crashing.org> References: <622fb6be108e894ee365d6b213535c8b@kernel.org> <87mu5dacs7.fsf@nanos.tec.linutronix.de> <0940571f9daa9829f70616b3036a2b3b3f25953c.camel@kernel.crashing.org> Date: Tue, 09 Jun 2020 01:36:24 +0200 Message-ID: <873675870n.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ben, Benjamin Herrenschmidt writes: > On Mon, 2020-06-08 at 15:48 +0200, Thomas Gleixner wrote: >> > if (cpu != its_dev->event_map.col_map[id]) { >> > target_col = &its_dev->its->collections[cpu]; >> > - its_send_movi(its_dev, target_col, id); >> > + >> > + /* If the IRQ is disabled a discard was sent so don't move */ >> > + if (!irqd_irq_disabled(d)) >> >> That check needs to be !irqd_is_activated() because enable_irq() does >> not touch anything affinity related. > > Right. Note: other drivers (like arch/powerpc/sysdev/xive/common.c > use irqd_is_started() ... this gets confusing :) Blast from the past ... arch/powerpc does not use hierarchical irq domains, so the activated state does not matter there. >> > + its_send_movi(its_dev, target_col, id); >> > + >> > its_dev->event_map.col_map[id] = cpu; >> > irq_data_update_effective_affinity(d, cpumask_of(cpu)); >> >> And then these associtations are disconnected from reality in any case. > > Not sure what you mean here, that said... You skip the setup and then you set that state to look like it really happened. How is that NOT disconnected from reality and a proper source for undecodable failure later on beause something else subtly depends on that state? >> Something like the completely untested patch below should work. > > Ok. One possible issue though is before, the driver always had the > opportunity to "vet" the affinity mask for whatever platform > constraints may be there and change it before applying it. This is no > longer the case on a deactivated interrupt with your patch as far as I > can tell. I don't know if that is a problem and if drivers that do that > have what it takes to "fixup" the affinity at startup time, the ones I > wrote don't need that feature, but... The driver still has the opportunity to do so when the interrupt is acticated. And if you look at the conditions of that patch it carefully applies this only to architectures which actually use hiearachical irq domains. Everything else including good old PPC won't notice at all. >> Thanks, >> >> tglx Can you please trim your replies? Thanks, tglx