Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325047
b: refs/heads/master
c: 44e323a
h: refs/heads/master
i:
  325045: d870e89
  325043: fc3e877
  325039: 9a2923e
v: v3
  • Loading branch information
Toshiaki Yamane authored and Greg Kroah-Hartman committed Sep 10, 2012
1 parent 63eb453 commit 76e2fdf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5a708764237ced9bf97981ea81d9a44b36fed90
refs/heads/master: 44e323a7f017475438b30c5632c999c719b86907
41 changes: 15 additions & 26 deletions trunk/drivers/staging/rts_pstor/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3757,9 +3757,8 @@ int sd_execute_no_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
}

retval = sd_switch_clock(chip);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
}

if (sd_card->pre_cmd_err) {
sd_card->pre_cmd_err = 0;
Expand All @@ -3768,12 +3767,11 @@ int sd_execute_no_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
}

cmd_idx = srb->cmnd[2] & 0x3F;
if (srb->cmnd[1] & 0x02) {
if (srb->cmnd[1] & 0x02)
standby = 1;
}
if (srb->cmnd[1] & 0x01) {

if (srb->cmnd[1] & 0x01)
acmd = 1;
}

arg = ((u32)srb->cmnd[3] << 24) | ((u32)srb->cmnd[4] << 16) |
((u32)srb->cmnd[5] << 8) | srb->cmnd[6];
Expand All @@ -3786,64 +3784,56 @@ int sd_execute_no_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
sd_card->last_rsp_type = rsp_type;

retval = sd_switch_clock(chip);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
}

#ifdef SUPPORT_SD_LOCK
if ((sd_card->sd_lock_status & SD_LOCK_1BIT_MODE) == 0) {
if (CHK_MMC_8BIT(sd_card)) {
retval = rtsx_write_register(chip, REG_SD_CFG1, 0x03, SD_BUS_WIDTH_8);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
}

} else if (CHK_SD(sd_card) || CHK_MMC_4BIT(sd_card)) {
retval = rtsx_write_register(chip, REG_SD_CFG1, 0x03, SD_BUS_WIDTH_4);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
}
}
}
#else
retval = rtsx_write_register(chip, REG_SD_CFG1, 0x03, SD_BUS_WIDTH_4);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_RET(chip, TRANSPORT_FAILED);
}
#endif

if (standby) {
retval = sd_select_card(chip, 0);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
}
}

if (acmd) {
retval = ext_sd_send_cmd_get_rsp(chip, APP_CMD, sd_card->sd_addr,
SD_RSP_TYPE_R1, NULL, 0, 0);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
}
}

retval = ext_sd_send_cmd_get_rsp(chip, cmd_idx, arg, rsp_type,
sd_card->rsp, rsp_len, 0);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
}

if (standby) {
retval = sd_select_card(chip, 1);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
}
}

#ifdef SUPPORT_SD_LOCK
retval = sd_update_lock_status(chip);
if (retval != STATUS_SUCCESS) {
if (retval != STATUS_SUCCESS)
TRACE_GOTO(chip, SD_Execute_Cmd_Failed);
}
#endif

scsi_set_resid(srb, 0);
Expand All @@ -3854,9 +3844,8 @@ int sd_execute_no_data(struct scsi_cmnd *srb, struct rtsx_chip *chip)
set_sense_type(chip, lun, SENSE_TYPE_NO_SENSE);
release_sd_card(chip);
do_reset_sd_card(chip);
if (!(chip->card_ready & SD_CARD)) {
if (!(chip->card_ready & SD_CARD))
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_NOT_PRESENT);
}

TRACE_RET(chip, TRANSPORT_FAILED);
}
Expand Down

0 comments on commit 76e2fdf

Please sign in to comment.