Re: [PATCH v3] bus: mhi: core: Sanity check values from remote device before use

2021-04-07 Thread Hemant Kumar
blindly use such values, we may access invalid data or crash if the values are corrupted. If validation fails, drop the relevant event. Signed-off-by: Jeffrey Hugo Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation

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

2021-04-02 Thread Hemant Kumar
to use MHI. This also helps controllers fail early on during preparation phase in some failure cases. Signed-off-by: Bhaumik Bhatt --- This patch was tested on arm64 architecture. Change looks good as current MHI controllers ath11k and pci generic are not using pre_init. Reviewed-by: Hemant Kumar

Re: [PATCH v2 RESEND] bus: mhi: core: Wait for ready state after reset

2021-03-10 Thread Hemant Kumar
occurred so let's silence it by making sure the device hits the ready state before the host completes its reset processing. Signed-off-by: Jeffrey Hugo Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

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

2021-02-26 Thread Hemant Kumar
client drivers to clean up once device enters mission mode. Signed-off-by: Bhaumik Bhatt It make sense to clean up previous execution env related resources. Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative

Re: [PATCH v3] bus: mhi: core: Return EAGAIN if MHI ring is full

2021-02-17 Thread Hemant Kumar
On 2/17/21 8:26 AM, Jeffrey Hugo wrote: From: Fan Wu Currently ENOMEM is returned when MHI ring is full. This error code is very misleading. Change to EAGAIN instead. Signed-off-by: Fan Wu Signed-off-by: Jeffrey Hugo --- Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc

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

2021-02-05 Thread Hemant Kumar
Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

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

2021-01-15 Thread Hemant Kumar
On 1/14/21 11:16 AM, Bhaumik Bhatt wrote: In current design, whenever the BHI interrupt is fired, the execution environment is updated. This can cause race conditions and impede any ongoing power up/down processing. For example, if a power down is in progress and the host has updated the

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

2021-01-15 Thread Hemant Kumar
Hi Bhaumik, On 1/14/21 11:16 AM, Bhaumik Bhatt wrote: During full boot chain firmware download, the PM state worker downloads the AMSS image after waiting for the SBL execution environment change in PBL mode itself. Since getting rid of the firmware load worker thread, this design needs to

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

2021-01-15 Thread Hemant Kumar
. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

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

2021-01-08 Thread Hemant Kumar
!mhi_chan->offload_ch) mhi_deinit_chan_ctxt(mhi_cntrl, mhi_chan); Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

[RESEND PATCH v18 3/3] bus: mhi: Add userspace client interface driver

2021-01-06 Thread Hemant Kumar
/Software/libqmi/ for additional information on libqmi. Signed-off-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Reviewed-by: Jeffrey Hugo Tested-by: Loic Poulain --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/uci.c| 664

[RESEND PATCH v18 2/3] docs: Add documentation for userspace client interface

2021-01-06 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently QMI MHI channel is supported by this driver. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo --- Documentation/mhi/index.rst

[RESEND PATCH v18 1/3] bus: mhi: core: Move MHI_MAX_MTU to external header file

2021-01-06 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[RESEND PATCH v18 0/3] userspace MHI client interface driver

2021-01-06 Thread Hemant Kumar
e. - Addressed style related review comments. V3: Added documentation for MHI UCI driver. V2: - Added mutex lock to prevent multiple readers to access same - mhi buffer which can result into use after free. Hemant Kumar (3): bus: mhi: core: Move MHI_MAX_MTU to external header file doc

[PATCH v18 0/3] userspace MHI client interface driver

2020-12-11 Thread Hemant Kumar
e. - Addressed style related review comments. V3: Added documentation for MHI UCI driver. V2: - Added mutex lock to prevent multiple readers to access same - mhi buffer which can result into use after free. Hemant Kumar (3): bus: mhi: core: Move MHI_MAX_MTU to external header file doc

[PATCH v18 1/3] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-12-11 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[PATCH v18 2/3] docs: Add documentation for userspace client interface

2020-12-11 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently QMI MHI channel is supported by this driver. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo --- Documentation/mhi/index.rst

[PATCH v18 3/3] bus: mhi: Add userspace client interface driver

2020-12-11 Thread Hemant Kumar
/Software/libqmi/ for additional information on libqmi. Signed-off-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Reviewed-by: Jeffrey Hugo Tested-by: Loic Poulain --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/uci.c| 664

