[PATCH v1 2/6] bus: mhi: core: Set BHI and BHIe pointers to NULL in clean-up

2021-04-16 Thread Bhaumik Bhatt
Set the BHI and BHIe pointers to NULL as part of clean-up. This makes sure that stale pointers are not accessed after powering MHI down. Suggested-by: Hemant Kumar Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/bus

[PATCH v1 4/6] ath11k: set register access length for MHI driver

2021-04-16 Thread Bhaumik Bhatt
MHI driver requires register space length to add range checks and prevent memory region accesses outside of that for MMIO space. Set it before registering the MHI controller. Signed-off-by: Bhaumik Bhatt --- drivers/net/wireless/ath/ath11k/mhi.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v1 5/6] bus: mhi: pci_generic: Set register access length for MHI driver

2021-04-16 Thread Bhaumik Bhatt
MHI driver requires register space length to add range checks and prevent memory region accesses outside of that for MMIO space. Set it from the PCI generic controller driver before registering the MHI controller. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/pci_generic.c | 1 + 1 file

[PATCH v1 6/6] bus: mhi: core: Add range checks for BHI and BHIe

2021-04-16 Thread Bhaumik Bhatt
cks will fail without it. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 1cc2f22..86ad06e 100644 --- a/drivers/bus/mhi/core/init.c ++

[PATCH v1 1/6] bus: mhi: core: Set BHI/BHIe offsets on power up preparation

