All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] usb: typec: ucsi: allow retry to find role switch
@ 2022-04-12 10:30 Linyu Yuan
  2022-04-12 10:30 ` [PATCH 1/3] usb: typec: ucsi: set con->port to NULL when register port fail Linyu Yuan
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Linyu Yuan @ 2022-04-12 10:30 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman; +Cc: linux-usb, Jack Pham, Linyu Yuan

when one role switch module built as module, it may load later then
ucsi, this change series allow retry from ucsi.

Linyu Yuan (3):
  usb: typec: ucsi: set con->port to NULL when register port fail
  usb: typec: ucsi: add a common function ucsi_connector_clean()
  usb: typec: ucsi: retry find role swithch when module load late

 drivers/usb/typec/ucsi/ucsi.c | 75 +++++++++++++++++++++++--------------------
 drivers/usb/typec/ucsi/ucsi.h |  2 +-
 2 files changed, 41 insertions(+), 36 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/3] usb: typec: ucsi: set con->port to NULL when register port fail
  2022-04-12 10:30 [PATCH 0/3] usb: typec: ucsi: allow retry to find role switch Linyu Yuan
@ 2022-04-12 10:30 ` Linyu Yuan
  2022-04-12 10:30 ` [PATCH 2/3] usb: typec: ucsi: add a common function ucsi_connector_clean() Linyu Yuan
  2022-04-12 10:30 ` [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late Linyu Yuan
  2 siblings, 0 replies; 14+ messages in thread
From: Linyu Yuan @ 2022-04-12 10:30 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman; +Cc: linux-usb, Jack Pham, Linyu Yuan

As con->port will be used in error path of ucsi_init(),
it should be NULL or valid.

Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index f0c2fa1..77ac0b7 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1100,6 +1100,7 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
 	con->port = typec_register_port(ucsi->dev, cap);
 	if (IS_ERR(con->port)) {
 		ret = PTR_ERR(con->port);
+		con->port = NULL;
 		goto out;
 	}
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/3] usb: typec: ucsi: add a common function ucsi_connector_clean()
  2022-04-12 10:30 [PATCH 0/3] usb: typec: ucsi: allow retry to find role switch Linyu Yuan
  2022-04-12 10:30 ` [PATCH 1/3] usb: typec: ucsi: set con->port to NULL when register port fail Linyu Yuan
@ 2022-04-12 10:30 ` Linyu Yuan
  2022-04-13  7:38   ` Heikki Krogerus
  2022-04-12 10:30 ` [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late Linyu Yuan
  2 siblings, 1 reply; 14+ messages in thread
From: Linyu Yuan @ 2022-04-12 10:30 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman; +Cc: linux-usb, Jack Pham, Linyu Yuan

In error path of ucsi_init(), it will clean all valid ucsi connector,
and samiliar operation also happen in ucsi_unregister(),
add a common function for two places.

Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 46 +++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 77ac0b7..684fc4f 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1187,6 +1187,27 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
 	return ret;
 }
 
+static void ucsi_connector_clean(struct ucsi *ucsi)
+{
+	struct ucsi_connector *con;
+
+	if (!ucsi->connector)
+		return;
+
+	for (con = ucsi->connector; con->port; con++) {
+		cancel_work_sync(&con->work);
+		ucsi_unregister_partner(con);
+		ucsi_unregister_altmodes(con, UCSI_RECIPIENT_CON);
+		ucsi_unregister_port_psy(con);
+		if (con->wq)
+			destroy_workqueue(con->wq);
+		typec_unregister_port(con->port);
+	}
+
+	kfree(ucsi->connector);
+	ucsi->connector = NULL;
+}
+
 /**
  * ucsi_init - Initialize UCSI interface
  * @ucsi: UCSI to be initialized
@@ -1195,7 +1216,6 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
  */
 static int ucsi_init(struct ucsi *ucsi)
 {
-	struct ucsi_connector *con;
 	u64 command;
 	int ret;
 	int i;
@@ -1250,15 +1270,7 @@ static int ucsi_init(struct ucsi *ucsi)
 	return 0;
 
 err_unregister:
-	for (con = ucsi->connector; con->port; con++) {
-		ucsi_unregister_partner(con);
-		ucsi_unregister_altmodes(con, UCSI_RECIPIENT_CON);
-		ucsi_unregister_port_psy(con);
-		if (con->wq)
-			destroy_workqueue(con->wq);
-		typec_unregister_port(con->port);
-		con->port = NULL;
-	}
+	ucsi_connector_clean(ucsi);
 
 err_reset:
 	memset(&ucsi->cap, 0, sizeof(ucsi->cap));
@@ -1364,7 +1376,6 @@ EXPORT_SYMBOL_GPL(ucsi_register);
 void ucsi_unregister(struct ucsi *ucsi)
 {
 	u64 cmd = UCSI_SET_NOTIFICATION_ENABLE;
-	int i;
 
 	/* Make sure that we are not in the middle of driver initialization */
 	cancel_work_sync(&ucsi->work);
@@ -1372,18 +1383,7 @@ void ucsi_unregister(struct ucsi *ucsi)
 	/* Disable notifications */
 	ucsi->ops->async_write(ucsi, UCSI_CONTROL, &cmd, sizeof(cmd));
 
-	for (i = 0; i < ucsi->cap.num_connectors; i++) {
-		cancel_work_sync(&ucsi->connector[i].work);
-		ucsi_unregister_partner(&ucsi->connector[i]);
-		ucsi_unregister_altmodes(&ucsi->connector[i],
-					 UCSI_RECIPIENT_CON);
-		ucsi_unregister_port_psy(&ucsi->connector[i]);
-		if (ucsi->connector[i].wq)
-			destroy_workqueue(ucsi->connector[i].wq);
-		typec_unregister_port(ucsi->connector[i].port);
-	}
-
-	kfree(ucsi->connector);
+	ucsi_connector_clean(ucsi);
 }
 EXPORT_SYMBOL_GPL(ucsi_unregister);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late
  2022-04-12 10:30 [PATCH 0/3] usb: typec: ucsi: allow retry to find role switch Linyu Yuan
  2022-04-12 10:30 ` [PATCH 1/3] usb: typec: ucsi: set con->port to NULL when register port fail Linyu Yuan
  2022-04-12 10:30 ` [PATCH 2/3] usb: typec: ucsi: add a common function ucsi_connector_clean() Linyu Yuan
@ 2022-04-12 10:30 ` Linyu Yuan
  2022-04-13  7:46   ` Heikki Krogerus
  2 siblings, 1 reply; 14+ messages in thread
From: Linyu Yuan @ 2022-04-12 10:30 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman; +Cc: linux-usb, Jack Pham, Linyu Yuan

When role switch enabled, return -EAGAIN if fail to find it due to
module load ordering issue, then restart ucsi init work to find
it again every 100ms.

It also means change ucsi init work to delayed_work.

Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 28 ++++++++++++++++------------
 drivers/usb/typec/ucsi/ucsi.h |  2 +-
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 684fc4f..fabd4df 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1053,6 +1053,14 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
 	con->num = index + 1;
 	con->ucsi = ucsi;
 
+	cap->fwnode = ucsi_find_fwnode(con);
+	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
+	if (IS_ERR(con->usb_role_sw)) {
+		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
+			index + 1);
+		return -EAGAIN;
+	}
+
 	/* Delay other interactions with the con until registration is complete */
 	mutex_lock(&con->lock);
 
