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

Commit 0422a763 authored by Manoj Prabhu B's avatar Manoj Prabhu B Committed by Gerrit - the friendly Code Review server
Browse files

diag: Update masks to peripherals in workqueue context



The patch updates the logging masks to diag_id supported peripherals
in workqueue context after processing diag_id request control packet
for root pd and clears the mask_update variable after the peripheral
is updated with logging mask.

CRs-Fixed: 2147011
Change-Id: I948da01ca63bd98923c87cace3e35aedacc2482c
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 81ab0bca
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2135,6 +2135,14 @@ void diag_send_updates_peripheral(uint8_t peripheral)
				driver->real_time_mode[DIAG_LOCAL_PROC]);
		diag_send_peripheral_buffering_mode(
					&driver->buffering_mode[peripheral]);

		/*
		 * Clear mask_update variable afer updating
		 * logging masks to peripheral.
		 */
		mutex_lock(&driver->cntl_lock);
		driver->mask_update ^= PERIPHERAL_MASK(peripheral);
		mutex_unlock(&driver->cntl_lock);
	}
}

+1 −4
Original line number Diff line number Diff line
@@ -40,9 +40,6 @@ static void diag_mask_update_work_fn(struct work_struct *work)
	for (peripheral = 0; peripheral <= NUM_PERIPHERALS; peripheral++) {
		if (!(driver->mask_update & PERIPHERAL_MASK(peripheral)))
			continue;
		mutex_lock(&driver->cntl_lock);
		driver->mask_update ^= PERIPHERAL_MASK(peripheral);
		mutex_unlock(&driver->cntl_lock);
		diag_send_updates_peripheral(peripheral);
	}
}
@@ -832,7 +829,7 @@ static void process_diagid(uint8_t *buf, uint32_t len,
		 */
		if (root_str) {
			driver->diag_id_sent[peripheral] = 1;
			diag_send_updates_peripheral(peripheral);
			queue_work(driver->cntl_wq, &driver->mask_update_work);
		}
		fwd_info = &peripheral_info[TYPE_DATA][peripheral];
		diagfwd_buffers_init(fwd_info);