2021-04-16 Thread Bhaumik Bhatt
correctly. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 42 +++--- drivers/bus/mhi/core/pm.c | 28 2 files changed, 27 insertions(+), 43 deletions(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core

[PATCH v1 3/6] bus: mhi: Add MMIO region length to controller structure

2021-04-16 Thread Bhaumik Bhatt
Make controller driver specify the MMIO register region length for range checking of BHI or BHIe space. This can help validate that offsets are in acceptable memory region or not and avoid any boot-up issues due to BHI or BHIe memory accesses. Signed-off-by: Bhaumik Bhatt --- include/linux

[PATCH v1 0/6] BHI/BHIe improvements for MHI power purposes

2021-04-16 Thread Bhaumik Bhatt
power down phase. Going forward, controllers will be required to specify a reg_len field which will be used to check whether the BHI/BHIe offsets are in range or not. This series has been tested on X86_64 architecture with the PCI generic driver as controller and an SDX55 device. Bhaumik Bhatt

[PATCH] bus: mhi: pci_generic: Add SDX65 based modem support

2021-04-02 Thread Bhaumik Bhatt
Add generic info for SDX65 based modems. Signed-off-by: Bhaumik Bhatt --- This patch was tested on SDX65 hardware with Ubuntu X86_64 PC as host. drivers/bus/mhi/pci_generic.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/bus/mhi/pci_generic.c b/drivers/bus/mhi

[RESEND PATCH] bus: mhi: core: Remove pre_init flag used for power purposes

2021-04-01 Thread Bhaumik Bhatt
early on during preparation phase in some failure cases. Signed-off-by: Bhaumik Bhatt --- This patch was tested on arm64 architecture. drivers/bus/mhi/core/init.c | 3 --- drivers/bus/mhi/core/pm.c | 20 include/linux/mhi.h | 2 -- 3 files changed, 25 deletions

[PATCH v8 4/9] bus: mhi: core: Update debug messages to use client device

2021-04-01 Thread Bhaumik Bhatt
Debug messages dealing with client devices use the generic MHI controller or parent device along with a channel number. It would be better to instead use the client device directly and enable better log messages for channel updates. Suggested-by: Manivannan Sadhasivam Signed-off-by: Bhaumik

[PATCH v8 8/9] bus: mhi: core: Remove __ prefix for MHI channel unprepare function

2021-04-01 Thread Bhaumik Bhatt
The __mhi_unprepare_channel() API does not require the __ prefix. Get rid of it and make the internal function consistent with the other function names. Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam Reviewed-by: Hemant Kumar --- drivers/bus/mhi/core/main.c | 10 +- 1

[PATCH v8 7/9] bus: mhi: core: Check channel execution environment before issuing reset

2021-04-01 Thread Bhaumik Bhatt
for it on the host as the device will no longer be able to respond to such a request. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/main.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/bus/mhi/core

[PATCH v8 6/9] bus: mhi: core: Clear configuration from channel context during reset

2021-04-01 Thread Bhaumik Bhatt
-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/init.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 9c2ed92..871a412 100644 --- a/drivers/bus/mhi/core/init.c

[PATCH v8 3/9] bus: mhi: core: Improvements to the channel handling state machine

2021-04-01 Thread Bhaumik Bhatt
messages and code duplication. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 6 ++ drivers/bus/mhi/core/internal.h | 12 drivers/bus/mhi/core/main.c | 151 ++-- 3 files changed, 100 insertions(+), 69 deletions(-) diff --git a/drivers

[PATCH v8 9/9] bus: mhi: Improve documentation on channel transfer setup APIs

2021-04-01 Thread Bhaumik Bhatt
The mhi_prepare_for_transfer() and mhi_unprepare_from_transfer() APIs could use better explanation. Add details on what MHI does when these APIs are used. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- include/linux/mhi.h | 18

[PATCH v8 1/9] bus: mhi: core: Allow sending the STOP channel command

2021-04-01 Thread Bhaumik Bhatt
to clients. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/main.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c index 58b8111..8c510f1 100644 --- a/drivers/bus/mhi

[PATCH v8 5/9] bus: mhi: core: Hold device wake for channel update commands

2021-04-01 Thread Bhaumik Bhatt
shorter wait periods for device to respond as votes are already held. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/main.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c index 94fdbf7..989a2a8

[PATCH v8 2/9] bus: mhi: core: Clear context for stopped channels from remove()

2021-04-01 Thread Bhaumik Bhatt
. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index d1d9b0d..f8ba954 100644 --- a/drivers/bus

[no subject]

2021-04-01 Thread Bhaumik Bhatt
Is -Removed the __ prefix from mhi_unprepare_channel() API for consistency. Bhaumik Bhatt (9): bus: mhi: core: Allow sending the STOP channel command bus: mhi: core: Clear context for stopped channels from remove() bus: mhi: core: Improvements to the channel handling state machine bus: mhi: core

[PATCH v6 2/2] bus: mhi: core: Move to polling method to wait for MHI ready

2021-03-31 Thread Bhaumik Bhatt
, MHI host can poll every 25 milliseconds to check if device has entered MHI READY until a maximum timeout of twice the timeout_ms is reached. Signed-off-by: Bhaumik Bhatt Reviewed-by: Loic Poulain --- drivers/bus/mhi/core/pm.c | 34 -- 1 file changed, 16 insertions

[PATCH v6 0/2] Polling for MHI ready

2021-03-31 Thread Bhaumik Bhatt
review comments -Introduce new patch for to use controller defined read_reg() for polling -Add usage in RDDM download panic path as well Bhaumik Bhatt (2): bus: mhi: core: Introduce internal register poll helper function bus: mhi: core: Move to polling method to wait for MHI ready drivers/bus

[PATCH v6 1/2] bus: mhi: core: Introduce internal register poll helper function

2021-03-31 Thread Bhaumik Bhatt
Introduce helper function to allow MHI core driver to poll for a value in a register field. This helps reach a common path to read and poll register values along with a retry time interval. Signed-off-by: Bhaumik Bhatt Reviewed-by: Loic Poulain --- drivers/bus/mhi/core/internal.h | 3

Re: [PATCH v5 2/2] bus: mhi: core: Move to polling method to wait for MHI ready

2021-03-31 Thread Bhaumik Bhatt
On 2021-03-31 06:04 AM, Manivannan Sadhasivam wrote: On Mon, Mar 29, 2021 at 12:53:03PM -0700, Bhaumik Bhatt wrote: In certain devices, it is likely that there is no incoming MHI interrupt for a transition to MHI READY state. One such example is the move from Pass Through to an SBL or AMSS

Re: [PATCH v5 1/2] bus: mhi: core: Introduce internal register poll helper function

2021-03-31 Thread Bhaumik Bhatt
Hi Mani, On 2021-03-31 06:03 AM, Manivannan Sadhasivam wrote: On Mon, Mar 29, 2021 at 12:53:02PM -0700, Bhaumik Bhatt wrote: Introduce helper function to allow MHI core driver to poll for a value in a register field. This helps reach a common path to read and poll register values along

Re: [PATCH v1 0/7] MHI Emergency download and flash programmer support

2021-03-31 Thread Bhaumik Bhatt
Hi Mani, On 2021-03-31 04:16 AM, Manivannan Sadhasivam wrote: On Mon, Mar 29, 2021 at 06:28:17PM -0700, Bhaumik Bhatt wrote: Allow handling EDL mode after SYS_ERROR occurs by reading the execution environment post handling and move to power on reset state to accommodate the scenario. Handle

[PATCH v7 3/7] bus: mhi: core: Improvements to the channel handling state machine

2021-03-29 Thread Bhaumik Bhatt
debug messages and code duplication Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar --- drivers/bus/mhi/core/init.c | 6 ++ drivers/bus/mhi/core/internal.h | 12 +++ drivers/bus/mhi/core/main.c | 172 ++-- 3 files changed, 114 insertions(+), 76

[PATCH v7 2/7] bus: mhi: core: Clear context for stopped channels from remove()

2021-03-29 Thread Bhaumik Bhatt
. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 706484f..bd62efcb 100644 --- a/drivers/bus

[PATCH v7 1/7] bus: mhi: core: Allow sending the STOP channel command

2021-03-29 Thread Bhaumik Bhatt
to clients. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/main.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c index d377d07..0dc3749 100644 --- a/drivers/bus/mhi

[PATCH v7 4/7] bus: mhi: core: Clear configuration from channel context during reset

2021-03-29 Thread Bhaumik Bhatt
-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/init.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 64846c4..8b840da 100644 --- a/drivers/bus/mhi/core/init.c

[PATCH v7 0/7] Updates to MHI channel handling

2021-03-29 Thread Bhaumik Bhatt
" v2: -Renamed the newly introduced APIs to mhi_start_transfer() / mhi_stop_transfer() -Added improved documentation to avoid confusion with the new APIs -Removed the __ prefix from mhi_unprepare_channel() API for consistency. Bhaumik Bhatt (7): bus: mhi: core: Allow sending the STOP ch

[PATCH v7 6/7] bus: mhi: core: Remove __ prefix for MHI channel unprepare function

2021-03-29 Thread Bhaumik Bhatt
The __mhi_unprepare_channel() API does not require the __ prefix. Get rid of it and make the internal function consistent with the other function names. Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam Reviewed-by: Hemant Kumar --- drivers/bus/mhi/core/main.c | 10 +- 1

[PATCH v7 7/7] bus: mhi: Improve documentation on channel transfer setup APIs

2021-03-29 Thread Bhaumik Bhatt
The mhi_prepare_for_transfer() and mhi_unprepare_from_transfer() APIs could use better explanation. Add details on what MHI does when these APIs are used. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- include/linux/mhi.h | 18

[PATCH v7 5/7] bus: mhi: core: Check channel execution environment before issuing reset

2021-03-29 Thread Bhaumik Bhatt
for it on the host as the device will no longer be able to respond to such a request. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/main.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/bus/mhi/core

[PATCH v1 7/7] bus: mhi: core: Improve state strings for debug messages

2021-03-29 Thread Bhaumik Bhatt
As of now abbreviations are being used for many state and execution environment strings. Improve and expand those such that debug messages are clear. Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/init.c | 34 +- 1 file

[PATCH v1 2/7] bus: mhi: core: Wait for ready after an EDL firmware download

2021-03-29 Thread Bhaumik Bhatt
Currently, the firmware load handler returns after the EDL image is downloaded. Wait for an MHI READY transition instead as the specification expects so as to proceed with further bootup such as device entering Flash Programmer execution environment. Signed-off-by: Bhaumik Bhatt Reviewed

[PATCH v1 0/7] MHI Emergency download and flash programmer support

2021-03-29 Thread Bhaumik Bhatt
was tested on x86_64 architecture. Bhaumik Bhatt (6): bus: mhi: core: Rely on accurate method to determine EDL mode bus: mhi: core: Wait for ready after an EDL firmware download bus: mhi: core: Handle EDL mode entry appropriately bus: mhi: core: Identify Flash Programmer as a mission mode use

[PATCH v1 1/7] bus: mhi: core: Rely on accurate method to determine EDL mode

2021-03-29 Thread Bhaumik Bhatt
Relying on the current execution environment to determine if EDL image was downloaded should not be done as the execution environment can change at this point in error cases and we may misread it. Instead, MHI can rely on the local 'fw_name' variable as a safer alternative. Signed-off-by: Bhaumik

[PATCH v1 3/7] bus: mhi: core: Handle EDL mode entry appropriately

2021-03-29 Thread Bhaumik Bhatt
functionality. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/pm.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index fbe9447..b65222e 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi

[PATCH v1 4/7] bus: mhi: core: Add support for Flash Programmer execution environment

2021-03-29 Thread Bhaumik Bhatt
ges to allow for this sequence to occur and allow using the Flash Programmer execution environment. Signed-off-by: Carl Yin Co-developed-by: Bhaumik Bhatt Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 2 ++ drivers/bus/mhi/core/internal.h | 1 + drivers/bus/mhi/core/main.c

[PATCH v1 6/7] bus: mhi: core: Wait for MHI READY state in most scenarios

2021-03-29 Thread Bhaumik Bhatt
out of the picture as it can change at any time. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/boot.c | 4 ++-- drivers/bus/mhi/core/pm.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/bus/mhi/core/boot.c b/drivers/bus/mhi/core/boot.c index 0f0ae88..8100cf5 100

[PATCH v1 5/7] bus: mhi: core: Identify Flash Programmer as a mission mode use case

2021-03-29 Thread Bhaumik Bhatt
environment with a purpose to flash the device image contents. Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/internal.h b/drivers/bus/mhi/core/internal.h

[PATCH v5 0/2] Polling for MHI ready

2021-03-29 Thread Bhaumik Bhatt
to facilitate faster bootup times as there is no need to wait until timeout_ms completes, MHI host can poll every 25 milliseconds to check if device has entered MHI READY until a maximum timeout of twice the timeout_ms is reached. This patch series has been tested on an arm64 device. Bhaumik Bhatt (2): bus

[PATCH v5 2/2] bus: mhi: core: Move to polling method to wait for MHI ready

2021-03-29 Thread Bhaumik Bhatt
, MHI host can poll every 25 milliseconds to check if device has entered MHI READY until a maximum timeout of twice the timeout_ms is reached. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/pm.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff

[PATCH v5 1/2] bus: mhi: core: Introduce internal register poll helper function

2021-03-29 Thread Bhaumik Bhatt
Introduce helper function to allow MHI core driver to poll for a value in a register field. This helps reach a common path to read and poll register values along with a retry time interval. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/internal.h | 3 +++ drivers/bus/mhi/core/main.c

Re: [PATCH v4 1/3] bus: mhi: core: Introduce internal register poll helper function

2021-03-18 Thread Bhaumik Bhatt
On 2021-03-18 09:43 AM, Loic Poulain wrote: On Thu, 18 Mar 2021 at 17:13, Jeffrey Hugo wrote: On 3/17/2021 3:26 PM, Bhaumik Bhatt wrote: > On 2021-03-11 11:59 AM, Jeffrey Hugo wrote: >> On 3/11/2021 1:00 AM, Loic Poulain wrote: >>> Hi Bhaumik, >>> >>> O

Re: [PATCH v4 1/3] bus: mhi: core: Introduce internal register poll helper function

2021-03-17 Thread Bhaumik Bhatt
On 2021-03-11 11:59 AM, Jeffrey Hugo wrote: On 3/11/2021 1:00 AM, Loic Poulain wrote: Hi Bhaumik, On Thu, 11 Mar 2021 at 00:31, Bhaumik Bhatt wrote: Introduce helper function to allow MHI core driver to poll for a value in a register field. This helps reach a common path to read and poll

[PATCH v4 1/3] bus: mhi: core: Introduce internal register poll helper function

2021-03-10 Thread Bhaumik Bhatt
Introduce helper function to allow MHI core driver to poll for a value in a register field. This helps reach a common path to read and poll register values along with a retry time interval. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/internal.h | 3 +++ drivers/bus/mhi/core/main.c

[PATCH v4 0/3] Polling for MHI ready

2021-03-10 Thread Bhaumik Bhatt
until a maximum timeout of twice the timeout_ms is reached. This patch series has been tested on an arm64 device. Bhaumik Bhatt (3): bus: mhi: core: Introduce internal register poll helper function bus: mhi: core: Move to polling method to wait for MHI ready bus: mhi: core: Use poll register

[PATCH v4 3/3] bus: mhi: core: Use poll register read API for RDDM download

2021-03-10 Thread Bhaumik Bhatt
Make use of mhi_poll_reg_field() API in order to poll for RDDM download in panic path to employ a common approach throughout the driver. Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo --- drivers/bus/mhi/core/boot.c | 20 ++-- 1 file changed, 6 insertions(+), 14

[PATCH v4 2/3] bus: mhi: core: Move to polling method to wait for MHI ready

2021-03-10 Thread Bhaumik Bhatt
, MHI host can poll every 25 milliseconds to check if device has entered MHI READY until a maximum timeout of twice the timeout_ms is reached. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/pm.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff

Re: [PATCH v3 2/3] bus: mhi: core: Move to polling method to wait for MHI ready

2021-03-10 Thread Bhaumik Bhatt
On 2021-03-10 11:02 AM, Jeffrey Hugo wrote: On 2/23/2021 8:44 PM, Bhaumik Bhatt wrote: In certain devices, it is likely that there is no incoming MHI interrupt for a transition to MHI READY state. One such example is the move from Pass Through to an SBL or AMSS execution environment. In order

Re: [PATCH v3 1/3] bus: mhi: core: Introduce internal register poll helper function

2021-03-10 Thread Bhaumik Bhatt
On 2021-03-10 10:57 AM, Jeffrey Hugo wrote: On 2/23/2021 8:44 PM, Bhaumik Bhatt wrote: Introduce helper function to allow MHI core driver to poll for a value in a register field. This helps reach a common path to read and poll register values along with a retry time interval. Signed-off

[PATCH] bus: mhi: Make firmware image optional for controller

2021-03-09 Thread Bhaumik Bhatt
. Suggested-by: Loic Poulain Signed-off-by: Bhaumik Bhatt --- include/linux/mhi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mhi.h b/include/linux/mhi.h index 56c4c52..838a3c4 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -296,7 +296,7

[PATCH v3] bus: mhi: core: Add missing checks for MMIO register entries

2021-03-09 Thread Bhaumik Bhatt
-off-by: Bhaumik Bhatt --- v3: removed fw_image as not all controllers require it v2: removed iova_start and iova_stop as they can be zero drivers/bus/mhi/core/init.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core

Re: [PATCH v2] bus: mhi: core: Add missing checks for MMIO register entries

2021-03-05 Thread Bhaumik Bhatt
On 2021-03-05 09:11 AM, Loic Poulain wrote: On Thu, 4 Mar 2021 at 23:14, Bhaumik Bhatt wrote: As per documentation, fields marked as (required) in an MHI controller structure need to be populated by the controller driver before calling mhi_register_controller(). Ensure all required pointers

[PATCH v2] bus: mhi: core: Add missing checks for MMIO register entries

2021-03-04 Thread Bhaumik Bhatt
-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 272f350..fed8a25 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -879,10 +879,9

[PATCH] bus: mhi: core: Remove pre_init flag used for power purposes

2021-03-02 Thread Bhaumik Bhatt
early on during preparation phase in some failure cases. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/init.c | 3 --- drivers/bus/mhi/core/pm.c | 20 include/linux/mhi.h | 2 -- 3 files changed, 25 deletions(-) diff --git a/drivers/bus/mhi/core/init.c b

[PATCH] bus: mhi: core: Add missing checks for MMIO register entries

2021-03-02 Thread Bhaumik Bhatt
As per documentation, fields marked as (required) in an MHI controller structure need to be populated by the controller driver before calling mhi_register_controller(). Ensure all required fields are present in the controller before proceeding with the registration. Signed-off-by: Bhaumik Bhatt

[PATCH] bus: mhi: core: Add missing checks for MMIO register entries

2021-03-02 Thread Bhaumik Bhatt
As per documentation, fields marked as (required) in an MHI controller structure need to be populated by the controller driver before calling mhi_register_controller(). Ensure all required fields are present in the controller before proceeding with the registration. Signed-off-by: Bhaumik Bhatt

Re: [PATCH v2] bus: mhi: core: Add unique qrtr node id support

2021-03-01 Thread Bhaumik Bhatt
Hi Kalle, On 2021-03-01 10:26 AM, Kalle Valo wrote: Bhaumik Bhatt writes: On 2021-03-01 03:14 AM, Kalle Valo wrote: + ath11k list Manivannan Sadhasivam writes: On Fri, Feb 26, 2021 at 04:12:49PM +0530, Gokul Sriram Palanisamy wrote: On platforms with two or more identical mhi devices

Re: [PATCH v2] bus: mhi: core: Add unique qrtr node id support

2021-03-01 Thread Bhaumik Bhatt
On 2021-03-01 10:26 AM, Kalle Valo wrote: Bhaumik Bhatt writes: On 2021-03-01 03:14 AM, Kalle Valo wrote: + ath11k list Manivannan Sadhasivam writes: On Fri, Feb 26, 2021 at 04:12:49PM +0530, Gokul Sriram Palanisamy wrote: On platforms with two or more identical mhi devices, qmi service

Re: [PATCH v2] bus: mhi: core: Add unique qrtr node id support

2021-03-01 Thread Bhaumik Bhatt
On 2021-03-01 03:14 AM, Kalle Valo wrote: + ath11k list Manivannan Sadhasivam writes: On Fri, Feb 26, 2021 at 04:12:49PM +0530, Gokul Sriram Palanisamy wrote: On platforms with two or more identical mhi devices, qmi service will run with identical qrtr-node-id. Because of this identical ID,

Re: [PATCH v2] bus: mhi: core: Add unique qrtr node id support

2021-02-26 Thread Bhaumik Bhatt
On 2021-02-26 06:52 AM, Manivannan Sadhasivam wrote: On Fri, Feb 26, 2021 at 04:12:49PM +0530, Gokul Sriram Palanisamy wrote: On platforms with two or more identical mhi devices, qmi service will run with identical qrtr-node-id. Because of this identical ID, host qrtr-lookup cannot register

Re: [PATCH v6 3/8] bus: mhi: core: Improvements to the channel handling state machine

2021-02-24 Thread Bhaumik Bhatt
Hi Mani, On 2021-02-24 02:03 AM, Manivannan Sadhasivam wrote: On Thu, Feb 04, 2021 at 12:28:01PM -0800, Bhaumik Bhatt wrote: Improve the channel handling state machine such that all commands go through a common function and validation process to ensure that the state machine is not violated

[PATCH v6 4/4] bus: mhi: core: Update debug prints to include local device state

2021-02-24 Thread Bhaumik Bhatt
Update debug prints to include local device in the BHI interrupt handler. This helps show transitions better between MHI states. Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/main.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff

[PATCH v6 3/4] bus: mhi: core: Process execution environment changes serially

2021-02-24 Thread Bhaumik Bhatt
Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/main.c | 40 +--- drivers/bus/mhi/core/pm.c | 7 --- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c index 7a2e98c..9715f51 100644 ---

[PATCH v6 2/4] bus: mhi: core: Download AMSS image from appropriate function

2021-02-24 Thread Bhaumik Bhatt
thread when a DEV_ST_TRANSITION_SBL is queued instead of the blocking wait. Signed-off-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/boot.c | 51 +++-- drivers/bus/mhi/core/internal.h | 1 + drivers/bus/mhi/core/pm.c

[PATCH v6 1/4] bus: mhi: core: Destroy SBL devices when moving to mission mode

2021-02-24 Thread Bhaumik Bhatt
mission mode. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/main.c | 29 + drivers/bus/mhi/core/pm.c | 3 +++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c index 4e0131b..7a2e98c

[PATCH v6 0/4] Serialize execution environment changes for MHI

2021-02-24 Thread Bhaumik Bhatt
ing remove callbacks for them so they are not left opened in a different execution environment. This patchset was tested on ARM64. Bhaumik Bhatt (4): bus: mhi: core: Destroy SBL devices when moving to mission mode bus: mhi: core: Download AMSS image from appropriate function bus: mhi: cor

Re: [PATCH v6 8/8] bus: mhi: core: Do not clear channel context more than once

2021-02-24 Thread Bhaumik Bhatt
On 2021-02-24 02:10 AM, Manivannan Sadhasivam wrote: On Thu, Feb 04, 2021 at 12:28:06PM -0800, Bhaumik Bhatt wrote: Clearing a channel context can happen twice if the client driver unprepares and reset the channels from the remove() callback from a controller requested MHI power down sequence

[PATCH v3 1/3] bus: mhi: core: Introduce internal register poll helper function

2021-02-23 Thread Bhaumik Bhatt
Introduce helper function to allow MHI core driver to poll for a value in a register field. This helps reach a common path to read and poll register values along with a retry time interval. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/internal.h | 3 +++ drivers/bus/mhi/core/main.c

[PATCH v3 0/3] Polling for MHI ready

2021-02-23 Thread Bhaumik Bhatt
host can poll every 25 milliseconds to check if device has entered MHI READY until a maximum timeout of twice the timeout_ms is reached. This patch series has been tested on an arm64 device. Bhaumik Bhatt (3): bus: mhi: core: Introduce internal register poll helper function bus: mhi: core: Move

[PATCH v3 3/3] bus: mhi: core: Use poll register read API for RDDM download

2021-02-23 Thread Bhaumik Bhatt
Make use of mhi_poll_reg_field() API in order to poll for RDDM download in panic path to employ a common approach throughout the driver. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/boot.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers

[PATCH v3 2/3] bus: mhi: core: Move to polling method to wait for MHI ready

2021-02-23 Thread Bhaumik Bhatt
, MHI host can poll every 25 milliseconds to check if device has entered MHI READY until a maximum timeout of twice the timeout_ms is reached. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/pm.c | 31 ++- 1 file changed, 14 insertions(+), 17 deletions(-) diff

[PATCH v2 2/3] bus: mhi: core: Move to polling method to wait for MHI ready

2021-02-23 Thread Bhaumik Bhatt
, MHI host can poll every 25 milliseconds to check if device has entered MHI READY until a maximum timeout of twice the timeout_ms is reached. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/pm.c | 31 ++- 1 file changed, 14 insertions(+), 17 deletions(-) diff

[PATCH v2 1/3] bus: mhi: core: Introduce internal register poll helper function

2021-02-23 Thread Bhaumik Bhatt
Introduce helper function to allow MHI core driver to poll for a value in a register field. This helps reach a common path to read and poll register values along with a retry time interval. Signed-off-by: Bhaumik Bhatt --- arch/arm64/configs/defconfig| 76

[PATCH v2 3/3] bus: mhi: core: Use poll register read API for RDDM download

2021-02-23 Thread Bhaumik Bhatt
Make use of mhi_poll_reg_field() API in order to poll for RDDM download in panic path to employ a common approach throughout the driver. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/boot.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers

[PATCH v2 0/3] Polling for MHI ready

2021-02-23 Thread Bhaumik Bhatt
entered MHI READY until a maximum timeout of twice the timeout_ms is reached. This patch series has been tested on an arm64 device. Bhaumik Bhatt (3): bus: mhi: core: Introduce internal register poll helper function bus: mhi: core: Move to polling method to wait for MHI ready bus: mhi: core: Use

[PATCH v5 3/3] bus: mhi: core: Process execution environment changes serially

2021-02-19 Thread Bhaumik Bhatt
of the PBL execution environments. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/main.c | 38 +++--- drivers/bus/mhi/core/pm.c | 5 +++-- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/c

[PATCH v5 1/3] bus: mhi: core: Clear devices when moving execution environments

2021-02-19 Thread Bhaumik Bhatt
an execution environment specific clean up if one is requested. Close this gap to issue remove callbacks in such scenarios that allow SBL-specific client drivers to clean-up once device enters mission mode. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/main.c | 27

[PATCH v5 2/3] bus: mhi: core: Download AMSS image from appropriate function

2021-02-19 Thread Bhaumik Bhatt
thread when a DEV_ST_TRANSITION_SBL is queued instead of the blocking wait. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/boot.c | 48 - drivers/bus/mhi/core/internal.h | 1 + drivers/bus/mhi/core/pm.c | 2 ++ 3 files changed, 27 insertions

[PATCH v5 0/3] Serialize execution environment changes for MHI

2021-02-19 Thread Bhaumik Bhatt
oving from SBL to AMSS EE, clear SBL specific client devices by calling remove callbacks for them so they are not left opened in a different execution environment. This patchset was tested on ARM64. Bhaumik Bhatt (3): bus: mhi: core: Clear devices when moving execution environments bus: mhi: core

Re: [PATCH v4 1/3] bus: mhi: core: Clear devices when moving execution environments

2021-02-19 Thread Bhaumik Bhatt
On 2021-02-19 08:10 AM, Jeffrey Hugo wrote: On 2/18/2021 7:17 PM, Bhaumik Bhatt wrote: When moving from SBL to mission mode execution environment, there is no remove callback notification to MHI client drivers which operate on SBL mode only. Client driver devices are being created in SBL

Re: [PATCH] bus: mhi: core: Move to polling method to wait for MHI ready

2021-02-19 Thread Bhaumik Bhatt
On 2021-02-19 06:55 AM, Jeffrey Hugo wrote: On 2/18/2021 7:18 PM, Bhaumik Bhatt wrote: In certain devices, it is likely that there is no incoming MHI interrupt for a transition to MHI READY state. One such example is the move from Pass Through to an SBL or AMSS execution environment. In order

[PATCH v4 2/3] bus: mhi: core: Download AMSS image from appropriate function

2021-02-18 Thread Bhaumik Bhatt
thread when a DEV_ST_TRANSITION_SBL is queued instead of the blocking wait. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/boot.c | 48 - drivers/bus/mhi/core/internal.h | 1 + drivers/bus/mhi/core/pm.c | 2 ++ 3 files changed, 27 insertions

[PATCH] bus: mhi: core: Move to polling method to wait for MHI ready

2021-02-18 Thread Bhaumik Bhatt
, MHI host can poll every 25 milliseconds to check if device has entered MHI READY until a maximum timeout of twice the timeout_ms is reached. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/pm.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff

[PATCH v4 0/3] Serialize execution environment changes for MHI

2021-02-18 Thread Bhaumik Bhatt
and the status callback is given to the controller drivers promptly. When moving from SBL to AMSS EE, clear SBL specific client devices by calling remove callbacks for them so they are not left opened in a different execution environment. Bhaumik Bhatt (3): bus: mhi: core: Clear devices when moving execution

[PATCH v4 1/3] bus: mhi: core: Clear devices when moving execution environments

2021-02-18 Thread Bhaumik Bhatt
-specific channels, those are left open and client drivers are thus unaware of the new execution environment where those channels cannot operate. Close the gap and issue remove callbacks to SBL-specific client drivers once device enters mission mode. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi

[PATCH v4 3/3] bus: mhi: core: Process execution environment changes serially

2021-02-18 Thread Bhaumik Bhatt
of the PBL execution environments. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/main.c | 40 +--- drivers/bus/mhi/core/pm.c | 5 +++-- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/c

Re: [PATCH] mhi_bus: core: Check state before processing power_down

2021-02-16 Thread Bhaumik Bhatt
On 2021-02-16 01:38 PM, Jeffrey Hugo wrote: We cannot process a power_down if the power state is DISABLED. There is no valid mhi_ctxt in that case, so attepting to process the power_down will likely result in a null pointer dereference. If the power state is DISABLED, there is nothing to do

Re: [PATCH] mhi_bus: core: Return EBUSY if MHI ring is full

2021-02-16 Thread Bhaumik Bhatt
On 2021-02-16 10:48 AM, Jeffrey Hugo wrote: From: Fan Wu Currently ENOMEM is returned when MHI ring is full. This error code is very misleading. Change to EBUSY instead. Signed-off-by: Fan Wu Signed-off-by: Jeffrey Hugo --- drivers/bus/mhi/core/main.c | 2 +- 1 file changed, 1

Re: [PATCH] bus: mhi: core: Use current ee in intvec handler for syserr

2021-02-16 Thread Bhaumik Bhatt
On 2021-02-15 11:32 PM, Manivannan Sadhasivam wrote: On Fri, Feb 12, 2021 at 05:40:14PM -0700, Jeffrey Hugo wrote: The intvec handler stores the caches ee in a local variable for use in processing the intvec. When determining if a syserr is a fatal error or not, the intvec handler is using

Re: [PATCH 1/1] mhi: Fix double dma free

2021-02-10 Thread Bhaumik Bhatt
On 2021-02-10 12:25 AM, Manivannan Sadhasivam wrote: From: Loic Poulain mhi_deinit_chan_ctxt functionthat takes care of unitializing channel s/functionthat/function that, uninitializing resources, including unmapping coherent MHI areas, can be called from different path in case of controller

[PATCH v3 2/3] bus: mhi: core: Download AMSS image from appropriate function

2021-02-08 Thread Bhaumik Bhatt
thread when a DEV_ST_TRANSITION_SBL is queued instead of the blocking wait. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/boot.c | 44 - drivers/bus/mhi/core/internal.h | 1 + drivers/bus/mhi/core/pm.c | 2 ++ 3 files changed, 24 insertions

[PATCH v3 1/3] bus: mhi: core: Clear devices when moving execution environments

2021-02-08 Thread Bhaumik Bhatt
-specific channels, those are left open and client drivers are thus unaware of the new execution environment where those channels cannot operate. Close the gap and issue remove callbacks to SBL-specific client drivers once device enters mission mode. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi

[PATCH v3 0/3] Serialize execution environment changes for MHI

2021-02-08 Thread Bhaumik Bhatt
callbacks for them so they are not left opened in a different execution environment. Bhaumik Bhatt (3): bus: mhi: core: Clear devices when moving execution environments bus: mhi: core: Download AMSS image from appropriate function bus: mhi: core: Process execution environment changes serially

[PATCH v3 3/3] bus: mhi: core: Process execution environment changes serially

2021-02-08 Thread Bhaumik Bhatt
or RDDM EE changes as critical events directly from the interrupt handler. This also makes sure that we use the correct execution environment to notify the controller driver when the device resets to one of the PBL execution environments. Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/m

Re: [PATCH v2 1/3] bus: mhi: core: Clear devices when moving execution environments

2021-02-04 Thread Bhaumik Bhatt
Hi Mani, On 2021-01-20 11:50 PM, Manivannan Sadhasivam wrote: On Thu, Jan 14, 2021 at 11:16:33AM -0800, Bhaumik Bhatt wrote: When moving from SBL to mission mode execution environment, there is no remove callback notification to MHI client drivers which operate on SBL mode only. Client driver

[PATCH v6 2/8] bus: mhi: core: Clear context for stopped channels from remove()

2021-02-04 Thread Bhaumik Bhatt
. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index aa575d3..03c5786 100644 --- a/drivers/bus

[PATCH v6 7/8] bus: mhi: Improve documentation on channel transfer setup APIs

2021-02-04 Thread Bhaumik Bhatt
The mhi_prepare_for_transfer() and mhi_unprepare_from_transfer() APIs could use better explanation. Add details on what MHI does when these APIs are used. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar --- include/linux/mhi.h | 18 -- 1 file changed, 16 insertions(+), 2

  1   2   3   4   >