lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABb+yY3Wz57dYZ8pa5zHatGRu1RFmyRK+UvN+B8txCcOUTPQzw@mail.gmail.com>
Date:   Mon, 16 Aug 2021 13:11:47 -0500
From:   Jassi Brar <jassisinghbrar@...il.com>
To:     Nitesh Narayan Lal <nitesh@...hat.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-scsi@...r.kernel.org, intel-wired-lan@...ts.osuosl.org,
        "<netdev@...r.kernel.org>" <netdev@...r.kernel.org>,
        linux-api@...r.kernel.org, linux-pci@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        jesse.brandeburg@...el.com, Robin Murphy <robin.murphy@....com>,
        mtosatti@...hat.com, mingo@...nel.org, jbrandeb@...nel.org,
        frederic@...nel.org, juri.lelli@...hat.com, abelits@...vell.com,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Steven Rostedt <rostedt@...dmis.org>, peterz@...radead.org,
        "David S . Miller" <davem@...emloft.net>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        stephen@...workplumber.org, rppt@...ux.vnet.ibm.com,
        chris.friesen@...driver.com, Marc Zyngier <maz@...nel.org>,
        nhorman@...driver.com, pjwaskiewicz@...il.com, sassmann@...hat.com,
        thenzl@...hat.com, kashyap.desai@...adcom.com,
        sumit.saxena@...adcom.com, shivasharan.srikanteshwara@...adcom.com,
        sathya.prakash@...adcom.com, sreekanth.reddy@...adcom.com,
        suganath-prabu.subramani@...adcom.com, james.smart@...adcom.com,
        dick.kennedy@...adcom.com, jkc@...hat.com, faisal.latif@...el.com,
        shiraz.saleem@...el.com, tariqt@...dia.com, ahleihel@...hat.com,
        kheib@...hat.com, borisp@...dia.com, saeedm@...dia.com,
        benve@...co.com, govind@....com, ajit.khaparde@...adcom.com,
        sriharsha.basavapatna@...adcom.com, somnath.kotur@...adcom.com,
        nilal@...hat.com, tatyana.e.nikolova@...el.com,
        mustafa.ismail@...el.com, ahs3@...hat.com, leonro@...dia.com,
        chandrakanth.patil@...adcom.com,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Chun-Kuang Hu <chunkuang.hu@...nel.org>,
        Yongqiang Niu <yongqiang.niu@...iatek.com>,
        Baolin Wang <baolin.wang7@...il.com>, poros@...hat.com,
        minlei@...hat.com, emilne@...hat.com, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, _govind@....com, kabel@...nel.org,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Tushar Khandelwal <Tushar.Khandelwal@....com>,
        Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH v5 10/14] mailbox: Use irq_update_affinity_hint

On Tue, Jul 20, 2021 at 6:27 PM Nitesh Narayan Lal <nitesh@...hat.com> 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 <nitesh@...hat.com>
> ---
>  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 <jaswinder.singh@...aro.org>

cheers.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