Skip to contentSkip to conversation

wo minor changes for Cavium MMC host driver

PATCH In review Bean Huo 2 participants 8 messages Mar 19, 2021 – May 10, 2021

Subsystems (3)
lore
Share & tools
lore

Bean Huo

author
#0 lore raw

cover wo minor changes for Cavium MMC host driver

From: Bean Huo <[email protected]>

Bean Huo (2):
mmc: cavium: Use '"%s...", __func__' to print function name
mmc: cavium: Remove redundant if-statement checkup

 drivers/mmc/host/cavium.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/2 mmc: cavium: Use '"%s...", __func__' to print function name

From: Bean Huo <[email protected]>

Use preferred way '"%s...", __func__' to print function name.

---
 drivers/mmc/host/cavium.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/cavium.c +1 -2
index 4bb8f2800a2b..95a41983c6c0 100644
@@ -656,8 +656,7 @@ static void cvm_mmc_dma_request(struct mmc_host *mmc,
 
 	if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len ||
 	    !mrq->stop || mrq->stop->opcode != MMC_STOP_TRANSMISSION) {
-		dev_err(&mmc->card->dev,
-			"Error: cmv_mmc_dma_request no data\n");
+		dev_err(&mmc->card->dev, "Error: %s no data\n", __func__);
 		goto error;
 	}
 
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH v1 1/2] mmc: cavium: Use '"%s...", __func__' to print function name

Quoted 6 lines · Bean Huo

From: Bean Huo <[email protected]>

Use preferred way '"%s...", __func__' to print function name.

Applied for next, thanks!

Kind regards
Uffe

Quoted 21 lines
---
 drivers/mmc/host/cavium.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/cavium.c +1 -3
index 4bb8f2800a2b..95a41983c6c0 100644
@@ -656,8 +656,7 @@ static void cvm_mmc_dma_request(struct mmc_host *mmc,
 
        if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len ||
            !mrq->stop || mrq->stop->opcode != MMC_STOP_TRANSMISSION) {
-               dev_err(&mmc->card->dev,
-                       "Error: cmv_mmc_dma_request no data\n");
+               dev_err(&mmc->card->dev, "Error: %s no data\n", __func__);
                goto error;
        }
 
--

2.25.1

author
#3 lore raw

PATCH 2/2 mmc: cavium: Remove redundant if-statement checkup

In reply to Bean Huo

From: Bean Huo <[email protected]>

Currently, we have two ways to issue multiple-block read/write the command to the eMMC. One is by normal IO request path fs->block->mmc. Another one is that we can issue multiple-block read/write through MMC ioctl interface. For the first path, mrq->stop, and mrq->stop->opcode will be initialized in mmc_blk_data_prep(). However, for the second IO path, mrq->stop is not initialized since it is a pre-defined multiple blocks read/write.

Meanwhile, if it is open-ended multiple block read/write command, STOP_TRANSMISSION CMD12 will be issued later in mmc_blk_issue_drv_op(), since it is MMC_IOC_MULTI_CMD.

So, delete these if-statement checkups, let these kinds of multiple-block read/write request go.

Fixes 'ba3869ff32e4 ("mmc: cavium: Add core MMC driver for Cavium SOCs")'

---
 drivers/mmc/host/cavium.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/cavium.c +1 -2
index 95a41983c6c0..8fb7cbcf62ad 100644
@@ -654,8 +654,7 @@ static void cvm_mmc_dma_request(struct mmc_host *mmc,
 	struct mmc_data *data;
 	u64 emm_dma, addr;
 
-	if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len ||
-	    !mrq->stop || mrq->stop->opcode != MMC_STOP_TRANSMISSION) {
+	if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len) {
 		dev_err(&mmc->card->dev, "Error: %s no data\n", __func__);
 		goto error;
 	}
Signature · 1 line
2.25.1
#4 lore raw

Re: [PATCH v1 2/2] mmc: cavium: Remove redundant if-statement checkup

Quoted 10 lines · Bean Huo

From: Bean Huo <[email protected]>

Currently, we have two ways to issue multiple-block read/write the command to the eMMC. One is by normal IO request path fs->block->mmc. Another one is that we can issue multiple-block read/write through MMC ioctl interface. For the first path, mrq->stop, and mrq->stop->opcode will be initialized in mmc_blk_data_prep(). However, for the second IO path, mrq->stop is not initialized since it is a pre-defined multiple blocks read/write.

As a matter of fact this way is also supported for the regular block I/O path. To make the mmc block driver to use it, mmc host drivers need to announce that it's supported by setting MMC_CAP_CMD23.

It looks like that is what your patch should be targeted towards, can you have a look at this instead?

Kind regards
Uffe

Quoted 32 lines

Meanwhile, if it is open-ended multiple block read/write command, STOP_TRANSMISSION CMD12 will be issued later in mmc_blk_issue_drv_op(), since it is MMC_IOC_MULTI_CMD.

So, delete these if-statement checkups, let these kinds of multiple-block read/write request go.

Fixes 'ba3869ff32e4 ("mmc: cavium: Add core MMC driver for Cavium SOCs")'

---
 drivers/mmc/host/cavium.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/cavium.c +1 -3
index 95a41983c6c0..8fb7cbcf62ad 100644
@@ -654,8 +654,7 @@ static void cvm_mmc_dma_request(struct mmc_host *mmc,
        struct mmc_data *data;
        u64 emm_dma, addr;
 
-       if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len ||
-           !mrq->stop || mrq->stop->opcode != MMC_STOP_TRANSMISSION) {
+       if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len) {
                dev_err(&mmc->card->dev, "Error: %s no data\n", __func__);
                goto error;
        }
