Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f2805a6 authored by Yaniv Gardi's avatar Yaniv Gardi
Browse files

scsi: ufs-msm: add support for rx and tx to work in different num of lanes



Uni-pro lane management provides flexibility for tx/rx to work with
different number of lanes.
This change supports different number of lanes for TX and for RX.
The configured number of lanes for TX will be now the minimum between
the device capability and the vendor preferences.
Same logic applies when configuring RX number of lanes.

Change-Id: I9387a4489d910f89a0741c6349084051d7d94549
Signed-off-by: default avatarYaniv Gardi <ygardi@codeaurora.org>
parent 8cf6ee43
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -1519,8 +1519,6 @@ static int get_pwr_dev_param(struct ufs_msm_dev_params *msm_param,
	int arr[NUM_OF_SUPPORTED_MODES] = {0};
	int i;
	int min_power;
	int min_dev_lanes;
	int min_msm_lanes;
	int min_msm_gear;
	int min_dev_gear;
	bool is_max_dev_hs;
@@ -1559,15 +1557,12 @@ static int get_pwr_dev_param(struct ufs_msm_dev_params *msm_param,
	}

	/**
	 * we would like rx and tx to work in the same number of lanes
	 * the minimum number of lanes between rx and tx of the device
	 * capabilities and the vendor preferences determines to how many
	 * lanes we shall configure the device
	 * we would like tx to work in the minimum number of lanes
	 * between device capability and vendor preferences.
	 * the same decision will be made for rx.
	 */
	min_dev_lanes = min_t(u32, dev_max->lane_rx, dev_max->lane_tx);
	min_msm_lanes = min_t(u32, msm_param->rx_lanes, msm_param->tx_lanes);
	dev_req->lane_rx = dev_req->lane_tx =
			min_t(u32, min_dev_lanes, min_msm_lanes);
	dev_req->lane_tx = min_t(u32, dev_max->lane_tx, msm_param->tx_lanes);
	dev_req->lane_rx = min_t(u32, dev_max->lane_rx, msm_param->rx_lanes);

	if (dev_max->pwr_rx == SLOW_MODE ||
	    dev_max->pwr_rx == SLOWAUTO_MODE)