Commit babf09c3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'tag-chrome-platform-fixes-for-v5.1-rc2' of...

Merge tag 'tag-chrome-platform-fixes-for-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux

Pull chrome platform fixes from Benson Leung:
 "Two fixes:

   - Fix locking and close a potential race condition in the new
     wilco_ec driver.

   - Fix a warning in cros_ec_debugfs on systems that do not support
     console logging, such as the Asus C201"

* tag 'tag-chrome-platform-fixes-for-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  platform/chrome: cros_ec_debugfs: cancel/schedule logging work only if supported
  platform/chrome: Fix locking pattern in wilco_ec_mailbox()
parents b7a42146 57aeef7f
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -440,7 +440,7 @@ static int cros_ec_debugfs_probe(struct platform_device *pd)

	ret = cros_ec_create_pdinfo(debug_info);
	if (ret)
		goto remove_debugfs;
		goto remove_log;

	ec->debug_info = debug_info;

@@ -448,6 +448,8 @@ static int cros_ec_debugfs_probe(struct platform_device *pd)

	return 0;

remove_log:
	cros_ec_cleanup_console_log(debug_info);
remove_debugfs:
	debugfs_remove_recursive(debug_info->dir);
	return ret;
@@ -467,6 +469,7 @@ static int __maybe_unused cros_ec_debugfs_suspend(struct device *dev)
{
	struct cros_ec_dev *ec = dev_get_drvdata(dev);

	if (ec->debug_info->log_buffer.buf)
		cancel_delayed_work_sync(&ec->debug_info->log_poll_work);

	return 0;
@@ -476,6 +479,7 @@ static int __maybe_unused cros_ec_debugfs_resume(struct device *dev)
{
	struct cros_ec_dev *ec = dev_get_drvdata(dev);

	if (ec->debug_info->log_buffer.buf)
		schedule_delayed_work(&ec->debug_info->log_poll_work, 0);

	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -223,11 +223,11 @@ int wilco_ec_mailbox(struct wilco_ec_device *ec, struct wilco_ec_message *msg)
		msg->command, msg->type, msg->flags, msg->response_size,
		msg->request_size);

	mutex_lock(&ec->mailbox_lock);
	/* Prepare request packet */
	rq = ec->data_buffer;
	wilco_ec_prepare(msg, rq);

	mutex_lock(&ec->mailbox_lock);
	ret = wilco_ec_transfer(ec, msg, rq);
	mutex_unlock(&ec->mailbox_lock);