@@ -1088,7 +1096,6 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
 	if (con->cap.op_mode & UCSI_CONCAP_OPMODE_DEBUG_ACCESSORY)
 		*accessory = TYPEC_ACCESSORY_DEBUG;
 
-	cap->fwnode = ucsi_find_fwnode(con);
 	cap->driver_data = con;
 	cap->ops = &ucsi_ops;
 
@@ -1147,13 +1154,6 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
 		ucsi_port_psy_changed(con);
 	}
 
-	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
-	if (IS_ERR(con->usb_role_sw)) {
-		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
-			con->num);
-		con->usb_role_sw = NULL;
-	}
-
 	/* Only notify USB controller if partner supports USB data */
 	if (!(UCSI_CONSTAT_PARTNER_FLAGS(con->status.flags) & UCSI_CONSTAT_PARTNER_FLAG_USB))
 		u_role = USB_ROLE_NONE;
@@ -1281,12 +1281,16 @@ static int ucsi_init(struct ucsi *ucsi)
 
 static void ucsi_init_work(struct work_struct *work)
 {
-	struct ucsi *ucsi = container_of(work, struct ucsi, work);
+	struct ucsi *ucsi = container_of(work, struct ucsi, work.work);
 	int ret;
 
 	ret = ucsi_init(ucsi);
 	if (ret)
 		dev_err(ucsi->dev, "PPM init failed (%d)\n", ret);
+
+
+	if (ret == -EAGAIN)
+		queue_delayed_work(system_long_wq, &ucsi->work, HZ/10);
 }
 
 /**
@@ -1326,7 +1330,7 @@ struct ucsi *ucsi_create(struct device *dev, const struct ucsi_operations *ops)
 	if (!ucsi)
 		return ERR_PTR(-ENOMEM);
 
-	INIT_WORK(&ucsi->work, ucsi_init_work);
+	INIT_DELAYED_WORK(&ucsi->work, ucsi_init_work);
 	mutex_init(&ucsi->ppm_lock);
 	ucsi->dev = dev;
 	ucsi->ops = ops;
@@ -1361,7 +1365,7 @@ int ucsi_register(struct ucsi *ucsi)
 	if (!ucsi->version)
 		return -ENODEV;
 
-	queue_work(system_long_wq, &ucsi->work);
+	queue_delayed_work(system_long_wq, &ucsi->work, 0);
 
 	return 0;
 }
@@ -1378,7 +1382,7 @@ void ucsi_unregister(struct ucsi *ucsi)
 	u64 cmd = UCSI_SET_NOTIFICATION_ENABLE;
 
 	/* Make sure that we are not in the middle of driver initialization */
-	cancel_work_sync(&ucsi->work);
+	cancel_delayed_work_sync(&ucsi->work);
 
 	/* Disable notifications */
 	ucsi->ops->async_write(ucsi, UCSI_CONTROL, &cmd, sizeof(cmd));
diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index 280f1e1..3812017 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -287,7 +287,7 @@ struct ucsi {
 	struct ucsi_capability cap;
 	struct ucsi_connector *connector;
 
-	struct work_struct work;
+	struct delayed_work work;
 
 	/* PPM Communication lock */
 	struct mutex ppm_lock;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] usb: typec: ucsi: add a common function ucsi_connector_clean()
  2022-04-12 10:30 ` [PATCH 2/3] usb: typec: ucsi: add a common function ucsi_connector_clean() Linyu Yuan
@ 2022-04-13  7:38   ` Heikki Krogerus
  2022-04-13  7:45     ` Linyu Yuan (QUIC)
  0 siblings, 1 reply; 14+ messages in thread
From: Heikki Krogerus @ 2022-04-13  7:38 UTC (permalink / raw)
  To: Linyu Yuan; +Cc: Greg Kroah-Hartman, linux-usb, Jack Pham

On Tue, Apr 12, 2022 at 06:30:06PM +0800, Linyu Yuan wrote:
> In error path of ucsi_init(), it will clean all valid ucsi connector,
> and samiliar operation also happen in ucsi_unregister(),
> add a common function for two places.
> 
> Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
> ---
>  drivers/usb/typec/ucsi/ucsi.c | 46 +++++++++++++++++++++----------------------
>  1 file changed, 23 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 77ac0b7..684fc4f 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1187,6 +1187,27 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
>  	return ret;
>  }
>  
> +static void ucsi_connector_clean(struct ucsi *ucsi)
> +{
> +	struct ucsi_connector *con;
> +
> +	if (!ucsi->connector)
> +		return;
> +
> +	for (con = ucsi->connector; con->port; con++) {
> +		cancel_work_sync(&con->work);
> +		ucsi_unregister_partner(con);
> +		ucsi_unregister_altmodes(con, UCSI_RECIPIENT_CON);
> +		ucsi_unregister_port_psy(con);
> +		if (con->wq)
> +			destroy_workqueue(con->wq);
> +		typec_unregister_port(con->port);
> +	}
> +
> +	kfree(ucsi->connector);
> +	ucsi->connector = NULL;
> +}

This looks OK, but the name of the function is confusing to me. Can
you make that ucsi_remove_connectors(), or perhaps
ucsi_unregister_connectors() to keep it alligned with the other
function names in this driver?

>  /**
>   * ucsi_init - Initialize UCSI interface
>   * @ucsi: UCSI to be initialized
> @@ -1195,7 +1216,6 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
>   */
>  static int ucsi_init(struct ucsi *ucsi)
>  {
> -	struct ucsi_connector *con;
>  	u64 command;
>  	int ret;
>  	int i;
> @@ -1250,15 +1270,7 @@ static int ucsi_init(struct ucsi *ucsi)
>  	return 0;
>  
>  err_unregister:
> -	for (con = ucsi->connector; con->port; con++) {
> -		ucsi_unregister_partner(con);
> -		ucsi_unregister_altmodes(con, UCSI_RECIPIENT_CON);
> -		ucsi_unregister_port_psy(con);
> -		if (con->wq)
> -			destroy_workqueue(con->wq);
> -		typec_unregister_port(con->port);
> -		con->port = NULL;
> -	}
> +	ucsi_connector_clean(ucsi);
>  
>  err_reset:
>  	memset(&ucsi->cap, 0, sizeof(ucsi->cap));
> @@ -1364,7 +1376,6 @@ EXPORT_SYMBOL_GPL(ucsi_register);
>  void ucsi_unregister(struct ucsi *ucsi)
>  {
>  	u64 cmd = UCSI_SET_NOTIFICATION_ENABLE;
> -	int i;
>  
>  	/* Make sure that we are not in the middle of driver initialization */
>  	cancel_work_sync(&ucsi->work);
> @@ -1372,18 +1383,7 @@ void ucsi_unregister(struct ucsi *ucsi)
>  	/* Disable notifications */
>  	ucsi->ops->async_write(ucsi, UCSI_CONTROL, &cmd, sizeof(cmd));
>  
> -	for (i = 0; i < ucsi->cap.num_connectors; i++) {
> -		cancel_work_sync(&ucsi->connector[i].work);
> -		ucsi_unregister_partner(&ucsi->connector[i]);
> -		ucsi_unregister_altmodes(&ucsi->connector[i],
> -					 UCSI_RECIPIENT_CON);
> -		ucsi_unregister_port_psy(&ucsi->connector[i]);
> -		if (ucsi->connector[i].wq)
> -			destroy_workqueue(ucsi->connector[i].wq);
> -		typec_unregister_port(ucsi->connector[i].port);
> -	}
> -
> -	kfree(ucsi->connector);
> +	ucsi_connector_clean(ucsi);
>  }
>  EXPORT_SYMBOL_GPL(ucsi_unregister);
>  
> -- 
> 2.7.4

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH 2/3] usb: typec: ucsi: add a common function ucsi_connector_clean()
  2022-04-13  7:38   ` Heikki Krogerus
