mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
soc/aspeed: espi: Fix mutex_trylock handling
Fix incorrect handling on mutex_trylock for non-blocking access. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Change-Id: Ica0b1cc01e8d1891cfd0fe6938c55b32098b9f5b
This commit is contained in:
parent
1392d9c02e
commit
8d428079d9
|
|
@ -32,8 +32,8 @@ static long aspeed_espi_flash_get_rx(struct file *fp,
|
|||
struct aspeed_espi_ctrl *espi_ctrl = espi_flash->ctrl;
|
||||
|
||||
if (fp->f_flags & O_NONBLOCK) {
|
||||
if (mutex_trylock(&espi_flash->get_rx_mtx))
|
||||
return -EBUSY;
|
||||
if (!mutex_trylock(&espi_flash->get_rx_mtx))
|
||||
return -EAGAIN;
|
||||
|
||||
if (!espi_flash->rx_ready) {
|
||||
rc = -ENODATA;
|
||||
|
|
|
|||
|
|
@ -105,8 +105,8 @@ static long aspeed_espi_oob_get_rx(struct file *fp,
|
|||
struct aspeed_espi_ctrl *espi_ctrl = espi_oob->ctrl;
|
||||
|
||||
if (fp->f_flags & O_NONBLOCK) {
|
||||
if (mutex_trylock(&espi_oob->get_rx_mtx))
|
||||
return -EBUSY;
|
||||
if (!mutex_trylock(&espi_oob->get_rx_mtx))
|
||||
return -EAGAIN;
|
||||
|
||||
if (!espi_oob->rx_ready) {
|
||||
rc = -ENODATA;
|
||||
|
|
@ -263,7 +263,7 @@ static long aspeed_espi_oob_put_tx(struct file *fp,
|
|||
struct aspeed_espi_ctrl *espi_ctrl = espi_oob->ctrl;
|
||||
|
||||
if (!mutex_trylock(&espi_oob->put_tx_mtx))
|
||||
return -EBUSY;
|
||||
return -EAGAIN;
|
||||
|
||||
if (espi_oob->dma_mode && espi_ctrl->model->version != ESPI_AST2500) {
|
||||
rc = aspeed_espi_oob_dma_desc_put_tx(fp, ioc, espi_oob);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ static long aspeed_espi_perif_pc_get_rx(struct file *fp,
|
|||
struct aspeed_espi_ctrl *espi_ctrl = espi_perif->ctrl;
|
||||
|
||||
if (fp->f_flags & O_NONBLOCK) {
|
||||
if (mutex_trylock(&espi_perif->pc_rx_mtx))
|
||||
return -EBUSY;
|
||||
if (!mutex_trylock(&espi_perif->pc_rx_mtx))
|
||||
return -EAGAIN;
|
||||
|
||||
if (!espi_perif->rx_ready) {
|
||||
rc = -ENODATA;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user