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

Commit 03aeea12 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Prevent multiple mask update to peripheral"

parents 8585d730 9553b460
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1982,6 +1982,7 @@ int diag_copy_to_user_log_mask(char __user *buf, size_t count,

void diag_send_updates_peripheral(uint8_t peripheral)
{
	if (!driver->feature[peripheral].sent_feature_mask)
		diag_send_feature_mask_update(peripheral);
	/*
	 * Masks (F3, logs and events) will be sent to
+16 −18
Original line number Diff line number Diff line
@@ -765,21 +765,17 @@ static void process_diagid(uint8_t *buf, uint32_t len,
			fwd_info_data->diagid_root = ctrl_pkt.diag_id;
		} else {
			i = fwd_info_cmd->num_pd - 2;
			if (i >= 0)
			if (i >= 0 && i < MAX_PERIPHERAL_UPD)
				fwd_info_cmd->diagid_user[i] =
				ctrl_pkt.diag_id;

			i = fwd_info_data->num_pd - 2;
			if (i >= 0)
			if (i >= 0 && i < MAX_PERIPHERAL_UPD)
				fwd_info_data->diagid_user[i] =
				ctrl_pkt.diag_id;
		}
	}

	if (root_str)
		driver->diag_id_sent[peripheral] = 0;


	DIAG_LOG(DIAG_DEBUG_PERIPHERALS,
		"diag: peripheral = %d: diag_id string = %s,diag_id = %d\n",
		peripheral, process_name, ctrl_pkt.diag_id);
@@ -805,13 +801,15 @@ static void process_diagid(uint8_t *buf, uint32_t len,
		 * With diag_id being sent now, mask will be updated
		 * to peripherals.
		 */
		if (root_str) {
			driver->diag_id_sent[peripheral] = 1;
			diag_send_updates_peripheral(peripheral);
		}
		diagfwd_buffers_init(fwd_info_data);
		DIAG_LOG(DIAG_DEBUG_PERIPHERALS,
		"diag: diag_id sent = %d to peripheral = %d with diag_id = %d for %s :\n",
			driver->diag_id_sent[peripheral], peripheral,
			ctrl_pkt.diag_id, process_name);
		diag_send_updates_peripheral(peripheral);
		diagfwd_buffers_init(fwd_info_data);
	}
}