dero
Posts: 21
Joined: Wed Nov 07, 2012 3:21 pm

SD corruption: mmc_blk_issue_rw_rq loosing requests

Mon Nov 26, 2012 3:59 pm

Hi, I am currently reviewing the source code of the driver to chase write corruptions. There is something in block.c, function mmc_blk_issue_rw_rq that makes me feel that the driver might loose requests:

Code: Select all

...
areq = mmc_start_req(card->host, areq, (int *) &status);  <-- Start new request "areq" (we call this one the NEWREQ) and return last completed request, now in "areq"
...
}   <--- end of switch( status )
if (ret) {  <--- we were only able to do a partial/failed request and need to retry
  /*
  * In case of a incomplete request
  * prepare it again and resend.
  */
  mmc_blk_rw_rq_prep(mq_rq, card, disable_multi, mq);
  mmc_start_req(card->host, &mq_rq->mmc_active, NULL); <--- BUG
}
At the position BUG, the incomplete request is started again, but if NEWREQ has completed meanwhile, it's result IS NOT PROCESSED!

The same also applies to the call to mmc_start_req after label "start_new_req:".

Am I missing something?

dero

Code: Select all

static int __trace( const char* file, const int line ) { pr_info( "#TRACE %s:%d\n", file, line ); return 1; }
#define return if( __trace( __FILE__, __LINE__) == 0 ) {} else return
#undef pr_debug
#define pr_debug pr_info

Return to “Troubleshooting”