linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: Jun Li <jun.li@nxp.com>
Cc: Peter Chen <peter.chen@kernel.org>,
	"heikki.krogerus@linux.intel.com"
	<heikki.krogerus@linux.intel.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH 1/1] usb: roles: reference controller's parent device if existed
Date: Mon, 30 Nov 2020 07:52:37 +0000	[thread overview]
Message-ID: <20201130075208.GD32154@b29397-desktop> (raw)
In-Reply-To: <VE1PR04MB652872CBAAE71856BBF68FE489F50@VE1PR04MB6528.eurprd04.prod.outlook.com>

On 20-11-30 02:37:54, Jun Li wrote:
> Hi Peter,
> > -----Original Message-----
> > From: Peter Chen <peter.chen@kernel.org>
> > Sent: Friday, November 27, 2020 2:28 PM
> > To: heikki.krogerus@linux.intel.com
> > Cc: linux-usb@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>; Peter
> > Chen <peter.chen@nxp.com>; Jun Li <jun.li@nxp.com>
> > Subject: [PATCH 1/1] usb: roles: reference controller's parent device if
> > existed
> > 
> > From: Peter Chen <peter.chen@nxp.com>
> > 
> > For some DRD IP drivers (eg, dwc3/cdns3/chipidea), the core device is created
> > and deleted by glue layer device. So, if role switch user (eg, tcpci), core
> > device, and glue layer device are all built as module, and glue layer device
> > is removed first, the core device's driver ->remove function will be called,
> > and its device's driver pointer will be NULL, and cause below oops.
> > 
> > To fix it, if there is a parent for controller device (role switch device's
> > parent), it references to parent too.
> 
> This may not enough, the trouble is role switch class isn't aware of
> the role switch is unregistered by its provider while typec class is
> using it, this can happen by different ways, if we do role switch provider
> driver unbind, we still suffer this problem:
> 
> echo usb_controller_dev > unbind
> 

Yes, to fix this issue totally, we need to change the way role switch class
used by controller and type-c driver, until now, we still have not a good
way.

We could fix module unload issue first, unbind two devices may not a common
use case.

> I am not sure if we should prevent this happening at USB controller
> drivers(provider side), or this is allowed and we should enhance
> role switch class to be aware of this situation and properly handle it.
> 


-- 

Thanks,
Peter Chen

      reply	other threads:[~2020-11-30  7:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27  6:28 [PATCH 1/1] usb: roles: reference controller's parent device if existed Peter Chen
2020-11-30  2:37 ` Jun Li
2020-11-30  7:52   ` Peter Chen [this message]

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=20201130075208.GD32154@b29397-desktop \
    --to=peter.chen@nxp.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jun.li@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).