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

Commit c7d0b2d

Browse files
bus: mhi: ep: Do not allocate memory for MHI objects from DMA zone
MHI endpoint stack accidentally started allocating memory for objects from DMA zone since commit 62210a2 ("bus: mhi: ep: Use slab allocator where applicable"). But there is no real need to allocate memory from this naturally limited DMA zone. This also causes the MHI endpoint stack to run out of memory while doing high bandwidth transfers. So let's switch over to normal memory. Cc: <[email protected]> # 6.8 Fixes: 62210a2 ("bus: mhi: ep: Use slab allocator where applicable") Reviewed-by: Mayank Rana <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]>
1 parent 1613e60 commit c7d0b2d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/bus/mhi/ep/main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int mhi_ep_send_completion_event(struct mhi_ep_cntrl *mhi_cntrl, struct m
9090
struct mhi_ring_element *event;
9191
int ret;
9292

93-
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA);
93+
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL);
9494
if (!event)
9595
return -ENOMEM;
9696

@@ -109,7 +109,7 @@ int mhi_ep_send_state_change_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_stat
109109
struct mhi_ring_element *event;
110110
int ret;
111111

112-
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA);
112+
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL);
113113
if (!event)
114114
return -ENOMEM;
115115

@@ -127,7 +127,7 @@ int mhi_ep_send_ee_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_ee_type exec_e
127127
struct mhi_ring_element *event;
128128
int ret;
129129

130-
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA);
130+
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL);
131131
if (!event)
132132
return -ENOMEM;
133133

@@ -146,7 +146,7 @@ static int mhi_ep_send_cmd_comp_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_e
146146
struct mhi_ring_element *event;
147147
int ret;
148148

149-
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA);
149+
event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL);
150150
if (!event)
151151
return -ENOMEM;
152152

@@ -438,7 +438,7 @@ static int mhi_ep_read_channel(struct mhi_ep_cntrl *mhi_cntrl,
438438
read_offset = mhi_chan->tre_size - mhi_chan->tre_bytes_left;
439439
write_offset = len - buf_left;
440440

441-
buf_addr = kmem_cache_zalloc(mhi_cntrl->tre_buf_cache, GFP_KERNEL | GFP_DMA);
441+
buf_addr = kmem_cache_zalloc(mhi_cntrl->tre_buf_cache, GFP_KERNEL);
442442
if (!buf_addr)
443443
return -ENOMEM;
444444

@@ -1481,14 +1481,14 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl,
14811481

14821482
mhi_cntrl->ev_ring_el_cache = kmem_cache_create("mhi_ep_event_ring_el",
14831483
sizeof(struct mhi_ring_element), 0,
1484-
SLAB_CACHE_DMA, NULL);
1484+
0, NULL);
14851485
if (!mhi_cntrl->ev_ring_el_cache) {
14861486
ret = -ENOMEM;
14871487
goto err_free_cmd;
14881488
}
14891489

14901490
mhi_cntrl->tre_buf_cache = kmem_cache_create("mhi_ep_tre_buf", MHI_EP_DEFAULT_MTU, 0,
1491-
SLAB_CACHE_DMA, NULL);
1491+
0, NULL);
14921492
if (!mhi_cntrl->tre_buf_cache) {
14931493
ret = -ENOMEM;
14941494
goto err_destroy_ev_ring_el_cache;

0 commit comments

Comments
 (0)