esp-idf/components/driver
Armando 3c8f6dd1cf SPI_BUS_LOCK: fix a concurrency issue
define: lock_bits = (lock->status & LOCK_MASK) >> LOCK_SHIFT;  This `lock_bits` is the Bit 29-20 of the lock->status

1. spi_hdl_1:
   acquire_end_core():
   uint32_t status = lock_status_clear(lock, dev_handle->mask & LOCK_MASK);
   Becuase this is the first `spi_hdl_1`, so after this , lock_bits == 0`b0. status == 0

2. spi_hdl_2:
   acquire_core:
   uint32_t status = lock_status_fetch_set(lock, dev_handle->mask & LOCK_MASK);
   Then here status is 0`b0, but lock_bits == 0`b10. Because this is the `spi_hdl_2`

3. spi_hdl_2:
   `acquire_core` return true, because status == 0. `spi_bus_lock_acquire_start(spi_hdl_2)` then won't block.

4. spi_hdl_2:
   spi_device_polling_end(spi_hdl_2).

5. spi_hdl_1:
   acquire_end_core:
   status is 0, so it cleas the lock->acquiring_dev

6. spi_hdl_2:
   spi_device_polling_end:
   assert(handle == get_acquiring_dev(host)); Fail

Closes https://github.com/espressif/esp-idf/issues/8179
2022-09-06 16:59:02 +08:00
..
deprecated mcpwm: fix multiplication overflow in converting us to compare ticks 2022-08-31 17:38:29 +08:00
esp32 touch_sensor: fix touch_sensor_v1 filter issue 2022-08-23 07:34:51 +00:00
esp32s2 esp_adc: new esp_adc component and adc drivers 2022-07-15 18:31:00 +08:00
esp32s3 touch_sensor: add description to distinguish the API on different target 2022-06-28 02:20:43 +00:00
gpio Merge branch 'contrib/github_pr_9491' into 'master' 2022-08-18 10:49:41 +08:00
i2s driver: specify the interrupt priority 2022-08-15 14:46:56 +08:00
include mcpwm: fix multiplication overflow in converting us to compare ticks 2022-08-31 17:38:29 +08:00
mcpwm mcpwm: don't use keyword operator 2022-08-17 06:31:50 +00:00
rmt driver: specify the interrupt priority 2022-08-15 14:46:56 +08:00
test Merge branch 'bugfix/fix_spi_hd_quad_issue_esp32c3' into 'master' 2022-08-30 10:53:11 +08:00
test_apps gpio: add a test case to test the ability of disabling USB D+ pin pull-up 2022-08-29 19:38:13 +08:00
.build-test-rules.yml touch_sensor: move unit tests to test_app 2022-08-08 19:12:56 +08:00
CMakeLists.txt soc_caps: Introduce SOC_LEDC_SUPPORTED and SOC_I2C_SUPPORTED caps to IDF 2022-08-31 20:43:22 +08:00
dac_common.c build: fix unused tag string 2022-01-18 10:06:08 +08:00
gptimer.c gptimer: add API to get captured count value 2022-08-25 17:55:19 +08:00
i2c.c I2C: i2c_port_t type is now an enumeration 2022-08-24 10:51:09 +08:00
Kconfig mcpwm: deprecate legacy driver 2022-07-27 15:08:58 +08:00
ledc.c ledc: Fix the usage of ledc_ls_timer_update and ledc_timer_rst 2022-08-19 19:07:46 +08:00
linker.lf sdm: added channel allocator for sigma delta module 2022-07-20 14:59:50 +08:00
pulse_cnt.c mcpwm: added enable/disable functions 2022-08-15 14:46:56 +08:00
sdio_slave.c hal: Deprecate interrupt_controller_hal.h, cpu_hal.h and cpu_ll.h interfaces 2022-07-22 00:06:06 +08:00
sdkconfig.rename mcpwm: rename MCPWM_ISR_IN_IRAM to MCPWM_ISR_IRAM_SAFE 2022-06-02 15:01:18 +08:00
sdm.c driver: remove -Wno-format flag 2022-08-08 08:30:09 +00:00
sdmmc_host.c driver: remove -Wno-format flag 2022-08-08 08:30:09 +00:00
sdmmc_private.h driver: update copyright notice 2021-05-25 17:43:57 +02:00
sdmmc_transaction.c driver: remove -Wno-format flag 2022-08-08 08:30:09 +00:00
sdspi_crc.c driver: update copyright notice 2021-05-25 17:43:57 +02:00
sdspi_crc.h driver: update copyright notice 2021-05-25 17:43:57 +02:00
sdspi_host.c Merge branch 'fix/sdspi_no_cs' into 'master' 2022-08-11 20:17:26 +08:00
sdspi_private.h driver: sdspi: add support for R1b response 2022-05-30 15:39:01 +02:00
sdspi_transaction.c driver: remove -Wno-format flag 2022-08-08 08:30:09 +00:00
spi_bus_lock.c SPI_BUS_LOCK: fix a concurrency issue 2022-09-06 16:59:02 +08:00
spi_common.c spi: move spi_common_internal to esp_private 2022-06-24 19:12:13 +08:00
spi_master.c Merge branch 'test/add_test_spi_sio_master_all' into 'master' 2022-08-18 14:41:48 +08:00
spi_slave_hd.c esp_hw_support: Remove compare_set.h API 2022-07-22 00:06:06 +08:00
spi_slave.c spi: move spi_common_internal to esp_private 2022-06-24 19:12:13 +08:00
temperature_sensor.c driver: remove -Wno-format flag 2022-08-08 08:30:09 +00:00
touch_sensor_common.c hw_support: move rtc_ctrl from driver to hw_support 2022-04-29 14:28:09 +08:00
twai.c esp_hw_support: Remove compare_set.h API 2022-07-22 00:06:06 +08:00
uart.c uart: fixed sclk_freq not init warning when compiling with asserts disabled 2022-08-26 11:52:46 +08:00
usb_serial_jtag.c gpio: fix USB D+ pin cannot disable pullup 2022-08-19 15:05:28 +08:00