[PATCH v17 0/3] userspace MHI client interface driver

2020-12-10 Thread Hemant Kumar
into use after free. Hemant Kumar (3): bus: mhi: core: Move MHI_MAX_MTU to external header file docs: Add documentation for userspace client interface bus: mhi: Add userspace client interface driver Documentation/mhi/index.rst | 1 + Documentation/mhi/uci.rst | 95 ++ dri

[PATCH v17 1/3] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-12-10 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[PATCH v17 2/3] docs: Add documentation for userspace client interface

2020-12-10 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently QMI MHI channel is supported by this driver. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo --- Documentation/mhi/index.rst

[PATCH v17 3/3] bus: mhi: Add userspace client interface driver

2020-12-10 Thread Hemant Kumar
/libqmi/ Signed-off-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Reviewed-by: Jeffrey Hugo Tested-by: Loic Poulain --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/uci.c| 664 +++ 3 files changed, 680

[PATCH v16 0/4] userspace MHI client interface driver

2020-12-09 Thread Hemant Kumar
ffer which can result into use after free. Hemant Kumar (4): bus: mhi: core: Add helper API to return number of free TREs bus: mhi: core: Move MHI_MAX_MTU to external header file docs: Add documentation for userspace client interface bus: mhi: Add userspace client interface driver Documen

[PATCH v16 3/4] docs: Add documentation for userspace client interface

2020-12-09 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently QMI MHI channel is supported by this driver. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo --- Documentation/mhi/index.rst

[PATCH v16 4/4] bus: mhi: Add userspace client interface driver

2020-12-09 Thread Hemant Kumar
it supports QMI channel. Signed-off-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Reviewed-by: Jeffrey Hugo Tested-by: Loic Poulain --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/uci.c| 664 +++ 3

[PATCH v16 1/4] bus: mhi: core: Add helper API to return number of free TREs

2020-12-09 Thread Hemant Kumar
Introduce mhi_get_free_desc_count() API to return number of TREs available to queue buffer. MHI clients can use this API to know before hand if ring is full without calling queue API. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi

[PATCH v16 2/4] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-12-09 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

Re: [PATCH] mhi: use irq_flags if client driver configures it

2020-12-09 Thread Hemant Kumar
On 12/7/20 7:55 PM, Carl Huang wrote: If client driver has specified the irq_flags, mhi uses this specified irq_flags. Otherwise, mhi uses default irq_flags. The purpose of this change is to support one MSI vector for QCA6390. MHI will use one same MSI vector too in this scenario. In case

Re: [PATCH v4 5/8] bus: mhi: core: Add support to stop or start channel data transfers

2020-12-03 Thread Hemant Kumar
is issued. This would need to be paired with an API that allows resuming the data transfer activity on channels by use of the START channel command. Enable this using two new APIs, mhi_start_transfer() and mhi_stop_transfer(). Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar -- The Qualcomm

Re: [PATCH v4 4/8] bus: mhi: core: Clear configuration from channel context during reset

2020-12-03 Thread Hemant Kumar
functions which expect a context. Signed-off-by: Bhaumik Bhatt --- Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

Re: [PATCH v4 1/8] bus: mhi: core: Allow sending the STOP channel command

2020-12-03 Thread Hemant Kumar
the ability to send this command is exposed to clients. Signed-off-by: Bhaumik Bhatt --- Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

[RESEND v15 4/4] bus: mhi: Add userspace client interface driver

2020-12-03 Thread Hemant Kumar
it supports QMI channel. Signed-off-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Reviewed-by: Jeffrey Hugo Tested-by: Loic Poulain --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/uci.c| 664 +++ 3

[RESEND v15 2/4] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-12-03 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[RESEND v15 3/4] docs: Add documentation for userspace client interface

2020-12-03 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently QMI MHI channel is supported by this driver. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo --- Documentation/mhi/index.rst

[RESEND v15 1/4] bus: mhi: core: Add helper API to return number of free TREs

2020-12-03 Thread Hemant Kumar
Introduce mhi_get_free_desc_count() API to return number of TREs available to queue buffer. MHI clients can use this API to know before hand if ring is full without calling queue API. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi

[RESEND v15 0/4] userspace MHI client interface driver

2020-12-03 Thread Hemant Kumar
ed uci ref counting in mhi_uci_open for error case. - Addressed style related review comments. V3: Added documentation for MHI UCI driver. V2: - Added mutex lock to prevent multiple readers to access same - mhi buffer which can result into use after free. Hemant Kumar (4): bus: mhi: core: Add

Re: [PATCH v15 4/4] bus: mhi: Add userspace client interface driver

2020-12-03 Thread Hemant Kumar
On 12/3/20 3:45 PM, Jeffrey Hugo wrote: On 12/3/2020 3:45 PM, Hemant Kumar wrote: This MHI client driver allows userspace clients to transfer raw data between MHI device and host using standard file operations. Driver instantiates UCI device object which is associated to device file node. UCI

[PATCH v15 3/4] docs: Add documentation for userspace client interface

2020-12-03 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently QMI MHI channel is supported by this driver. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo --- Documentation/mhi/index.rst

[PATCH v15 1/4] bus: mhi: core: Add helper API to return number of free TREs

2020-12-03 Thread Hemant Kumar
Introduce mhi_get_free_desc_count() API to return number of TREs available to queue buffer. MHI clients can use this API to know before hand if ring is full without calling queue API. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi

[PATCH v15 2/4] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-12-03 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[PATCH v15 4/4] bus: mhi: Add userspace client interface driver

2020-12-03 Thread Hemant Kumar
it supports QMI channel. Signed-off-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Reviewed-by: Jeffrey Hugo --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/uci.c| 664 +++ 3 files changed, 680

[PATCH v15 0/4] userspace MHI client interface driver

2020-12-03 Thread Hemant Kumar
ed uci ref counting in mhi_uci_open for error case. - Addressed style related review comments. V3: Added documentation for MHI UCI driver. V2: - Added mutex lock to prevent multiple readers to access same - mhi buffer which can result into use after free. Hemant Kumar (4): bus: mhi: core: Add

Re: [PATCH v14 3/4] docs: Add documentation for userspace client interface

2020-12-03 Thread Hemant Kumar
Hi Jeff On 12/3/20 12:38 PM, jh...@codeaurora.org wrote: On 2020-12-01 19:59, Hemant Kumar wrote: MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently QMI MHI channel is supported

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

2020-12-02 Thread Hemant Kumar
-by: Bhaumik Bhatt --- Reviewed-by: Hemant Kumar The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

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

2020-12-02 Thread Hemant Kumar
for the channel context and memory allocated for it on the host. Signed-off-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

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

2020-12-02 Thread Hemant Kumar
specification. Signed-off-by: Bhaumik Bhatt --- Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

Re: [PATCH v3 4/7] bus: mhi: core: Add support to stop or start channel data transfers

2020-12-02 Thread Hemant Kumar
Hi Bhaumik, On 12/2/20 3:40 PM, Bhaumik Bhatt wrote: Some MHI client drivers may want to request a pause or halt of data transfer activity on their channels. Support for this does not exist and must be introduced, wherein the channel context is not reset or cleared but only the STOP channel

Re: [PATCH v3 2/7] bus: mhi: core: Allow channel to be disabled from stopped state

2020-12-02 Thread Hemant Kumar
driver module is unloaded or a device crash occurs. Signed-off-by: Bhaumik Bhatt --- Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

Re: [PATCH v3 1/7] bus: mhi: core: Allow receiving a STOP channel command response

2020-12-02 Thread Hemant Kumar
Hi Bhaumik, On 12/2/20 3:40 PM, Bhaumik Bhatt wrote: Add support to receive the response to a STOP channel command to the How about saying "Add support to send the STOP channel command ? MHI bus. If a client would like to STOP a channel instead of issuing a RESET to it, this would provide

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

2020-12-02 Thread Hemant Kumar
On 12/2/20 3:40 PM, Bhaumik Bhatt wrote: 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

[PATCH v14 4/4] bus: mhi: Add userspace client interface driver

2020-12-01 Thread Hemant Kumar
it supports QMI channel. Signed-off-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Tested-by: Loic Poulain --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/uci.c| 664 +++ 3 files changed, 680 insertions

[PATCH v14 3/4] docs: Add documentation for userspace client interface

2020-12-01 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently QMI MHI channel is supported by this driver. Signed-off-by: Hemant Kumar --- Documentation/mhi/index.rst | 1 + Documentation/mhi

[PATCH v14 0/4] userspace MHI client interface driver

2020-12-01 Thread Hemant Kumar
ted review comments. V3: Added documentation for MHI UCI driver. V2: - Added mutex lock to prevent multiple readers to access same - mhi buffer which can result into use after free. Hemant Kumar (4): bus: mhi: core: Add helper API to return number of free TREs bus: mhi: core: Move MHI_MAX_MTU t

[PATCH v14 1/4] bus: mhi: core: Add helper API to return number of free TREs

2020-12-01 Thread Hemant Kumar
Introduce mhi_get_free_desc_count() API to return number of TREs available to queue buffer. MHI clients can use this API to know before hand if ring is full without calling queue API. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi

[PATCH v14 2/4] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-12-01 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

Re: [PATCH v13 4/4] bus: mhi: Add userspace client interface driver

2020-12-01 Thread Hemant Kumar
Dec 2020 at 02:16, Hemant Kumar wrote: Hi Loic, On 11/30/20 10:22 AM, Loic Poulain wrote: On Sat, 28 Nov 2020 at 04:26, Hemant Kumar wrote: This MHI client driver allows userspace clients to transfer raw data between MHI device and host using standard file operations. Driver instantiates

Re: [PATCH v13 4/4] bus: mhi: Add userspace client interface driver

2020-11-30 Thread Hemant Kumar
Hi Loic, On 11/30/20 10:22 AM, Loic Poulain wrote: On Sat, 28 Nov 2020 at 04:26, Hemant Kumar wrote: This MHI client driver allows userspace clients to transfer raw data between MHI device and host using standard file operations. Driver instantiates UCI device object which is associated

Re: [PATCH v13 4/4] bus: mhi: Add userspace client interface driver

2020-11-30 Thread Hemant Kumar
Hi Mani, On 11/27/20 10:11 PM, Manivannan Sadhasivam wrote: Hi Hemant, On Fri, Nov 27, 2020 at 07:26:06PM -0800, Hemant Kumar wrote: This MHI client driver allows userspace clients to transfer raw data between MHI device and host using standard file operations. Driver instantiates UCI device

[PATCH v13 2/4] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-11-28 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[PATCH v13 1/4] bus: mhi: core: Add helper API to return number of free TREs

2020-11-28 Thread Hemant Kumar
Introduce mhi_get_free_desc_count() API to return number of TREs available to queue buffer. MHI clients can use this API to know before hand if ring is full without calling queue API. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi

[PATCH v13 0/4] userspace MHI client interface driver

2020-11-27 Thread Hemant Kumar
comments. V3: Added documentation for MHI UCI driver. V2: - Added mutex lock to prevent multiple readers to access same - mhi buffer which can result into use after free. Hemant Kumar (4): bus: mhi: core: Add helper API to return number of free TREs bus: mhi: core: Move MHI_MAX_MTU

[PATCH v13 4/4] bus: mhi: Add userspace client interface driver

2020-11-27 Thread Hemant Kumar
Currently it supports QMI channel. Signed-off-by: Hemant Kumar --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/uci.c| 665 +++ 3 files changed, 681 insertions(+) create mode 100644 drivers/bus/mhi/uci.c diff --git

[PATCH v13 3/4] docs: Add documentation for userspace client interface

2020-11-27 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently QMI MHI channel is supported by this driver. Signed-off-by: Hemant Kumar --- Documentation/mhi/index.rst | 1 + Documentation/mhi

Re: [PATCH v12 5/5] selftest: mhi: Add support to test MHI LOOPBACK channel

2020-11-20 Thread Hemant Kumar
Hi Shuah, On 11/20/20 7:26 AM, Shuah Khan wrote: On 11/16/20 3:46 PM, Hemant Kumar wrote: Loopback test opens the MHI device file node and writes a data buffer to it. MHI UCI kernel space driver copies the data and sends it to MHI uplink (Tx) LOOPBACK channel. MHI device loops back the same

Re: [PATCH v12 5/5] selftest: mhi: Add support to test MHI LOOPBACK channel

