Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp316916iob; Wed, 18 May 2022 02:54:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY+X//hBBqbOkeQvAzLd5sqygH9+VBuaAtCMDUdrLimDmK6bpk2njOq3qsuN+64/I+1hqb X-Received: by 2002:a63:8ac7:0:b0:3aa:fa62:5a28 with SMTP id y190-20020a638ac7000000b003aafa625a28mr23174941pgd.400.1652867640550; Wed, 18 May 2022 02:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652867640; cv=none; d=google.com; s=arc-20160816; b=khxM7z5ivAcij4tee2j+0JJ0U3TBKTjB2p4PnY8QRwKtOEf6LywEcZLNggDpQg3Y6M ylEFdeoNXLNT+Zhj9szsFFauhyYCBxu0LdonxfghXuRUqKdhXh/Oix0hNW/AvHbz8Kci qnWALXQtrTheZqeOTbOFvIjbcYacB9X7nYcWUMZdYicaVL35CjFJo12nIxd6B/ZuapNQ XNZGwfECwZ/eVyrfuF25h9GiEuLHZw+iVxDHIKH0M58L51IkoAkH5jw3pGo7Cfzvjoa5 RBpxoKYVKdGqu+2XvicorSvMdaiA74liEm48Br017fHaHYCVySUc4kpGToVAWq1F2jFv 0diw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xt6cx7jfdtIzxFo8xURtsGgmnzna5Y1WbrzL+0I9i88=; b=FBRG40omplHAaPad/Q7tEe/ZXXor8LHxubTxRWGli4v+Dfs5BcWM7bVz/GQEwheqvD /64kGKn/ZX/n+Y+Vb7BQWbU/7iE5m7qTQvSJqWRsoAQcOJFOwz0XgaFpPyS7jtS+/lWs x2WhTpFIyWgIFl1C09671Qv1WNLhzsrsjxLU3JG+5AwDO8I5PIjGJkCxYpi/XrlRTlgc vAZbErYOGeDJaxKDIBf88rZgCKWk7NmLUBNqBMlBOiTfwGeroEv3mglE/3RPpjVz17ZZ YDsEtUAAL6My2D/z41DMiNBg6Xnc2WKdarVDGWpqk64WUNi5LNYnh8kSUYVyXkHaBES8 BEyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WdPPOTLZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mh7-20020a17090b4ac700b001df7567a52fsi7394280pjb.107.2022.05.18.02.54.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 02:54:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WdPPOTLZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 63F7514AA6D; Wed, 18 May 2022 02:40:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234557AbiERJjg (ORCPT + 99 others); Wed, 18 May 2022 05:39:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234556AbiERJjc (ORCPT ); Wed, 18 May 2022 05:39:32 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E86D12B004 for ; Wed, 18 May 2022 02:39:30 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id d15so2610103lfk.5 for ; Wed, 18 May 2022 02:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=xt6cx7jfdtIzxFo8xURtsGgmnzna5Y1WbrzL+0I9i88=; b=WdPPOTLZEmP6fLpXhxUCY+FLR0re9MImuXhfUpZuwAp6zbSPxLr9o/TgQAipysxVbr erLdjvEzsUZ2JUNRQl7E2cFyxpMdNeKAlMNN/NckLhBlbhuDZUb4SIhoCEAYu74RBLNB M7S6+ykzn5Zru4xrCcZEv60+FqmjKlBKlvA93LKNGsTXJs5KFUvlnW+Z5Tgt4xY+gpIw xbH8qUlPxCLx852Z//f6lt6CsxAfmJ/3eunpiX+H7KOOKs3kKwG6EfdVuu9ErPAxOiEQ 8tnnjBpyyZRTj2LWqjVtUn3WdNqn1gDa/JDI/OtKR4DfFT0mHaclzxv8gO31H+v9m0Iv ICYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=xt6cx7jfdtIzxFo8xURtsGgmnzna5Y1WbrzL+0I9i88=; b=eQk8v91nH5NoipPM9xFOL9+y4w8vbXrWyTWhSvP/lEcwlyRK9uWjQ5thx5j5CE/akw +5iHEIaQx8n3tglnPxSbc2WhN82zyOLnY4qIixe+Z1FEmBkTWHCkmlhR3D9R1wUOKFCO mNGAfM3pAEXMkU+RSYLMF+BRgCDpGI5VPya31YuJvV1diu6YasLjc4wgfAjTje02Utro SYRYj/x0keMG++mAWRqCU1ZFM4iRcmvG4+cxJUaTe0JiHg3X6aj7CDfc6WUC/EpdO2F2 JJK2oIGYkyc+TzDzIqVekZ8U6DNKpg0zW8bclaKehuk8E7NbbQI1rR9zvzy0HtTvPiSG YJHQ== X-Gm-Message-State: AOAM5312pt1N856r+WpJ54iKSYFXANIH/3ojLlOH2sdH5eBBV0ejxwbb WQ6q4asrtd1t/ij1PRotoAR/PQ== X-Received: by 2002:a05:6512:3a86:b0:472:6287:6994 with SMTP id q6-20020a0565123a8600b0047262876994mr19830525lfu.16.1652866768962; Wed, 18 May 2022 02:39:28 -0700 (PDT) Received: from [192.168.0.17] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id s9-20020a056512214900b0047255d21163sm153402lfr.146.2022.05.18.02.39.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 May 2022 02:39:28 -0700 (PDT) Message-ID: Date: Wed, 18 May 2022 11:39:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH net v2] NFC: hci: fix sleep in atomic context bugs in nfc_hci_hcp_message_tx Content-Language: en-US To: duoming@zju.edu.cn Cc: linux-kernel@vger.kernel.org, kuba@kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, gregkh@linuxfoundation.org, alexander.deucher@amd.com, broonie@kernel.org, netdev@vger.kernel.org References: <20220517105526.114421-1-duoming@zju.edu.cn> <2ce7a871-3e55-ae50-955c-bf04a443aba3@linaro.org> <71c24f38.1a1f4.180d29ff1fd.Coremail.duoming@zju.edu.cn> <68ccef70-ef30-8f53-6ec5-17ce5815089c@linaro.org> <454a29ba.1b9b1.180d576985b.Coremail.duoming@zju.edu.cn> From: Krzysztof Kozlowski In-Reply-To: <454a29ba.1b9b1.180d576985b.Coremail.duoming@zju.edu.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/05/2022 06:39, duoming@zju.edu.cn wrote: >> There is. >> >> nfc_hci_failure -> spin lock -> nfc_driver_failure -> nfc_targets_found >> -> device_lock >> >> I found it just by a very quick look, so I suspect there are several >> other places, not really checked. > > I agree with you, the spin_lock is not a good solution to this problem. There is another solution: > > We could put the nfc_hci_send_event() of st21nfca_se_wt_timeout() in a work item, then, using > schedule_work() in st21nfca_se_wt_timeout() to execute the work item. The schedule_work() will > wake up another kernel thread which is in process context to execute the bottom half of the interrupt, > so it allows sleep. > > The following is the details. Yes, this seems good solution. You might also need to add cancel_work_sync to all places removing the timer. Best regards, Krzysztof