Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp522895iob; Thu, 28 Apr 2022 07:28:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbKNPWK9Vp4ns3RxLSaEnLLN6oDd6BZZUvb192FHnC1bEvpmIDRMxprye/PTY7Czz20Uvl X-Received: by 2002:a2e:9d46:0:b0:24c:7f1d:73cc with SMTP id y6-20020a2e9d46000000b0024c7f1d73ccmr21846513ljj.358.1651156114424; Thu, 28 Apr 2022 07:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651156114; cv=none; d=google.com; s=arc-20160816; b=sqgOU9T//6h8ADYthN9l9w4kox2zwZnGNHDpHNU1yPN94kX6kzgcF9ODbLC7qIV5uv O0wHmqyitIzFqMuCV4/M8D1VFphc5a2nvg3e2wRLURwbYPyqebMzLOnHfkdtswoLWosl N+63LRpf+dM5DnE14DVPdaqxu7SNy59Z3A1W+p+p4ax44cuxPu6px9S0bTMTem6G/oei foEvxqZ0GayZiqmJi7PlrS9xMUq/kBMWlsQm3LWYTylTOxFoVrESoXxwgVOe9JwuG7U7 LYtMF4m7qcBynq0CHO08DiRiZdO/XOY6D6RfNTlVHf+3Ji7pjllWjz/Z7EwM990feJfw ammQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:references:in-reply-to:subject:cc:to:from :date; bh=KRlvKEdzv0Ly+bzpLTcfroJcxsrJ6xRID1CHqVrAfsY=; b=ULK6wTcdO7MM3GP7UdAbHV0WRtcn/A45z6eqqvoIuV9YXw3j5tXo6wstC1E3+rbqB4 uInuUygmJr5gVJQL3TB1jz3g0LWMy5zztizanKUGM4IPzzTk7qSA93iUew9JR5GlwnuM hrLmpf48dUZPIcp2o/Rq5OieXUEI9ptdtLlFz54JGgMIRNI5Ng9PxrdbdOCVMw+DAQn4 ABa+qN42ERulRAt9nl37TSRn2ZmaJx7CdaspId0Uc7awUW/Liyri7RUFKDA+uBjri899 Yzu1JQeSQbzDimhxrLLDXX2IGXXfyrk82dsW2F/Twch5XONHAMGY0K+NmQu8K5T7ov9s E1ng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s8-20020a056512214800b0046ba99878e0si4226411lfr.325.2022.04.28.07.27.41; Thu, 28 Apr 2022 07:28:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244961AbiD1HSe (ORCPT + 99 others); Thu, 28 Apr 2022 03:18:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244936AbiD1HSb (ORCPT ); Thu, 28 Apr 2022 03:18:31 -0400 Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E42C972B2; Thu, 28 Apr 2022 00:15:15 -0700 (PDT) Received: by ajax-webmail-mail-app2 (Coremail) ; Thu, 28 Apr 2022 15:15:02 +0800 (GMT+08:00) X-Originating-IP: [10.181.234.41] Date: Thu, 28 Apr 2022 15:15:02 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: "Lin Ma" To: "Jakub Kicinski" Cc: "Duoming Zhou" , krzysztof.kozlowski@linaro.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, davem@davemloft.net, gregkh@linuxfoundation.org, alexander.deucher@amd.com, akpm@linux-foundation.org, broonie@kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net v4] nfc: ... device_is_registered() is data race-able X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT5.0.13 build 20210104(ab8c30b6) Copyright (c) 2002-2022 www.mailtech.cn zju.edu.cn In-Reply-To: <20220427174548.2ae53b84@kernel.org> References: <20220427011438.110582-1-duoming@zju.edu.cn> <20220427174548.2ae53b84@kernel.org> Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=UTF-8 MIME-Version: 1.0 Message-ID: <38929d91.237b.1806f05f467.Coremail.linma@zju.edu.cn> X-Coremail-Locale: en_US X-CM-TRANSID: by_KCgC3pcX3PmpioM+tAg--.58464W X-CM-SenderInfo: qtrwiiyqvtljo62m3hxhgxhubq/1tbiAwUOElNG3GhBaQAAsT X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham 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 SGVsbG8gSmFrdWIsCgphbmQgaGVsbG8gdGhlcmUgbWFpbnRhaW5lcnMsIHdoZW4gd2UgdHJpZWQg dG8gZml4IHRoaXMgcmFjZSBwcm9ibGVtLCB3ZSBmb3VuZCBhbm90aGVyIHZlcnkgd2VpcmQgaXNz dWUgYXMgYmVsb3cKCj4gCj4gWW91IGNhbid0IHVzZSBhIHNpbmdsZSBnbG9iYWwgdmFyaWFibGUs IHRoZXJlIGNhbiBiZSBtYW55IGRldmljZXMgCj4gZWFjaCB3aXRoIHRo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