Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2629082pxj; Mon, 10 May 2021 07:20:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLHgKdf9zBZqkiptWqLTAfTp5fbSyHs5fGR7I4mrpIGB8m0ySZyDKv7d2GaSJ83LNxSKlM X-Received: by 2002:a92:280b:: with SMTP id l11mr21554467ilf.111.1620656455515; Mon, 10 May 2021 07:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620656453; cv=none; d=google.com; s=arc-20160816; b=XPrg+x/23nENdD/0bOcJK65NSPkz+PRRVcoNyVYgyvpXEbv2WPHCtlhDC7YqGcdIFz J0reDg3UoK1Xu9qSZ+Lo4hy3QKXBZXKLM7EFCcxF3wLobmaXB2Vn3IFC7Grbt4saITw7 5Au9KSF0ohV/+qhgHnsnVqozWlc3VK+/YGIJJXZTHTC4hx0Fbe+h/zUP9/FegDbMaXHF WS7mZ8b7nAxVEI4ZIcWKNto5bqSBSAulxOUa2e8mf6DqWqPbmiONeBDsTdtf2oywGqDC FQoI728L+jbt7EUWJDCHR4KMCQGPZ5JTNhmrLVcRo1/KZ5CvZ698Wn938MkGV94gBTU4 zSsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ukmd8wC6iLxp/7DPQoRcUbb6TtLzWN0oan/ZP7duPk4=; b=RTLnWWRaPugq2hANdtm6Va6LtHgar/CEthA9OEBfbzqTNoTsICDSI6aRjkeoBn6rOF 3FlJ3AIjwKqFL5kgoYK59qJ+toweukq2xrhIouEDArunlmRhVz3Frwe63OYwkurXbi94 CHvqO64dlNsNK5Rc4ghx7f5BosLOFx+v+qDLzbQwhNqJNOCPg+umduq+m6uJWqE3jJ/F p97gbOAa+Y9/pm6YlkDWiUjrmFerKPadrF3HHG1JbGTi5++jwRCYZPXovtK1vC9rUWj1 QGvM6BsY2cWrbEKfnXFuZXfxED5e+nRcgTSGtBtQuStjyGrevFJrdLGEHwfHRoCDrEu8 0iIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si18523982jas.106.2021.05.10.07.20.41; Mon, 10 May 2021 07:20:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236415AbhEJOUi (ORCPT + 99 others); Mon, 10 May 2021 10:20:38 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:46547 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233786AbhEJORu (ORCPT ); Mon, 10 May 2021 10:17:50 -0400 Received: from mail-qk1-f198.google.com ([209.85.222.198]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lg6iC-0004R3-TU for linux-kernel@vger.kernel.org; Mon, 10 May 2021 14:16:44 +0000 Received: by mail-qk1-f198.google.com with SMTP id d201-20020ae9efd20000b02902e9e9d8d9dcso11725015qkg.10 for ; Mon, 10 May 2021 07:16:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ukmd8wC6iLxp/7DPQoRcUbb6TtLzWN0oan/ZP7duPk4=; b=B4GWIJbsLF3N411r+0XjTKCxYz4R6ZnMp+CvjmBblkie6HPXsRydPYv18DhaEH3lXM PoipY2FDzeFJrmb20XnsOKciGicx17UiibrTLH1tNVLJiqzhxGAHI9qVZY4DawS6dHfE ekHa7sxGcG0YiiTqsK+JgmO3sBIuisVSoZayXivURgFRSkVvH7lahkOgVckxe1SNeQ3p yZLU6rbPCuLZlQTTEYZ/HMBr74Z3NuH984jOr06aIqe3qsRaWAFmthj2FtxLTlmWodif PCbwUByq2A25MdMo/DMirJ+UdtK99Q23GmLgfvpxmlCv3pM7vkeCqNlAg+mUGty//vTM 4w4g== X-Gm-Message-State: AOAM531D2uZjtZBOBPuD68/q2sjDfzPC8ib0z+PkwnJQAcXj93q+laAX axddHivcL3c47PUZNqel2lKEbTdUCelEaWgaGy4y/oUbHUfbaubXyBChOzKro9C98vXFUeCzq3x TVt9KjoI+Ux/nbCV9cSQGzfbSs+y5xAnBBEzqR1a02A== X-Received: by 2002:ac8:c83:: with SMTP id n3mr23504101qti.236.1620656203837; Mon, 10 May 2021 07:16:43 -0700 (PDT) X-Received: by 2002:ac8:c83:: with SMTP id n3mr23504079qti.236.1620656203675; Mon, 10 May 2021 07:16:43 -0700 (PDT) Received: from [192.168.1.4] ([45.237.49.2]) by smtp.gmail.com with ESMTPSA id a26sm12582883qtg.60.2021.05.10.07.16.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 May 2021 07:16:42 -0700 (PDT) Subject: Re: [PATCH 3/4] extcon: extcon-max77693.c: Fix potential work-queue cancellation race To: Matti Vaittinen , Matti Vaittinen Cc: Chanwoo Choi , Bartlomiej Zolnierkiewicz , MyungJoo Ham , Hans de Goede , Marek Szyprowski , linux-kernel@vger.kernel.org References: From: Krzysztof Kozlowski Message-ID: Date: Mon, 10 May 2021 10:16:31 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/05/2021 04:12, Matti Vaittinen wrote: > The extcon IRQ schedules a work item. IRQ is requested using devm while > WQ is cancelld at remove(). This mixing of devm and manual unwinding has > potential case where the WQ has been emptied (.remove() was ran) but > devm unwinding of IRQ was not yet done. It may be possible the IRQ is > triggered at this point scheduling new work item to the already flushed > queue. > > According to the input documentation the input device allocated by > devm_input_allocate_device() does not need to be explicitly unregistered. > Use the new devm_work_autocancel() and remove the remove() to simplify the > code. > > Signed-off-by: Matti Vaittinen > --- > > Please note that the change is compile-tested only. All proper testing is > highly appreciated. > --- > drivers/extcon/extcon-max77693.c | 17 +++++------------ > 1 file changed, 5 insertions(+), 12 deletions(-) > Seems correct: Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof