linux-next: manual merge of the usb tree with the usb.current tree
Hi all,
Today's linux-next merge of the usb tree got a conflict in:
drivers/usb/typec/ucsi/ucsi.c
between commit:
87eb3cb4ec61 ("usb: typec: ucsi: Fix cable registration")
from the usb.current tree and commit:
73910c511b1a ("usb: typec: ucsi: Only assign the identity structure if the PPM supports it")
from the usb tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Signature · 37 lines
Cheers,
Stephen Rothwell
diff --cc drivers/usb/typec/ucsi/ucsi.c
index 17155ed17fdf,f0b5867048e2..000000000000
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@@ -993,11 -929,12 +939,12 @@@ static int ucsi_register_cable(struct u
break;
}
- desc.identity = &con->cable_identity;
+ if (con->ucsi->cap.features & UCSI_CAP_GET_PD_MESSAGE)
+ desc.identity = &con->cable_identity;
- desc.active = !!(UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE &
- con->cable_prop.flags);
- desc.pd_revision = UCSI_CABLE_PROP_FLAG_PD_MAJOR_REV_AS_BCD(
- con->cable_prop.flags);
+ desc.active = !!(UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE & cable_prop.flags);
+
+ if (con->ucsi->version >= UCSI_VERSION_2_1)
+ desc.pd_revision = UCSI_CABLE_PROP_FLAG_PD_MAJOR_REV_AS_BCD(cable_prop.flags);
cable = typec_register_cable(con->port, &desc);
if (IS_ERR(cable)) {
@@@ -1094,8 -1009,10 +1041,9 @@@ static int ucsi_register_partner(struc
if (pwr_opmode == UCSI_CONSTAT_PWR_OPMODE_PD)
ucsi_register_device_pdos(con);
- desc.identity = &con->partner_identity;
+ if (con->ucsi->cap.features & UCSI_CAP_GET_PD_MESSAGE)
+ desc.identity = &con->partner_identity;
desc.usb_pd = pwr_opmode == UCSI_CONSTAT_PWR_OPMODE_PD;
- desc.pd_revision = UCSI_CONCAP_FLAG_PARTNER_PD_MAJOR_REV_AS_BCD(con->cap.flags);
partner = typec_register_partner(con->port, &desc);
if (IS_ERR(partner)) {Quoted 51 lines · Stephen Rothwell
Hi all,
Today's linux-next merge of the usb tree got a conflict in:
drivers/usb/typec/ucsi/ucsi.cbetween commit:
87eb3cb4ec61("usb: typec: ucsi: Fix cable registration")from the usb.current tree and commit:
73910c511b1a("usb: typec: ucsi: Only assign the identity structure if the PPM supports it")from the usb tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Signature · 2 lines
Cheers, Stephen Rothwelldrivers/usb/typec/ucsi/ucsi.c +2
-1@@@ -993,11 -929,12 +939,12 @@@ static int ucsi_register_cable(struct ubreak ; } - desc.identity = &con->cable_identity; +if (con->ucsi->cap.features &UCSI_CAP_GET_PD_MESSAGE ) + desc.identity = &con->cable_identity; - desc.active = !!(UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE & - con->cable_prop.flags); - desc.pd_revision =UCSI_CABLE_PROP_FLAG_PD_MAJOR_REV_AS_BCD ( - con->cable_prop.flags); + desc.active = !!(UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE & cable_prop.flags); + + if (con->ucsi->version >= UCSI_VERSION_2_1) + desc.pd_revision =UCSI_CABLE_PROP_FLAG_PD_MAJOR_REV_AS_BCD (cable_prop.flags); cable =typec_register_cable (con->port, &desc);if (IS_ERR (cable)) {@@@ -1094,8 -1009,10 +1041,9 @@@ static int ucsi_register_partner(strucif (pwr_opmode ==UCSI_CONSTAT_PWR_OPMODE_PD )
drivers/usb/typec/ucsi/ucsi.c
Quoted 10 lines
drivers/usb/typec/ucsi/ucsi.c +2
-1ucsi_register_device_pdos (con); - desc.identity = &con->partner_identity; +if (con->ucsi->cap.features &UCSI_CAP_GET_PD_MESSAGE ) + desc.identity = &con->partner_identity; desc.usb_pd = pwr_opmode ==UCSI_CONSTAT_PWR_OPMODE_PD ; - desc.pd_revision =UCSI_CONCAP_FLAG_PARTNER_PD_MAJOR_REV_AS_BCD (con->cap.flags); partner =typec_register_partner (con->port, &desc);if (IS_ERR (partner)) {
Heikki, does this resolution look correct? I knew there would be a conflict, just want to make sure we get it right.
thanks
greg k-h
Quoted 60 lines · Greg KH
Quoted 59 lines · Stephen Rothwell
Hi all,
Today's linux-next merge of the usb tree got a conflict in:
drivers/usb/typec/ucsi/ucsi.cbetween commit:
87eb3cb4ec61("usb: typec: ucsi: Fix cable registration")from the usb.current tree and commit:
73910c511b1a("usb: typec: ucsi: Only assign the identity structure if the PPM supports it")from the usb tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Signature · 2 lines
Cheers, Stephen Rothwelldrivers/usb/typec/ucsi/ucsi.c +4
-2@@@ -993,11 -929,12 +939,12 @@@ static int ucsi_register_cable(struct ubreak ; } - desc.identity = &con->cable_identity; +if (con->ucsi->cap.features &UCSI_CAP_GET_PD_MESSAGE ) + desc.identity = &con->cable_identity; - desc.active = !!(UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE & - con->cable_prop.flags); - desc.pd_revision =UCSI_CABLE_PROP_FLAG_PD_MAJOR_REV_AS_BCD ( - con->cable_prop.flags); + desc.active = !!(UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE & cable_prop.flags); + + if (con->ucsi->version >= UCSI_VERSION_2_1) + desc.pd_revision =UCSI_CABLE_PROP_FLAG_PD_MAJOR_REV_AS_BCD (cable_prop.flags); cable =typec_register_cable (con->port, &desc);if (IS_ERR (cable)) {@@@ -1094,8 -1009,10 +1041,9 @@@ static int ucsi_register_partner(strucif (pwr_opmode ==UCSI_CONSTAT_PWR_OPMODE_PD )ucsi_register_device_pdos (con); - desc.identity = &con->partner_identity; +if (con->ucsi->cap.features &UCSI_CAP_GET_PD_MESSAGE ) + desc.identity = &con->partner_identity; desc.usb_pd = pwr_opmode ==UCSI_CONSTAT_PWR_OPMODE_PD ; - desc.pd_revision =UCSI_CONCAP_FLAG_PARTNER_PD_MAJOR_REV_AS_BCD (con->cap.flags);
Quoted 6 lines
Quoted 2 lines
partner = typec_register_partner(con->port, &desc); if (IS_ERR(partner)) {Heikki, does this resolution look correct? I knew there would be a conflict, just want to make sure we get it right.
It's correct.
thanks,
Signature · 1 line
heikki
Quoted 61 lines · Heikki Krogerus
Quoted 60 lines · Greg KH
Quoted 59 lines · Stephen Rothwell
Hi all,
Today's linux-next merge of the usb tree got a conflict in:
drivers/usb/typec/ucsi/ucsi.cbetween commit:
87eb3cb4ec61("usb: typec: ucsi: Fix cable registration")from the usb.current tree and commit:
73910c511b1a("usb: typec: ucsi: Only assign the identity structure if the PPM supports it")from the usb tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Signature · 2 lines
Cheers, Stephen Rothwelldrivers/usb/typec/ucsi/ucsi.c +4
-2@@@ -993,11 -929,12 +939,12 @@@ static int ucsi_register_cable(struct ubreak ; } - desc.identity = &con->cable_identity; +if (con->ucsi->cap.features &UCSI_CAP_GET_PD_MESSAGE ) + desc.identity = &con->cable_identity; - desc.active = !!(UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE & - con->cable_prop.flags); - desc.pd_revision =UCSI_CABLE_PROP_FLAG_PD_MAJOR_REV_AS_BCD ( - con->cable_prop.flags); + desc.active = !!(UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE & cable_prop.flags); + + if (con->ucsi->version >= UCSI_VERSION_2_1) + desc.pd_revision =UCSI_CABLE_PROP_FLAG_PD_MAJOR_REV_AS_BCD (cable_prop.flags); cable =typec_register_cable (con->port, &desc);if (IS_ERR (cable)) {@@@ -1094,8 -1009,10 +1041,9 @@@ static int ucsi_register_partner(strucif (pwr_opmode ==UCSI_CONSTAT_PWR_OPMODE_PD )ucsi_register_device_pdos (con); - desc.identity = &con->partner_identity; +if (con->ucsi->cap.features &UCSI_CAP_GET_PD_MESSAGE ) + desc.identity = &con->partner_identity; desc.usb_pd = pwr_opmode ==UCSI_CONSTAT_PWR_OPMODE_PD ; - desc.pd_revision =UCSI_CONCAP_FLAG_PARTNER_PD_MAJOR_REV_AS_BCD (con->cap.flags);
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
partner = typec_register_partner(con->port, &desc); if (IS_ERR(partner)) {Heikki, does this resolution look correct? I knew there would be a conflict, just want to make sure we get it right.
It's correct.
Great, I've made this merge resolution in my tree now as well.
thanks,
greg k-h