RE: [PATCH 2/7] ufs: add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christoph,

> From: Christoph Hellwig, Sent: Friday, April 15, 2022 3:46 PM
> 
> On Tue, Apr 12, 2022 at 04:36:42PM +0900, Yoshihiro Shimoda wrote:
> > Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS for a broken host controller
> > of the 64-bit addressing supported capability.
> 
> Why can't you just clear MASK_64_ADDRESSING_SUPPORT for this case?

Unfortunately, the register (REG_CONTROLLER_CAPABILITIES) is read-only.
So, software cannot clear MASK_64_ADDRESSING_SUPPORT on the register.
I am also asking a person in charge of hardware why the MASK_64_ADDRESSING_SUPPORT
is set now, but I didn't get any feedback yet...

However, we can add the following code instead. Perhaps, it's better than the current patch?

---
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2201,6 +2201,9 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba)
 	((hba->capabilities & MASK_TASK_MANAGEMENT_REQUEST_SLOTS) >> 16) + 1;
 	hba->reserved_slot = hba->nutrs - 1;
 
+	if (hba->quirks & UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS)
+		hba->capabilities &= ~MASK_64_ADDRESSING_SUPPORT;
+
 	/* Read crypto capabilities */
 	err = ufshcd_hba_init_crypto_capabilities(hba);
 	if (err)
---

Best regards,
Yoshihiro Shimoda





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux