Re: [PATCH V2] driver core: auxiliary bus: Fix sysfs creation on bind

From: Jacob Keller

Date: Thu Feb 19 2026 - 17:22:55 EST




On 2/19/2026 1:04 PM, Tariq Toukan wrote:
From: Amir Tzin <amirtz@xxxxxxxxxx>

In case an auxiliary device with IRQs directory is unbinded, the
directory is released, but auxdev->sysfs.irq_dir_exists remains true.
This leads to a failure recreating the directory on bind [1].

Expose functions auxiliary_device_sysfs_irq_dir_init() and
auxiliary_device_sysfs_irq_dir_destroy(). Move the responsibility for
the IRQs directory creation and destruction to the drivers. This change
corresponds to the general concept according to which the core driver
manages the auxiliary device locking and lifetime. Now the auxiliary
device sysfs related fields, irq_dir_exists and lock, are redundant and
can be removed.

mlx5 SFs, the only users of IRQs sysfs API, must align. Create the
directory before a SF control irq is requested and destroy it upon
its release.

[1]
[] mlx5_core.sf mlx5_core.sf.2: mlx5_irq_affinity_request:167:(pid 1939):
Failed to create sysfs entry for irq 56, ret = -2
[] mlx5_core.sf mlx5_core.sf.2: mlx5_eq_table_create:1195:(pid 1939):
Failed to create async EQs
[] mlx5_core.sf mlx5_core.sf.2: mlx5_load:1362:(pid 1939):
Failed to create EQs


This approach looks sensible, and managing the lifetime in the parent driver is easier than exposing the extra locks and adding more potential issues for mismanaging those locks.

Reviewed-by: Jacob Keller <jacob.e.keller@xxxxxxxxx>