Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH resend] extcon: Fix attached value returned by is_extcon_changed
       [not found] <1442752494-22244-1-git-send-email-hdegoede@redhat.com>
@ 2015-09-20 12:34 ` Hans de Goede
  2015-09-21  1:36   ` Chanwoo Choi
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2015-09-20 12:34 UTC (permalink / raw)
  To: MyungJoo Ham, Chanwoo Choi
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel, Hans de Goede,
	stable

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.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/extcon/extcon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index a07addd..8dd0af1 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -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;
 	}
 
-- 
2.4.3


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

* Re: [PATCH resend] extcon: Fix attached value returned by is_extcon_changed
  2015-09-20 12:34 ` [PATCH resend] extcon: Fix attached value returned by is_extcon_changed Hans de Goede
@ 2015-09-21  1:36   ` Chanwoo Choi
  2015-09-21 11:29     ` Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Chanwoo Choi @ 2015-09-21  1:36 UTC (permalink / raw)
  To: Hans de Goede, MyungJoo Ham
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel, stable

On 2015년 09월 20일 21:34, Hans de Goede wrote:
> 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.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/extcon/extcon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index a07addd..8dd0af1 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -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

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

* Re: [PATCH resend] extcon: Fix attached value returned by is_extcon_changed
  2015-09-21  1:36   ` Chanwoo Choi
@ 2015-09-21 11:29     ` Hans de Goede
  2015-09-22  1:44       ` Chanwoo Choi
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2015-09-21 11:29 UTC (permalink / raw)
  To: Chanwoo Choi, MyungJoo Ham
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel, stable

Hi,

On 21-09-15 03:36, Chanwoo Choi wrote:
> On 2015년 09월 20일 21:34, Hans de Goede wrote:
>> 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.
>>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   drivers/extcon/extcon.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
>> index a07addd..8dd0af1 100644
>> --- a/drivers/extcon/extcon.c
>> +++ b/drivers/extcon/extcon.c
>> @@ -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

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

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

* Re: [PATCH resend] extcon: Fix attached value returned by is_extcon_changed
  2015-09-21 11:29     ` Hans de Goede
@ 2015-09-22  1:44       ` Chanwoo Choi
  2015-09-22  7:12         ` Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Chanwoo Choi @ 2015-09-22  1:44 UTC (permalink / raw)
  To: Hans de Goede, MyungJoo Ham
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel, stable

Hi,

On 2015년 09월 21일 20:29, Hans de Goede wrote:
> Hi,
> 
> On 21-09-15 03:36, Chanwoo Choi wrote:
>> On 2015년 09월 20일 21:34, Hans de Goede wrote:
>>> 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.
>>>
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>> ---
>>>   drivers/extcon/extcon.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
>>> index a07addd..8dd0af1 100644
>>> --- a/drivers/extcon/extcon.c
>>> +++ b/drivers/extcon/extcon.c
>>> @@ -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
> 
> 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






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

* Re: [PATCH resend] extcon: Fix attached value returned by is_extcon_changed
  2015-09-22  1:44       ` Chanwoo Choi
@ 2015-09-22  7:12         ` Hans de Goede
  2015-09-22  7:54           ` Chanwoo Choi
  0 siblings, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2015-09-22  7:12 UTC (permalink / raw)
  To: Chanwoo Choi, MyungJoo Ham
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel, stable

Hi,

On 22-09-15 03:44, Chanwoo Choi wrote:
> Hi,
>
> On 2015년 09월 21일 20:29, Hans de Goede wrote:
>> Hi,
>>
>> On 21-09-15 03:36, Chanwoo Choi wrote:
>>> On 2015년 09월 20일 21:34, Hans de Goede wrote:
>>>> 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.
>>>>
>>>> Cc: stable@vger.kernel.org
>>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>>> ---
>>>>    drivers/extcon/extcon.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
>>>> index a07addd..8dd0af1 100644
>>>> --- a/drivers/extcon/extcon.c
>>>> +++ b/drivers/extcon/extcon.c
>>>> @@ -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
>>
>> 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@vger.kernel.org. When you do you plan to submit a pullreq with this
patch ?

Regards,

Hans

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

* Re: [PATCH resend] extcon: Fix attached value returned by is_extcon_changed
  2015-09-22  7:12         ` Hans de Goede
@ 2015-09-22  7:54           ` Chanwoo Choi
  0 siblings, 0 replies; 6+ messages in thread
From: Chanwoo Choi @ 2015-09-22  7:54 UTC (permalink / raw)
  To: Hans de Goede, MyungJoo Ham
  Cc: Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel, stable

On 2015년 09월 22일 16:12, Hans de Goede wrote:
> Hi,
> 
> On 22-09-15 03:44, Chanwoo Choi wrote:
>> Hi,
>>
>> On 2015년 09월 21일 20:29, Hans de Goede wrote:
>>> Hi,
>>>
>>> On 21-09-15 03:36, Chanwoo Choi wrote:
>>>> On 2015년 09월 20일 21:34, Hans de Goede wrote:
>>>>> 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.
>>>>>
>>>>> Cc: stable@vger.kernel.org
>>>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>>>> ---
>>>>>    drivers/extcon/extcon.c | 2 +-
>>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
>>>>> index a07addd..8dd0af1 100644
>>>>> --- a/drivers/extcon/extcon.c
>>>>> +++ b/drivers/extcon/extcon.c
>>>>> @@ -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
>>>
>>> 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.

> 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.

> be Cc: stable@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

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

end of thread, other threads:[~2015-09-22  7:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1442752494-22244-1-git-send-email-hdegoede@redhat.com>
2015-09-20 12:34 ` [PATCH resend] extcon: Fix attached value returned by is_extcon_changed Hans de Goede
2015-09-21  1:36   ` Chanwoo Choi
2015-09-21 11:29     ` Hans de Goede
2015-09-22  1:44       ` Chanwoo Choi
2015-09-22  7:12         ` Hans de Goede
2015-09-22  7:54           ` Chanwoo Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox