public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: MMC request with REQ_DISCARD option may not release host when it should
       [not found] <1C995FCD38EDD646A035D3E5892E8C7C04C1674F@SJEXCHMB13.corp.ad.broadcom.com>
@ 2013-10-23  1:03 ` Seungwon Jeon
  2013-10-23  1:37   ` Ray Jui
  0 siblings, 1 reply; 2+ messages in thread
From: Seungwon Jeon @ 2013-10-23  1:03 UTC (permalink / raw)
  To: 'Ray Jui', 'Chris Ball'; +Cc: linux-kernel

Hi Ray,

Thank you for information. Your analysis is right.
I also noticed same problem.
If you'd like to submit patch, not to report, please send it with regular form.
Or I could send similar patch I have.

Thanks,
Seungwon Jeon

On Wed, Oct 23, 2013, Ray Jui wrote:
Hi Seungwon/Chris,

We recently came across an eMMC issue that causes mmc_suspend to stuck waiting to claim the host. This issue only happens when one
of the MMC partitions is mounted with the discard option. By tracing the issue down in the kernel MMC stack, in the function
mmc_blk_issue_rq under drivers/mmc/card/block.c, we noticed the host will be released when req is valid and when req->cmd_flags is
set to one of the masks: MMC_REQ_SPECIAL_MASK. Based on the code comment, I believe the intention is to always release the host in
the case of special request (which include both REQ_DISCARD and REQ_FLUSH).

Note in function call mmc_blk_issue_discard_rq, the memory where req points to can be freed. This means at the bottom of the
mmc_blk_issue_rq, req->cmd_flags may contain garbage value and I believe this is what’s causing the issue that we are seeing in
mmc_suspend after the discard operation: In mmc_suspend, it blocks waiting to claim the host but the host was never released after
the discard operation.

Please help to review the attached patch that fixes the issue.

Thanks,

Ray Jui


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: MMC request with REQ_DISCARD option may not release host when it should
  2013-10-23  1:03 ` MMC request with REQ_DISCARD option may not release host when it should Seungwon Jeon
@ 2013-10-23  1:37   ` Ray Jui
  0 siblings, 0 replies; 2+ messages in thread
From: Ray Jui @ 2013-10-23  1:37 UTC (permalink / raw)
  To: Seungwon Jeon, 'Chris Ball'; +Cc: linux-kernel@vger.kernel.org

Hi Seungwon,

Thanks for your reply. I'll try my best to find time and submit my patch within the next couple days.

Thanks,

Ray

-----Original Message-----
From: Seungwon Jeon [mailto:tgih.jun@samsung.com] 
Sent: Tuesday, October 22, 2013 6:03 PM
To: Ray Jui; 'Chris Ball'
Cc: linux-kernel@vger.kernel.org
Subject: RE: MMC request with REQ_DISCARD option may not release host when it should

Hi Ray,

Thank you for information. Your analysis is right.
I also noticed same problem.
If you'd like to submit patch, not to report, please send it with regular form.
Or I could send similar patch I have.

Thanks,
Seungwon Jeon

On Wed, Oct 23, 2013, Ray Jui wrote:
Hi Seungwon/Chris,

We recently came across an eMMC issue that causes mmc_suspend to stuck waiting to claim the host. This issue only happens when one
of the MMC partitions is mounted with the discard option. By tracing the issue down in the kernel MMC stack, in the function
mmc_blk_issue_rq under drivers/mmc/card/block.c, we noticed the host will be released when req is valid and when req->cmd_flags is
set to one of the masks: MMC_REQ_SPECIAL_MASK. Based on the code comment, I believe the intention is to always release the host in
the case of special request (which include both REQ_DISCARD and REQ_FLUSH).

Note in function call mmc_blk_issue_discard_rq, the memory where req points to can be freed. This means at the bottom of the
mmc_blk_issue_rq, req->cmd_flags may contain garbage value and I believe this is what's causing the issue that we are seeing in
mmc_suspend after the discard operation: In mmc_suspend, it blocks waiting to claim the host but the host was never released after
the discard operation.

Please help to review the attached patch that fixes the issue.

Thanks,

Ray Jui




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-23  1:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1C995FCD38EDD646A035D3E5892E8C7C04C1674F@SJEXCHMB13.corp.ad.broadcom.com>
2013-10-23  1:03 ` MMC request with REQ_DISCARD option may not release host when it should Seungwon Jeon
2013-10-23  1:37   ` Ray Jui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox