Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp147311rwb; Tue, 13 Dec 2022 15:23:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf5w0DtYCiZculGSWEH2abNJJ996YKDQMOWA2Ktaoj3CpZR+qzxjnH9dhu1AtTlV8OBQxmNw X-Received: by 2002:a05:6402:20f:b0:469:15eb:16fa with SMTP id t15-20020a056402020f00b0046915eb16famr18829786edv.13.1670973780432; Tue, 13 Dec 2022 15:23:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670973780; cv=none; d=google.com; s=arc-20160816; b=uOjWP82/zRqifusBZoMBas63vqoWFgrYz0rFWMxhKdi3DgiN5jj/e1mWtEErEIId8j 00WgDxS9kkxARPjWnnk1VX0AJyQwxetWvdC/7Jo1plMSL/wJSVE+Oa9jbqpUTsN04Wdj MU9lnfSnzs2CkfMwR9agt4cpLztx0UZ64LGTU1RtlDtksDo25DP4q8fjnDD2sNzGjf9o VbwuBcDd89GEylsMmxBWJCGYRWPCsCnOtHdRhahweNVuI9jFCI7gCG6MnOOghBmefOg0 v7f9t1LXUzDmtzN0r6U+gBy2G/do8nIaQ/4WilYpXYKpB4h1WiUM8WbcibFDTMNgYFap bZMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=acFcWsZp8jeuy0aOVlX6PCUPzovLJAhrsBv6ucRF3IU=; b=XvoFDclk6dIrAtzOX7CUfsR8AoSVSv4b5MMFmENTNyP139Ab9ZxDIhnQQaM7BBTcLa u0nGemZreBxxHa5tESi5U7Afq9SWtpVcPtPBGM8XwzhJ4NW2u9xFIO2j7n3ifVM7e+Ll ckJqj65n6T7r8D2bN+iAevesm1+IaMTAUQ3jXBDtaw8zdQtVTJfvS1Em1IaSalpYIKMg K4+LSsyptcD0qV64bOFuLe1aqN62v3uLwxLmQcoGujICpgGIsZef/CSx6N8QURbgUzx8 Grz32MYBdg4UKsEyXyeRTWJquQ6XGAxn0FGPCtGZa9lA/DfAw1CGpFNLEiv24Sg6gUIl zCjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=gi8Qn5HR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a056402400900b0046fa2af972dsi7302184eda.336.2022.12.13.15.22.42; Tue, 13 Dec 2022 15:23:00 -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; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=gi8Qn5HR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236865AbiLMXFn (ORCPT + 72 others); Tue, 13 Dec 2022 18:05:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236149AbiLMXFm (ORCPT ); Tue, 13 Dec 2022 18:05:42 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51743127 for ; Tue, 13 Dec 2022 15:05:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description; bh=acFcWsZp8jeuy0aOVlX6PCUPzovLJAhrsBv6ucRF3IU=; b=gi8Qn5HRZAtpxzz5YJZ05RPV8g YJ0W7ei0he98EPBkc/C6n9oP+SGGHW+OZVWGoDeSShO4KHZT2AMnaQGFrSeufGjh0TMzW7OeZEmlx prUxCXndMK79i6OS38dDpWijDBvTEugkcuqkxM7zKHdeAdcbvXqWI6RMl1ZnpWjtaoeniR3PK3BOf alnuEcmqJvhsipsytjf+H789Pr92NPi7NisZUkwxUcfURmBiNECXXiSoM+LS1SeDOAPqK20b6LAVd 5Wm4OJytRw3tuF3cXJGoWoSLN9AhKtUi7v97bpioc85HlplK4pBzlUZ5n7K621alFIgYY2H+/p4XF Rb9du+fw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5ELD-0084r9-L8; Tue, 13 Dec 2022 23:05:39 +0000 Date: Tue, 13 Dec 2022 15:05:39 -0800 From: Luis Chamberlain To: =?utf-8?Q?Micha=C5=82?= Lach Cc: linux-kernel@vger.kernel.org, russell.h.weight@intel.com, gregkh@linuxfoundation.org, rafael@kernel.org, tiwai@suse.de Subject: Re: [PATCH] drivers/firmware_loader: remove list entry before deallocation Message-ID: References: <20221123111455.94972-1-michal.lach@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 On Mon, Dec 12, 2022 at 06:52:51PM +0100, MichaƂ Lach wrote: > On 12/12/22 07:04, Luis Chamberlain wrote: > > Hey Michal! Thanks for your patch! I have a few doubts though! > > :-) > > > To account for not having to deal with specific drivers we have the > > Linux kernel selftests. And so you can test the firmware loader with all > > sorts of crazy situations which any driver could use and try to see > > if you can re-recreate the issue. > > > > The kernel selftests driver for the firmware loader is in > > lib/test_firmware.c and you can use thetools/testing/selftests/firmware/fw_run_tests.sh > > to run all the tests. To test the firmware fallback alone you can use > > just fw_fallback.sh. > > > > If you want to just virtualize this and you can also use kdevops [0] and > > enable the firmware loader selftest and use:; > > > > make menuconfig # enable selftests and just the firmware test > > make linux # build linux, pick linux-next > > make selftests > > make selftests-firmware > > > > But this may be something more you can use later once you get your flow > > going. Just compiling the kernel and running the selftest manually with > > fw_fallback.sh should suffice. > > Thanks a lot, I had no idea that there is something like this. selftests has been there for ages, kdevops support for selftests is pretty new, like 1 week old only :) > > OK so this proves the bug can happen but I'd like to see the full trace > > and the exact kernel version showing that this can happen on a recent > > kernel. Without that I'm not seeing how this can trigger yet. > > Unfortunately I cannot provide a trace. The kernel version was 5.15.41 (-stable). Ah, I suspected as much, given I couldn't see how this could happen in linux-next. > Keeping that in mind, I will try to reproduce this behaviour with in-tree > code and provide proof. Yes please use linux-next, if you can't reproduce there then likely your kernel is missing some fixes. Luis