Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit efdfa92

Browse files
Mani-Sadhasivamgregkh
authored andcommitted
bus: mhi: ep: Rename read_from_host() and write_to_host() APIs
[ Upstream commit 9271052 ] In the preparation for adding async API support, let's rename the existing APIs to read_sync() and write_sync() to make it explicit that these APIs are used for synchronous read/write. Signed-off-by: Manivannan Sadhasivam <[email protected]> Stable-dep-of: c7d0b2d ("bus: mhi: ep: Do not allocate memory for MHI objects from DMA zone") Signed-off-by: Sasha Levin <[email protected]>
1 parent be6c52b commit efdfa92

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

drivers/bus/mhi/ep/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static int mhi_ep_read_channel(struct mhi_ep_cntrl *mhi_cntrl,
361361
buf_info.size = tr_len;
362362

363363
dev_dbg(dev, "Reading %zd bytes from channel (%u)\n", tr_len, ring->ch_id);
364-
ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
364+
ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
365365
if (ret < 0) {
366366
dev_err(&mhi_chan->mhi_dev->dev, "Error reading from channel\n");
367367
return ret;
@@ -523,7 +523,7 @@ int mhi_ep_queue_skb(struct mhi_ep_device *mhi_dev, struct sk_buff *skb)
523523
buf_info.size = tr_len;
524524

525525
dev_dbg(dev, "Writing %zd bytes to channel (%u)\n", tr_len, ring->ch_id);
526-
ret = mhi_cntrl->write_to_host(mhi_cntrl, &buf_info);
526+
ret = mhi_cntrl->write_sync(mhi_cntrl, &buf_info);
527527
if (ret < 0) {
528528
dev_err(dev, "Error writing to the channel\n");
529529
goto err_exit;

drivers/bus/mhi/ep/ring.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
4848
buf_info.host_addr = ring->rbase + (start * sizeof(struct mhi_ring_element));
4949
buf_info.dev_addr = &ring->ring_cache[start];
5050

51-
ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
51+
ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
5252
if (ret < 0)
5353
return ret;
5454
} else {
5555
buf_info.size = (ring->ring_size - start) * sizeof(struct mhi_ring_element);
5656
buf_info.host_addr = ring->rbase + (start * sizeof(struct mhi_ring_element));
5757
buf_info.dev_addr = &ring->ring_cache[start];
5858

59-
ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
59+
ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
6060
if (ret < 0)
6161
return ret;
6262

@@ -65,7 +65,7 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
6565
buf_info.dev_addr = &ring->ring_cache[0];
6666
buf_info.size = end * sizeof(struct mhi_ring_element);
6767

68-
ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
68+
ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
6969
if (ret < 0)
7070
return ret;
7171
}
@@ -143,7 +143,7 @@ int mhi_ep_ring_add_element(struct mhi_ep_ring *ring, struct mhi_ring_element *e
143143
buf_info.dev_addr = el;
144144
buf_info.size = sizeof(*el);
145145

146-
return mhi_cntrl->write_to_host(mhi_cntrl, &buf_info);
146+
return mhi_cntrl->write_sync(mhi_cntrl, &buf_info);
147147
}
148148

149149
void mhi_ep_ring_init(struct mhi_ep_ring *ring, enum mhi_ep_ring_type type, u32 id)

drivers/pci/endpoint/functions/pci-epf-mhi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,11 @@ static int pci_epf_mhi_link_up(struct pci_epf *epf)
536536
mhi_cntrl->alloc_map = pci_epf_mhi_alloc_map;
537537
mhi_cntrl->unmap_free = pci_epf_mhi_unmap_free;
538538
if (info->flags & MHI_EPF_USE_DMA) {
539-
mhi_cntrl->read_from_host = pci_epf_mhi_edma_read;
540-
mhi_cntrl->write_to_host = pci_epf_mhi_edma_write;
539+
mhi_cntrl->read_sync = pci_epf_mhi_edma_read;
540+
mhi_cntrl->write_sync = pci_epf_mhi_edma_write;
541541
} else {
542-
mhi_cntrl->read_from_host = pci_epf_mhi_iatu_read;
543-
mhi_cntrl->write_to_host = pci_epf_mhi_iatu_write;
542+
mhi_cntrl->read_sync = pci_epf_mhi_iatu_read;
543+
mhi_cntrl->write_sync = pci_epf_mhi_iatu_write;
544544
}
545545

546546
/* Register the MHI EP controller */

include/linux/mhi_ep.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ struct mhi_ep_buf_info {
9494
* @raise_irq: CB function for raising IRQ to the host
9595
* @alloc_map: CB function for allocating memory in endpoint for storing host context and mapping it
9696
* @unmap_free: CB function to unmap and free the allocated memory in endpoint for storing host context
97-
* @read_from_host: CB function for reading from host memory from endpoint
98-
* @write_to_host: CB function for writing to host memory from endpoint
97+
* @read_sync: CB function for reading from host memory synchronously
98+
* @write_sync: CB function for writing to host memory synchronously
9999
* @mhi_state: MHI Endpoint state
100100
* @max_chan: Maximum channels supported by the endpoint controller
101101
* @mru: MRU (Maximum Receive Unit) value of the endpoint controller
@@ -149,8 +149,8 @@ struct mhi_ep_cntrl {
149149
void __iomem **virt, size_t size);
150150
void (*unmap_free)(struct mhi_ep_cntrl *mhi_cntrl, u64 pci_addr, phys_addr_t phys,
151151
void __iomem *virt, size_t size);
152-
int (*read_from_host)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
153-
int (*write_to_host)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
152+
int (*read_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
153+
int (*write_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
154154

155155
enum mhi_state mhi_state;
156156

0 commit comments

Comments
 (0)