From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751640AbdAYJlD (ORCPT ); Wed, 25 Jan 2017 04:41:03 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:53954 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbdAYJlB (ORCPT ); Wed, 25 Jan 2017 04:41:01 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com Date: Wed, 25 Jan 2017 09:41:55 +0000 From: Charles Keepax To: Chanwoo Choi CC: , , Subject: Re: [PATCH v2] extcon: arizona: Wait for any running HPDETs to complete on jack removal Message-ID: <20170125094155.GC1754@localhost.localdomain> References: <1485336846-6440-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> <58887151.3050503@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <58887151.3050503@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701250095 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 25, 2017 at 06:35:13PM +0900, Chanwoo Choi wrote: > On 2017년 01월 25일 18:34, Charles Keepax wrote: > > As the HPDET can't be aborted mid way through we should not allow any new > > insertion to be processed until the previous HPDET has finished. It is very > > unlikely but with low enough debounce settings you could start a new HPDET > > before the old one has completed, which results in an erroneous reading. > > > > Signed-off-by: Charles Keepax > > --- > > + /* > > + * If the jack was removed during a headphone detection we > > + * need to wait for the headphone detection to finish, as > > + * it can not be aborted. We don't want to be able to start > > + * a new headphone detection from a fresh insert until this > > + * one is finished. > > + */ > > + arizona_hpdet_wait(info); > > If there is no necessary to handle the error return value, > I recommend that you better to use the dev_warn() instead of dev_err(). > > dev_warn(arizona->dev, "HPDET did not appear to complete\n"); > > > How about changing the debug level with dev_warn()? > Yeah can do. Thanks, Charles