scsi: ufs: core: Initialize hba->reserved_slot earlier
authorBart Van Assche <bvanassche@acm.org>
Mon, 8 Jul 2024 21:16:00 +0000 (14:16 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 11 Jul 2024 02:19:04 +0000 (22:19 -0400)
commitf4750af7081d0466c187f5b72272d07148d75e67
tree538c0ef5c8890bc8c9eeb2058366b19525d9d35c
parentb53eb9a050d76fc695258e04384e71b3fbb1e7d5
scsi: ufs: core: Initialize hba->reserved_slot earlier

Move the hba->reserved_slot and the host->can_queue assignments from
ufshcd_config_mcq() into ufshcd_alloc_mcq(). The advantages of this change
are as follows:

 - It becomes easier to verify that these two parameters are updated if
   hba->nutrs is updated.

 - It prevents unnecessary assignments to these two parameters. While
   ufshcd_config_mcq() is called during host reset, ufshcd_alloc_mcq() is
   not.

Cc: Can Guo <quic_cang@quicinc.com>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240708211716.2827751-6-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c