--

2.25.1

author
#5 lore raw

Re: [PATCH v1 2/2] mmc: cavium: Remove redundant if-statement checkup

Quoted 20 lines · Ulf Hansson
Quoted 4 lines · Bean Huo

From: Bean Huo <[email protected]>
Currently, we have two ways to issue multiple-block read/write the command to the eMMC. One is by normal IO request path fs->block-

Quoted 1 line

mmc.

Quoted 8 lines

Another one is that we can issue multiple-block read/write through MMC ioctl interface. For the first path, mrq->stop, and mrq->stop-

Quoted 1 line

opcode

will be initialized in mmc_blk_data_prep(). However, for the second IO
path, mrq->stop is not initialized since it is a pre-defined multiple
blocks read/write.

As a matter of fact this way is also supported for the regular block

I/O path. To make the mmc block driver to use it, mmc host drivers

Quoted 9 lines

need to announce that it's supported by setting MMC_CAP_CMD23.

It looks like that is what your patch should be targeted towards, can

you have a look at this instead?

Hi Ulf,
Thanks for your comments. I will look at that as your suggestion. The patch [1/2] is accepted, so I will just update this patch to the next version.

Kind regards,
Bean

Quoted 4 lines

Kind regards

Uffe

author
#6 lore raw

Re: [PATCH v1 2/2] mmc: cavium: Remove redundant if-statement checkup

Quoted 34 lines · Bean Huo
Quoted 17 lines · Ulf Hansson
Quoted 8 lines · Bean Huo

From: Bean Huo <[email protected]>
Currently, we have two ways to issue multiple-block read/write the
command to the eMMC. One is by normal IO request path fs->block-

Quoted 1 line

mmc.

Another one is that we can issue multiple-block read/write through
MMC ioctl interface. For the first path, mrq->stop, and mrq-

Quoted 8 lines
Quoted 2 lines

stop-
opcode

will be initialized in mmc_blk_data_prep(). However, for the second
IO
path, mrq->stop is not initialized since it is a pre-defined multiple
blocks read/write.

Quoted 7 lines

As a matter of fact this way is also supported for the regular block
I/O path. To make the mmc block driver to use it, mmc host drivers need to announce that it's supported by setting MMC_CAP_CMD23. It looks like that is what your patch should be targeted towards, can
you have a look at this instead?

Hi Ulf,

Thanks for your comments. I will look at that as your suggestion.

The patch [1/2] is accepted, so I will just update this patch to

Quoted 7 lines

the next version.

Kind regards,

Bean

Hi Uffe,
Could you please firstly accept this patch? let the customer update their kernel. As I tried to develop the next version of the patch according to your suggestion, more changes will be involved. Also, no matter how to make the change general, below mrq->stop checkup should be deleted since it is obsolete. In the data transmission completion interrupt, mrq->stop will be checked again.

-	if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len ||
-	    !mrq->stop || mrq->stop->opcode != MMC_STOP_TRANSMISSION) {
+	if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len) {

Kind regards
Bean

#7 lore raw

Re: [PATCH v1 2/2] mmc: cavium: Remove redundant if-statement checkup

Quoted 54 lines · Bean Huo
Quoted 34 lines · Bean Huo
Quoted 17 lines · Ulf Hansson
Quoted 8 lines · Bean Huo

From: Bean Huo <[email protected]>
Currently, we have two ways to issue multiple-block read/write the
command to the eMMC. One is by normal IO request path fs->block-

Quoted 1 line

mmc.

Another one is that we can issue multiple-block read/write through
MMC ioctl interface. For the first path, mrq->stop, and mrq-

Quoted 8 lines
Quoted 2 lines

stop-
opcode

will be initialized in mmc_blk_data_prep(). However, for the second
IO
path, mrq->stop is not initialized since it is a pre-defined multiple
blocks read/write.

Quoted 7 lines

As a matter of fact this way is also supported for the regular block
I/O path. To make the mmc block driver to use it, mmc host drivers need to announce that it's supported by setting MMC_CAP_CMD23. It looks like that is what your patch should be targeted towards, can
you have a look at this instead?

Hi Ulf,

Thanks for your comments. I will look at that as your suggestion.

The patch [1/2] is accepted, so I will just update this patch to

Quoted 7 lines

the next version.

Kind regards,

Bean

Hi Uffe,
Could you please firstly accept this patch? let the customer update their kernel. As I tried to develop the next version of the patch according to your suggestion, more changes will be involved. Also, no matter how to make the change general, below mrq->stop checkup should be deleted since it is obsolete. In the data transmission completion interrupt, mrq->stop will be checked again.

drivers/mmc/host/cavium.c static void cvm_mmc_dma_request(struct mmc_host *mmc, · line 657

Quoted 3 lines
drivers/mmc/host/cavium.c +1 -2
-       if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len ||
-           !mrq->stop || mrq->stop->opcode != MMC_STOP_TRANSMISSION) {
+       if (!mrq->data || !mrq->data->sg || !mrq->data->sg_len) {

Well, I don't think the above checks are incorrect. Instead I think it points out that the cavium mmc driver lacks support for CMD23, while only open ended data transfers are supported.

The proper way forward is instead to implement CMD23 support to the cavium mmc driver. In the same patch adding that support, you should be able to remove the above checks.

Kind regards
Uffe