Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 659648a6 authored by Atish Kumar Patra's avatar Atish Kumar Patra
Browse files

soc: qcom: glink: Use GFP_ATOMIC in memory allocation



All the rx notification callbacks are invoked from atomic
context. Memory allocation using GFP_KERNEL flags might sleep.

As the memory allocated during rx callback is immediately freed
upon worker thread completion, GFP_ATOMIC flag can be used to
allocate the memory.

CRs-Fixed: 896463
Change-Id: I722000e594e82b1fc1e72eade3f95e881577baf3
Signed-off-by: default avatarAtish Kumar Patra <apatra@codeaurora.org>
parent 1d6b7340
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -748,7 +748,7 @@ void glink_lpbsrv_notify_rx(void *handle, const void *priv,
		"%s:%s:%s %s: end (Success) RX priv[%p] data[%p] size[%zu]\n",
		rx_ch_info->transport, rx_ch_info->edge, rx_ch_info->name,
		__func__, pkt_priv, (char *)ptr, size);
	tmp_work_info = kzalloc(sizeof(struct rx_work_info), GFP_KERNEL);
	tmp_work_info = kzalloc(sizeof(struct rx_work_info), GFP_ATOMIC);
	if (!tmp_work_info) {
		LBSRV_ERR("%s:%s:%s %s: Error allocating rx_work\n",
				rx_ch_info->transport, rx_ch_info->edge,
@@ -776,7 +776,7 @@ void glink_lpbsrv_notify_rxv(void *handle, const void *priv,
	LBSRV_INFO("%s:%s:%s %s: priv[%p] data[%p] size[%zu]\n",
		   rx_ch_info->transport, rx_ch_info->edge, rx_ch_info->name,
		   __func__, pkt_priv, (char *)ptr, size);
	tmp_work_info = kzalloc(sizeof(struct rx_work_info), GFP_KERNEL);
	tmp_work_info = kzalloc(sizeof(struct rx_work_info), GFP_ATOMIC);
	if (!tmp_work_info) {
		LBSRV_ERR("%s:%s:%s %s: Error allocating rx_work\n",
				rx_ch_info->transport, rx_ch_info->edge,
@@ -806,7 +806,7 @@ void glink_lpbsrv_notify_rx_tp(void *handle, const void *priv,
		rx_ch_info->transport, rx_ch_info->edge, rx_ch_info->name,
		__func__, pkt_priv, (char *)ptr, size);
	tracer_pkt_log_event((void *)ptr, LOOPBACK_SRV_RX);
	tmp_work_info = kmalloc(sizeof(struct rx_work_info), GFP_KERNEL);
	tmp_work_info = kmalloc(sizeof(struct rx_work_info), GFP_ATOMIC);
	if (!tmp_work_info) {
		LBSRV_ERR("%s:%s:%s %s: Error allocating rx_work\n",
				rx_ch_info->transport, rx_ch_info->edge,