2020-11-20 Thread Hemant Kumar
Hi Mani, On 11/19/20 10:10 PM, Manivannan Sadhasivam wrote: On Mon, Nov 16, 2020 at 02:46:22PM -0800, Hemant Kumar wrote: Loopback test opens the MHI device file node and writes a data buffer to it. MHI UCI kernel space driver copies the data and sends it to MHI uplink (Tx) LOOPBACK channel

[PATCH v12 2/5] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-11-16 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[PATCH v12 5/5] selftest: mhi: Add support to test MHI LOOPBACK channel

2020-11-16 Thread Hemant Kumar
against the data sent. Test passes if data buffer matches between Tx and Rx. Test application performs open(), poll(), write(), read() and close() file operations. Signed-off-by: Hemant Kumar --- Documentation/mhi/uci.rst | 32 + tools/testing/selftests/Makefile

[PATCH v12 3/5] docs: Add documentation for userspace client interface

2020-11-16 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently Loopback MHI channel is supported by this driver. Signed-off-by: Hemant Kumar --- Documentation/mhi/index.rst | 1 + Documentation

[PATCH v12 1/5] bus: mhi: core: Add helper API to return number of free TREs

2020-11-16 Thread Hemant Kumar
Introduce mhi_get_free_desc_count() API to return number of TREs available to queue buffer. MHI clients can use this API to know before hand if ring is full without calling queue API. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi

[PATCH v12 0/5] userspace MHI client interface driver

2020-11-16 Thread Hemant Kumar
. Hemant Kumar (5): bus: mhi: core: Add helper API to return number of free TREs bus: mhi: core: Move MHI_MAX_MTU to external header file docs: Add documentation for userspace client interface bus: mhi: Add userspace client interface driver selftest: mhi: Add support to test MHI LOOPBACK

[PATCH v12 4/5] bus: mhi: Add userspace client interface driver

2020-11-16 Thread Hemant Kumar
Currently it supports LOOPBACK channel. Signed-off-by: Hemant Kumar --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 3 + drivers/bus/mhi/uci.c| 667 +++ 3 files changed, 683 insertions(+) create mode 100644 drivers/bus/mhi/uci.c diff

Re: [PATCH v2] bus: mhi: core: Fix null pointer access when parsing MHI configuration

2020-11-03 Thread Hemant Kumar
rt for registering MHI controllers") Signed-off-by: carl.yin Reviewed-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

Re: [PATCH v11 4/4] bus: mhi: Add userspace client interface driver

2020-10-30 Thread Hemant Kumar
Hi Mani, On 10/30/20 3:34 AM, Manivannan Sadhasivam wrote: Hi Hemant, On Thu, Oct 29, 2020 at 07:45:46PM -0700, Hemant Kumar wrote: This MHI client driver allows userspace clients to transfer raw data between MHI device and host using standard file operations. Driver instantiates UCI device

Re: [PATCH v11 4/4] bus: mhi: Add userspace client interface driver

2020-10-30 Thread Hemant Kumar
Hi Randy, On 10/29/20 10:48 PM, Randy Dunlap wrote: On 10/29/20 7:45 PM, Hemant Kumar wrote: diff --git a/drivers/bus/mhi/Kconfig b/drivers/bus/mhi/Kconfig index e841c10..476cc55 100644 --- a/drivers/bus/mhi/Kconfig +++ b/drivers/bus/mhi/Kconfig @@ -20,3 +20,16 @@ config MHI_BUS_DEBUG

[PATCH v11 3/4] docs: Add documentation for userspace client interface

2020-10-29 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently Loopback MHI channel is supported by this driver. Signed-off-by: Hemant Kumar --- Documentation/mhi/index.rst | 1 + Documentation

[PATCH v11 4/4] bus: mhi: Add userspace client interface driver

2020-10-29 Thread Hemant Kumar
Currently it supports LOOPBACK channel. Signed-off-by: Hemant Kumar --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 4 + drivers/bus/mhi/uci.c| 662 +++ 3 files changed, 679 insertions(+) create mode 100644 drivers/bus/mhi/uci.c diff

[PATCH v11 0/4] userspace MHI client interface driver

2020-10-29 Thread Hemant Kumar
. - Fixed uci ref counting in mhi_uci_open for error case. - Addressed style related review comments. V3: Added documentation for MHI UCI driver. V2: - Added mutex lock to prevent multiple readers to access same - mhi buffer which can result into use after free. Hemant Kumar (4): bus: mhi: core

