···1605160516061606 The attribute is read/write.1607160716081608+What: /sys/bus/platform/drivers/ufshcd/*/device_lvl_exception_count16091609+What: /sys/bus/platform/devices/*.ufs/device_lvl_exception_count16101610+Date: March 202516111611+Contact: Bao D. Nguyen <quic_nguyenb@quicinc.com>16121612+Description:16131613+ This attribute is applicable to ufs devices compliant to the16141614+ JEDEC specifications version 4.1 or later. The16151615+ device_lvl_exception_count is a counter indicating the number of16161616+ times the device level exceptions have occurred since the last16171617+ time this variable is reset. Writing a 0 value to this16181618+ attribute will reset the device_lvl_exception_count. If the16191619+ device_lvl_exception_count reads a positive value, the user16201620+ application should read the device_lvl_exception_id attribute to16211621+ know more information about the exception.16221622+16231623+ The attribute is read/write.16241624+16251625+What: /sys/bus/platform/drivers/ufshcd/*/device_lvl_exception_id16261626+What: /sys/bus/platform/devices/*.ufs/device_lvl_exception_id16271627+Date: March 202516281628+Contact: Bao D. Nguyen <quic_nguyenb@quicinc.com>16291629+Description:16301630+ Reading the device_lvl_exception_id returns the16311631+ qDeviceLevelExceptionID attribute of the ufs device JEDEC16321632+ specification version 4.1. The definition of the16331633+ qDeviceLevelExceptionID is the ufs device vendor specific16341634+ implementation. Refer to the device manufacturer datasheet for16351635+ more information on the meaning of the qDeviceLevelExceptionID16361636+ attribute value.16371637+16381638+ The attribute is read only.16391639+16081640What: /sys/bus/platform/drivers/ufshcd/*/wb_resize_enable16091641What: /sys/bus/platform/devices/*.ufs/wb_resize_enable16101642Date: April 2025
+20
drivers/scsi/hisi_sas/hisi_sas_main.c
···943943 container_of(work, typeof(*phy), works[event]);944944 struct hisi_hba *hisi_hba = phy->hisi_hba;945945 struct asd_sas_phy *sas_phy = &phy->sas_phy;946946+ struct asd_sas_port *sas_port = sas_phy->port;947947+ struct hisi_sas_port *port = phy->port;948948+ struct device *dev = hisi_hba->dev;949949+ struct domain_device *port_dev;946950 int phy_no = sas_phy->id;951951+952952+ if (!test_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags) &&953953+ sas_port && port && (port->id != phy->port_id)) {954954+ dev_info(dev, "phy%d's hw port id changed from %d to %llu\n",955955+ phy_no, port->id, phy->port_id);956956+ port_dev = sas_port->port_dev;957957+ if (port_dev && !dev_is_expander(port_dev->dev_type)) {958958+ /*959959+ * Set the device state to gone to block960960+ * sending IO to the device.961961+ */962962+ set_bit(SAS_DEV_GONE, &port_dev->state);963963+ hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET);964964+ return;965965+ }966966+ }947967948968 phy->wait_phyup_cnt = 0;949969 if (phy->identify.target_port_protocols == SAS_PROTOCOL_SSP)
···181181 struct exynos_ufs_uic_attr *uic_attr;182182 unsigned int quirks;183183 unsigned int opts;184184+ u32 iocc_mask;184185 /* SoC's specific operations */185186 int (*drv_init)(struct exynos_ufs *ufs);186187 int (*pre_link)(struct exynos_ufs *ufs);···192191 const struct ufs_pa_layer_attr *pwr);193192 int (*pre_hce_enable)(struct exynos_ufs *ufs);194193 int (*post_hce_enable)(struct exynos_ufs *ufs);194194+ int (*suspend)(struct exynos_ufs *ufs);195195};196196197197struct ufs_phy_time_cfg {···232230 ktime_t entry_hibern8_t;233231 const struct exynos_ufs_drv_data *drv_data;234232 struct regmap *sysreg;235235- u32 shareability_reg_offset;233233+ u32 iocc_offset;234234+ u32 iocc_mask;235235+ u32 iocc_val;236236237237 u32 opts;238238#define EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL BIT(0)
+43
drivers/ufs/host/ufs-qcom.c
···3333 ((((c) >> 16) & MCQ_QCFGPTR_MASK) * MCQ_QCFGPTR_UNIT)3434#define MCQ_QCFG_SIZE 0x4035353636+/* De-emphasis for gear-5 */3737+#define DEEMPHASIS_3_5_dB 0x043838+#define NO_DEEMPHASIS 0x03939+3640enum {3741 TSTBUS_UAWM,3842 TSTBUS_UARM,···834830 return ufs_qcom_icc_set_bw(host, bw_table.mem_bw, bw_table.cfg_bw);835831}836832833833+static void ufs_qcom_set_tx_hs_equalizer(struct ufs_hba *hba, u32 gear, u32 tx_lanes)834834+{835835+ u32 equalizer_val;836836+ int ret, i;837837+838838+ /* Determine the equalizer value based on the gear */839839+ equalizer_val = (gear == 5) ? DEEMPHASIS_3_5_dB : NO_DEEMPHASIS;840840+841841+ for (i = 0; i < tx_lanes; i++) {842842+ ret = ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(TX_HS_EQUALIZER, i),843843+ equalizer_val);844844+ if (ret)845845+ dev_err(hba->dev, "%s: failed equalizer lane %d\n",846846+ __func__, i);847847+ }848848+}849849+837850static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,838851 enum ufs_notify_change_status status,839852 const struct ufs_pa_layer_attr *dev_max_params,···902881 dev_req_params->gear_tx,903882 PA_INITIAL_ADAPT);904883 }884884+885885+ if (hba->dev_quirks & UFS_DEVICE_QUIRK_PA_TX_DEEMPHASIS_TUNING)886886+ ufs_qcom_set_tx_hs_equalizer(hba,887887+ dev_req_params->gear_tx, dev_req_params->lane_tx);888888+905889 break;906890 case POST_CHANGE:907891 if (ufs_qcom_cfg_timers(hba, false)) {···954928 (pa_vs_config_reg1 | (1 << 12)));955929}956930931931+static void ufs_qcom_override_pa_tx_hsg1_sync_len(struct ufs_hba *hba)932932+{933933+ int err;934934+935935+ err = ufshcd_dme_peer_set(hba, UIC_ARG_MIB(PA_TX_HSG1_SYNC_LENGTH),936936+ PA_TX_HSG1_SYNC_LENGTH_VAL);937937+ if (err)938938+ dev_err(hba->dev, "Failed (%d) set PA_TX_HSG1_SYNC_LENGTH\n", err);939939+}940940+957941static int ufs_qcom_apply_dev_quirks(struct ufs_hba *hba)958942{959943 int err = 0;960944961945 if (hba->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME)962946 err = ufs_qcom_quirk_host_pa_saveconfigtime(hba);947947+948948+ if (hba->dev_quirks & UFS_DEVICE_QUIRK_PA_TX_HSG1_SYNC_LENGTH)949949+ ufs_qcom_override_pa_tx_hsg1_sync_len(hba);963950964951 return err;965952}···988949 { .wmanufacturerid = UFS_VENDOR_WDC,989950 .model = UFS_ANY_MODEL,990951 .quirk = UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE },952952+ { .wmanufacturerid = UFS_VENDOR_SAMSUNG,953953+ .model = UFS_ANY_MODEL,954954+ .quirk = UFS_DEVICE_QUIRK_PA_TX_HSG1_SYNC_LENGTH |955955+ UFS_DEVICE_QUIRK_PA_TX_DEEMPHASIS_TUNING },991956 {}992957};993958
+18
drivers/ufs/host/ufs-qcom.h
···122122 TMRLUT_HW_CGC_EN | OCSC_HW_CGC_EN)123123124124/* QUniPro Vendor specific attributes */125125+#define PA_TX_HSG1_SYNC_LENGTH 0x1552125126#define PA_VS_CONFIG_REG1 0x9000126127#define DME_VS_CORE_CLK_CTRL 0xD002128128+#define TX_HS_EQUALIZER 0x0037129129+127130/* bit and mask definitions for DME_VS_CORE_CLK_CTRL attribute */128131#define CLK_1US_CYCLES_MASK_V4 GENMASK(27, 16)129132#define CLK_1US_CYCLES_MASK GENMASK(7, 0)···143140#define UNIPRO_CORE_CLK_FREQ_300_MHZ 300144141#define UNIPRO_CORE_CLK_FREQ_201_5_MHZ 202145142#define UNIPRO_CORE_CLK_FREQ_403_MHZ 403143143+144144+/* TX_HSG1_SYNC_LENGTH attr value */145145+#define PA_TX_HSG1_SYNC_LENGTH_VAL 0x4A146146+147147+/*148148+ * Some ufs device vendors need a different TSync length.149149+ * Enable this quirk to give an additional TX_HS_SYNC_LENGTH.150150+ */151151+#define UFS_DEVICE_QUIRK_PA_TX_HSG1_SYNC_LENGTH BIT(16)152152+153153+/*154154+ * Some ufs device vendors need a different Deemphasis setting.155155+ * Enable this quirk to tune TX Deemphasis parameters.156156+ */157157+#define UFS_DEVICE_QUIRK_PA_TX_DEEMPHASIS_TUNING BIT(17)146158147159/* ICE allocator type to share AES engines among TX stream and RX stream */148160#define ICE_ALLOCATOR_TYPE 2
···107107 */108108#define UFS_DEVICE_QUIRK_DELAY_AFTER_LPM (1 << 11)109109110110+/*111111+ * Some ufs devices may need more time to be in hibern8 before exiting.112112+ * Enable this quirk to give it an additional 100us.113113+ */114114+#define UFS_DEVICE_QUIRK_PA_HIBER8TIME (1 << 12)115115+110116#endif /* UFS_QUIRKS_H_ */
+6-1
include/ufs/ufshcd.h
···246246struct ufs_dev_cmd {247247 enum dev_cmd_type type;248248 struct mutex lock;249249- struct completion *complete;249249+ struct completion complete;250250 struct ufs_query query;251251};252252···964964 * @pm_qos_req: PM QoS request handle965965 * @pm_qos_enabled: flag to check if pm qos is enabled966966 * @critical_health_count: count of critical health exceptions967967+ * @dev_lvl_exception_count: count of device level exceptions since last reset968968+ * @dev_lvl_exception_id: vendor specific information about the969969+ * device level exception event.967970 */968971struct ufs_hba {969972 void __iomem *mmio_base;···11381135 bool pm_qos_enabled;1139113611401137 int critical_health_count;11381138+ atomic_t dev_lvl_exception_count;11391139+ u64 dev_lvl_exception_id;11411140};1142114111431142/**