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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux