RE: [PATCH 5/7] soc: aspeed: Add eSPI flash channel support
From: YH Chung
Date: Mon Jun 29 2026 - 04:25:13 EST
Hi Markus,
> > +++ b/drivers/soc/aspeed/espi/aspeed-espi.c
> …
> > +static void aspeed_espi_flash_rx_work(struct work_struct *work) {
> > + struct aspeed_espi_flash *flash = container_of(work, struct
> aspeed_espi_flash, rx_work);
> > + struct aspeed_espi *espi = container_of(flash, struct aspeed_espi,
> > +flash);
> > +
> > + mutex_lock(&flash->tx_mtx);
> > + aspeed_espi_flash_handle_lun(espi);
> > + mutex_unlock(&flash->tx_mtx);
> > +}
> …
>
> Under which circumstances would you become interested to apply a statement
> like “guard(mutex)(&flash->tx_mtx);”?
> https://elixir.bootlin.com/linux/v7.1.1/source/include/linux/mutex.h#L253
>
Thanks for the suggestion. I agree that guard(mutex) is helpful when a locked
section has multiple exit paths. Since this worker currently has a single
simple path, I would prefer to keep the explicit mutex_lock()/mutex_unlock()
pair for readability. I can switch to guard(mutex) if you think it would be
better in this case.
Thanks,
Yun Hsuan