From patchwork Fri Nov 25 06:35:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Zhongjin X-Patchwork-Id: 25850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3807620wrr; Thu, 24 Nov 2022 22:42:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf48+WnyLkrOzuOt7CSr5N2NBKKse19utOGC7QDH960SI8NQqbzUcuv6NDjtxXw63q+cqrT/ X-Received: by 2002:a17:902:8d93:b0:17f:8042:7223 with SMTP id v19-20020a1709028d9300b0017f80427223mr21663550plo.38.1669358529127; Thu, 24 Nov 2022 22:42:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669358529; cv=none; d=google.com; s=arc-20160816; b=zfHD+GPPd2WpYfNqVF2TYOJUVaKGCjM2UipowIXK7Wnf/4scc8EuQgd73cCdhb+Yeu iD9kXnaMeIzqXqCkAggbN7RxSnc0uSTGkTRN1dN7rDzI5TxKn/zy2CkonUMme1NmV8S/ CDF3rZsWAwVhVYfk9dmXhyi94573iRypimCEJTpoil9gMomWuJbj0G7wWOBMGeVggw2d opVKhgGinHRuyJt/Pt91qSP8CQ1QEpyyKyqjFaPk+L8Sr6S+Dff7fFlPbGTzSVwJ9iey vWR8/iz1zaChGJxtq7pgyD0WeDssyKpRzyRGJv4ZiKcw8kNb4sPYhcUq2c3H+Tzna46e e2/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=J+YFnqHDK2ptnrq6AWEsZE5HZS4uO6t2WvUTa4BedKE=; b=AFQQyyJpxxdJxkJ6FVTrC+I6zPgT2ohhPYnR4VvN/amX0VYjfGu0vkFW4OoF+k0HF/ k+pO7SZP9ePn0A9QWu/2shn0cONohuwqksSgtCXIJiEWJ0ZXrQgDe6XEHgwaYRkDWEIo aZRz/q9l1VWVDUBuf30/fztUUpT+CQ0xZLhEszFrBPRu+P3tLRQjKGiX119TUfkPxEbE rTsRONXUGzeQq4NxtSX23DT1dmZx5oYhB3Z+82RKBP/ics8b3Rb3a4ooJfJi4Pf5quVB o+jVvAH6rZ5amwkwF758wQxClIB4a+x4kehbrpwllPqu4mB31WO/CxKzSrOGqCvg6nK6 ip9A== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n27-20020aa7985b000000b005612b15a927si2797745pfq.181.2022.11.24.22.41.56; Thu, 24 Nov 2022 22:42:09 -0800 (PST) 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbiKYGis (ORCPT + 99 others); Fri, 25 Nov 2022 01:38:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbiKYGir (ORCPT ); Fri, 25 Nov 2022 01:38:47 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29D6B193FC for ; Thu, 24 Nov 2022 22:38:47 -0800 (PST) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NJQ881gZBzqSf5; Fri, 25 Nov 2022 14:34:48 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 14:38:45 +0800 Received: from ubuntu1804.huawei.com (10.67.175.36) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 14:38:45 +0800 From: Chen Zhongjin To: CC: , , , , Subject: [PATCH] driver core: Fix test_async_probe_init saves device in wrong array Date: Fri, 25 Nov 2022 14:35:41 +0800 Message-ID: <20221125063541.241328-1-chenzhongjin@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.175.36] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750449289033907488?= X-GMAIL-MSGID: =?utf-8?q?1750449289033907488?= In test_async_probe_init, second set of asynchronous devices are saved in sync_dev[sync_id], which should be async_dev[async_id]. This makes these devices not unregistered when exit. > modprobe test_async_driver_probe && \ > modprobe -r test_async_driver_probe && \ > modprobe test_async_driver_probe ... > sysfs: cannot create duplicate filename '/devices/platform/test_async_driver.4' > kobject_add_internal failed for test_async_driver.4 with -EEXIST, don't try to register things with the same name in the same directory. Fixes: 57ea974fb871 ("driver core: Rewrite test_async_driver_probe to cover serialization and NUMA affinity") Signed-off-by: Chen Zhongjin --- drivers/base/test/test_async_driver_probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/test/test_async_driver_probe.c b/drivers/base/test/test_async_driver_probe.c index 4d1976ca5072..929410d0dd6f 100644 --- a/drivers/base/test/test_async_driver_probe.c +++ b/drivers/base/test/test_async_driver_probe.c @@ -145,7 +145,7 @@ static int __init test_async_probe_init(void) calltime = ktime_get(); for_each_online_cpu(cpu) { nid = cpu_to_node(cpu); - pdev = &sync_dev[sync_id]; + pdev = &async_dev[async_id]; *pdev = test_platform_device_register_node("test_async_driver", async_id,