From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D17D4C433B4 for ; Mon, 10 May 2021 14:19:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A46FB61490 for ; Mon, 10 May 2021 14:19:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235889AbhEJOUv (ORCPT ); Mon, 10 May 2021 10:20:51 -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-Google-Smtp-Source: ABdhPJwQeo0X1p3WiWb5qrb2jIVaXtKJGusaDV3N4JyOja6HHUNTyj9kaEL6pc4uflhq+3ssxbwb0g== 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