lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251211-siva_mhi_dp2-v1-5-d2895c4ec73a@oss.qualcomm.com>
Date: Thu, 11 Dec 2025 13:37:37 +0530
From: Sivareddy Surasani <sivareddy.surasani@....qualcomm.com>
To: Manivannan Sadhasivam <mani@...nel.org>, Jonathan Corbet <corbet@....net>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: mhi@...ts.linux.dev, linux-arm-msm@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
        Upal Kumar Saha <upal.saha@....qualcomm.com>,
        Himanshu Shukla <quic_himashuk@...cinc.com>,
        Sivareddy Surasani <sivareddy.surasani@....qualcomm.com>,
        Vivek Pernamitta <vivek.pernamitta@....qualcomm.com>
Subject: [PATCH 05/11] bus: mhi: host: Add support for both DL and Ul chan
 for poll

From: Vivek Pernamitta <vivek.pernamitta@....qualcomm.com>

Add support for both DL and Ul chan in mhi_poll.

Signed-off-by: Vivek Pernamitta <vivek.pernamitta@....qualcomm.com>
Signed-off-by: Sivareddy Surasani <sivareddy.surasani@....qualcomm.com>
---
 drivers/bus/mhi/host/main.c | 4 ++--
 include/linux/mhi.h         | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
index 5d50f6ebf6f9..53bb93da4017 100644
--- a/drivers/bus/mhi/host/main.c
+++ b/drivers/bus/mhi/host/main.c
@@ -1859,10 +1859,10 @@ int mhi_get_channel_doorbell_offset(struct mhi_controller *mhi_cntrl, u32 *chdb_
 }
 EXPORT_SYMBOL_GPL(mhi_get_channel_doorbell_offset);
 
-int mhi_poll(struct mhi_device *mhi_dev, u32 budget)
+int mhi_poll(struct mhi_device *mhi_dev, u32 budget, enum dma_data_direction dir)
 {
 	struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;
-	struct mhi_chan *mhi_chan = mhi_dev->dl_chan;
+	struct mhi_chan *mhi_chan = (dir == DMA_TO_DEVICE) ? mhi_dev->ul_chan : mhi_dev->dl_chan;
 	struct mhi_event *mhi_event = &mhi_cntrl->mhi_event[mhi_chan->er_index];
 	int ret;
 
diff --git a/include/linux/mhi.h b/include/linux/mhi.h
index 360770ddef70..299216b5e4de 100644
--- a/include/linux/mhi.h
+++ b/include/linux/mhi.h
@@ -780,8 +780,9 @@ void mhi_unprepare_from_transfer(struct mhi_device *mhi_dev);
  * mhi_poll - Poll for any available data in DL direction
  * @mhi_dev: Device associated with the channels
  * @budget: # of events to process
+ * @dir: Set direction whether for DMA_TO_DVICE or DMA_FROM_DEVICE
  */
-int mhi_poll(struct mhi_device *mhi_dev, u32 budget);
+int mhi_poll(struct mhi_device *mhi_dev, u32 budget, enum dma_data_direction dir);
 
 /**
  * mhi_queue_buf - Send or receive raw buffers from client device over MHI

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