@ 2022-04-13  7:45     ` Linyu Yuan (QUIC)
  0 siblings, 0 replies; 14+ messages in thread
From: Linyu Yuan (QUIC) @ 2022-04-13  7:45 UTC (permalink / raw)
  To: Heikki Krogerus, Linyu Yuan (QUIC)
  Cc: Greg Kroah-Hartman, linux-usb, Jack Pham (QUIC)

> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Sent: Wednesday, April 13, 2022 3:38 PM
> To: Linyu Yuan (QUIC) <quic_linyyuan@quicinc.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; linux-
> usb@vger.kernel.org; Jack Pham (QUIC) <quic_jackp@quicinc.com>
> Subject: Re: [PATCH 2/3] usb: typec: ucsi: add a common function
> ucsi_connector_clean()
> 
> On Tue, Apr 12, 2022 at 06:30:06PM +0800, Linyu Yuan wrote:
> > In error path of ucsi_init(), it will clean all valid ucsi connector,
> > and samiliar operation also happen in ucsi_unregister(),
> > add a common function for two places.
> >
> > Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
> > ---
> >  drivers/usb/typec/ucsi/ucsi.c | 46 +++++++++++++++++++++----------------
> ------
> >  1 file changed, 23 insertions(+), 23 deletions(-)
> >
> > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > index 77ac0b7..684fc4f 100644
> > --- a/drivers/usb/typec/ucsi/ucsi.c
> > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > @@ -1187,6 +1187,27 @@ static int ucsi_register_port(struct ucsi *ucsi, int
> index)
> >  	return ret;
> >  }
> >
> > +static void ucsi_connector_clean(struct ucsi *ucsi)
> > +{
> > +	struct ucsi_connector *con;
> > +
> > +	if (!ucsi->connector)
> > +		return;
> > +
> > +	for (con = ucsi->connector; con->port; con++) {
> > +		cancel_work_sync(&con->work);
> > +		ucsi_unregister_partner(con);
> > +		ucsi_unregister_altmodes(con, UCSI_RECIPIENT_CON);
> > +		ucsi_unregister_port_psy(con);
> > +		if (con->wq)
> > +			destroy_workqueue(con->wq);
> > +		typec_unregister_port(con->port);
> > +	}
> > +
> > +	kfree(ucsi->connector);
> > +	ucsi->connector = NULL;
> > +}
> 
> This looks OK, but the name of the function is confusing to me. Can
> you make that ucsi_remove_connectors(), or perhaps
> ucsi_unregister_connectors() to keep it alligned with the other
> function names in this driver?
Thanks, will choose ucsi_unregister_connectors().
> 
> >  /**
> >   * ucsi_init - Initialize UCSI interface
> >   * @ucsi: UCSI to be initialized
> > @@ -1195,7 +1216,6 @@ static int ucsi_register_port(struct ucsi *ucsi, int
> index)
> >   */
> >  static int ucsi_init(struct ucsi *ucsi)
> >  {
> > -	struct ucsi_connector *con;
> >  	u64 command;
> >  	int ret;
> >  	int i;
> > @@ -1250,15 +1270,7 @@ static int ucsi_init(struct ucsi *ucsi)
> >  	return 0;
> >
> >  err_unregister:
> > -	for (con = ucsi->connector; con->port; con++) {
> > -		ucsi_unregister_partner(con);
> > -		ucsi_unregister_altmodes(con, UCSI_RECIPIENT_CON);
> > -		ucsi_unregister_port_psy(con);
> > -		if (con->wq)
> > -			destroy_workqueue(con->wq);
> > -		typec_unregister_port(con->port);
> > -		con->port = NULL;
> > -	}
> > +	ucsi_connector_clean(ucsi);
> >
> >  err_reset:
> >  	memset(&ucsi->cap, 0, sizeof(ucsi->cap));
> > @@ -1364,7 +1376,6 @@ EXPORT_SYMBOL_GPL(ucsi_register);
> >  void ucsi_unregister(struct ucsi *ucsi)
> >  {
> >  	u64 cmd = UCSI_SET_NOTIFICATION_ENABLE;
> > -	int i;
> >
> >  	/* Make sure that we are not in the middle of driver initialization */
> >  	cancel_work_sync(&ucsi->work);
> > @@ -1372,18 +1383,7 @@ void ucsi_unregister(struct ucsi *ucsi)
> >  	/* Disable notifications */
> >  	ucsi->ops->async_write(ucsi, UCSI_CONTROL, &cmd, sizeof(cmd));
> >
> > -	for (i = 0; i < ucsi->cap.num_connectors; i++) {
> > -		cancel_work_sync(&ucsi->connector[i].work);
> > -		ucsi_unregister_partner(&ucsi->connector[i]);
> > -		ucsi_unregister_altmodes(&ucsi->connector[i],
> > -					 UCSI_RECIPIENT_CON);
> > -		ucsi_unregister_port_psy(&ucsi->connector[i]);
> > -		if (ucsi->connector[i].wq)
> > -			destroy_workqueue(ucsi->connector[i].wq);
> > -		typec_unregister_port(ucsi->connector[i].port);
> > -	}
> > -
> > -	kfree(ucsi->connector);
> > +	ucsi_connector_clean(ucsi);
> >  }
> >  EXPORT_SYMBOL_GPL(ucsi_unregister);
> >
> > --
> > 2.7.4
> 
> thanks,
> 
> --
> heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late
  2022-04-12 10:30 ` [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late Linyu Yuan
@ 2022-04-13  7:46   ` Heikki Krogerus
  2022-04-13  8:00     ` Linyu Yuan (QUIC)
  0 siblings, 1 reply; 14+ messages in thread
From: Heikki Krogerus @ 2022-04-13  7:46 UTC (permalink / raw)
  To: Linyu Yuan; +Cc: Greg Kroah-Hartman, linux-usb, Jack Pham

On Tue, Apr 12, 2022 at 06:30:07PM +0800, Linyu Yuan wrote:
> When role switch enabled, return -EAGAIN if fail to find it due to
> module load ordering issue, then restart ucsi init work to find
> it again every 100ms.
> 
> It also means change ucsi init work to delayed_work.
> 
> Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
> ---
>  drivers/usb/typec/ucsi/ucsi.c | 28 ++++++++++++++++------------
>  drivers/usb/typec/ucsi/ucsi.h |  2 +-
>  2 files changed, 17 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 684fc4f..fabd4df 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1053,6 +1053,14 @@ static int ucsi_register_port(struct ucsi *ucsi, int index)
>  	con->num = index + 1;
>  	con->ucsi = ucsi;
>  
> +	cap->fwnode = ucsi_find_fwnode(con);
> +	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
> +	if (IS_ERR(con->usb_role_sw)) {
> +		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
> +			index + 1);
> +		return -EAGAIN;
> +	}

No, this is wrong. If there is a role switch assigned in the firmware
for the port, then fwnode_usb_role_switch_get() will return
-EPROBE_DEFER until the switch has been registered.

So I think what you want to do is just make the failure to get the
role switch fatal in this driver. Just return PTR_ERR(con->usb_role_sw).

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late
  2022-04-13  7:46   ` Heikki Krogerus
@ 2022-04-13  8:00     ` Linyu Yuan (QUIC)
  2022-04-13  8:09       ` Heikki Krogerus
  0 siblings, 1 reply; 14+ messages in thread
From: Linyu Yuan (QUIC) @ 2022-04-13  8:00 UTC (permalink / raw)
  To: Heikki Krogerus, Linyu Yuan (QUIC)
  Cc: Greg Kroah-Hartman, linux-usb, Jack Pham (QUIC)

> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Sent: Wednesday, April 13, 2022 3:46 PM
> To: Linyu Yuan (QUIC) <quic_linyyuan@quicinc.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; linux-
> usb@vger.kernel.org; Jack Pham (QUIC) <quic_jackp@quicinc.com>
> Subject: Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when
> module load late
> 
> On Tue, Apr 12, 2022 at 06:30:07PM +0800, Linyu Yuan wrote:
> > When role switch enabled, return -EAGAIN if fail to find it due to
> > module load ordering issue, then restart ucsi init work to find
> > it again every 100ms.
> >
> > It also means change ucsi init work to delayed_work.
> >
> > Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
> > ---
> >  drivers/usb/typec/ucsi/ucsi.c | 28 ++++++++++++++++------------
> >  drivers/usb/typec/ucsi/ucsi.h |  2 +-
> >  2 files changed, 17 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > index 684fc4f..fabd4df 100644
> > --- a/drivers/usb/typec/ucsi/ucsi.c
> > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > @@ -1053,6 +1053,14 @@ static int ucsi_register_port(struct ucsi *ucsi, int
> index)
> >  	con->num = index + 1;
> >  	con->ucsi = ucsi;
> >
> > +	cap->fwnode = ucsi_find_fwnode(con);
> > +	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
> > +	if (IS_ERR(con->usb_role_sw)) {
> > +		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
> > +			index + 1);
> > +		return -EAGAIN;
> > +	}
> 
> No, this is wrong. If there is a role switch assigned in the firmware
> for the port, then fwnode_usb_role_switch_get() will return
> -EPROBE_DEFER until the switch has been registered.
> 
> So I think what you want to do is just make the failure to get the
> role switch fatal in this driver. Just return PTR_ERR(con->usb_role_sw).
Thanks, will change it to check -EPROBE_DEFER.
> 
> thanks,
> 
> --
> heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late
  2022-04-13  8:00     ` Linyu Yuan (QUIC)
@ 2022-04-13  8:09       ` Heikki Krogerus
  2022-04-13  8:16         ` Linyu Yuan (QUIC)
  0 siblings, 1 reply; 14+ messages in thread
From: Heikki Krogerus @ 2022-04-13  8:09 UTC (permalink / raw)
  To: Linyu Yuan (QUIC); +Cc: Greg Kroah-Hartman, linux-usb, Jack Pham (QUIC)

On Wed, Apr 13, 2022 at 08:00:35AM +0000, Linyu Yuan (QUIC) wrote:
> > From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > Sent: Wednesday, April 13, 2022 3:46 PM
> > To: Linyu Yuan (QUIC) <quic_linyyuan@quicinc.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; linux-
> > usb@vger.kernel.org; Jack Pham (QUIC) <quic_jackp@quicinc.com>
> > Subject: Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when
> > module load late
> > 
> > On Tue, Apr 12, 2022 at 06:30:07PM +0800, Linyu Yuan wrote:
> > > When role switch enabled, return -EAGAIN if fail to find it due to
> > > module load ordering issue, then restart ucsi init work to find
> > > it again every 100ms.
> > >
> > > It also means change ucsi init work to delayed_work.
> > >
> > > Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
> > > ---
> > >  drivers/usb/typec/ucsi/ucsi.c | 28 ++++++++++++++++------------
> > >  drivers/usb/typec/ucsi/ucsi.h |  2 +-
> > >  2 files changed, 17 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> > > index 684fc4f..fabd4df 100644
> > > --- a/drivers/usb/typec/ucsi/ucsi.c
> > > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > > @@ -1053,6 +1053,14 @@ static int ucsi_register_port(struct ucsi *ucsi, int
> > index)
> > >  	con->num = index + 1;
> > >  	con->ucsi = ucsi;
> > >
> > > +	cap->fwnode = ucsi_find_fwnode(con);
> > > +	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
> > > +	if (IS_ERR(con->usb_role_sw)) {
> > > +		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
> > > +			index + 1);
> > > +		return -EAGAIN;
> > > +	}
> > 
> > No, this is wrong. If there is a role switch assigned in the firmware
> > for the port, then fwnode_usb_role_switch_get() will return
> > -EPROBE_DEFER until the switch has been registered.
> > 
> > So I think what you want to do is just make the failure to get the
> > role switch fatal in this driver. Just return PTR_ERR(con->usb_role_sw).
> Thanks, will change it to check -EPROBE_DEFER.

