* [PATCH 0/2] ucsi driver fixes
@ 2020-01-08 13:13 Heikki Krogerus
2020-01-08 13:13 ` [PATCH 1/2] usb: typec: ucsi: Fix the notification bit offsets Heikki Krogerus
2020-01-08 13:13 ` [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications Heikki Krogerus
0 siblings, 2 replies; 6+ messages in thread
From: Heikki Krogerus @ 2020-01-08 13:13 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb
Hi Greg,
Here are two fixes for the ucsi driver. Both fix issues with the Set
Notification Enable command.
Heikki Krogerus (2):
usb: typec: ucsi: Fix the notification bit offsets
usb: typec: ucsi: Actually enable all the interface notifications
drivers/usb/typec/ucsi/ucsi.c | 1 +
drivers/usb/typec/ucsi/ucsi.h | 18 +++++++++---------
2 files changed, 10 insertions(+), 9 deletions(-)
--
2.24.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] usb: typec: ucsi: Fix the notification bit offsets
2020-01-08 13:13 [PATCH 0/2] ucsi driver fixes Heikki Krogerus
@ 2020-01-08 13:13 ` Heikki Krogerus
2020-01-08 13:13 ` [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications Heikki Krogerus
1 sibling, 0 replies; 6+ messages in thread
From: Heikki Krogerus @ 2020-01-08 13:13 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb
The bit offsets for the Set Notification Enable command were
not considering the reserved bits in the middle.
Fixes: 470ce43a1a81 ("usb: typec: ucsi: Remove struct ucsi_control")
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/usb/typec/ucsi/ucsi.h | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
index 9e01a9556603..e434b9c9a9eb 100644
--- a/drivers/usb/typec/ucsi/ucsi.h
+++ b/drivers/usb/typec/ucsi/ucsi.h
@@ -99,15 +99,15 @@ void ucsi_connector_change(struct ucsi *ucsi, u8 num);
#define UCSI_ENABLE_NTFY_CMD_COMPLETE BIT(16)
#define UCSI_ENABLE_NTFY_EXT_PWR_SRC_CHANGE BIT(17)
#define UCSI_ENABLE_NTFY_PWR_OPMODE_CHANGE BIT(18)
-#define UCSI_ENABLE_NTFY_CAP_CHANGE BIT(19)
-#define UCSI_ENABLE_NTFY_PWR_LEVEL_CHANGE BIT(20)
-#define UCSI_ENABLE_NTFY_PD_RESET_COMPLETE BIT(21)
-#define UCSI_ENABLE_NTFY_CAM_CHANGE BIT(22)
-#define UCSI_ENABLE_NTFY_BAT_STATUS_CHANGE BIT(23)
-#define UCSI_ENABLE_NTFY_PARTNER_CHANGE BIT(24)
-#define UCSI_ENABLE_NTFY_PWR_DIR_CHANGE BIT(25)
-#define UCSI_ENABLE_NTFY_CONNECTOR_CHANGE BIT(26)
-#define UCSI_ENABLE_NTFY_ERROR BIT(27)
+#define UCSI_ENABLE_NTFY_CAP_CHANGE BIT(21)
+#define UCSI_ENABLE_NTFY_PWR_LEVEL_CHANGE BIT(22)
+#define UCSI_ENABLE_NTFY_PD_RESET_COMPLETE BIT(23)
+#define UCSI_ENABLE_NTFY_CAM_CHANGE BIT(24)
+#define UCSI_ENABLE_NTFY_BAT_STATUS_CHANGE BIT(25)
+#define UCSI_ENABLE_NTFY_PARTNER_CHANGE BIT(27)
+#define UCSI_ENABLE_NTFY_PWR_DIR_CHANGE BIT(28)
+#define UCSI_ENABLE_NTFY_CONNECTOR_CHANGE BIT(30)
+#define UCSI_ENABLE_NTFY_ERROR BIT(31)
#define UCSI_ENABLE_NTFY_ALL 0xdbe70000
/* SET_UOR command bits */
--
2.24.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications
2020-01-08 13:13 [PATCH 0/2] ucsi driver fixes Heikki Krogerus
2020-01-08 13:13 ` [PATCH 1/2] usb: typec: ucsi: Fix the notification bit offsets Heikki Krogerus
@ 2020-01-08 13:13 ` Heikki Krogerus
2020-01-08 15:29 ` Heikki Krogerus
1 sibling, 1 reply; 6+ messages in thread
From: Heikki Krogerus @ 2020-01-08 13:13 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb
The notification mask was not updated properly before all
the notifications were enabled in ucsi_init().
Fixes: 71a1fa0df2a3 ("usb: typec: ucsi: Store the notification mask")
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.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 466bd8afceea..59c8ccdc68ac 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1007,6 +1007,7 @@ int ucsi_init(struct ucsi *ucsi)
}
/* Enable all notifications */
+ ucsi->ntfy = UCSI_ENABLE_NTFY_ALL;
command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;
ret = ucsi_run_command(ucsi, command, NULL, 0);
if (ret < 0)
--
2.24.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications
2020-01-08 13:13 ` [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications Heikki Krogerus
@ 2020-01-08 15:29 ` Heikki Krogerus
2020-01-08 15:52 ` Greg Kroah-Hartman
0 siblings, 1 reply; 6+ messages in thread
From: Heikki Krogerus @ 2020-01-08 15:29 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb
Hi Greg,
On Wed, Jan 08, 2020 at 04:13:47PM +0300, Heikki Krogerus wrote:
> The notification mask was not updated properly before all
> the notifications were enabled in ucsi_init().
>
> Fixes: 71a1fa0df2a3 ("usb: typec: ucsi: Store the notification mask")
That commit (71a1fa0df2a3) is still in your usb-next branch, so this
patch should also go only to your usb-next.
Sorry about the mix-up.
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.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 466bd8afceea..59c8ccdc68ac 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1007,6 +1007,7 @@ int ucsi_init(struct ucsi *ucsi)
> }
>
> /* Enable all notifications */
> + ucsi->ntfy = UCSI_ENABLE_NTFY_ALL;
> command = UCSI_SET_NOTIFICATION_ENABLE | ucsi->ntfy;
> ret = ucsi_run_command(ucsi, command, NULL, 0);
> if (ret < 0)
> --
> 2.24.1
thanks,
--
heikki
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications
2020-01-08 15:29 ` Heikki Krogerus
@ 2020-01-08 15:52 ` Greg Kroah-Hartman
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2020-01-08 15:52 UTC (permalink / raw)
To: Heikki Krogerus; +Cc: linux-usb
On Wed, Jan 08, 2020 at 05:29:42PM +0200, Heikki Krogerus wrote:
> Hi Greg,
>
> On Wed, Jan 08, 2020 at 04:13:47PM +0300, Heikki Krogerus wrote:
> > The notification mask was not updated properly before all
> > the notifications were enabled in ucsi_init().
> >
> > Fixes: 71a1fa0df2a3 ("usb: typec: ucsi: Store the notification mask")
>
> That commit (71a1fa0df2a3) is still in your usb-next branch, so this
> patch should also go only to your usb-next.
>
> Sorry about the mix-up.
No problem, I'll split the two patches between my two branches, thanks
for the heads-up.
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0/2] UCSI driver fixes
@ 2019-10-04 10:02 Heikki Krogerus
0 siblings, 0 replies; 6+ messages in thread
From: Heikki Krogerus @ 2019-10-04 10:02 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Ajay Gupta, linux-usb
Hi Greg,
Here are two fixes for the ucsi drivers. The first patch removes a
potential deadlock from ucsi_ccg.c, and the second fixes
ucsi_displayport_enter() function so that it does not return error if
the mode has already been entered by the time the function is called.
Let me know if you want anything to be changed.
thanks,
Heikki Krogerus (2):
usb: typec: ucsi: ccg: Remove run_isr flag
usb: typec: ucsi: displayport: Fix for the mode entering routine
drivers/usb/typec/ucsi/displayport.c | 2 ++
drivers/usb/typec/ucsi/ucsi_ccg.c | 42 +++-------------------------
2 files changed, 6 insertions(+), 38 deletions(-)
--
2.23.0
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-01-08 15:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 13:13 [PATCH 0/2] ucsi driver fixes Heikki Krogerus
2020-01-08 13:13 ` [PATCH 1/2] usb: typec: ucsi: Fix the notification bit offsets Heikki Krogerus
2020-01-08 13:13 ` [PATCH 2/2] usb: typec: ucsi: Actually enable all the interface notifications Heikki Krogerus
2020-01-08 15:29 ` Heikki Krogerus
2020-01-08 15:52 ` Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2019-10-04 10:02 [PATCH 0/2] UCSI driver fixes Heikki Krogerus
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).