All of lore.kernel.org
 help / color / mirror / Atom feed
* gpio-f7188x: Fix concurrent GPIO accesses (and minor improvements)
@ 2015-08-20 18:03 Vincent Pelletier
  2015-08-20 18:03 ` [1/4] gpio: gpio-f7188x: Use mutex for access serialisation Vincent Pelletier
  0 siblings, 1 reply; 27+ messages in thread
From: Vincent Pelletier @ 2015-08-20 18:03 UTC (permalink / raw)
  To: linux-gpio; +Cc: Simon Guinot

Hello,

Making intensive use of the GPIOs on this SuperIO chip, I triggered a race
condition causing apparently the wrong GPIO pins to be modified (and likely
read) randomly.
For some reason (unclear to me, I'm not used at all to kernel API),
request_muxed_region/release_region as it is used in this driver is not
sufficient to serialize accesses.
Also, reading other drivers for the same chip, I see a different pattern:
rather than accessing GPIO registers through the common IO region, this
region is only used for device discovery. From there, per-function base
address is retrieved, and that IO region gets requested once.

So I fixed the concurrent access by:
- using the same access pattern as in other drivers
- adding mutexes around IO region accesses

Once this was done and I got a bit more comfortable with this driver, chip and
gpiolib, I continued and fixed 3 minor issues/lacks.

Regards,
--
Vincent Pelletier


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

end of thread, other threads:[~2016-02-24 14:25 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 18:03 gpio-f7188x: Fix concurrent GPIO accesses (and minor improvements) Vincent Pelletier
2015-08-20 18:03 ` [1/4] gpio: gpio-f7188x: Use mutex for access serialisation Vincent Pelletier
2015-08-20 18:03   ` [2/4] gpio: gpio-f7188x: GPIO bank 0 bit 0 is not available on f71869a Vincent Pelletier
2015-08-20 18:03   ` [3/4] gpio: gpio-f7188x: "get" should retrieve sensed level when available Vincent Pelletier
2015-08-20 18:03   ` [4/4] gpio: gpio-f7188x: Implement get_direction Vincent Pelletier
2015-08-21 17:52   ` [1/4] gpio: gpio-f7188x: Use mutex for access serialisation Simon Guinot
2015-08-21 20:48     ` Vincent Pelletier
2015-08-22 17:04       ` Vincent Pelletier
2015-09-03 18:05       ` Vincent Pelletier
2015-09-04  7:39         ` Simon Guinot
2015-09-09 22:01         ` Simon Guinot
2015-09-09 22:15           ` [PATCH] kernel/resource.c: fix muxed resource handling in __request_region() Simon Guinot
2016-02-19 21:10             ` Vincent Pelletier
2016-02-19 23:25               ` Jesse Barnes
2016-02-20 17:11                 ` Linus Torvalds
2016-02-20 22:15                   ` Jesse Barnes
2016-02-20 22:15                     ` Jesse Barnes
2016-02-22 13:49                     ` Alan Cox
2016-02-22 20:46                       ` Jesse Barnes
2016-02-23 16:19                         ` Simon Guinot
2016-02-23 17:19                           ` Jesse Barnes
2016-02-23 21:38                             ` One Thousand Gnomes
2016-02-24 14:25                             ` [PATCH] kernel/resource.c: ensure parent is not freed " Simon Guinot
2016-02-23  8:00                       ` [PATCH] kernel/resource.c: fix muxed resource handling " Vincent Pelletier
2015-09-12 13:26           ` [1/4] gpio: gpio-f7188x: Use mutex for access serialisation Vincent Pelletier
2015-09-04 13:48       ` Vincent Donnefort
2015-09-05  7:43         ` Vincent Pelletier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.