No, you don't check that, you just return that.

So you don't need that crazy polling mechanism where you queue a work
until you get the resource. Just let the driver core handle the
situation.

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late
  2022-04-13  8:09       ` Heikki Krogerus
@ 2022-04-13  8:16         ` Linyu Yuan (QUIC)
  2022-04-13 10:24           ` Heikki Krogerus
  0 siblings, 1 reply; 14+ messages in thread
From: Linyu Yuan (QUIC) @ 2022-04-13  8:16 UTC (permalink / raw)
  To: Heikki Krogerus, Linyu Yuan (QUIC)
  Cc: Greg Kroah-Hartman, linux-usb, Jack Pham (QUIC)

> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Sent: Wednesday, April 13, 2022 4:10 PM
> To: Linyu Yuan (QUIC) <quic_linyyuan@quicinc.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; linux-
> usb@vger.kernel.org; Jack Pham (QUIC) <quic_jackp@quicinc.com>
> Subject: Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when
> module load late
> 
> On Wed, Apr 13, 2022 at 08:00:35AM +0000, Linyu Yuan (QUIC) wrote:
> > > From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > > Sent: Wednesday, April 13, 2022 3:46 PM
> > > To: Linyu Yuan (QUIC) <quic_linyyuan@quicinc.com>
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; linux-
> > > usb@vger.kernel.org; Jack Pham (QUIC) <quic_jackp@quicinc.com>
> > > Subject: Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when
> > > module load late
> > >
> > > On Tue, Apr 12, 2022 at 06:30:07PM +0800, Linyu Yuan wrote:
> > > > When role switch enabled, return -EAGAIN if fail to find it due to
> > > > module load ordering issue, then restart ucsi init work to find
> > > > it again every 100ms.
> > > >
> > > > It also means change ucsi init work to delayed_work.
> > > >
> > > > Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
> > > > ---
> > > >  drivers/usb/typec/ucsi/ucsi.c | 28 ++++++++++++++++------------
> > > >  drivers/usb/typec/ucsi/ucsi.h |  2 +-
> > > >  2 files changed, 17 insertions(+), 13 deletions(-)
> > > >
> > > > diff --git a/drivers/usb/typec/ucsi/ucsi.c
> b/drivers/usb/typec/ucsi/ucsi.c
> > > > index 684fc4f..fabd4df 100644
> > > > --- a/drivers/usb/typec/ucsi/ucsi.c
> > > > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > > > @@ -1053,6 +1053,14 @@ static int ucsi_register_port(struct ucsi *ucsi,
> int
> > > index)
> > > >  	con->num = index + 1;
> > > >  	con->ucsi = ucsi;
> > > >
> > > > +	cap->fwnode = ucsi_find_fwnode(con);
> > > > +	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
> > > > +	if (IS_ERR(con->usb_role_sw)) {
> > > > +		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
> > > > +			index + 1);
> > > > +		return -EAGAIN;
> > > > +	}
> > >
> > > No, this is wrong. If there is a role switch assigned in the firmware
> > > for the port, then fwnode_usb_role_switch_get() will return
> > > -EPROBE_DEFER until the switch has been registered.
> > >
> > > So I think what you want to do is just make the failure to get the
> > > role switch fatal in this driver. Just return PTR_ERR(con->usb_role_sw).
> > Thanks, will change it to check -EPROBE_DEFER.
> 
> No, you don't check that, you just return that.
Yes, I do like it.
> 
> So you don't need that crazy polling mechanism where you queue a work
> until you get the resource. Just let the driver core handle the
> situation.
The issue is when a UCSI implementation driver probe, it call ucsi_register(),
But this function will not return -EPROBE_DEFER,
It just queue a work to start connector discovery.
> 
> thanks,
> 
> --
> heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late
  2022-04-13  8:16         ` Linyu Yuan (QUIC)
@ 2022-04-13 10:24           ` Heikki Krogerus
  2022-04-13 11:01             ` Linyu Yuan (QUIC)
  0 siblings, 1 reply; 14+ messages in thread
From: Heikki Krogerus @ 2022-04-13 10:24 UTC (permalink / raw)
  To: Linyu Yuan (QUIC); +Cc: Greg Kroah-Hartman, linux-usb, Jack Pham (QUIC)

