Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1577970ybg; Tue, 2 Jun 2020 13:57:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6meh4xACiUmfRP9d+PVJJ8o16HvdbfHDHvxf1UyVe5QHeHUZgEQuyD67dbSl1GkjdheMc X-Received: by 2002:a17:906:f155:: with SMTP id gw21mr24626515ejb.388.1591131444504; Tue, 02 Jun 2020 13:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591131444; cv=none; d=google.com; s=arc-20160816; b=TKiNEmWuPQDQm3UOyHlBvyEH91t36yQ3rN6P64mgOijOwpsYJ99oiZyj9zHmtH8auv jfVLLPbUuS+7THADZL2rrlr4wkxtoIdHK71wGOyiDRvg5dmlHNY8+/6NAZluSrz6Z5tw TIyYy/hZksfe6PthzirSQfoAWpvi68Zjtzsyzjz2Fo7IBlunnXT3RViq54yypcnF3aj6 QOq9FdAkRaJcWHGt7pzoQUxvCem0ZJVdUwIgZOtOeaIUmgYaOveahE0rhyaXQ7T2I9MZ XDM0X8v6qJ5uPLlePQ4AsBYfwEbQOv/OzVvWkwduZ095iPU6VN3hZEEsoJtOPWIjDxgZ EPcg== 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=dO35VZwfyyU2oWj8+mLwALo8P8FD3I0UgmYPg1A2J44=; b=E30teApIf7oV+59wOJiuqiqdfLwErmGcdjX3xKU2IfnWbUd/lplX5RXCtWYbv407Fc 0jKwXuTDVoEBmBVyg2yhONI6IL8yhLS3JTfrfr6Srjst7aFUfqIGzkSyiGczLfhoBLYf fZI+Ojy1cPmHdSwTGP7aiJHVu9Fxw3Iu95skTdsP1nY3QuhvDvYN55J1u74eC3cU6tiC M/bFj/YoXuoZ8aChZfOqy3Z/bAJJcVjOYggmFc36yPDUz+GFKd2RNU+RJg53unhg9ntn NBB61dwt+AVnUMDWNLdNt4/11Qt/TOF0N7+SfGZozgBEA8mZqV0C37KQVrTmkXxZH/Vw +dgw== 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 bz17si15490ejc.605.2020.06.02.13.57.01; Tue, 02 Jun 2020 13:57:24 -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 S1728327AbgFBUyW (ORCPT + 99 others); Tue, 2 Jun 2020 16:54:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgFBUyW (ORCPT ); Tue, 2 Jun 2020 16:54:22 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10476C08C5C0 for ; Tue, 2 Jun 2020 13:54:22 -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 1jgDvL-0003XN-0L; Tue, 02 Jun 2020 22:54:15 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 4DB14100F18; Tue, 2 Jun 2020 22:54:14 +0200 (CEST) From: Thomas Gleixner To: "Herrenschmidt\, Benjamin" , "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: <37e55e71faf76dc3db76d89c20c1bdfff942e380.camel@amazon.com> References: <20200529015501.15771-1-alisaidi@amazon.com> <8c3be990888ecfb7cca9503853dc4aac@kernel.org> <2C4F431F-8140-4C82-B4BD-E51DE618FC08@amazon.com> <20200530174929.7bf6d5d7@why> <37e55e71faf76dc3db76d89c20c1bdfff942e380.camel@amazon.com> Date: Tue, 02 Jun 2020 22:54:14 +0200 Message-ID: <87y2p5fatl.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 "Herrenschmidt, Benjamin" writes: > On Sun, 2020-05-31 at 12:09 +0100, Marc Zyngier wrote: >> > The semantic of activate/deactivate (which maps to started/shutdown >> > in the IRQ code) is that the HW resources for a given interrupt are >> > only committed when the interrupt is activated. Trying to perform >> > actions involving the HW on an interrupt that isn't active cannot be >> > guaranteed to take effect. >> > >> > I'd rather address it in the core code, by preventing set_affinity (and >> > potentially others) to take place when the interrupt is not in the >> > STARTED state. Userspace would get an error, which is perfectly >> > legitimate, and which it already has to deal with it for plenty of >> > other >> > reasons. > > So I finally found time to dig a bit in there :) Code has changed a bit > since last I looked. But I have memories of the startup code messing > around with the affinity, and here it is. In irq_startup() : > > > switch (__irq_startup_managed(desc, aff, force)) { > case IRQ_STARTUP_NORMAL: > ret = __irq_startup(desc); > irq_setup_affinity(desc); > break; > case IRQ_STARTUP_MANAGED: > irq_do_set_affinity(d, aff, false); > ret = __irq_startup(desc); > break; > case IRQ_STARTUP_ABORT: > irqd_set_managed_shutdown(d); > return 0; > > So we have two cases here. Normal and managed. > > In the managed case, we set the affinity before startup. I feel like your > patch might break that or am I missing something ? It will break stuff because the affinity is not stored in case that the interrupt is not started. I think we can fix this in the core code but that needs more thought. __irq_can_set_affinity() is definitely the wrong place. Thanks, tglx