mmc: tmio: comment the ERR_PTR usage in this driver
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 5 Mar 2024 10:56:24 +0000 (11:56 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 5 Mar 2024 12:10:52 +0000 (13:10 +0100)
It is not super obvious why the driver sometimes uses an ERR_PTR for the
current mrq. Explain why in comments.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20240305105623.3379-2-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/tmio_mmc_core.c

index c253d176db69180b9da70036e3594ab587547d0c..93e912afd3ae5aa0bfe46010f93a1c77b1858836 100644 (file)
@@ -972,6 +972,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                return;
        }
 
+       /* Disallow new mrqs and work handlers to run */
        host->mrq = ERR_PTR(-EBUSY);
 
        spin_unlock_irqrestore(&host->lock, flags);
@@ -1006,8 +1007,9 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                        "%s.%d: IOS interrupted: clk %u, mode %u",
                        current->comm, task_pid_nr(current),
                        ios->clock, ios->power_mode);
-       host->mrq = NULL;
 
+       /* Ready for new mrqs */
+       host->mrq = NULL;
        host->clk_cache = ios->clock;
 
        mutex_unlock(&host->ios_lock);