From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC39EC25B48 for ; Thu, 26 Oct 2023 21:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232063AbjJZVRe (ORCPT ); Thu, 26 Oct 2023 17:17:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjJZVRb (ORCPT ); Thu, 26 Oct 2023 17:17:31 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48E45C0 for ; Thu, 26 Oct 2023 14:17:29 -0700 (PDT) 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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RAZ8HHKchqOYdcF3I8aqrN2sz0ZoEqDQCNwNy5dZLbU=; b=4rUOCii0h6li4mpuKW9ItFTN3w wMBnACxAgpkXtnYeWcQ3FIn3ENU5kCNAIJkqAWgFHd6pE8LVfbc3rrKXSw0jbu2iAv9NDg3le1xM7 bdfUrUhbc47hiExqy0qHtdyqviyfJC/1o70fAvhRiGIYUNLC1yfhjE7xhxa+PI10FQCUn/vUgf1/O jZvPIK686ROG+uxFmd4ifsbfUuNkGIjcJGyiWCLWvhXB+15pt18kl0c9a1kq+RCcwYMETeHz5se5G oeXR55DookKghv1me17KG4+rfLFvCwFOha2nr0wpmA4k1YLQCX6iu9yQdmT4s9bp1rcX0QWf3EAut 0+gMWiJQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qw7jJ-00FAJY-2H; Thu, 26 Oct 2023 21:17:25 +0000 Date: Thu, 26 Oct 2023 14:17:25 -0700 From: Luis Chamberlain To: Mukesh Ojha Cc: Russ Weight , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] firmware_loader: Abort all upcoming firmware load request once reboot triggered Message-ID: References: <1698330459-31776-1-git-send-email-quic_mojha@quicinc.com> <1698330459-31776-2-git-send-email-quic_mojha@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1698330459-31776-2-git-send-email-quic_mojha@quicinc.com> Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 26, 2023 at 07:57:39PM +0530, Mukesh Ojha wrote: > There could be following scenario where there is a ongoing reboot > is going from processA which tries to call all the reboot notifier > callback and one of them is firmware reboot call which tries to > abort all the ongoing firmware userspace request under fw_lock but > there could be another processB which tries to do request firmware, > which came just after abort done from ProcessA and ask for userspace > to load the firmware and this can stop the ongoing reboot ProcessA > to stall for next 60s(default timeout) which may not be expected > behaviour everyone like to see, instead we should abort any firmware > load request which came once firmware knows about the reboot through > notification. > > ProcessA ProcessB > > kernel_restart_prepare > blocking_notifier_call_chain > fw_shutdown_notify > kill_pending_fw_fallback_reqs > __fw_load_abort > fw_state_aborted request_firmware > __fw_state_set firmware_fallback_sysfs > ... fw_load_from_user_helper > .. ... > . .. > usermodehelper_read_trylock > fw_load_sysfs_fallback > fw_sysfs_wait_timeout > usermodehelper_disable > __usermodehelper_disable > down_write() > > Signed-off-by: Mukesh Ojha > --- Acked-by: Luis Chamberlain Luis