[PATCH v11 2/4] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-10-29 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[PATCH v11 1/4] bus: mhi: core: Add helper API to return number of free TREs

2020-10-29 Thread Hemant Kumar
Introduce mhi_get_free_desc_count() API to return number of TREs available to queue buffer. MHI clients can use this API to know before hand if ring is full without calling queue API. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi

Re: [PATCH v10 3/4] docs: Add documentation for userspace client interface

2020-10-29 Thread Hemant Kumar
Hi Randy, On 10/29/20 2:51 PM, Randy Dunlap wrote: Hi, On 10/29/20 2:40 PM, Hemant Kumar wrote: MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently Loopback MHI channel is supported

[PATCH v10 1/4] bus: mhi: core: Add helper API to return number of free TREs

2020-10-29 Thread Hemant Kumar
Introduce mhi_get_free_desc_count() API to return number of TREs available to queue buffer. MHI clients can use this API to know before hand if ring is full without calling queue API. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi

[PATCH v10 3/4] docs: Add documentation for userspace client interface

2020-10-29 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently Loopback MHI channel is supported by this driver. Signed-off-by: Hemant Kumar --- Documentation/mhi/index.rst | 1 + Documentation

[PATCH v10 2/4] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-10-29 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[PATCH v10 4/4] bus: mhi: Add userspace client interface driver

2020-10-29 Thread Hemant Kumar
Currently it supports LOOPBACK channel. Signed-off-by: Hemant Kumar --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 4 + drivers/bus/mhi/uci.c| 662 +++ 3 files changed, 679 insertions(+) create mode 100644 drivers/bus/mhi/uci.c diff

[PATCH v10 0/4] userspace MHI client interface driver

2020-10-29 Thread Hemant Kumar
. V3: Added documentation for MHI UCI driver. V2: - Added mutex lock to prevent multiple readers to access same - mhi buffer which can result into use after free. Hemant Kumar (4): bus: mhi: core: Add helper API to return number of free TREs bus: mhi: core: Move MHI_MAX_MTU to external header

Re: [PATCH] bus: mhi: core: Add support MHI EE FP for download firmware

2020-10-27 Thread Hemant Kumar
Hi Jeff, On 10/27/20 8:11 AM, Jeffrey Hugo wrote: On 10/27/2020 3:43 AM, carl@quectel.com wrote: From: "carl.yin" MHI wwan modems support download firmware to nand or emmc by firehose protocol, process as next: 1. wwan modem normal bootup and enter EE AMSS, create mhi DIAG chan device

Re: [PATCH] bus: mhi: core: Introduce sysfs ul chan id for mhi chan device

2020-10-27 Thread Hemant Kumar
Hi Carl, On 10/27/20 8:06 AM, Jeffrey Hugo wrote: On 10/27/2020 3:43 AM, carl@quectel.com wrote: From: "carl.yin" User space software like ModemManager can identify the function of the mhi chan device by ul_chan_id. Signed-off-by: carl.yin ---   Documentation/ABI/stable/sysfs-bus-mhi |

Re: [PATCH v9 4/4] bus: mhi: Add userspace client interface driver

