Skip to contentSkip to conversation

mmc: core: Support packed write command for eMMC4.5 device

PATCH [email protected] 2 participants 5 messages May 31, 2012 – Jun 5, 2012 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

Review static int mmc_blk_issue_rw_rq(struct mmc_queue

Quoted 1 line
(quoted diff) +0 -0
@@ -1313,10 +1609,17 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue

*mq, struct request *rqc)

Review static int mmc_blk_issue_rw_rq(struct mmc_queue · line 1614

Quoted 8 lines
(quoted diff) +3 -2
 			 * A block was successfully transferred.
 			 */
 			mmc_blk_reset_success(md, type);
-			spin_lock_irq(&md->lock);
-			ret = __blk_end_request(req, 0,
+
+			if (mq_rq->packed_cmd != MMC_PACKED_NONE) {
+				ret = mmc_blk_end_packed_req(mq, mq_rq);

If a specific request in the packed request consistantly fails, there is nothing to stop us from sending the same packed request in an endless loop.

Review static int mmc_blk_issue_rw_rq(struct mmc_queue · line 1615

Quoted 1 line
(quoted diff) +1 -0
+				break;

Thanks,
Maya Erez
Consultant for Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

#1 lore raw
Quoted 13 lines · Maya Erez

Review static int mmc_blk_issue_rw_rq(struct mmc_queue

Quoted 1 line
(quoted diff) +0 -0
@@ -1313,10 +1609,17 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue

*mq, struct request *rqc)

Review static int mmc_blk_issue_rw_rq(struct mmc_queue · line 1614

Quoted 8 lines
(quoted diff) +3 -2
 			 * A block was successfully transferred.
 			 */
 			mmc_blk_reset_success(md, type);
-			spin_lock_irq(&md->lock);
-			ret = __blk_end_request(req, 0,
+
+			if (mq_rq->packed_cmd != MMC_PACKED_NONE) {
+				ret = mmc_blk_end_packed_req(mq, mq_rq);

If a specific request in the packed request consistantly fails, there is nothing to stop us from sending the same packed request in an endless loop.

There is various error case. This patch reused the existing error handling. What is that case we need to consider?

Best regards,
Seungwon Jeon

Quoted 14 lines

Review static int mmc_blk_issue_rw_rq(struct mmc_queue · line 1615

Quoted 1 line
(quoted diff) +1 -0
+				break;

Thanks,
Maya Erez
Consultant for Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 16 lines
Quoted 14 lines · Maya Erez

Review static int mmc_blk_issue_rw_rq(struct

Quoted 1 line
(quoted diff) +0 -0
@@ -1313,10 +1609,17 @@ static int mmc_blk_issue_rw_rq(struct

mmc_queue
*mq, struct request *rqc)

Review static int mmc_blk_issue_rw_rq(struct · line 1614

Quoted 8 lines
(quoted diff) +3 -2
 			 * A block was successfully transferred.
 			 */
 			mmc_blk_reset_success(md, type);
-			spin_lock_irq(&md->lock);
-			ret = __blk_end_request(req, 0,
+
+			if (mq_rq->packed_cmd != MMC_PACKED_NONE) {
+				ret = mmc_blk_end_packed_req(mq, mq_rq);

If a specific request in the packed request consistantly fails, there is nothing to stop us from sending the same packed request in an endless loop.

Quoted 6 lines

There is various error case. This patch reused the existing error handling.
What is that case we need to consider?

Best regards,
Seungwon Jeon

This is different from unpacked requests handling since in the packed err check function you don't always return the error returned from mmc_blk_err_check. In case the EXT_CSD_PACKED_INDEXED_ERROR is set you return MMC_BLK_PARTIAL which is handled differently in the mmc_blk_issue_rw_rd.
In our tests we set to 1 the packed bit in CMD23 arg of the first req (in the header). As a result, mmc_blk_err_check returned MMC_BLK_CMD_ERR. However, mmc_blk_packed_err_check returned MMC_BLK_PARTIAL (since the card indicated the index of the first request as the failed request). mmc_blk_issue_rw_rd handles MMC_BLK_PARTIAL by sending the packed command from the failed index and on, but since the packed bit was still set, the same error occurred and was handled the same way and we ended up with an endless loop.
I hope my description is clear, let me know if you have further questions.

Thanks,
Maya Erez
Consultant for Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

#3 lore raw
Quoted 22 lines · Maya Erez
Quoted 15 lines
Quoted 14 lines · Maya Erez

Review static int mmc_blk_issue_rw_rq(struct

Quoted 1 line
(quoted diff) +0 -0
@@ -1313,10 +1609,17 @@ static int mmc_blk_issue_rw_rq(struct

mmc_queue
*mq, struct request *rqc)

Review static int mmc_blk_issue_rw_rq(struct · line 1614

Quoted 8 lines
(quoted diff) +3 -2
 			 * A block was successfully transferred.
 			 */
 			mmc_blk_reset_success(md, type);
-			spin_lock_irq(&md->lock);
-			ret = __blk_end_request(req, 0,
+
+			if (mq_rq->packed_cmd != MMC_PACKED_NONE) {
+				ret = mmc_blk_end_packed_req(mq, mq_rq);

If a specific request in the packed request consistantly fails, there is nothing to stop us from sending the same packed request in an endless loop.

Quoted 6 lines

There is various error case. This patch reused the existing error handling.
What is that case we need to consider?

Best regards,
Seungwon Jeon

Quoted 14 lines

This is different from unpacked requests handling since in the packed err check function you don't always return the error returned from mmc_blk_err_check. In case the EXT_CSD_PACKED_INDEXED_ERROR is set you return MMC_BLK_PARTIAL which is handled differently in the mmc_blk_issue_rw_rd.
In our tests we set to 1 the packed bit in CMD23 arg of the first req (in the header). As a result, mmc_blk_err_check returned MMC_BLK_CMD_ERR. However, mmc_blk_packed_err_check returned MMC_BLK_PARTIAL (since the card indicated the index of the first request as the failed request). mmc_blk_issue_rw_rd handles MMC_BLK_PARTIAL by sending the packed command from the failed index and on, but since the packed bit was still set, the same error occurred and was handled the same way and we ended up with an endless loop.
I hope my description is clear, let me know if you have further questions.

I tested your test case equally.
Even though your test makes the header parameter incorrect artificially and keeps going with wrong setting repeatedly, we need to assure that the similar result can be found practically with normal running. I'll test it heavily and check more.
And if you have more review about this version, please let me know.

Thanks for your review.
Seungwon Jeon.

Quoted 10 lines

Thanks,
Maya Erez
Consultant for Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 52 lines
Quoted 35 lines · Maya Erez
Quoted 4 lines
Quoted 3 lines · Maya Erez

Review static int mmc_blk_issue_rw_rq(struct

Quoted 1 line
(quoted diff) +0 -0
@@ -1313,10 +1609,17 @@ static int mmc_blk_issue_rw_rq(struct

mmc_queue
*mq, struct request *rqc)

Quoted 9 lines
Quoted 9 lines

Review static int mmc_blk_issue_rw_rq(struct · line 1614

Quoted 8 lines
(quoted diff) +3 -2
 			 * A block was successfully transferred.
 			 */
 			mmc_blk_reset_success(md, type);
-			spin_lock_irq(&md->lock);
-			ret = __blk_end_request(req, 0,
+
+			if (mq_rq->packed_cmd != MMC_PACKED_NONE) {
+				ret = mmc_blk_end_packed_req(mq, mq_rq);

If a specific request in the packed request consistantly fails, there

is

Quoted 8 lines
Quoted 2 lines

nothing to stop us from sending the same packed request in an endless loop.

There is various error case. This patch reused the existing error handling.
What is that case we need to consider?

Best regards,
Seungwon Jeon

This is different from unpacked requests handling since in the packed err
check function you don't always return the error returned from mmc_blk_err_check. In case the EXT_CSD_PACKED_INDEXED_ERROR is set you return MMC_BLK_PARTIAL which is handled differently in the mmc_blk_issue_rw_rd.
In our tests we set to 1 the packed bit in CMD23 arg of the first req (in
the header). As a result, mmc_blk_err_check returned MMC_BLK_CMD_ERR. However, mmc_blk_packed_err_check returned MMC_BLK_PARTIAL (since the card
indicated the index of the first request as the failed request).

Quoted 8 lines

mmc_blk_issue_rw_rd handles MMC_BLK_PARTIAL by sending the packed command
from the failed index and on, but since the packed bit was still set, the
same error occurred and was handled the same way and we ended up with an endless loop.
I hope my description is clear, let me know if you have further questions.

I tested your test case equally.
Even though your test makes the header parameter incorrect artificially and keeps going with wrong setting repeatedly, we need to assure that the similar result can be found practically with normal running. I'll test it heavily and check more.
And if you have more review about this version, please let me know.

Quoted 2 lines

Thanks for your review.
Seungwon Jeon.

Our code should be robust enough to deal with any card behavior. Therefore, I think we need to avoid having endless loops regardless of the scenario that caused it.
Currently I have no additional comments about this version.

Thanks,
Maya Erez
Consultant for Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum