Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
Merge "dt-bindings: bus: mhi: add missing entries for configuration s…
Browse files Browse the repository at this point in the history
…upport"
  • Loading branch information
qctecmdr authored and Gerrit - the friendly Code Review server committed Sep 29, 2020
2 parents d4cc323 + 8bd4797 commit 9602850
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
14 changes: 14 additions & 0 deletions Documentation/devicetree/bindings/bus/mhi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ Main node properties:
Definition: Set to true if MHI device supports sending subsystem failure
reason upon assert in case PCIe link is functional.

- mhi,allow-m1
Usage: optional
Value type: <bool>
Definition: Set to true if MHI device does not support autonomous low
power modes entry.

- mhi,skip-forced-suspend
Usage: optional
Value type: <bool>
Definition: Set to true if MHI device does not require support for a forced
suspend/resume cycle at bootup since it has no requirement to switch
to a separate set of mission mode PCIe phy settings to enable low power
modes.

============================
mhi channel node properties:
============================
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/qcom/sm8150-lemur.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
qcom,smmu-cfg = <0x1d>;
qcom,addr-win = <0x0 0x20000000 0x0 0x2fffffff>;
mhi,sfr-support;
mhi,skip-forced-suspend;

/* controller noc frequency scaling configuration */
qcom,msm-bus,name = "mhi1";
Expand Down Expand Up @@ -286,6 +287,7 @@
qcom,smmu-cfg = <0x1d>;
qcom,addr-win = <0x0 0x20000000 0x0 0x2fffffff>;
mhi,sfr-support;
mhi,skip-forced-suspend;

/* controller noc frequency scaling configuration */
qcom,msm-bus,name = "mhi0";
Expand Down
28 changes: 22 additions & 6 deletions drivers/bus/mhi/controllers/mhi_qcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,15 @@ static void mhi_status_cb(struct mhi_controller *mhi_cntrl,
* we need to force a suspend so device can switch to
* mission mode pcie phy settings.
*/
pm_runtime_get(dev);
ret = mhi_force_suspend(mhi_cntrl);
if (!ret) {
MHI_CNTRL_LOG("Attempt resume after forced suspend\n");
mhi_runtime_resume(dev);
if (!mhi_dev->skip_forced_suspend) {
pm_runtime_get(dev);
ret = mhi_force_suspend(mhi_cntrl);
if (!ret) {
MHI_CNTRL_LOG("Resume after forced suspend\n");
mhi_runtime_resume(dev);
}
pm_runtime_put(dev);
}
pm_runtime_put(dev);
mhi_arch_mission_mode_enter(mhi_cntrl);
pm_runtime_allow(&mhi_dev->pci_dev->dev);
break;
Expand Down Expand Up @@ -752,8 +754,22 @@ static struct mhi_controller *mhi_register_controller(struct pci_dev *pci_dev)
goto error_register;

use_bb = of_property_read_bool(of_node, "mhi,use-bb");

/*
* Certain devices would send M1 events to MHI as they may not have
* autonomous M2 support. MHI host can skip registering for link
* inactivity timeouts in that case.
*/
mhi_dev->allow_m1 = of_property_read_bool(of_node, "mhi,allow-m1");

/*
* Certain devices do not require a forced suspend/resume cycle at
* mission mode entry after boot as they do not need to switch to
* separate phy settings in order to enable low power modes
*/
mhi_dev->skip_forced_suspend = of_property_read_bool(of_node,
"mhi,skip-forced-suspend");

/*
* if s1 translation enabled or using bounce buffer pull iova addr
* from dt
Expand Down
1 change: 1 addition & 0 deletions drivers/bus/mhi/controllers/mhi_qcom.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct mhi_dev {
bool allow_m1;
bool mdm_state;
bool disable_pci_lpm;
bool skip_forced_suspend;
dma_addr_t iova_start;
dma_addr_t iova_stop;
enum mhi_suspend_mode suspend_mode;
Expand Down

0 comments on commit 9602850

Please sign in to comment.