USB Type-C fixes for usb-next
Subsystems (3)
Heikki Krogerus
maintainerv2 cover USB Type-C fixes for usb-next
Hi,
So these Intel PMC mux driver fixes out of my original series [1] are all for your usb-next.
[1] https://lore.kernel.org/linux-usb/[email protected]/
Azhar Shaikh (1):
usb: typec: intel_pmc_mux: Pass correct USB Type-C port number to SoC
Heikki Krogerus (1):
usb: typec: intel_pmc_mux: Add dependency on ACPI
Madhusudanarao Amara (1):
usb: typec: intel_pmc_mux: Handle SCU IPC error conditions
drivers/usb/typec/mux/Kconfig | 1 + drivers/usb/typec/mux/intel_pmc_mux.c | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-)
Signature · 1 line
2.28.0
Heikki Krogerus
maintainerPATCH v2 1/3 usb: typec: intel_pmc_mux: Add dependency on ACPI
Since the driver now needs to find the IOM ACPI node, the driver depends on ACPI. Without the dependency set, the driver will only fail to compile when ACPI is not enabled.
--- drivers/usb/typec/mux/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/usb/typec/mux/Kconfig +1 -0
@@ -11,6 +11,7 @@ config TYPEC_MUX_PI3USB30532 config TYPEC_MUX_INTEL_PMC tristate "Intel PMC mux control" + depends on ACPI depends on INTEL_SCU_IPC select USB_ROLE_SWITCH help
Signature · 1 line
2.28.0
Heikki Krogerus
maintainerPATCH v2 2/3 usb: typec: intel_pmc_mux: Pass correct USB Type-C port number to SoC
In reply to Heikki KrogerusFrom: Azhar Shaikh <[email protected]>
The SoC expects the USB Type-C ports numbers to be starting with 0. If the port number is passed as it is, the IOM status will not be updated. The IOM port status check fails which will eventually lead to PMC IPC communication failure.
--- drivers/usb/typec/mux/intel_pmc_mux.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/usb/typec/mux/intel_pmc_mux.c +6 -1
@@ -148,8 +148,13 @@ struct pmc_usb {static void update_port_status (struct pmc_usb_port *port) { +u8 port_num; + +/* SoC expects the USB Type-C port numbers to start with 0 */ + port_num = port->usb3_port -1 ; + port->iom_status =readl (port->pmc->iom_base +IOM_PORT_STATUS_OFFSET + - port->usb3_port *sizeof (u32)); + port_num *sizeof (u32)); }static int sbu_orientation (struct pmc_usb_port *port)
Signature · 1 line
2.28.0
Heikki Krogerus
maintainerPATCH v2 3/3 usb: typec: intel_pmc_mux: Handle SCU IPC error conditions
In reply to Heikki KrogerusFrom: Madhusudanarao Amara <[email protected]>
Check and return if there are errors. The response bits are valid only on no errors.
--- drivers/usb/typec/mux/intel_pmc_mux.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/usb/typec/mux/intel_pmc_mux.c +9 -3
@@ -176,13 +176,19 @@ static int hsl_orientation(struct pmc_usb_port *port)static int pmc_usb_command (struct pmc_usb_port *port,u8 *msg,u32 len) {u8 response[4 ]; +int ret;/* * Error bit will always be 0 with the USBC command. -* Status can be checked from the response message. +* Status can be checked from the response message if the +* function intel_scu_ipc_dev_command succeeds. */ -intel_scu_ipc_dev_command (port->pmc->ipc,PMC_USBC_CMD ,0 , msg, len, - response,sizeof (response)); + ret =intel_scu_ipc_dev_command (port->pmc->ipc,PMC_USBC_CMD ,0 , msg, + len, response,sizeof (response)); + +if (ret) +return ret; +if (response[2 ] &PMC_USB_RESP_STATUS_FAILURE ) {if (response[2 ] &PMC_USB_RESP_STATUS_FATAL )return -EIO ;
Signature · 1 line
2.28.0
Greg Kroah-Hartman
maintainerRe: [PATCH 3/3] usb: typec: intel_pmc_mux: Handle SCU IPC error conditions
Quoted 6 lines · Heikki Krogerus
From: Madhusudanarao Amara <[email protected]>
Check and return if there are errors. The response bits are valid only on no errors.
Fixes b7404a29cd3d ("usb: typec: intel_pmc_mux: Definitions for response status bits")
This is in 5.9-rc4, so shouldn't it go in for 5.9-final?
thanks,
greg k-h
A message that is not in the archive (sent off-list or not yet received): [email protected]
Greg Kroah-Hartman
maintainerRe: [PATCH 3/3] usb: typec: intel_pmc_mux: Handle SCU IPC error conditions
Quoted 4 lines · Heikki Krogerus
Quoted 3 lines · Greg Kroah-Hartman
Quoted 2 lines · Heikki Krogerus
From: Madhusudanarao Amara <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Check and return if there are errors. The response bits are valid only on no errors.
Fixes b7404a29cd3d ("usb: typec: intel_pmc_mux: Definitions for response status bits")This is in 5.9-rc4, so shouldn't it go in for 5.9-final?
You are correct. I'm sorry about that. Do you want me to resend?
No worries, I'll take it in the correct branch now, thanks!
greg k-h