On Wed, Apr 13, 2022 at 08:16:53AM +0000, Linyu Yuan (QUIC) wrote:
> > From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > Sent: Wednesday, April 13, 2022 4:10 PM
> > To: Linyu Yuan (QUIC) <quic_linyyuan@quicinc.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; linux-
> > usb@vger.kernel.org; Jack Pham (QUIC) <quic_jackp@quicinc.com>
> > Subject: Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when
> > module load late
> > 
> > On Wed, Apr 13, 2022 at 08:00:35AM +0000, Linyu Yuan (QUIC) wrote:
> > > > From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > > > Sent: Wednesday, April 13, 2022 3:46 PM
> > > > To: Linyu Yuan (QUIC) <quic_linyyuan@quicinc.com>
> > > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; linux-
> > > > usb@vger.kernel.org; Jack Pham (QUIC) <quic_jackp@quicinc.com>
> > > > Subject: Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when
> > > > module load late
> > > >
> > > > On Tue, Apr 12, 2022 at 06:30:07PM +0800, Linyu Yuan wrote:
> > > > > When role switch enabled, return -EAGAIN if fail to find it due to
> > > > > module load ordering issue, then restart ucsi init work to find
> > > > > it again every 100ms.
> > > > >
> > > > > It also means change ucsi init work to delayed_work.
> > > > >
> > > > > Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
> > > > > ---
> > > > >  drivers/usb/typec/ucsi/ucsi.c | 28 ++++++++++++++++------------
> > > > >  drivers/usb/typec/ucsi/ucsi.h |  2 +-
> > > > >  2 files changed, 17 insertions(+), 13 deletions(-)
> > > > >
> > > > > diff --git a/drivers/usb/typec/ucsi/ucsi.c
> > b/drivers/usb/typec/ucsi/ucsi.c
> > > > > index 684fc4f..fabd4df 100644
> > > > > --- a/drivers/usb/typec/ucsi/ucsi.c
> > > > > +++ b/drivers/usb/typec/ucsi/ucsi.c
> > > > > @@ -1053,6 +1053,14 @@ static int ucsi_register_port(struct ucsi *ucsi,
> > int
> > > > index)
> > > > >  	con->num = index + 1;
> > > > >  	con->ucsi = ucsi;
> > > > >
> > > > > +	cap->fwnode = ucsi_find_fwnode(con);
> > > > > +	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
> > > > > +	if (IS_ERR(con->usb_role_sw)) {
> > > > > +		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
> > > > > +			index + 1);
> > > > > +		return -EAGAIN;
> > > > > +	}
> > > >
> > > > No, this is wrong. If there is a role switch assigned in the firmware
> > > > for the port, then fwnode_usb_role_switch_get() will return
> > > > -EPROBE_DEFER until the switch has been registered.
> > > >
> > > > So I think what you want to do is just make the failure to get the
> > > > role switch fatal in this driver. Just return PTR_ERR(con->usb_role_sw).
> > > Thanks, will change it to check -EPROBE_DEFER.
> > 
> > No, you don't check that, you just return that.
> Yes, I do like it.
> > 
> > So you don't need that crazy polling mechanism where you queue a work
> > until you get the resource. Just let the driver core handle the
> > situation.
> The issue is when a UCSI implementation driver probe, it call ucsi_register(),
> But this function will not return -EPROBE_DEFER,
> It just queue a work to start connector discovery.

Ah, right right. This is a library. But we should be able use
wait_for_device_probe().

So if fwnode_usb_role_switch_get() returns -EPROBE_DEFER, you call
wait_for_device_probe() and try again.

Br,

-- 
heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late
  2022-04-13 10:24           ` Heikki Krogerus
@ 2022-04-13 11:01             ` Linyu Yuan (QUIC)
  2022-04-13 11:19               ` Heikki Krogerus
  0 siblings, 1 reply; 14+ messages in thread
From: Linyu Yuan (QUIC) @ 2022-04-13 11:01 UTC (permalink / raw)
  To: Heikki Krogerus, Linyu Yuan (QUIC)
  Cc: Greg Kroah-Hartman, linux-usb, Jack Pham (QUIC)

> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Sent: Wednesday, April 13, 2022 6:24 PM
> > > No, you don't check that, you just return that.
> > Yes, I do like it.
> > >
> > > So you don't need that crazy polling mechanism where you queue a work
> > > until you get the resource. Just let the driver core handle the
> > > situation.
> > The issue is when a UCSI implementation driver probe, it call ucsi_register(),
> > But this function will not return -EPROBE_DEFER,
> > It just queue a work to start connector discovery.
> 
> Ah, right right. This is a library. But we should be able use
> wait_for_device_probe().
> 
> So if fwnode_usb_role_switch_get() returns -EPROBE_DEFER, you call
> wait_for_device_probe() and try again.
Do you mean do as below,

find_role_switch:
	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
	if (IS_ERR(con->usb_role_sw)) {
		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
			con->num);
		if (con->usb_role_sw == -EPROBE_DEFER) {
			wait_for_device_probe();
			goto find_role_switch;
		}

		return PTR_ERR(con->usb_role_sw);
	}

Seem wait_for_device_probe() will wait all drivers probe,
Can we accept it ?
> 
> Br,
> 
> --
> heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late
  2022-04-13 11:01             ` Linyu Yuan (QUIC)
@ 2022-04-13 11:19               ` Heikki Krogerus
  2022-04-13 11:30                 ` Heikki Krogerus
  0 siblings, 1 reply; 14+ messages in thread
From: Heikki Krogerus @ 2022-04-13 11:19 UTC (permalink / raw)
  To: Linyu Yuan (QUIC); +Cc: Greg Kroah-Hartman, linux-usb, Jack Pham (QUIC)

