]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: dw_mmc: Remove queue from dw_mci
authorShawn Lin <shawn.lin@rock-chips.com>
Tue, 16 Dec 2025 11:50:06 +0000 (19:50 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Feb 2026 11:06:53 +0000 (12:06 +0100)
It's pointless to use a queue if only one slot is supported.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/dw_mmc.h

index 02a88826928d8b57b3ec88d0533a2fea01dce5a7..4ec60740b0b45d37d6d82b0991dbbc5546b3442b 100644 (file)
@@ -1346,8 +1346,6 @@ static void dw_mci_queue_request(struct dw_mci *host, struct dw_mci_slot *slot,
        if (host->state == STATE_IDLE) {
                host->state = STATE_SENDING_CMD;
                dw_mci_start_request(host, slot);
-       } else {
-               list_add_tail(&slot->queue_node, &host->queue);
        }
 }
 
@@ -1811,28 +1809,16 @@ static void dw_mci_request_end(struct dw_mci *host, struct mmc_request *mrq)
        __releases(&host->lock)
        __acquires(&host->lock)
 {
-       struct dw_mci_slot *slot;
        struct mmc_host *prev_mmc = host->mmc;
 
        WARN_ON(host->cmd || host->data);
 
        host->mrq = NULL;
-       if (!list_empty(&host->queue)) {
-               slot = list_entry(host->queue.next,
-                                 struct dw_mci_slot, queue_node);
-               list_del(&slot->queue_node);
-               dev_vdbg(host->dev, "list not empty: %s is next\n",
-                        mmc_hostname(host->mmc));
-               host->state = STATE_SENDING_CMD;
-               dw_mci_start_request(host, slot);
-       } else {
-               dev_vdbg(host->dev, "list empty\n");
 
-               if (host->state == STATE_SENDING_CMD11)
-                       host->state = STATE_WAITING_CMD11_DONE;
-               else
-                       host->state = STATE_IDLE;
-       }
+       if (host->state == STATE_SENDING_CMD11)
+               host->state = STATE_WAITING_CMD11_DONE;
+       else
+               host->state = STATE_IDLE;
 
        spin_unlock(&host->lock);
        mmc_request_done(prev_mmc, mrq);
@@ -3353,7 +3339,6 @@ int dw_mci_probe(struct dw_mci *host)
 
        spin_lock_init(&host->lock);
        spin_lock_init(&host->irq_lock);
-       INIT_LIST_HEAD(&host->queue);
 
        dw_mci_init_fault(host);
 
index f91f5fcb94223517560ee2190821c4df056b8c1a..d5e4e6d678121bea50e8595b7d86c44da4e1a0b1 100644 (file)
@@ -96,7 +96,6 @@ struct dw_mci_dma_slave {
  * @completed_events: Bitmask of events which the state machine has
  *     processed.
  * @state: BH work state.
- * @queue: List of slots waiting for access to the controller.
  * @bus_hz: The rate of @mck in Hz. This forms the basis for MMC bus
  *     rate and timeout calculations.
  * @current_speed: Configured rate of the controller.
@@ -136,12 +135,12 @@ struct dw_mci_dma_slave {
  * Locking
  * =======
  *
- * @lock is a softirq-safe spinlock protecting @queue as well as
+ * @lock is a softirq-safe spinlock protecting as well as
  * @slot, @mrq and @state. These must always be updated
  * at the same time while holding @lock.
  * The @mrq field of struct dw_mci_slot is also protected by @lock,
  * and must always be written at the same time as the slot is added to
- * @queue.
+ * @host.
  *
  * @irq_lock is an irq-safe spinlock protecting the INTMASK register
  * to allow the interrupt handler to modify it directly.  Held for only long
@@ -203,7 +202,6 @@ struct dw_mci {
        unsigned long           pending_events;
        unsigned long           completed_events;
        enum dw_mci_state       state;
-       struct list_head        queue;
 
        u32                     bus_hz;
        u32                     current_speed;
@@ -560,14 +558,11 @@ static inline int dw_mci_runtime_resume(struct device *device) { return -EOPNOTS
  * struct dw_mci_slot - MMC slot state
  * @host: The MMC controller this slot is using.
  *     processed, or NULL when the slot is idle.
- * @queue_node: List node for placing this node in the @queue list of
  *     &struct dw_mci.
  *     Keeping track of this helps us to avoid spamming the console.
  */
 struct dw_mci_slot {
        struct dw_mci           *host;
-
-       struct list_head        queue_node;
 };
 
 /**