All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Shah, Nehal-bakulchandra" <nbshah@amd.com>
Cc: ajayg@nvidia.com, linux-usb@vger.kernel.org
Subject: Re: UCSI:CCG: AMD Platform
Date: Thu, 13 Feb 2020 14:05:55 +0200	[thread overview]
Message-ID: <20200213120555.GM1498@kuha.fi.intel.com> (raw)
In-Reply-To: <20200213120011.GL1498@kuha.fi.intel.com>

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

On Thu, Feb 13, 2020 at 02:00:14PM +0200, Heikki Krogerus wrote:
> > I am using CCG based UCSI driver without any
> > modification.For I2C part i have written custom
> > driver.
> > 
> > I have attached the trace out and dmesg crash log.
> > 
> > Please have a look
> 
> Thanks for the logs. Can you test the attached diff?

Actually, don't try that one. Try this one instead.

-- 
heikki

[-- Attachment #2: displayport_lock.diff --]
[-- Type: text/plain, Size: 1179 bytes --]

diff --git a/drivers/usb/typec/ucsi/displayport.c b/drivers/usb/typec/ucsi/displayport.c
index 0f1273ae086c..0f8f5d07e270 100644
--- a/drivers/usb/typec/ucsi/displayport.c
+++ b/drivers/usb/typec/ucsi/displayport.c
@@ -285,6 +285,8 @@ struct typec_altmode *ucsi_register_displayport(struct ucsi_connector *con,
 	struct typec_altmode *alt;
 	struct ucsi_dp *dp;
 
+	mutex_lock(&con->lock);
+
 	/* We can't rely on the firmware with the capabilities. */
 	desc->vdo |= DP_CAP_DP_SIGNALING | DP_CAP_RECEPTACLE;
 
@@ -293,12 +295,15 @@ struct typec_altmode *ucsi_register_displayport(struct ucsi_connector *con,
 	desc->vdo |= all_assignments << 16;
 
 	alt = typec_port_register_altmode(con->port, desc);
-	if (IS_ERR(alt))
+	if (IS_ERR(alt)) {
+		mutex_unlock(&con->lock);
 		return alt;
+	}
 
 	dp = devm_kzalloc(&alt->dev, sizeof(*dp), GFP_KERNEL);
 	if (!dp) {
 		typec_unregister_altmode(alt);
+		mutex_unlock(&con->lock);
 		return ERR_PTR(-ENOMEM);
 	}
 
@@ -311,5 +316,7 @@ struct typec_altmode *ucsi_register_displayport(struct ucsi_connector *con,
 	alt->ops = &ucsi_displayport_ops;
 	typec_altmode_set_drvdata(alt, dp);
 
+	mutex_unlock(&con->lock);
+
 	return alt;
 }

  reply	other threads:[~2020-02-13 12:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03  5:22 UCSI:CCG: AMD Platform Shah, Nehal-bakulchandra
2020-02-03 13:28 ` Heikki Krogerus
2020-02-03 13:32   ` Heikki Krogerus
2020-02-10 10:09     ` Shah, Nehal-bakulchandra
2020-02-13 12:00       ` Heikki Krogerus
2020-02-13 12:05         ` Heikki Krogerus [this message]
2020-02-14 14:28           ` Shah, Nehal-bakulchandra
2020-02-24  9:08             ` Shah, Nehal-bakulchandra
2020-02-27 12:23               ` Heikki Krogerus
2020-02-27 16:59                 ` Shah, Nehal-bakulchandra
2020-02-29  3:25                   ` Shah, Nehal-bakulchandra
2020-03-26  8:35                     ` Heikki Krogerus
2020-03-26 13:41                       ` Shah, Nehal-bakulchandra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200213120555.GM1498@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=ajayg@nvidia.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=nbshah@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.