On Wed, Apr 13, 2022 at 11:01:23AM +0000, Linyu Yuan (QUIC) wrote:
> > From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > Sent: Wednesday, April 13, 2022 6:24 PM
> > > > No, you don't check that, you just return that.
> > > Yes, I do like it.
> > > >
> > > > So you don't need that crazy polling mechanism where you queue a work
> > > > until you get the resource. Just let the driver core handle the
> > > > situation.
> > > The issue is when a UCSI implementation driver probe, it call ucsi_register(),
> > > But this function will not return -EPROBE_DEFER,
> > > It just queue a work to start connector discovery.
> > 
> > Ah, right right. This is a library. But we should be able use
> > wait_for_device_probe().
> > 
> > So if fwnode_usb_role_switch_get() returns -EPROBE_DEFER, you call
> > wait_for_device_probe() and try again.
> Do you mean do as below,
> 
> find_role_switch:
> 	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
> 	if (IS_ERR(con->usb_role_sw)) {
> 		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
> 			con->num);
> 		if (con->usb_role_sw == -EPROBE_DEFER) {
> 			wait_for_device_probe();
> 			goto find_role_switch;
> 		}
> 
> 		return PTR_ERR(con->usb_role_sw);
> 	}

Yes, something like that. Perhaps you could just do that in a loop,
and you should have a delay there.

> Seem wait_for_device_probe() will wait all drivers probe,
> Can we accept it ?

That part is not a problem, but I'm not sure if it appropriate to call
the function from drivers. Let me check if there is something else
that we can do...

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late
  2022-04-13 11:19               ` Heikki Krogerus
@ 2022-04-13 11:30                 ` Heikki Krogerus
  0 siblings, 0 replies; 14+ messages in thread
From: Heikki Krogerus @ 2022-04-13 11:30 UTC (permalink / raw)
  To: Linyu Yuan (QUIC); +Cc: Greg Kroah-Hartman, linux-usb, Jack Pham (QUIC)

On Wed, Apr 13, 2022 at 02:19:49PM +0300, Heikki Krogerus wrote:
> On Wed, Apr 13, 2022 at 11:01:23AM +0000, Linyu Yuan (QUIC) wrote:
> > > From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > > Sent: Wednesday, April 13, 2022 6:24 PM
> > > > > No, you don't check that, you just return that.
> > > > Yes, I do like it.
> > > > >
> > > > > So you don't need that crazy polling mechanism where you queue a work
> > > > > until you get the resource. Just let the driver core handle the
> > > > > situation.
> > > > The issue is when a UCSI implementation driver probe, it call ucsi_register(),
> > > > But this function will not return -EPROBE_DEFER,
> > > > It just queue a work to start connector discovery.
> > > 
> > > Ah, right right. This is a library. But we should be able use
> > > wait_for_device_probe().
> > > 
> > > So if fwnode_usb_role_switch_get() returns -EPROBE_DEFER, you call
> > > wait_for_device_probe() and try again.
> > Do you mean do as below,
> > 
> > find_role_switch:
> > 	con->usb_role_sw = fwnode_usb_role_switch_get(cap->fwnode);
> > 	if (IS_ERR(con->usb_role_sw)) {
> > 		dev_err(ucsi->dev, "con%d: failed to get usb role switch\n",
> > 			con->num);
> > 		if (con->usb_role_sw == -EPROBE_DEFER) {
> > 			wait_for_device_probe();
> > 			goto find_role_switch;
> > 		}
> > 
> > 		return PTR_ERR(con->usb_role_sw);
> > 	}
> 
> Yes, something like that. Perhaps you could just do that in a loop,
> and you should have a delay there.
> 
> > Seem wait_for_device_probe() will wait all drivers probe,
> > Can we accept it ?
> 
> That part is not a problem, but I'm not sure if it appropriate to call
> the function from drivers. Let me check if there is something else
> that we can do...

OK, I don't think we should use that in drivers, and I don't have any
better ideas. Sorry for the noise.

I notised that you have already send a couple of new versions of this
series. I'll review the last one of those, but in the future please
don't send the new versions so fast.

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-04-13 11:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 10:30 [PATCH 0/3] usb: typec: ucsi: allow retry to find role switch Linyu Yuan
2022-04-12 10:30 ` [PATCH 1/3] usb: typec: ucsi: set con->port to NULL when register port fail Linyu Yuan
2022-04-12 10:30 ` [PATCH 2/3] usb: typec: ucsi: add a common function ucsi_connector_clean() Linyu Yuan
2022-04-13  7:38   ` Heikki Krogerus
2022-04-13  7:45     ` Linyu Yuan (QUIC)
2022-04-12 10:30 ` [PATCH 3/3] usb: typec: ucsi: retry find role swithch when module load late Linyu Yuan
2022-04-13  7:46   ` Heikki Krogerus
2022-04-13  8:00     ` Linyu Yuan (QUIC)
2022-04-13  8:09       ` Heikki Krogerus
2022-04-13  8:16         ` Linyu Yuan (QUIC)
2022-04-13 10:24           ` Heikki Krogerus
2022-04-13 11:01             ` Linyu Yuan (QUIC)
2022-04-13 11:19               ` Heikki Krogerus
2022-04-13 11:30                 ` Heikki Krogerus

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.