Re: [PATCH] scsi: ufs: should not override buffer lengh

2021-01-11 Thread Jaegeuk Kim
On 01/11, Can Guo wrote: > On 2021-01-11 16:15, Avri Altman wrote: > > > > > > Sorry, typo corrected. > > > > > > Hi Jaegeuk, > > > > > > I think the problem is that func ufshcd_read_desc_param() is not > > > expecting > > > one access unsupported descriptors on RPMB LU. > > Correct. > > This

Re: [PATCH] scsi: ufs: should not override buffer lengh

2021-01-11 Thread Can Guo
On 2021-01-11 16:15, Avri Altman wrote: Sorry, typo corrected. Hi Jaegeuk, I think the problem is that func ufshcd_read_desc_param() is not expecting one access unsupported descriptors on RPMB LU. Correct. This is about wb introducing a new constraint: wb buffer is only allowed in lu 0..7.

RE: [PATCH] scsi: ufs: should not override buffer lengh

2021-01-11 Thread Avri Altman
> > Sorry, typo corrected. > > Hi Jaegeuk, > > I think the problem is that func ufshcd_read_desc_param() is not > expecting > one access unsupported descriptors on RPMB LU. Correct. This is about wb introducing a new constraint: wb buffer is only allowed in lu 0..7. And this is why, IMHO, the

Re: [PATCH] scsi: ufs: should not override buffer lengh

2021-01-10 Thread Can Guo
Sorry, typo corrected. Hi Jaegeuk, I think the problem is that func ufshcd_read_desc_param() is not expecting one access unsupported descriptors on RPMB LU. If we can get the right buf_len from func ufshcd_map_desc_id_to_length(), the issue won't happen. -

Re: [PATCH] scsi: ufs: should not override buffer lengh

2021-01-10 Thread Can Guo
Hi Jaegeuk, I think the problem is that func ufshcd_read_desc_param() is not expecting one access unsupported descriptors on all W-LUs, not just RPMB LU. If we can get the right buf_len from func ufshcd_map_desc_id_to_length(), the issue won't happen. -

[PATCH] scsi: ufs: should not override buffer lengh

2021-01-10 Thread Jaegeuk Kim
From: Jaegeuk Kim Kernel stack violation when getting unit_descriptor/wb_buf_alloc_units from rpmb lun. The reason is the unit descriptor length is different per LU. The lengh of Normal LU is 45, while the one of rpmb LU is 35. int ufshcd_read_desc_param(struct ufs_hba *hba, ...) {