driver core, iio: suppress driver_override
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | driver core: allow certain drivers prohibit override via sysfsDocumentation/ drivers/ include/ | +8 | 1 reply | |
| 2/4 | spi: Support suppress_override_attrs flagdrivers/ | +11 | 2 replies | |
| 3/4 | iio: imu: inv_mpu6050: Suppress driver_override sysfs attributedrivers/ | +1 | 0 replies | |
| 4/4 | iio: imu: inv_icm42600: Suppress driver_override sysfs attributedrivers/ | +2 | 0 replies |
Reviews trailers per patch
1 of 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Jonathan Cameron | Mark Brown |
|---|---|---|
| Series | R-b | |
| 1/4 | ||
| 2/4 | A-b | |
| 3/4 | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 0/4] driver core, iio: suppress driver_override
Recently Sashiko started reporting the missed NULL check of spi_get_device_match_data() or device_get_match_data() in SPI drivers in IIO subsystem. It appears that the way to crash can be made by use of driver_override sysfs attribute. However, many drivers, that may be instantiate via ACPI, OF, or, in some cases, user space won't work without necessary driver data. These are, e.g., most of the drivers in IIO subsystem. Trying to override the driver for the device that has no matching entry makes no sense in such cases and might lead to a crash, when the driver is not prepared for that. Instead of adding a NULL check for driver data pointer in each of that drivers, effectively meaning a dead code for normal functionality, introduce a special attribute in the struct device_driver to allow drivers just to hide the attribute for good.
The last two patches are the examples of use and code simplification at the same time.
I consider getting an Ack from Mark for SPI, and from Jonathan for IIO and route this via driver core, while providing an immutable branch/tag for the above mentioned stakeholders.
Note, this doesn't change the state of affairs for some busses that do not have driver_override flag set while using custom approach. On a brief look it's the s390 crypto case which may not ever need the above and hence left untouched.
Andy Shevchenko (4):
driver core: allow certain drivers prohibit override via sysfs
spi: Support suppress_override_attrs flag
iio: imu: inv_mpu6050: Suppress driver_override sysfs attribute
iio: imu: inv_icm42600: Suppress driver_override sysfs attribute
Documentation/driver-api/driver-model/binding.rst | 4 ++++ drivers/base/bus.c | 4 ++-- drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 8 ++------ drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 3 +-- drivers/spi/spi.c | 11 +++++++++++ include/linux/device/driver.h | 2 ++ 6 files changed, 22 insertions(+), 10 deletions(-)
Signature · 1 line
2.50.1