From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ivan T. Ivanov" Subject: Re: [PATCH v2 1/2] extcon: fix hang and extcon_get/set_cable_state(). Date: Tue, 07 Jul 2015 17:04:24 +0300 Message-ID: <1436277864.2190.5.camel@linaro.org> References: <1436194018-18696-2-git-send-email-rogerq@ti.com> <1436274375-10308-1-git-send-email-rogerq@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436274375-10308-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Roger Quadros Cc: cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Greg Kroah-Hartman List-Id: linux-omap@vger.kernel.org On Tue, 2015-07-07 at 16:06 +0300, Roger Quadros wrote: > Users of find_cable_index_by_name() will cause a kernel hang > as the while loop counter is never incremented and end condition > is never reached. > > extcon_get_cable_state() and extcon_set_cable_state() are broken > because they use cable index instead of cable id. This causes > the first cable state (cable.0) to be always invalid in sysfs > or extcon_get_cable_state() users. > > Introduce a new function find_cable_id_by_name() that fixes > both of the above issues. > > Fixes: commit 73b6ecdb93e8 ("extcon: Redefine the unique id of supported external connectors without 'enum extcon' type") > Cc: Greg Kroah-Hartman > Signed-off-by: Roger Quadros > --- Thank you. It is fine now. For both patches. Tested-by: Ivan T. Ivanov -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757468AbbGGOEl (ORCPT ); Tue, 7 Jul 2015 10:04:41 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:33225 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757356AbbGGOE2 (ORCPT ); Tue, 7 Jul 2015 10:04:28 -0400 Message-ID: <1436277864.2190.5.camel@linaro.org> Subject: Re: [PATCH v2 1/2] extcon: fix hang and extcon_get/set_cable_state(). From: "Ivan T. Ivanov" To: Roger Quadros Cc: cw00.choi@samsung.com, linux-omap@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Date: Tue, 07 Jul 2015 17:04:24 +0300 In-Reply-To: <1436274375-10308-1-git-send-email-rogerq@ti.com> References: <1436194018-18696-2-git-send-email-rogerq@ti.com> <1436274375-10308-1-git-send-email-rogerq@ti.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.13.7-fta1.2~trusty Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-07-07 at 16:06 +0300, Roger Quadros wrote: > Users of find_cable_index_by_name() will cause a kernel hang > as the while loop counter is never incremented and end condition > is never reached. > > extcon_get_cable_state() and extcon_set_cable_state() are broken > because they use cable index instead of cable id. This causes > the first cable state (cable.0) to be always invalid in sysfs > or extcon_get_cable_state() users. > > Introduce a new function find_cable_id_by_name() that fixes > both of the above issues. > > Fixes: commit 73b6ecdb93e8 ("extcon: Redefine the unique id of supported external connectors without 'enum extcon' type") > Cc: Greg Kroah-Hartman > Signed-off-by: Roger Quadros > --- Thank you. It is fine now. For both patches. Tested-by: Ivan T. Ivanov