diff options
author | 2024-04-09 11:42:52 -0400 | |
---|---|---|
committer | 2024-04-11 14:08:08 +0200 | |
commit | cf9c37530fdabc0c25a896ff56f4c9208dcb9c86 (patch) | |
tree | 1631d3e5b1c072bc80c13b621e2017ca5e6ead98 /drivers/gpio/gpio-tangier.c | |
parent | serial: sc16is7xx: split into core and I2C/SPI parts (core) (diff) | |
download | linux-cf9c37530fdabc0c25a896ff56f4c9208dcb9c86.tar.gz linux-cf9c37530fdabc0c25a896ff56f4c9208dcb9c86.tar.bz2 linux-cf9c37530fdabc0c25a896ff56f4c9208dcb9c86.zip |
serial: sc16is7xx: split into core and I2C/SPI parts (sc16is7xx_lines)
Before, sc16is7xx_lines was checked for a free (zero) bit first, and then
later it was set only if UART port registration succeeded. Now that
sc16is7xx_lines is shared for the I2C and SPI drivers, there is a
possibility that the two drivers can simultaneously try to reserve the same
line bit at the same time.
To prevent this, make sure line allocation is reserved atomically, and use
a new variable to hold the status of UART port registration.
Now that we no longer need to search if a bit is set, it is now possible
to simplify sc16is7xx_lines allocation by using the IDA framework.
Link: https://lore.kernel.org/all/20231212150302.a9ec5d085a4ba65e89ca41af@hugovil.com/
Link: https://lore.kernel.org/all/CAHp75VebCZckUrNraYQj9k=Mrn2kbYs1Lx26f5-8rKJ3RXeh-w@mail.gmail.com/
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20240409154253.3043822-5-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpio/gpio-tangier.c')
0 files changed, 0 insertions, 0 deletions