Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp210082iob; Mon, 2 May 2022 17:17:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBZVrNU0iaLCMCmHKTo8Y3Ktaj6mUOFAH7z+pHmd4HGSiJjTzrbVRMh2/v5+V08G3EmyRy X-Received: by 2002:a63:e70f:0:b0:380:d919:beb with SMTP id b15-20020a63e70f000000b00380d9190bebmr11673975pgi.58.1651537077018; Mon, 02 May 2022 17:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651537077; cv=none; d=google.com; s=arc-20160816; b=l6losLSooy++w5+cUKT0b1qNtiNMubf2oHtJvyxvmJwsu8N0ym7bdNokoQigQqYFCG /dsdH0lqYoCBzl43WnK6NunoY1tdfc5/C9MunLwXtQDpOC/pT76mu45mUM7tquQwOTYd cmfrzc41P6nyMoV/pCkL+y4S9a+VF4zu37DXzXiMrLWoZKDn/MlNWVUQJqqiQv/WUsWa IR1lFKHRjlHNetY9fa7Mi7oz+8QSvcuaEbPJAmfX9XEYcZcPTr6pa5BDi/YN+CuG9CQk ibpcBlSi5oDMLM+jirI/hCuA/Mck6xwpP6bmkzKcQUeGpsjblaTWDJh/wq2tfud1ZcC7 h5sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature; bh=hCsLV9PdiKusadUpSgzFCJfw9Pk/lTm+asEkY23wxFw=; b=MDgMngO+wWXOs0AHYz/t52M8WkmcgjU5AO8s7A15mvipLNHlUWXRr8gIJ9QRso3VQL bRH8HfoijMLm/9EoO1ZZwwSESwsnicVyqf2RUg8lbkAfOhHdulqZCotxQFIlkBst45nh IdHbpXY2RJYVQmV0bvrYz/WWiuFb1BAWix28n+F8l4DroFwZj3elM8p1wEMRmBPjuwEb l3nSzvgYUrpl5FxIUVHfwZqccb01AhRHtg+eTkJ4xyIqFlviGceidgCUTloe1ZxDyOo9 KswtvjVB2RxmvJzbFxz4PZl1TBd8yhjqx20fN1tsDvcnRR+kdLYunjNkhRDU0zTBY9X/ 9tqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oDrJuISc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s68-20020a632c47000000b003c25d640906si2229996pgs.97.2022.05.02.17.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:17:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oDrJuISc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 674382019E; Mon, 2 May 2022 17:15:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384226AbiEBJeV (ORCPT + 99 others); Mon, 2 May 2022 05:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384265AbiEBJeD (ORCPT ); Mon, 2 May 2022 05:34:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4F08E0BD for ; Mon, 2 May 2022 02:30:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 62355B815BE for ; Mon, 2 May 2022 09:30:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C40AC385A4; Mon, 2 May 2022 09:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651483833; bh=HTGTeq8uKlquYM7Dt4tKVhKro/OXk4ZWBJItzDvqR5o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oDrJuIScjL72QXUponKtcPCfiZE2heXmP7cLLvQtP9soOnPlnNuC/sq5dQpCWz19o 8AIfZ9Gfh7XJA5sA4TTUT1ORaVTiIAyft31OMl6bG5rU20cniVE7eQY3CjRd9ldSE5 9vWA5CrBZ1G6+mn47cBIDeXOd8J62wqOFQ5lObpvLPU6pD6OzNJqLjJA5vsU1UDEbj FXYQLePWD7ByFq94fjHmt6c66k/T88DPbmrqQI1gmKsfsswBZkEHqAljoDAcbNm0V8 fVaIPKjrO0Ysb6v5BnpwhEFmtjx/mUaAVzkJau7QSqKMqJJz6v36ktRYZQl9fvS57X eXmlHFCOUI3mw== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nlSNy-008Ntf-Gi; Mon, 02 May 2022 10:30:30 +0100 Date: Mon, 02 May 2022 10:31:11 +0100 Message-ID: <87mtg0i8m8.wl-maz@kernel.org> From: Marc Zyngier To: Marek =?UTF-8?B?QmVow7pu?= Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , pali@kernel.org Subject: Re: irqdomain API: how to set affinity of parent irq of chained irqs? In-Reply-To: <20220502102137.764606ee@thinkpad> References: <20220502102137.764606ee@thinkpad> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kabel@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, pali@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 02 May 2022 09:21:37 +0100, Marek Beh=C3=BAn wrote: >=20 > Dear Marc, Thomas, >=20 > we have encountered the following problem that can hopefully be put > some light onto: What is the intended way to set affinity (and possibly > other irq attributes) of parent IRQ of chained IRQs, when using the > irqdomain API? Simples: you can't. What sense does it make to change the affinity of the parent interrupt, given that its fate is tied to *all* of the other interrupts that are muxed to it? Moving the parent interrupt breaks userspace's view of how interrupt affinity is managed (change the affinity of one interrupt, see all the others move the same way). Which is why we don't expose this interrupt to userspace, as this can only lead to bad things. Note that this has nothing to do with the irqdomain API, but everything to do with the userspace ABI. >=20 > We are working on a driver that > - registers an irqchip and adds an irqdomain > - calls irq_set_chained_handler_and_data(parent_irq, handler) > where handler triggers handling of child IRQs > - but since parent_irq isn't requested for with request_thread_irq(), > it does not show up in proc/sysfs, only in debugfs > - the HW does not support setting affinity for the chained IRQs, only=20 > the parent (which comes from a GIC chip) >=20 > The problem is that he parent IRQ, as mentioned in the third point, does > not show up in proc/sysfs. >=20 > Is there some precedent for this? There were precedents of irqchips doing terrible things, such as implementing a set_affinity() callback in the chained irqchip. Thankfully, they have been either fixed or eradicated. M. --=20 Without deviation from the norm, progress is not possible.