Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3123135rdb; Wed, 13 Sep 2023 02:48:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMyTpnWS2wzzKJK396xitGMWRrlrWoLZAEbDKpD1ezP6Do+HYFTgEwXI2JC7gHST3fJTqV X-Received: by 2002:a05:6808:203:b0:3a7:7d4:4f91 with SMTP id l3-20020a056808020300b003a707d44f91mr2220681oie.14.1694598538570; Wed, 13 Sep 2023 02:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694598538; cv=none; d=google.com; s=arc-20160816; b=VMWieoeo8eCmalSzYlp5jN83yV250boAGIARiDGjdWzg0JuXW/U9HjV5Be38pGZDKB V38zQCvzseN4WSxFoG8IyqLt3COdHodrPS3SzNVvgSaaXASSzU97MgqpSiFGxkqRp3Dr WTFiRRP7VGUpo3/+kxzgS4k9oDBCgJ6jOej93zVPt6+HtMMCj6ezRboNTTNLLkhvS2ZE OvrA991ZqTpQLKe9nO1a/aw9qnJ7FpjfCl7vtlJVNa6ShkMunE3UiOHHvPFoEiHCEXk4 wCH1jPUkJcs5pOcGhVg00wQaaHe2qhJAFyKxfNhn/giMDDIlBRkJ/aBLnR+SPZsxKDZ3 P2pg== 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:references :in-reply-to:subject:to:dkim-signature:dkim-signature:from; bh=tQEwfUkV8H19i9zBZle+8XE3Io4n8Wakgi4pw+rr94s=; fh=lCg74wyb25OR2p+DoAu+eQkoBa3+1YK9gYfm3ZKy+ZA=; b=hZbo0l4tI6NOh2HxSfJj6DcZ7uII6HqdOpbv2gBYlA02VgPMMqWdVkqBZlyxu2QibN uSE9/nxOwzsroT7312P7ok5k2EBhQeWm+OHEzcmPa4GKNsx+cksE9TlRuOF+GozqUCzk 21Q9uD96XUiHJQHEy1i6pe3Y++iU+/JOD2luZ4qwm9RkAriN5jCy95o7wCoTOP/v9zep X5+hibXulbP+Z8BpszTmqSscAIaslUWJRIeB5OoXxHmrhYGQLv1tKj4Led5V8vbdZUUB wvEMNLgSXcAvstsYqDGPHZ0Kag8wOxVt1K81XZ23NK95HRxCimXxE7iRc2LcJrs9xyGZ jhuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cfMaOQ6r; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=8uagnMXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id v23-20020a634817000000b00565bcc15ee2si9695739pga.815.2023.09.13.02.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 02:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cfMaOQ6r; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=8uagnMXn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 1FFFA8244C8D; Wed, 13 Sep 2023 02:48:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239460AbjIMJsz (ORCPT + 99 others); Wed, 13 Sep 2023 05:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239396AbjIMJsy (ORCPT ); Wed, 13 Sep 2023 05:48:54 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A700199D for ; Wed, 13 Sep 2023 02:48:50 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694598521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tQEwfUkV8H19i9zBZle+8XE3Io4n8Wakgi4pw+rr94s=; b=cfMaOQ6rQZAD2Zc4V2zUNZHFXIgLD5qG6gKy+n0PsD+3BnxmYeRsFnxmEDQZ2o8IHYqcVm IBNtCxYoabCJIRLKUlucfIz8LPDjJRs8JZMFTTEiCzezDppDQxEgPEZ4LqGGL+sbuag9S3 VeGNkRyGBZzyteKxlR2xBpcSbsn4m1VYOD5EvrUG9H02HxIvLTu2U6b3uvymslwONJbhRn IdRJSniOC1if1uR/4tf25DrP36U5xIrNusDQnqs+rprUaa8gfu8jupmjC9mLLdgMm9jGN6 cSAGO+fPdGIad0ykCLnXPEdYtdPJbu1AZNaoq1bQ/vzej2sQw7XedNMD1/U6hA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694598521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tQEwfUkV8H19i9zBZle+8XE3Io4n8Wakgi4pw+rr94s=; b=8uagnMXnIBVrl6gPJF8zV32bJI6rtXhJcw2+1XovNqnxhAxxbK4SkN6o8GHntBn8Bn0ExM iaAESFgbAl7PikCA== To: Takashi Sakamoto , linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] firewire: core: obsolete usage of GFP_ATOMIC at building node tree In-Reply-To: <20230604070255.172700-1-o-takashi@sakamocchi.jp> References: <20230604070255.172700-1-o-takashi@sakamocchi.jp> Date: Wed, 13 Sep 2023 11:54:39 +0206 Message-ID: <87jzsuv1xk.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 02:48:55 -0700 (PDT) X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email On 2023-06-04, Takashi Sakamoto wrote: > The flag of GFP_ATOMIC is given to the call of kmalloc when building node > tree, but the call is not atomic context. The call of > fw_core_handle_bus_reset() and fw_core_remove_card() builds the tree, > while they are done in specific workqueue or pci remove callback. The comment is incorrect about not being in atomic context. fw_core_handle_bus_reset() calls build_tree() with the card->lock spinlock held. With 6.6-rc1 I see: [ 12.555784] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306 [ 12.555808] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 70, name: kworker/1:2 [ 12.555814] preempt_count: 1, expected: 0 [ 12.555820] INFO: lockdep is turned off. [ 12.555824] irq event stamp: 208 [ 12.555828] hardirqs last enabled at (207): [] ._raw_spin_unlock_irq+0x44/0x80 [ 12.555850] hardirqs last disabled at (208): [] .__schedule+0x854/0xfe0 [ 12.555859] softirqs last enabled at (188): [] .addrconf_verify_rtnl+0x2c4/0xb70 [ 12.555872] softirqs last disabled at (182): [] .addrconf_verify_rtnl+0x70/0xb70 [ 12.555884] CPU: 1 PID: 70 Comm: kworker/1:2 Tainted: G S 6.6.0-rc1 #1 [ 12.555893] Hardware name: PowerMac7,2 PPC970 0x390202 PowerMac [ 12.555898] Workqueue: firewire_ohci .bus_reset_work [firewire_ohci] [ 12.555939] Call Trace: [ 12.555944] [c000000009677830] [c0000000010d83c0] .dump_stack_lvl+0x8c/0xd0 (unreliable) [ 12.555963] [c0000000096778b0] [c000000000140270] .__might_resched+0x320/0x340 [ 12.555978] [c000000009677940] [c000000000497600] .__kmem_cache_alloc_node+0x390/0x460 [ 12.555993] [c000000009677a10] [c0000000003fe620] .__kmalloc+0x70/0x310 [ 12.556007] [c000000009677ac0] [c0003d00004e2268] .fw_core_handle_bus_reset+0x2c8/0xba0 [firewire_core] [ 12.556060] [c000000009677c20] [c0003d0000491190] .bus_reset_work+0x330/0x9b0 [firewire_ohci] [ 12.556079] [c000000009677d10] [c00000000011d0d0] .process_one_work+0x280/0x6f0 [ 12.556094] [c000000009677e10] [c00000000011d8a0] .worker_thread+0x360/0x500 [ 12.556107] [c000000009677ef0] [c00000000012e3b4] .kthread+0x154/0x160 [ 12.556120] [c000000009677f90] [c00000000000bfa8] .start_kernel_thread+0x10/0x14 John Ogness