All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] typec: tcpm: Fix a msecs vs jiffies bug
@ 2018-06-07 13:17 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2018-06-07 13:17 UTC (permalink / raw)
  To: Heikki Krogerus, Guenter Roeck
  Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors

The tcpm_set_state() function take msecs not jiffies.

Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
index 8a201dd53d36..0dfd755020f4 100644
--- a/drivers/usb/typec/tcpm.c
+++ b/drivers/usb/typec/tcpm.c
@@ -3043,7 +3043,8 @@ static void run_state_machine(struct tcpm_port *port)
 		    tcpm_port_is_sink(port) &&
 		    time_is_after_jiffies(port->delayed_runtime)) {
 			tcpm_set_state(port, SNK_DISCOVERY,
-				       port->delayed_runtime - jiffies);
+				       jiffies_to_msecs(port->delayed_runtime -
+							jiffies));
 			break;
 		}
 		tcpm_set_state(port, unattached_state(port), 0);

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

* typec: tcpm: Fix a msecs vs jiffies bug
@ 2018-06-07 13:17 ` Dan Carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2018-06-07 13:17 UTC (permalink / raw)
  To: Heikki Krogerus, Guenter Roeck
  Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors

The tcpm_set_state() function take msecs not jiffies.

Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
index 8a201dd53d36..0dfd755020f4 100644
--- a/drivers/usb/typec/tcpm.c
+++ b/drivers/usb/typec/tcpm.c
@@ -3043,7 +3043,8 @@ static void run_state_machine(struct tcpm_port *port)
 		    tcpm_port_is_sink(port) &&
 		    time_is_after_jiffies(port->delayed_runtime)) {
 			tcpm_set_state(port, SNK_DISCOVERY,
-				       port->delayed_runtime - jiffies);
+				       jiffies_to_msecs(port->delayed_runtime -
+							jiffies));
 			break;
 		}
 		tcpm_set_state(port, unattached_state(port), 0);

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

* Re: [PATCH] typec: tcpm: Fix a msecs vs jiffies bug
@ 2018-06-07 13:25   ` Heikki Krogerus
  0 siblings, 0 replies; 6+ messages in thread
From: Heikki Krogerus @ 2018-06-07 13:25 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Guenter Roeck, Greg Kroah-Hartman, linux-usb, kernel-janitors

On Thu, Jun 07, 2018 at 04:17:14PM +0300, Dan Carpenter wrote:
> The tcpm_set_state() function take msecs not jiffies.
> 
> Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
> index 8a201dd53d36..0dfd755020f4 100644
> --- a/drivers/usb/typec/tcpm.c
> +++ b/drivers/usb/typec/tcpm.c
> @@ -3043,7 +3043,8 @@ static void run_state_machine(struct tcpm_port *port)
>  		    tcpm_port_is_sink(port) &&
>  		    time_is_after_jiffies(port->delayed_runtime)) {
>  			tcpm_set_state(port, SNK_DISCOVERY,
> -				       port->delayed_runtime - jiffies);
> +				       jiffies_to_msecs(port->delayed_runtime -
> +							jiffies));
>  			break;
>  		}
>  		tcpm_set_state(port, unattached_state(port), 0);

-- 
heikki

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

* typec: tcpm: Fix a msecs vs jiffies bug
@ 2018-06-07 13:25   ` Heikki Krogerus
  0 siblings, 0 replies; 6+ messages in thread
From: Heikki Krogerus @ 2018-06-07 13:25 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Guenter Roeck, Greg Kroah-Hartman, linux-usb, kernel-janitors

On Thu, Jun 07, 2018 at 04:17:14PM +0300, Dan Carpenter wrote:
> The tcpm_set_state() function take msecs not jiffies.
> 
> Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
> index 8a201dd53d36..0dfd755020f4 100644
> --- a/drivers/usb/typec/tcpm.c
> +++ b/drivers/usb/typec/tcpm.c
> @@ -3043,7 +3043,8 @@ static void run_state_machine(struct tcpm_port *port)
>  		    tcpm_port_is_sink(port) &&
>  		    time_is_after_jiffies(port->delayed_runtime)) {
>  			tcpm_set_state(port, SNK_DISCOVERY,
> -				       port->delayed_runtime - jiffies);
> +				       jiffies_to_msecs(port->delayed_runtime -
> +							jiffies));
>  			break;
>  		}
>  		tcpm_set_state(port, unattached_state(port), 0);

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

* Re: [PATCH] typec: tcpm: Fix a msecs vs jiffies bug
@ 2018-06-08  6:13   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2018-06-08  6:13 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Heikki Krogerus, Guenter Roeck, Greg Kroah-Hartman, linux-usb,
	kernel-janitors

On Thu, Jun 7, 2018 at 6:17 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> The tcpm_set_state() function take msecs not jiffies.
>

Nice catch.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
> index 8a201dd53d36..0dfd755020f4 100644
> --- a/drivers/usb/typec/tcpm.c
> +++ b/drivers/usb/typec/tcpm.c
> @@ -3043,7 +3043,8 @@ static void run_state_machine(struct tcpm_port *port)
>                     tcpm_port_is_sink(port) &&
>                     time_is_after_jiffies(port->delayed_runtime)) {
>                         tcpm_set_state(port, SNK_DISCOVERY,
> -                                      port->delayed_runtime - jiffies);
> +                                      jiffies_to_msecs(port->delayed_runtime -
> +                                                       jiffies));
>                         break;
>                 }
>                 tcpm_set_state(port, unattached_state(port), 0);

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

* typec: tcpm: Fix a msecs vs jiffies bug
@ 2018-06-08  6:13   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2018-06-08  6:13 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Heikki Krogerus, Guenter Roeck, Greg Kroah-Hartman, linux-usb,
	kernel-janitors

On Thu, Jun 7, 2018 at 6:17 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> The tcpm_set_state() function take msecs not jiffies.
>

Nice catch.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
> index 8a201dd53d36..0dfd755020f4 100644
> --- a/drivers/usb/typec/tcpm.c
> +++ b/drivers/usb/typec/tcpm.c
> @@ -3043,7 +3043,8 @@ static void run_state_machine(struct tcpm_port *port)
>                     tcpm_port_is_sink(port) &&
>                     time_is_after_jiffies(port->delayed_runtime)) {
>                         tcpm_set_state(port, SNK_DISCOVERY,
> -                                      port->delayed_runtime - jiffies);
> +                                      jiffies_to_msecs(port->delayed_runtime -
> +                                                       jiffies));
>                         break;
>                 }
>                 tcpm_set_state(port, unattached_state(port), 0);
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2018-06-08  6:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-07 13:17 [PATCH] typec: tcpm: Fix a msecs vs jiffies bug Dan Carpenter
2018-06-07 13:17 ` Dan Carpenter
2018-06-07 13:25 ` [PATCH] " Heikki Krogerus
2018-06-07 13:25   ` Heikki Krogerus
2018-06-08  6:13 ` [PATCH] " Guenter Roeck
2018-06-08  6:13   ` Guenter Roeck

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.