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] [day] [month] [year] [list]
Message-ID: <4097a1d7-5594-44e2-b2f0-1d1877981928@acm.org>
Date: Thu, 22 Jan 2026 16:57:28 -0800
From: Bart Van Assche <bvanassche@....org>
To: Nitin Rawat <nitin.rawat@....qualcomm.com>, mani@...nel.org,
 James.Bottomley@...senPartnership.com, martin.petersen@...cle.com
Cc: linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-scsi@...r.kernel.org
Subject: Re: [PATCH V1 1/3] ufs: ufs-qcom: Add UFS ESI CPU affinity support

On 1/22/26 6:13 AM, Nitin Rawat wrote:
> +static void ufs_qcom_set_esi_affinity(struct ufs_hba *hba)
> +{
> +	struct msi_desc *desc;
> +	int ret, i = 0, nr_irqs = 0;
> +	const cpumask_t *mask;
> +	int cpu;
> +
> +	__msi_lock_descs(hba->dev);
> +	/* Count the number of MSI descriptors */
> +	msi_for_each_desc(desc, hba->dev, MSI_DESC_ALL) {
> +		nr_irqs++;
> +	}
> +	__msi_unlock_descs(hba->dev);
> +
> +	if (nr_irqs == 0)
> +		return;
> +
> +	__msi_lock_descs(hba->dev);
> +	/* Set affinity hints for each interrupt in round-robin fashion */
> +	msi_for_each_desc(desc, hba->dev, MSI_DESC_ALL) {
> +		if (i >= nr_irqs)
> +			break;
> +
> +		/* Distribute interrupts across online CPUs in round-robin */
> +		cpu = cpumask_nth(i % num_online_cpus(), cpu_online_mask);
> +		mask = get_cpu_mask(cpu);
> +		if (!cpumask_subset(mask, cpu_online_mask)) {
> +			dev_err(hba->dev, "Invalid CPU %d in map, using online CPUs\n",
> +				cpu);
> +			mask = cpu_online_mask;
> +		}
> +
> +		ret = irq_set_affinity_hint(desc->irq, mask);
> +		if (ret < 0)
> +			dev_err(hba->dev, "Failed to set affinity hint to CPU %d for ESI IRQ %d, err = %d\n",
> +				cpu, desc->irq, ret);
> +
> +		i++;
> +	}
> +	__msi_unlock_descs(hba->dev);
> +}

Why an entirely new function for setting interrupt affinity? Why isn't
irq_create_affinity_masks() good enough? Are you aware that
devm_platform_get_irqs_affinity() calls irq_create_affinity_masks()?

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