Linux IIO development
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: adc: ad7313: fix non-const info struct
@ 2024-11-22 17:39 David Lechner
  2024-11-22 17:39 ` [PATCH 1/2] iio: adc: ad7313: fix irq number stored in static " David Lechner
  2024-11-22 17:39 ` [PATCH 2/2] iio: adc: ad7173: make struct ad_sigma_delta_info ad7173_sigma_delta_info const David Lechner
  0 siblings, 2 replies; 6+ messages in thread
From: David Lechner @ 2024-11-22 17:39 UTC (permalink / raw)
  To: Jonathan Cameron, Dumitru Ceclan
  Cc: Michael Hennerich, Nuno Sa, Michael Walle, Andy Shevchenko,
	linux-iio, linux-kernel, Guillaume Ranquet, Uwe Kleine-König,
	David Lechner

While working ad7124, Uwe pointed out a bug in the ad7313 driver.
static struct ad_sigma_delta_info ad7173_sigma_delta_info was not const
and was being modified during driver probe, which could lead to race
conditions if two instances of the driver were probed at the same time.

I've made an attempt to fix it, but it isn't exactly trivial and I have
only compile tested it. Guillaume has access to ad4111 hardware, so it
would be good to get a Tested-by from him to make sure this doesn't
break anything.

Reported-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
David Lechner (2):
      iio: adc: ad7313: fix irq number stored in static info struct
      iio: adc: ad7173: make struct ad_sigma_delta_info ad7173_sigma_delta_info const

 drivers/iio/adc/ad7173.c               | 476 +++++++++++++++++----------------
 drivers/iio/adc/ad_sigma_delta.c       |  14 +-
 include/linux/iio/adc/ad_sigma_delta.h |   5 +-
 3 files changed, 264 insertions(+), 231 deletions(-)
---
base-commit: 9dd2270ca0b38ee16094817f4a53e7ba78e31567
change-id: 20241122-iio-adc-ad7313-fix-non-const-info-struct-92e59b91ee2e

Best regards,
-- 
David Lechner <dlechner@baylibre.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-25 14:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-22 17:39 [PATCH 0/2] iio: adc: ad7313: fix non-const info struct David Lechner
2024-11-22 17:39 ` [PATCH 1/2] iio: adc: ad7313: fix irq number stored in static " David Lechner
2024-11-25  8:59   ` Uwe Kleine-König
2024-11-25 14:57     ` David Lechner
2024-11-22 17:39 ` [PATCH 2/2] iio: adc: ad7173: make struct ad_sigma_delta_info ad7173_sigma_delta_info const David Lechner
2024-11-24 17:48   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox