@@ -3199,7 +3199,8 @@ ufshcd_dev_cmd_completion(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
3199
3199
}
3200
3200
3201
3201
/*
3202
- * Return: 0 upon success; < 0 upon failure.
3202
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3203
+ * < 0 if another error occurred.
3203
3204
*/
3204
3205
static int ufshcd_wait_for_dev_cmd (struct ufs_hba * hba ,
3205
3206
struct ufshcd_lrb * lrbp , int max_timeout )
@@ -3275,7 +3276,6 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
3275
3276
}
3276
3277
}
3277
3278
3278
- WARN_ONCE (err > 0 , "Incorrect return value %d > 0\n" , err );
3279
3279
return err ;
3280
3280
}
3281
3281
@@ -3294,7 +3294,8 @@ static void ufshcd_dev_man_unlock(struct ufs_hba *hba)
3294
3294
}
3295
3295
3296
3296
/*
3297
- * Return: 0 upon success; < 0 upon failure.
3297
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3298
+ * < 0 if another error occurred.
3298
3299
*/
3299
3300
static int ufshcd_issue_dev_cmd (struct ufs_hba * hba , struct ufshcd_lrb * lrbp ,
3300
3301
const u32 tag , int timeout )
@@ -3317,7 +3318,8 @@ static int ufshcd_issue_dev_cmd(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
3317
3318
* @cmd_type: specifies the type (NOP, Query...)
3318
3319
* @timeout: timeout in milliseconds
3319
3320
*
3320
- * Return: 0 upon success; < 0 upon failure.
3321
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3322
+ * < 0 if another error occurred.
3321
3323
*
3322
3324
* NOTE: Since there is only one available tag for device management commands,
3323
3325
* it is expected you hold the hba->dev_cmd.lock mutex.
@@ -3363,6 +3365,10 @@ static inline void ufshcd_init_query(struct ufs_hba *hba,
3363
3365
(* request )-> upiu_req .selector = selector ;
3364
3366
}
3365
3367
3368
+ /*
3369
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3370
+ * < 0 if another error occurred.
3371
+ */
3366
3372
static int ufshcd_query_flag_retry (struct ufs_hba * hba ,
3367
3373
enum query_opcode opcode , enum flag_idn idn , u8 index , bool * flag_res )
3368
3374
{
@@ -3383,7 +3389,6 @@ static int ufshcd_query_flag_retry(struct ufs_hba *hba,
3383
3389
dev_err (hba -> dev ,
3384
3390
"%s: query flag, opcode %d, idn %d, failed with error %d after %d retries\n" ,
3385
3391
__func__ , opcode , idn , ret , retries );
3386
- WARN_ONCE (ret > 0 , "Incorrect return value %d > 0\n" , ret );
3387
3392
return ret ;
3388
3393
}
3389
3394
@@ -3395,7 +3400,8 @@ static int ufshcd_query_flag_retry(struct ufs_hba *hba,
3395
3400
* @index: flag index to access
3396
3401
* @flag_res: the flag value after the query request completes
3397
3402
*
3398
- * Return: 0 for success; < 0 upon failure.
3403
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3404
+ * < 0 if another error occurred.
3399
3405
*/
3400
3406
int ufshcd_query_flag (struct ufs_hba * hba , enum query_opcode opcode ,
3401
3407
enum flag_idn idn , u8 index , bool * flag_res )
@@ -3451,7 +3457,6 @@ int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
3451
3457
3452
3458
out_unlock :
3453
3459
ufshcd_dev_man_unlock (hba );
3454
- WARN_ONCE (err > 0 , "Incorrect return value %d > 0\n" , err );
3455
3460
return err ;
3456
3461
}
3457
3462
@@ -3464,8 +3469,9 @@ int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
3464
3469
* @selector: selector field
3465
3470
* @attr_val: the attribute value after the query request completes
3466
3471
*
3467
- * Return: 0 upon success; < 0 upon failure.
3468
- */
3472
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3473
+ * < 0 if another error occurred.
3474
+ */
3469
3475
int ufshcd_query_attr (struct ufs_hba * hba , enum query_opcode opcode ,
3470
3476
enum attr_idn idn , u8 index , u8 selector , u32 * attr_val )
3471
3477
{
@@ -3513,7 +3519,6 @@ int ufshcd_query_attr(struct ufs_hba *hba, enum query_opcode opcode,
3513
3519
3514
3520
out_unlock :
3515
3521
ufshcd_dev_man_unlock (hba );
3516
- WARN_ONCE (err > 0 , "Incorrect return value %d > 0\n" , err );
3517
3522
return err ;
3518
3523
}
3519
3524
@@ -3528,8 +3533,9 @@ int ufshcd_query_attr(struct ufs_hba *hba, enum query_opcode opcode,
3528
3533
* @attr_val: the attribute value after the query request
3529
3534
* completes
3530
3535
*
3531
- * Return: 0 for success; < 0 upon failure.
3532
- */
3536
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3537
+ * < 0 if another error occurred.
3538
+ */
3533
3539
int ufshcd_query_attr_retry (struct ufs_hba * hba ,
3534
3540
enum query_opcode opcode , enum attr_idn idn , u8 index , u8 selector ,
3535
3541
u32 * attr_val )
@@ -3551,12 +3557,12 @@ int ufshcd_query_attr_retry(struct ufs_hba *hba,
3551
3557
dev_err (hba -> dev ,
3552
3558
"%s: query attribute, idn %d, failed with error %d after %d retries\n" ,
3553
3559
__func__ , idn , ret , QUERY_REQ_RETRIES );
3554
- WARN_ONCE (ret > 0 , "Incorrect return value %d > 0\n" , ret );
3555
3560
return ret ;
3556
3561
}
3557
3562
3558
3563
/*
3559
- * Return: 0 if successful; < 0 upon failure.
3564
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3565
+ * < 0 if another error occurred.
3560
3566
*/
3561
3567
static int __ufshcd_query_descriptor (struct ufs_hba * hba ,
3562
3568
enum query_opcode opcode , enum desc_idn idn , u8 index ,
@@ -3615,7 +3621,6 @@ static int __ufshcd_query_descriptor(struct ufs_hba *hba,
3615
3621
out_unlock :
3616
3622
hba -> dev_cmd .query .descriptor = NULL ;
3617
3623
ufshcd_dev_man_unlock (hba );
3618
- WARN_ONCE (err > 0 , "Incorrect return value %d > 0\n" , err );
3619
3624
return err ;
3620
3625
}
3621
3626
@@ -3632,7 +3637,8 @@ static int __ufshcd_query_descriptor(struct ufs_hba *hba,
3632
3637
* The buf_len parameter will contain, on return, the length parameter
3633
3638
* received on the response.
3634
3639
*
3635
- * Return: 0 for success; < 0 upon failure.
3640
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3641
+ * < 0 if another error occurred.
3636
3642
*/
3637
3643
int ufshcd_query_descriptor_retry (struct ufs_hba * hba ,
3638
3644
enum query_opcode opcode ,
@@ -3650,7 +3656,6 @@ int ufshcd_query_descriptor_retry(struct ufs_hba *hba,
3650
3656
break ;
3651
3657
}
3652
3658
3653
- WARN_ONCE (err > 0 , "Incorrect return value %d > 0\n" , err );
3654
3659
return err ;
3655
3660
}
3656
3661
@@ -3663,7 +3668,8 @@ int ufshcd_query_descriptor_retry(struct ufs_hba *hba,
3663
3668
* @param_read_buf: pointer to buffer where parameter would be read
3664
3669
* @param_size: sizeof(param_read_buf)
3665
3670
*
3666
- * Return: 0 in case of success; < 0 upon failure.
3671
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
3672
+ * < 0 if another error occurred.
3667
3673
*/
3668
3674
int ufshcd_read_desc_param (struct ufs_hba * hba ,
3669
3675
enum desc_idn desc_id ,
@@ -3730,7 +3736,6 @@ int ufshcd_read_desc_param(struct ufs_hba *hba,
3730
3736
out :
3731
3737
if (is_kmalloc )
3732
3738
kfree (desc_buf );
3733
- WARN_ONCE (ret > 0 , "Incorrect return value %d > 0\n" , ret );
3734
3739
return ret ;
3735
3740
}
3736
3741
@@ -4781,7 +4786,8 @@ EXPORT_SYMBOL_GPL(ufshcd_config_pwr_mode);
4781
4786
*
4782
4787
* Set fDeviceInit flag and poll until device toggles it.
4783
4788
*
4784
- * Return: 0 upon success; < 0 upon failure.
4789
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
4790
+ * < 0 if another error occurred.
4785
4791
*/
4786
4792
static int ufshcd_complete_dev_init (struct ufs_hba * hba )
4787
4793
{
@@ -5135,7 +5141,8 @@ static int ufshcd_link_startup(struct ufs_hba *hba)
5135
5141
* not respond with NOP IN UPIU within timeout of %NOP_OUT_TIMEOUT
5136
5142
* and we retry sending NOP OUT for %NOP_OUT_RETRIES iterations.
5137
5143
*
5138
- * Return: 0 upon success; < 0 upon failure.
5144
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
5145
+ * < 0 if another error occurred.
5139
5146
*/
5140
5147
static int ufshcd_verify_dev_init (struct ufs_hba * hba )
5141
5148
{
@@ -5867,7 +5874,8 @@ static inline int ufshcd_enable_ee(struct ufs_hba *hba, u16 mask)
5867
5874
* as the device is allowed to manage its own way of handling background
5868
5875
* operations.
5869
5876
*
5870
- * Return: zero on success, non-zero on failure.
5877
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
5878
+ * < 0 if another error occurred.
5871
5879
*/
5872
5880
static int ufshcd_enable_auto_bkops (struct ufs_hba * hba )
5873
5881
{
@@ -5906,7 +5914,8 @@ static int ufshcd_enable_auto_bkops(struct ufs_hba *hba)
5906
5914
* host is idle so that BKOPS are managed effectively without any negative
5907
5915
* impacts.
5908
5916
*
5909
- * Return: zero on success, non-zero on failure.
5917
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
5918
+ * < 0 if another error occurred.
5910
5919
*/
5911
5920
static int ufshcd_disable_auto_bkops (struct ufs_hba * hba )
5912
5921
{
@@ -6056,6 +6065,10 @@ static void ufshcd_bkops_exception_event_handler(struct ufs_hba *hba)
6056
6065
__func__ , err );
6057
6066
}
6058
6067
6068
+ /*
6069
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
6070
+ * < 0 if another error occurred.
6071
+ */
6059
6072
int ufshcd_read_device_lvl_exception_id (struct ufs_hba * hba , u64 * exception_id )
6060
6073
{
6061
6074
struct utp_upiu_query_v4_0 * upiu_resp ;
@@ -7452,7 +7465,8 @@ int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba,
7452
7465
* @sg_list: Pointer to SG list when DATA IN/OUT UPIU is required in ARPMB operation
7453
7466
* @dir: DMA direction
7454
7467
*
7455
- * Return: zero on success, non-zero on failure.
7468
+ * Return: 0 upon success; > 0 in case the UFS device reported an OCS error;
7469
+ * < 0 if another error occurred.
7456
7470
*/
7457
7471
int ufshcd_advanced_rpmb_req_handler (struct ufs_hba * hba , struct utp_upiu_req * req_upiu ,
7458
7472
struct utp_upiu_req * rsp_upiu , struct ufs_ehs * req_ehs ,
0 commit comments