bus: mhi: host: Process invalid BW requests sent by device

When an invalid BW request is sent by the device to the host
to proccess, a value of 0x1 is written to the bw_scale_db
register.

Change-Id: I362e9b308142fe5a9107d46789d26cb38933e858
Signed-off-by: Lazarus Motha <quic_lmotha@quicinc.com>
This commit is contained in:
Lazarus Motha 2022-09-27 17:30:25 -07:00 committed by Gerrit - the friendly Code Review server
parent 5a1870bb6b
commit 4f5e1c26d9
2 changed files with 10 additions and 3 deletions

View File

@ -1364,7 +1364,7 @@ int mhi_process_misc_bw_ev_ring(struct mhi_controller *mhi_cntrl,
struct mhi_link_info link_info, *cur_info = &mhi_cntrl->mhi_link_info;
struct device *dev = &mhi_cntrl->mhi_dev->dev;
struct mhi_private *mhi_priv = dev_get_drvdata(dev);
u32 result = MHI_BW_SCALE_NACK;
enum mhi_bw_scale_req_status result = MHI_BW_SCALE_NACK;
int ret = -EINVAL;
if (!MHI_IN_MISSION_MODE(mhi_cntrl->ee))
@ -1428,7 +1428,9 @@ int mhi_process_misc_bw_ev_ring(struct mhi_controller *mhi_cntrl,
ret = mhi_priv->bw_scale(mhi_cntrl, &link_info);
if (!ret) {
*cur_info = link_info;
result = 0;
result = MHI_BW_SCALE_SUCCESS;
} else if (ret == -EINVAL) {
result = MHI_BW_SCALE_INVALID;
}
write_lock_bh(&mhi_cntrl->pm_lock);

View File

@ -44,7 +44,12 @@
#define MHI_BW_SCALE_RESULT(status, seq) (((status) & 0xF) << 8 | \
((seq) & 0xFF))
#define MHI_BW_SCALE_NACK 0xF
enum mhi_bw_scale_req_status {
MHI_BW_SCALE_SUCCESS = 0x0,
MHI_BW_SCALE_INVALID = 0x1,
MHI_BW_SCALE_NACK = 0xF,
};
/* subsystem failure reason cfg command */
#define MHI_TRE_CMD_SFR_CFG_PTR(ptr) (ptr)