Commit 891e811a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "The important core fix is another tweak to our discard discovery
  issues. The off by 512 in logical block count seems bad, but in fact
  the inline was only ever used in debug prints, which is why no-one
  noticed"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: sd: Do not attempt to configure discard unless LBPME is set
  scsi: MAINTAINERS: Add header files to SCSI SUBSYSTEM
  scsi: ufs: qcom: Add UFSHCD_QUIRK_BROKEN_LSDBS_CAP for SM8550 SoC
  scsi: ufs: core: Add a quirk for handling broken LSDBS field in controller capabilities register
  scsi: core: Fix the return value of scsi_logical_block_count()
  scsi: MAINTAINERS: Update HiSilicon SAS controller driver maintainer
parents d2bafcf2 cbaac689
...@@ -10175,7 +10175,7 @@ F: Documentation/devicetree/bindings/infiniband/hisilicon-hns-roce.txt ...@@ -10175,7 +10175,7 @@ F: Documentation/devicetree/bindings/infiniband/hisilicon-hns-roce.txt
F: drivers/infiniband/hw/hns/ F: drivers/infiniband/hw/hns/
HISILICON SAS Controller HISILICON SAS Controller
M: Xiang Chen <chenxiang66@hisilicon.com> M: Yihang Li <liyihang9@huawei.com>
S: Supported S: Supported
W: http://www.hisilicon.com W: http://www.hisilicon.com
F: Documentation/devicetree/bindings/scsi/hisilicon-sas.txt F: Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
...@@ -20374,6 +20374,7 @@ F: Documentation/devicetree/bindings/scsi/ ...@@ -20374,6 +20374,7 @@ F: Documentation/devicetree/bindings/scsi/
F: drivers/scsi/ F: drivers/scsi/
F: drivers/ufs/ F: drivers/ufs/
F: include/scsi/ F: include/scsi/
F: include/uapi/scsi/
SCSI TAPE DRIVER SCSI TAPE DRIVER
M: Kai Mäkisara <Kai.Makisara@kolumbus.fi> M: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
......
...@@ -3308,6 +3308,9 @@ static void sd_read_app_tag_own(struct scsi_disk *sdkp, unsigned char *buffer) ...@@ -3308,6 +3308,9 @@ static void sd_read_app_tag_own(struct scsi_disk *sdkp, unsigned char *buffer)
static unsigned int sd_discard_mode(struct scsi_disk *sdkp) static unsigned int sd_discard_mode(struct scsi_disk *sdkp)
{ {
if (!sdkp->lbpme)
return SD_LBP_FULL;
if (!sdkp->lbpvpd) { if (!sdkp->lbpvpd) {
/* LBP VPD page not provided */ /* LBP VPD page not provided */
if (sdkp->max_unmap_blocks) if (sdkp->max_unmap_blocks)
......
...@@ -2426,7 +2426,11 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba) ...@@ -2426,7 +2426,11 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba)
* 0h: legacy single doorbell support is available * 0h: legacy single doorbell support is available
* 1h: indicate that legacy single doorbell support has been removed * 1h: indicate that legacy single doorbell support has been removed
*/ */
hba->lsdb_sup = !FIELD_GET(MASK_LSDB_SUPPORT, hba->capabilities); if (!(hba->quirks & UFSHCD_QUIRK_BROKEN_LSDBS_CAP))
hba->lsdb_sup = !FIELD_GET(MASK_LSDB_SUPPORT, hba->capabilities);
else
hba->lsdb_sup = true;
if (!hba->mcq_sup) if (!hba->mcq_sup)
return 0; return 0;
......
...@@ -857,6 +857,9 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba) ...@@ -857,6 +857,9 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
if (host->hw_ver.major > 0x3) if (host->hw_ver.major > 0x3)
hba->quirks |= UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH; hba->quirks |= UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH;
if (of_device_is_compatible(hba->dev->of_node, "qcom,sm8550-ufshc"))
hba->quirks |= UFSHCD_QUIRK_BROKEN_LSDBS_CAP;
} }
static void ufs_qcom_set_phy_gear(struct ufs_qcom_host *host) static void ufs_qcom_set_phy_gear(struct ufs_qcom_host *host)
...@@ -1847,7 +1850,8 @@ static void ufs_qcom_remove(struct platform_device *pdev) ...@@ -1847,7 +1850,8 @@ static void ufs_qcom_remove(struct platform_device *pdev)
} }
static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = { static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = {
{ .compatible = "qcom,ufshc"}, { .compatible = "qcom,ufshc" },
{ .compatible = "qcom,sm8550-ufshc" },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, ufs_qcom_of_match); MODULE_DEVICE_TABLE(of, ufs_qcom_of_match);
......
...@@ -234,7 +234,7 @@ static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd) ...@@ -234,7 +234,7 @@ static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd)
static inline unsigned int scsi_logical_block_count(struct scsi_cmnd *scmd) static inline unsigned int scsi_logical_block_count(struct scsi_cmnd *scmd)
{ {
unsigned int shift = ilog2(scmd->device->sector_size) - SECTOR_SHIFT; unsigned int shift = ilog2(scmd->device->sector_size);
return blk_rq_bytes(scsi_cmd_to_rq(scmd)) >> shift; return blk_rq_bytes(scsi_cmd_to_rq(scmd)) >> shift;
} }
......
...@@ -676,6 +676,14 @@ enum ufshcd_quirks { ...@@ -676,6 +676,14 @@ enum ufshcd_quirks {
* the standard best practice for managing keys). * the standard best practice for managing keys).
*/ */
UFSHCD_QUIRK_KEYS_IN_PRDT = 1 << 24, UFSHCD_QUIRK_KEYS_IN_PRDT = 1 << 24,
/*
* This quirk indicates that the controller reports the value 1 (not
* supported) in the Legacy Single DoorBell Support (LSDBS) bit of the
* Controller Capabilities register although it supports the legacy
* single doorbell mode.
*/
UFSHCD_QUIRK_BROKEN_LSDBS_CAP = 1 << 25,
}; };
enum ufshcd_caps { enum ufshcd_caps {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment