dw_mmc: add quirk about using only one slot
Subsystems (2)
Jaehoon Chung
maintainerRFC PATCH 1/1 dw_mmc: add quirk about using only one slot
If assume only using one slot, i think that dw_mci_queue_request() need not.
--- drivers/mmc/host/dw_mmc.c | 9 +++++++-- include/linux/mmc/dw_mmc.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/mmc/host/dw_mmc.c +7 -2
@@ -673,8 +673,13 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)return ; } -/* We don't support multiple blocks of weird lengths. */ -dw_mci_queue_request (host, slot, mrq); +if (host->quirks &DW_MCI_QUIRK_FORCE_ONE_SLOT ) { + slot->mrq = mrq; + host->state =STATE_SENDING_CMD ; +dw_mci_start_request (host, slot); + }else +/* We don't support multiple blocks of weird lengths. */ +dw_mci_queue_request (host, slot, mrq); }static void dw_mci_set_ios (struct mmc_host *mmc,struct mmc_ios *ios)
include/linux/mmc/dw_mmc.h +2 -1
@@ -176,7 +176,8 @@ struct dw_mci_dma_ops {#define DW_MCI_QUIRK_HIGHSPEED BIT(2)/* Unreliable card detection */ #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) - +/* Force using only one slot */ +#define DW_MCI_QUIRK_FORCE_ONE_SLOT BIT(4)struct dma_pdata ;
Quoted 14 lines · Jaehoon Chung
If assume only using one slot, i think that
dw_mci_queue_request()need not.Signed-off-by Jaehoon Chung <[email protected]>Signed-off-by Kyungmin Park <[email protected]---
drivers/mmc/host/dw_mmc.c | 9 +++++++--
include/linux/mmc/dw_mmc.h | 3 ++-2 files changed, 9 insertions(+), 3 deletions(-)drivers/mmc/host/dw_mmc.c +0
-0
drivers/mmc/host/dw_mmc.c static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) · line 676
Quoted 6 lines
drivers/mmc/host/dw_mmc.c +1
-2@@ -673,8 +673,13 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) return; } - /* We don't support multiple blocks of weird lengths. */ - dw_mci_queue_request(host, slot, mrq); + if (host->quirks & DW_MCI_QUIRK_FORCE_ONE_SLOT) {
Do we really need a quirk for this? Why not use host->num_slots?
drivers/mmc/host/dw_mmc.c static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) · line 678
Quoted 2 lines
drivers/mmc/host/dw_mmc.c +2
-0+ slot->mrq = mrq; + host->state = STATE_SENDING_CMD;
I don't think it is safe to manipulate these structures without taking the host->lock. If we are to do this then I think I would like to know why (e.g. do we have performance numbers to support this change) and some analysis of what is protected by host->lock and which functions need the lock to be held. For example I do not think it is safe to call dw_mci_start_request without taking the lock.
drivers/mmc/host/dw_mmc.c static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) · line 681
Quoted 3 lines
drivers/mmc/host/dw_mmc.c +3
-0+ dw_mci_start_request(host, slot); + } else + /* We don't support multiple blocks of weird lengths. */
This comment is obsolete I think and can be removed.
Jaehoon Chung
maintainerHi Will
Quoted 18 lines · Will Newton
Quoted 17 lines · Jaehoon Chung
If assume only using one slot, i think that
dw_mci_queue_request()need not.Signed-off-by Jaehoon Chung <[email protected]>Signed-off-by Kyungmin Park <[email protected]--- drivers/mmc/host/dw_mmc.c | 9 +++++++-- include/linux/mmc/dw_mmc.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-)drivers/mmc/host/dw_mmc.c +0
-0@@ -673,8 +673,13 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)return ; }
Quoted 5 lines
drivers/mmc/host/dw_mmc.c static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) · line 676
Quoted 3 lines
drivers/mmc/host/dw_mmc.c +1
-2-/* We don't support multiple blocks of weird lengths. */ -dw_mci_queue_request (host, slot, mrq); +if (host->quirks &DW_MCI_QUIRK_FORCE_ONE_SLOT ) {Do we really need a quirk for this? Why not use
host->num_slots
Yes, you'r right. if using this patch, can use host->num_slots.
Quoted 11 lines
drivers/mmc/host/dw_mmc.c static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) · line 678
Quoted 3 lines
drivers/mmc/host/dw_mmc.c +2
-0+ slot->mrq = mrq; + host->state =STATE_SENDING_CMD ;I don't think it is safe to manipulate these structures without taking the
host->lock. If we are to do this then I think I would like to know why (e.g. do we have performance numbers to support this change) and some analysis of what is protected byhost->lockand which functions need the lock to be held. For example I do not think it is safe to calldw_mci_start_requestwithout taking the lock.
I know this patch didn't increase the performance.
BUt If we want to know some analysis..I should analysis what protected by host->lock. Did you analysis what protect by host->lock?
Quoted 5 lines
drivers/mmc/host/dw_mmc.c static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) · line 681
Quoted 3 lines
drivers/mmc/host/dw_mmc.c +3
-0+dw_mci_start_request (host, slot); + }else +/* We don't support multiple blocks of weird lengths. */ This comment is obsolete I think and can be removed.
Anyway, Thanks for your comment.
Regards,
Jaehoon Chung