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

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

Merge "diag: Update the status for feature mask correctly"

parents e776016c 0398ed91
Loading
Loading
Loading
Loading
+8 −11
Original line number Original line Diff line number Diff line
@@ -165,10 +165,9 @@ static void diag_send_log_mask_update(uint8_t peripheral, int equip_id)


		err = diagfwd_write(peripheral, TYPE_CNTL,
		err = diagfwd_write(peripheral, TYPE_CNTL,
				    buf, header_len + mask_size);
				    buf, header_len + mask_size);
		if (err && err != -ENODEV) {
		if (err && err != -ENODEV)
			pr_err("diag: Unable to send log masks to peripheral %d, equip_id: %d, err: %d\n",
			pr_err_ratelimited("diag: Unable to send log masks to peripheral %d, equip_id: %d, err: %d\n",
			       peripheral, i, err);
			       peripheral, i, err);
		}
		if (send_once || equip_id != ALL_EQUIP_ID)
		if (send_once || equip_id != ALL_EQUIP_ID)
			break;
			break;


@@ -243,10 +242,9 @@ static void diag_send_event_mask_update(uint8_t peripheral)
	write_len += sizeof(header);
	write_len += sizeof(header);


	err = diagfwd_write(peripheral, TYPE_CNTL, buf, write_len);
	err = diagfwd_write(peripheral, TYPE_CNTL, buf, write_len);
	if (err && err != -ENODEV) {
	if (err && err != -ENODEV)
		pr_err("diag: Unable to send event masks to peripheral %d\n",
		pr_err_ratelimited("diag: Unable to send event masks to peripheral %d\n",
		       peripheral);
		       peripheral);
	}
err:
err:
	mutex_unlock(&event_mask.lock);
	mutex_unlock(&event_mask.lock);
}
}
@@ -334,10 +332,9 @@ proceed:


		err = diagfwd_write(peripheral, TYPE_CNTL, buf,
		err = diagfwd_write(peripheral, TYPE_CNTL, buf,
				    header_len + mask_size);
				    header_len + mask_size);
		if (err && err != -ENODEV) {
		if (err && err != -ENODEV)
			pr_err("diag: Unable to send msg masks to peripheral %d\n",
			pr_err_ratelimited("diag: Unable to send msg masks to peripheral %d\n",
			       peripheral);
			       peripheral);
		}


		if (first != ALL_SSID)
		if (first != ALL_SSID)
			break;
			break;
@@ -422,8 +419,8 @@ static void diag_send_feature_mask_update(uint8_t peripheral)
	total_len = header_size + FEATURE_MASK_LEN;
	total_len = header_size + FEATURE_MASK_LEN;


	err = diagfwd_write(peripheral, TYPE_CNTL, buf, total_len);
	err = diagfwd_write(peripheral, TYPE_CNTL, buf, total_len);
	if (err && err != -ENODEV) {
	if (err) {
		pr_err("diag: In %s, unable to write to peripheral: %d, type: %d, len: %d, err: %d\n",
		pr_err_ratelimited("diag: In %s, unable to write feature mask to peripheral: %d, type: %d, len: %d, err: %d\n",
		       __func__, peripheral, TYPE_CNTL,
		       __func__, peripheral, TYPE_CNTL,
		       total_len, err);
		       total_len, err);
		mutex_unlock(&driver->diag_cntl_mutex);
		mutex_unlock(&driver->diag_cntl_mutex);
+6 −4
Original line number Original line Diff line number Diff line
@@ -61,18 +61,20 @@ void diag_cntl_channel_close(struct diagfwd_info *p_info)
		return;
		return;


	peripheral = p_info->peripheral;
	peripheral = p_info->peripheral;
	if (peripheral >= NUM_PERIPHERALS)
		return;

	driver->feature[peripheral].sent_feature_mask = 0;
	driver->feature[peripheral].rcvd_feature_mask = 0;
	flush_workqueue(driver->cntl_wq);
	reg_dirty |= PERIPHERAL_MASK(peripheral);
	reg_dirty |= PERIPHERAL_MASK(peripheral);
	diag_cmd_remove_reg_by_proc(peripheral);
	diag_cmd_remove_reg_by_proc(peripheral);
	driver->feature[peripheral].rcvd_feature_mask = 0;
	driver->feature[peripheral].stm_support = DISABLE_STM;
	driver->feature[peripheral].stm_support = DISABLE_STM;
	driver->feature[peripheral].log_on_demand = 0;
	driver->feature[peripheral].log_on_demand = 0;
	driver->feature[peripheral].sent_feature_mask = 0;
	driver->stm_state[peripheral] = DISABLE_STM;
	driver->stm_state[peripheral] = DISABLE_STM;
	driver->stm_state_requested[peripheral] = DISABLE_STM;
	driver->stm_state_requested[peripheral] = DISABLE_STM;
	reg_dirty ^= PERIPHERAL_MASK(peripheral);
	reg_dirty ^= PERIPHERAL_MASK(peripheral);
	diag_notify_md_client(peripheral, DIAG_STATUS_CLOSED);
	diag_notify_md_client(peripheral, DIAG_STATUS_CLOSED);

	flush_workqueue(driver->cntl_wq);
}
}


static void diag_stm_update_work_fn(struct work_struct *work)
static void diag_stm_update_work_fn(struct work_struct *work)