2020-10-26 Thread Hemant Kumar
Hi Loic, On 10/26/20 10:34 AM, Loic Poulain wrote: Hi Hemant, That looks better IMHO, just small comments on locking. [..] +static ssize_t mhi_uci_write(struct file *file, +                            const char __user *buf, +                            size_t count, +       

Re: [PATCH v9 3/4] docs: Add documentation for userspace client interface

2020-10-26 Thread Hemant Kumar
Hi Jakub, On 10/26/20 3:56 PM, Jakub Kicinski wrote: On Mon, 26 Oct 2020 07:38:46 -0600 Jeffrey Hugo wrote: On 10/25/2020 3:46 PM, Jakub Kicinski wrote: On Fri, 23 Oct 2020 16:17:54 -0700 Hemant Kumar wrote: +UCI driver enables userspace clients to communicate to external MHI devices +like

Re: [PATCH v9 3/4] docs: Add documentation for userspace client interface

2020-10-26 Thread Hemant Kumar
On 10/26/20 6:56 AM, Jeffrey Hugo wrote: On 10/26/2020 7:46 AM, Dan Williams wrote: On Mon, 2020-10-26 at 07:38 -0600, Jeffrey Hugo wrote: On 10/25/2020 3:46 PM, Jakub Kicinski wrote: On Fri, 23 Oct 2020 16:17:54 -0700 Hemant Kumar wrote: +UCI driver enables userspace clients

[PATCH v1 1/2] bus: mhi: core: Count number of HW channels supported by controller

2020-10-23 Thread Hemant Kumar
Device provides the total number of HW channels it supports using MHI configuration register. Host supported HW channels shall not exceed that value. In order to make this check, a counter is needed to store total number of HW channels required by host. Signed-off-by: Hemant Kumar --- drivers

[PATCH v1 2/2] bus: mhi: core: Check for device supported event rings and channels

2020-10-23 Thread Hemant Kumar
-off-by: Hemant Kumar --- drivers/bus/mhi/core/init.c | 31 +++ drivers/bus/mhi/core/internal.h | 4 2 files changed, 35 insertions(+) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index 70fd6af..35a6b1d 100644 --- a/drivers/bus/mhi/core

[PATCH v1 0/2] Check for device supported event rings and channels

2020-10-23 Thread Hemant Kumar
This change is introduced to make sure device supported hardware event ring, hardware channels, total number of event rings and total number of channels match with MHI host controller. In case of a mismatch, driver bails out and does not move MHI device to M0 from Ready state. Hemant Kumar (2

[PATCH v9 1/4] bus: mhi: core: Add helper API to return number of free TREs

2020-10-23 Thread Hemant Kumar
Introduce mhi_get_free_desc_count() API to return number of TREs available to queue buffer. MHI clients can use this API to know before hand if ring is full without calling queue API. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus/mhi

[PATCH v9 2/4] bus: mhi: core: Move MHI_MAX_MTU to external header file

2020-10-23 Thread Hemant Kumar
Currently this macro is defined in internal MHI header as a TRE length mask. Moving it to external header allows MHI client drivers to set this upper bound for the transmit buffer size. Signed-off-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam --- drivers/bus

[PATCH v9 4/4] bus: mhi: Add userspace client interface driver

2020-10-23 Thread Hemant Kumar
Currently it supports LOOPBACK channel. Signed-off-by: Hemant Kumar --- drivers/bus/mhi/Kconfig | 13 + drivers/bus/mhi/Makefile | 4 + drivers/bus/mhi/uci.c| 658 +++ 3 files changed, 675 insertions(+) create mode 100644 drivers/bus/mhi/uci.c diff

[PATCH v9 3/4] docs: Add documentation for userspace client interface

2020-10-23 Thread Hemant Kumar
MHI userspace client driver is creating device file node for user application to perform file operations. File operations are handled by MHI core driver. Currently Loopback MHI channel is supported by this driver. Signed-off-by: Hemant Kumar --- Documentation/mhi/index.rst | 1 + Documentation

[PATCH v9 0/4] userspace MHI client interface driver

2020-10-23 Thread Hemant Kumar
to access same mhi buffer which can result into use after free. Hemant Kumar (4): bus: mhi: core: Add helper API to return number of free TREs bus: mhi: core: Move MHI_MAX_MTU to external header file docs: Add documentation for userspace client interface bus: mhi: Add userspace client interface

Re: [PATCH v8 0/4] userspace MHI client interface driver

2020-10-23 Thread Hemant Kumar
Hi Jakub, On 10/23/20 9:37 AM, Jakub Kicinski wrote: On Thu, 22 Oct 2020 01:22:34 -0700 Hemant Kumar wrote: This patch series adds support for UCI driver. UCI driver enables userspace clients to communicate to external MHI devices like modem and WLAN. UCI driver probe creates standard

Re: [PATCH v8 4/4] bus: mhi: Add userspace client interface driver

2020-10-22 Thread Hemant Kumar
Hi Loic, On 10/22/20 3:20 AM, Loic Poulain wrote: Hi Hemant, A few comments inline. On Thu, 22 Oct 2020 at 10:22, Hemant Kumar wrote: This MHI client driver allows userspace clients to transfer raw data between MHI device and host using standard file operations. Driver instantiates UCI

  1   2   3   4   5   6   7   >