Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp543948pxb; Mon, 16 Aug 2021 11:15:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr18K3apBgRQBF5vtR67j44EYenKrQ5S6a9ZevU69nIsU57wZqqqgFWDjtitvbnLqPezqX X-Received: by 2002:a17:907:1c9b:: with SMTP id nb27mr17513723ejc.226.1629137747686; Mon, 16 Aug 2021 11:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629137747; cv=none; d=google.com; s=arc-20160816; b=aM+OyIm6tzD9gmQA8RCWJP3EYlzPq54hOfAGlXUkMOFPL4dkPZocvbBddWoEawoVuY 6GkdH00NTQlujaRDJK9FkYp2TU0cB9iFs7CdEzU3NTCPu2Ap3lsUZFOMCP53aoo5LMIU Aijo72VTlcAgUn+4C3sJAvJ3hwEKrE9dWKtJHTKSkzsGE5F8xU0FA2dAxIua1mgau6ky Q1klJumhI9wAMa6ijM4NzYrPcUS9CgyqbwRcBRBC/ckKmjyttbNZ3MhBoW2VE9j+XdhA QflQNAmCI13Izg+q738pmlyjuOv3PXWix5oeXt/s9sAh+wtU6SCLUecy8hpzUNbzcN2h zdjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OgXtNKQVWNS/t9DnTxT4k+sKuavXVHdSyozmTrDmIzs=; b=LIxfKOn/DrnfM+qX/WZgSUPcHRqUCthvvxdeU8D7MVjxUERQVmzkGgU+mFEyXr2GCZ 5PBRCQtvDA6ehHocS180vtSYIosNiG41QpSizcYXPcY8cSAj8m80HdfomO9LEjkY727H TiqXLwRFP9Wc+BrkHYgBRb8j1t3Uh74wR+OWucgLpcQJzo8dNNFxxJbXaQQpi0PU24+O 2TPZXBK/mEtesFja+ILtjQcpa0qB3lSXgfPnIi5jRCt5cqmo1W+ktic34SMPd5TnZ6CH boTKmieQsFDUID9sitws43Bj9tSbZ+yY1GjjwhAJ39O1Y82R520EHEA8KwCUc38qR4oE qJdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VQMcJfqD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si12064059edx.592.2021.08.16.11.15.24; Mon, 16 Aug 2021 11:15:47 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VQMcJfqD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230105AbhHPSMa (ORCPT + 99 others); Mon, 16 Aug 2021 14:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbhHPSMa (ORCPT ); Mon, 16 Aug 2021 14:12:30 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50899C061764; Mon, 16 Aug 2021 11:11:58 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id a15so5587798iot.2; Mon, 16 Aug 2021 11:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OgXtNKQVWNS/t9DnTxT4k+sKuavXVHdSyozmTrDmIzs=; b=VQMcJfqDIF28JPMngb0oQ/7fJS4RV/h/jGqHDfDcji1nnRVIW5va2razqqgzHvBHOS TGfaCQjdn1vsY7Aam4D1pRST+6Ff/b4jXbQdLkSUS/jeJp2FMDX4bx1t2rZgASQVXNPn WOJw/pN70skdHEW9+0y1qly5biPDnQ+jn9qcKqMzwA6DZEksN2oYTuSgCkTJlXiMqKBz Et09bRVTahG0zDEiaW3HwGOd6dqWseR7SEYxBZQ4cNJ2DaOZuDpgFczJoNGB3XsmyVO1 YQZzJ7c0yfYdDp8kx9lkckpUCjm21/JIkZG4vjROEk/KkAooM4GdibKsTu5Il6ecpfmq 277w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OgXtNKQVWNS/t9DnTxT4k+sKuavXVHdSyozmTrDmIzs=; b=dBmopis+IxKL3SfqvUk3TepQgG2G+tsn/g5hw4Y2elP/wPmhe2iWLMNXAGYtv+qCA3 n8LuFk6wTwCNFIlNQhpU4DEsblNDre1awaeeKwoz0d7peXIYZi4AGeDBmW8nkG+lXMjm q8my3wGuUSG90o1p44hFPPKXecHZfP8a3M2mVDrwoXVR8ADPEEfQ5O/IPYSiONRiHFUK Qzi3hZuisZjb8lw2cCSdnsGPobJpoT2sKzk7JDC7MOyh0uYs5pmXF1raY/jq4uGVx1R7 HQ3JDPbeF+ZIGwex5HIKNtOndK/ivmqqPtD7AXSpTESzSWex/b5MRJGipVLUPXF7qeBL nMQA== X-Gm-Message-State: AOAM530KUO7xM7Nf3dy+6ibNmmvJjJc3fyUkW+mJAexzGku/k7VJhjFC /adnouicA0Uqtv95R2mrBVw5PdgCg2yPBnDQk3Y= X-Received: by 2002:a5d:9eda:: with SMTP id a26mr150414ioe.166.1629137517690; Mon, 16 Aug 2021 11:11:57 -0700 (PDT) MIME-Version: 1.0 References: <20210720232624.1493424-1-nitesh@redhat.com> <20210720232624.1493424-11-nitesh@redhat.com> In-Reply-To: <20210720232624.1493424-11-nitesh@redhat.com> From: Jassi Brar Date: Mon, 16 Aug 2021 13:11:47 -0500 Message-ID: Subject: Re: [PATCH v5 10/14] mailbox: Use irq_update_affinity_hint To: Nitesh Narayan Lal Cc: Linux Kernel Mailing List , linux-scsi@vger.kernel.org, intel-wired-lan@lists.osuosl.org, "" , linux-api@vger.kernel.org, linux-pci@vger.kernel.org, Thomas Gleixner , jesse.brandeburg@intel.com, Robin Murphy , mtosatti@redhat.com, mingo@kernel.org, jbrandeb@kernel.org, frederic@kernel.org, juri.lelli@redhat.com, abelits@marvell.com, Bjorn Helgaas , Steven Rostedt , peterz@infradead.org, "David S . Miller" , Andrew Morton , Stephen Rothwell , stephen@networkplumber.org, rppt@linux.vnet.ibm.com, chris.friesen@windriver.com, Marc Zyngier , nhorman@tuxdriver.com, pjwaskiewicz@gmail.com, sassmann@redhat.com, thenzl@redhat.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com, sathya.prakash@broadcom.com, sreekanth.reddy@broadcom.com, suganath-prabu.subramani@broadcom.com, james.smart@broadcom.com, dick.kennedy@broadcom.com, jkc@redhat.com, faisal.latif@intel.com, shiraz.saleem@intel.com, tariqt@nvidia.com, ahleihel@redhat.com, kheib@redhat.com, borisp@nvidia.com, saeedm@nvidia.com, benve@cisco.com, govind@gmx.com, ajit.khaparde@broadcom.com, sriharsha.basavapatna@broadcom.com, somnath.kotur@broadcom.com, nilal@redhat.com, tatyana.e.nikolova@intel.com, mustafa.ismail@intel.com, ahs3@redhat.com, leonro@nvidia.com, chandrakanth.patil@broadcom.com, Bjorn Andersson , Chun-Kuang Hu , Yongqiang Niu , Baolin Wang , poros@redhat.com, minlei@redhat.com, emilne@redhat.com, jejb@linux.ibm.com, martin.petersen@oracle.com, _govind@gmx.com, kabel@kernel.org, Viresh Kumar , Tushar Khandelwal , Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 20, 2021 at 6:27 PM Nitesh Narayan Lal wrote: > > The driver uses irq_set_affinity_hint() to: > > - Set the affinity_hint which is consumed by the userspace for > distributing the interrupts > > - Enforce affinity > > As per commit 6ac17fe8c14a ("mailbox: bcm-flexrm-mailbox: Set IRQ affinity > hint for FlexRM ring IRQs") the latter is done to ensure that the FlexRM > ring interrupts are evenly spread across all available CPUs. However, since > commit a0c9259dc4e1 ("irq/matrix: Spread interrupts on allocation") the > spreading of interrupts is dynamically performed at the time of allocation. > Hence, there is no need for the drivers to enforce their own affinity for > the spreading of interrupts. > > Also, irq_set_affinity_hint() applying the provided cpumask as an affinity > for the interrupt is an undocumented side effect. To remove this side > effect irq_set_affinity_hint() has been marked as deprecated and new > interfaces have been introduced. Hence, replace the irq_set_affinity_hint() > with the new interface irq_update_affinity_hint() that only sets the > affinity_hint pointer. > > Signed-off-by: Nitesh Narayan Lal > --- > drivers/mailbox/bcm-flexrm-mailbox.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c > index 78073ad1f2f1..16982c13d323 100644 > --- a/drivers/mailbox/bcm-flexrm-mailbox.c > +++ b/drivers/mailbox/bcm-flexrm-mailbox.c > @@ -1298,7 +1298,7 @@ static int flexrm_startup(struct mbox_chan *chan) > val = (num_online_cpus() < val) ? val / num_online_cpus() : 1; > cpumask_set_cpu((ring->num / val) % num_online_cpus(), > &ring->irq_aff_hint); > - ret = irq_set_affinity_hint(ring->irq, &ring->irq_aff_hint); > + ret = irq_update_affinity_hint(ring->irq, &ring->irq_aff_hint); > if (ret) { > dev_err(ring->mbox->dev, > "failed to set IRQ affinity hint for ring%d\n", > @@ -1425,7 +1425,7 @@ static void flexrm_shutdown(struct mbox_chan *chan) > > /* Release IRQ */ > if (ring->irq_requested) { > - irq_set_affinity_hint(ring->irq, NULL); > + irq_update_affinity_hint(ring->irq, NULL); > free_irq(ring->irq, ring); > ring->irq_requested = false; > } > Seems ok to me. But I don't have the h/w to test. Acked-by: Jassi Brar cheers.