extcon: Fix attached value returned by is_extcon_changed
Subsystems (2)
PATCH RESEND 1/1 extcon: Fix attached value returned by is_extcon_changed
Hi MyungJoo,
Here is a resend of a bug-fix I send a while back, you said you would merge this for v4.3-rc1, but I'm not seeing it there.
Can you please get this merged into 4.3, without this fix the sunxi usb otg controller support which got merged in 4.3 will not work properly.
Regards,
Hans
PATCH RESEND 1/1 extcon: Fix attached value returned by is_extcon_changed
is_extcon_changed should only check the idx-th bit of new, not the entirety of new when setting attached.
This fixes extcon sending notifications that a cable was inserted when it gets removed while another cable is still connected.
--- drivers/extcon/extcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon.c +1 -1
@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)static bool is_extcon_changed (u32 prev,u32 new,int idx,bool *attached) {if (((prev >> idx) &0x1 ) != ((new >> idx) &0x1 )) { - *attached = new ? true : false; + *attached = ((new >> idx) &0x1 ) ? true : false;return true; }
Signature · 1 line
2.4.3
Chanwoo Choi
maintainerPATCH RESEND 1/1 extcon: Fix attached value returned by is_extcon_changed
Quoted 18 lines · Hans de Goede
is_extcon_changedshould only check the idx-th bit of new, not the entirety of new when setting attached.This fixes extcon sending notifications that a cable was inserted when it gets removed while another cable is still connected.
Cc stable at vger.kernel.orgSigned-off-by Hans de Goede <[email protected]>--- drivers/extcon/extcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/extcon/extcon.c +0
-0
drivers/extcon/extcon.c static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) · line 165
Quoted 8 lines
drivers/extcon/extcon.c +1
-1@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)static bool is_extcon_changed (u32 prev,u32 new,int idx,bool *attached) {if (((prev >> idx) &0x1 ) != ((new >> idx) &0x1 )) { - *attached = new ? true : false; + *attached = ((new >> idx) &0x1 ) ? true : false;return true; }
This patch was already applied[1].
[1] https://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/log/?h=extcon-next
Thanks,
Chanwoo Choi
PATCH RESEND 1/1 extcon: Fix attached value returned by is_extcon_changed
Hi,
Quoted 22 lines · Chanwoo Choi
Quoted 21 lines · Hans de Goede
is_extcon_changedshould only check the idx-th bit of new, not the entirety of new when setting attached.This fixes extcon sending notifications that a cable was inserted when it gets removed while another cable is still connected.
Cc stable at vger.kernel.orgSigned-off-by Hans de Goede <[email protected]>--- drivers/extcon/extcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/extcon/extcon.c +0
-1@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)static bool is_extcon_changed (u32 prev,u32 new,int idx,bool *attached) {if (((prev >> idx) &0x1 ) != ((new >> idx) &0x1 )) { - *attached = new ? true : false;
Quoted 8 lines
drivers/extcon/extcon.c static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) · line 165
Quoted 5 lines
drivers/extcon/extcon.c +1
-0+ *attached = ((new >> idx) &0x1 ) ? true : false;return true; }This patch was already applied[1].
[1] https://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/log/?h=extcon-next
Yet it is not in 4.3-rc1, applying the patch to your tree is not useful unless you also send a pull-req to get the changes in your tree actually merged ...
Regards,
Hans
Chanwoo Choi
maintainerPATCH RESEND 1/1 extcon: Fix attached value returned by is_extcon_changed
Hi,
Quoted 34 lines · Hans de Goede
Hi,
Quoted 22 lines · Chanwoo Choi
Quoted 21 lines · Hans de Goede
is_extcon_changedshould only check the idx-th bit of new, not the entirety of new when setting attached.This fixes extcon sending notifications that a cable was inserted when it gets removed while another cable is still connected.
Cc stable at vger.kernel.orgSigned-off-by Hans de Goede <[email protected]>--- drivers/extcon/extcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/extcon/extcon.c +0
-1@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)static bool is_extcon_changed (u32 prev,u32 new,int idx,bool *attached) {if (((prev >> idx) &0x1 ) != ((new >> idx) &0x1 )) { - *attached = new ? true : false;Quoted 8 lines
drivers/extcon/extcon.c static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) · line 165
Quoted 5 lines
drivers/extcon/extcon.c +1
-0+ *attached = ((new >> idx) &0x1 ) ? true : false;return true; }This patch was already applied[1].
[1] https://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/log/?h=extcon-next
Quoted 3 lines
Yet it is not in 4.3-rc1, applying the patch to your tree is not useful unless you also send a pull-req to get the changes in your tree actually merged ...
No. It is useful step. It is first step to send pull-request for including the main tree. I'll send pull-request before releasing official version.
Thanks,
Chanwoo Choi
PATCH RESEND 1/1 extcon: Fix attached value returned by is_extcon_changed
Hi,
Quoted 37 lines · Chanwoo Choi
Hi,
Quoted 34 lines · Hans de Goede
Hi,
Quoted 30 lines · Chanwoo Choi
Quoted 18 lines · Hans de Goede
is_extcon_changedshould only check the idx-th bit of new, not the entirety of new when setting attached.This fixes extcon sending notifications that a cable was inserted when it gets removed while another cable is still connected.
Cc stable at vger.kernel.orgSigned-off-by Hans de Goede <[email protected]>--- drivers/extcon/extcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/extcon/extcon.c +0
-0drivers/extcon/extcon.c static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) · line 165
Quoted 8 lines
drivers/extcon/extcon.c +1
-1@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)static bool is_extcon_changed (u32 prev,u32 new,int idx,bool *attached) {if (((prev >> idx) &0x1 ) != ((new >> idx) &0x1 )) { - *attached = new ? true : false; + *attached = ((new >> idx) &0x1 ) ? true : false;return true; }This patch was already applied[1].
[1] https://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/log/?h=extcon-next
Quoted 6 lines
Quoted 3 lines
Yet it is not in 4.3-rc1, applying the patch to your tree is not useful unless you also send a pull-req to get the changes in your tree actually merged ...
No. It is useful step. It is first step to send pull-request for including the main tree. I'll send pull-request before releasing official version.
This patch fixes a bug in the extcon core, thus affecting ALL extcon users, the patch is trivial, so IMHO this patch should have been part of a pull-req already, adn should be Cc: stable at vger.kernel.org. When you do you plan to submit a pullreq with this patch ?
Regards,
Hans
Chanwoo Choi
maintainerPATCH RESEND 1/1 extcon: Fix attached value returned by is_extcon_changed
Quoted 40 lines · Hans de Goede
Hi,
Quoted 37 lines · Chanwoo Choi
Hi,
Quoted 34 lines · Hans de Goede
Hi,
Quoted 30 lines · Chanwoo Choi
Quoted 18 lines · Hans de Goede
is_extcon_changedshould only check the idx-th bit of new, not the entirety of new when setting attached.This fixes extcon sending notifications that a cable was inserted when it gets removed while another cable is still connected.
Cc stable at vger.kernel.orgSigned-off-by Hans de Goede <[email protected]>--- drivers/extcon/extcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/extcon/extcon.c +0
-0drivers/extcon/extcon.c static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) · line 165
Quoted 8 lines
drivers/extcon/extcon.c +1
-1@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)static bool is_extcon_changed (u32 prev,u32 new,int idx,bool *attached) {if (((prev >> idx) &0x1 ) != ((new >> idx) &0x1 )) { - *attached = new ? true : false; + *attached = ((new >> idx) &0x1 ) ? true : false;return true; }This patch was already applied[1].
[1] https://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/log/?h=extcon-next
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Yet it is not in 4.3-rc1, applying the patch to your tree is not useful unless you also send a pull-req to get the changes in your tree actually merged ...
No. It is useful step. It is first step to send pull-request for including the main tree. I'll send pull-request before releasing official version.
This patch fixes a bug in the extcon core, thus affecting ALL extcon users, the patch
I know.
Quoted 1 line
is trivial, so IMHO this patch should have been part of a pull-req already, adn should
I'll send pull-request to include this patch on rc release. But it is not fixed that should be included in rc1. Don't worry about this patch that is included in rcX version.
Quoted 2 lines
be Cc: stable at vger.kernel.org. When you do you plan to submit a pullreq with this patch ?
I'll send fixes pull-request wihtin this week for including it in rc3.
Thanks,
Chanwoo Choi