diff options
| author | Yaniv Gardi <ygardi@codeaurora.org> | 2015-09-08 12:33:55 +0300 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:00:39 -0700 |
| commit | 4575b28635063575ac3ece2813719de6f758bb49 (patch) | |
| tree | 68c72ff19af73b2ae9b8420cf84c04a7cc89ca88 | |
| parent | 56d62c00cc5487121dd7915f4d4d2f39526482a9 (diff) | |
scsi: ufs: fix condition in which DME command failure msg is printed out
The condition in which error message is printed out was incorrect and
resulted error message only if retries exhausted.
But retries happens only if DME command is a peer command, and thus
DME commands which are not peer commands and fail are not printed out.
This change fixes this issue.
Change-Id: I43367befd810da0ebe34efd3a93751b582a19565
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
| -rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 369f8047f796..7e2336b09bfd 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3617,10 +3617,10 @@ int ufshcd_dme_set_attr(struct ufs_hba *hba, u32 attr_sel, set, UIC_GET_ATTR_ID(attr_sel), mib_val, ret); } while (ret && peer && --retries); - if (!retries) + if (ret) dev_err(hba->dev, "%s: attr-id 0x%x val 0x%x failed %d retries\n", - set, UIC_GET_ATTR_ID(attr_sel), mib_val, - retries); + set, UIC_GET_ATTR_ID(attr_sel), mib_val, + UFS_UIC_COMMAND_RETRIES - retries); return ret; } @@ -3688,9 +3688,10 @@ int ufshcd_dme_get_attr(struct ufs_hba *hba, u32 attr_sel, get, UIC_GET_ATTR_ID(attr_sel), ret); } while (ret && peer && --retries); - if (!retries) + if (ret) dev_err(hba->dev, "%s: attr-id 0x%x failed %d retries\n", - get, UIC_GET_ATTR_ID(attr_sel), retries); + get, UIC_GET_ATTR_ID(attr_sel), + UFS_UIC_COMMAND_RETRIES - retries); if (mib_val && !ret) *mib_val = uic_cmd.argument3; |
