Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp353976pxu; Wed, 25 Nov 2020 05:05:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyI7SCoYoWHWvvuj+sA6wEOJGCNvz6SrjvxdeD49bfb5tmuuKz2hW0wRR69BT6ntXeLB+vk X-Received: by 2002:a17:906:cede:: with SMTP id si30mr3039605ejb.16.1606309527210; Wed, 25 Nov 2020 05:05:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606309527; cv=none; d=google.com; s=arc-20160816; b=K5g4lbM2xBHRPw2w6fwHGGxvXShQ9q2zgtIDrJYpJ5rR+gFAbDkrWEFwoxTReK6CTr OcMRFrFDLz7EUPmt4W9eygkfkJio9za/t9U8HdY5A1HBaLOUuXcGJr845y1UPg1YKXEO LP0qqSS6f3rHTklfMkaoogJY/Pa/FdkG458qfDuDbIQOrwblPbuaprfEyAi4lCR45CVo UO8SdKAJFUndUHTzdqzFEuKOgDfQXaHqRrnvrzQVfy3B71Z5zUgnlw3LlxcytPndTZIr t5RGRWc3WZjX385KXAlm8Ac6xVK2xRQ1BA50pn1/p6aVlXxnBxDLUyxCa5UBQbJwd6RP I+9w== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=XXkariPjFINxPap3zuxAB/5Z/1PG1F6rfdGsq8+Kk1g=; b=nktCIu9XV7ixXir+Z5CdjRmaQAJJEm0Qk79ea+QDiN3p0vSUoluHy+9r+ZRoZX1Y29 YRw10ZiwOa0AncdMacfZ1wbuc9Tyo4pLyELAnbjZz9qUcuOUQZF6kETWNNCrfGoEQ/Kl O/W69APmzQYf4Wtrw/2EjpeZVr9Sri4JpkXu91JtjGoaLM49Qi+4dTNV5hRIH/4Z6F5Y OtZvznt7gWyDTeG32BZCqeAJGN9BNGMUmLftkqJGMFAZnUJURZBZowZvE5dv1w+OkBmW HUvTf5wddv6v4zK6+ALB7o6jMNXkgXFsqhE3HHWExl33xEx2BPi0rit7acZiMKaGWWIn 7/vg== 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 wr19si1180951ejb.218.2020.11.25.05.05.03; Wed, 25 Nov 2020 05:05:27 -0800 (PST) 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 S1729508AbgKYNB5 (ORCPT + 99 others); Wed, 25 Nov 2020 08:01:57 -0500 Received: from 7.mo52.mail-out.ovh.net ([188.165.59.253]:52695 "EHLO 7.mo52.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729475AbgKYNB5 (ORCPT ); Wed, 25 Nov 2020 08:01:57 -0500 Received: from mxplan5.mail.ovh.net (unknown [10.108.16.164]) by mo52.mail-out.ovh.net (Postfix) with ESMTPS id 35B1B21BD52; Wed, 25 Nov 2020 13:45:40 +0100 (CET) Received: from kaod.org (37.59.142.100) by DAG8EX1.mxp5.local (172.16.2.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Wed, 25 Nov 2020 13:45:39 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-100R003764d7788-e883-4b91-8c12-09b64416a181, 13817E1CA0648EB9EE095497159C33290D197662) smtp.auth=groug@kaod.org Date: Wed, 25 Nov 2020 13:45:38 +0100 From: Greg Kurz To: Laurent Vivier CC: , , "Paul Mackerras" , , Thomas Gleixner , Marc Zyngier , , Benjamin Herrenschmidt , "Michael S . Tsirkin" , Christoph Hellwig , Michael Ellerman Subject: Re: [PATCH v2 1/2] genirq: add an irq_create_mapping_affinity() function Message-ID: <20201125134538.71895275@bahia.lan> In-Reply-To: <20201125111657.1141295-2-lvivier@redhat.com> References: <20201125111657.1141295-1-lvivier@redhat.com> <20201125111657.1141295-2-lvivier@redhat.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [37.59.142.100] X-ClientProxiedBy: DAG5EX2.mxp5.local (172.16.2.42) To DAG8EX1.mxp5.local (172.16.2.71) X-Ovh-Tracer-GUID: d00713c1-4f18-4b54-a786-baae8bb63fee X-Ovh-Tracer-Id: 5905345013404899832 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedujedrudehtddggeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffukfgjfhfogggtgfhisehtjeeftdertddvnecuhfhrohhmpefirhgvghcumfhurhiiuceoghhrohhugheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeetgffffffggfekgeffteekhffhueelffdvhedvgfdthfeiudetvddulefgveevteenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddttdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepghhrohhugheskhgrohgurdhorhhgpdhrtghpthhtohepmhhpvgesvghllhgvrhhmrghnrdhiugdrrghu Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Nov 2020 12:16:56 +0100 Laurent Vivier wrote: > This function adds an affinity parameter to irq_create_mapping(). > This parameter is needed to pass it to irq_domain_alloc_descs(). > > irq_create_mapping() is a wrapper around irq_create_mapping_affinity() > to pass NULL for the affinity parameter. > > No functional change. > > Signed-off-by: Laurent Vivier > --- Reviewed-by: Greg Kurz > include/linux/irqdomain.h | 12 ++++++++++-- > kernel/irq/irqdomain.c | 13 ++++++++----- > 2 files changed, 18 insertions(+), 7 deletions(-) > > diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h > index 71535e87109f..ea5a337e0f8b 100644 > --- a/include/linux/irqdomain.h > +++ b/include/linux/irqdomain.h > @@ -384,11 +384,19 @@ extern void irq_domain_associate_many(struct irq_domain *domain, > extern void irq_domain_disassociate(struct irq_domain *domain, > unsigned int irq); > > -extern unsigned int irq_create_mapping(struct irq_domain *host, > - irq_hw_number_t hwirq); > +extern unsigned int irq_create_mapping_affinity(struct irq_domain *host, > + irq_hw_number_t hwirq, > + const struct irq_affinity_desc *affinity); > extern unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec); > extern void irq_dispose_mapping(unsigned int virq); > > +static inline unsigned int irq_create_mapping(struct irq_domain *host, > + irq_hw_number_t hwirq) > +{ > + return irq_create_mapping_affinity(host, hwirq, NULL); > +} > + > + > /** > * irq_linear_revmap() - Find a linux irq from a hw irq number. > * @domain: domain owning this hardware interrupt > diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c > index cf8b374b892d..e4ca69608f3b 100644 > --- a/kernel/irq/irqdomain.c > +++ b/kernel/irq/irqdomain.c > @@ -624,17 +624,19 @@ unsigned int irq_create_direct_mapping(struct irq_domain *domain) > EXPORT_SYMBOL_GPL(irq_create_direct_mapping); > > /** > - * irq_create_mapping() - Map a hardware interrupt into linux irq space > + * irq_create_mapping_affinity() - Map a hardware interrupt into linux irq space > * @domain: domain owning this hardware interrupt or NULL for default domain > * @hwirq: hardware irq number in that domain space > + * @affinity: irq affinity > * > * Only one mapping per hardware interrupt is permitted. Returns a linux > * irq number. > * If the sense/trigger is to be specified, set_irq_type() should be called > * on the number returned from that call. > */ > -unsigned int irq_create_mapping(struct irq_domain *domain, > - irq_hw_number_t hwirq) > +unsigned int irq_create_mapping_affinity(struct irq_domain *domain, > + irq_hw_number_t hwirq, > + const struct irq_affinity_desc *affinity) > { > struct device_node *of_node; > int virq; > @@ -660,7 +662,8 @@ unsigned int irq_create_mapping(struct irq_domain *domain, > } > > /* Allocate a virtual interrupt number */ > - virq = irq_domain_alloc_descs(-1, 1, hwirq, of_node_to_nid(of_node), NULL); > + virq = irq_domain_alloc_descs(-1, 1, hwirq, of_node_to_nid(of_node), > + affinity); > if (virq <= 0) { > pr_debug("-> virq allocation failed\n"); > return 0; > @@ -676,7 +679,7 @@ unsigned int irq_create_mapping(struct irq_domain *domain, > > return virq; > } > -EXPORT_SYMBOL_GPL(irq_create_mapping); > +EXPORT_SYMBOL_GPL(irq_create_mapping_affinity); > > /** > * irq_create_strict_mappings() - Map a range of hw irqs to fixed linux irqs