Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp732943rdh; Thu, 26 Oct 2023 14:17:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH77KXMevp+xNoVG4fTfqsGBs4xQ9n0BWmYnPJZshI0KU7WcUa3BwTSHQ3Py93ijr+IljzY X-Received: by 2002:a05:6358:9144:b0:168:de6a:d653 with SMTP id r4-20020a056358914400b00168de6ad653mr1145755rwr.21.1698355061035; Thu, 26 Oct 2023 14:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698355061; cv=none; d=google.com; s=arc-20160816; b=SN6/QRqq00PfTbO4LtEINsxQ+Ya7Npqari3IWRcTL4Kp/CAyiEkIjFxLQL+OpJbYPD TlCYjPz0snkp/30CqE1W3kHNQe/+TuKXO4R0GdISU6PYHD2iUv1yw/T+5Y3VdZlksq2y WmSPeR3XPvQtw/hLhGG4peeDYEbwFOhILndt03BJzsxakPu2IKJQMmSw9RmivSuNypgt i+0EmKti7dCLtrIDcDzKBrXFgergOtIiMbZSxHSIE9feZrRXEc2vb+LpKfPV9J5lcr1u EHrtlhfdoKmOPyIwwnbDWXW3B6qIg7MMvV6/R7bgQHKC13DMLB0iUr7L7m5vaA3vMQL6 h6FQ== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=RAZ8HHKchqOYdcF3I8aqrN2sz0ZoEqDQCNwNy5dZLbU=; fh=oaW4oK7XkCOTpt4vDJEOLsNjl08vrn1s9v64rEMg0rA=; b=Qoqe5Jnnsn5XjtVi6k8rcWpPYuDh8yhN9C1J3XAtd9VyPXV8rSRGNjIdKqX9UdI6ol X0ALqKy6LpypuGbS1b7WJXM9bixzQOE6z80E67nVe5Wu38sFz8NPcJFzCgo2FGgEKDPL BJWfhImBqi9aCuplCaazsFKttu55M6qqAP4PO+U4Qj8Me8QSW2GO3cx35S/A4WIHOnml cyxpu2SOUOPzPjDQUjtVcSC3tm7KXvECHBWNormlv/LtgUcjACgj5dMQ5syaO6T6RpF7 rRLBntf9j/4Pq44bHr28bTUkPobEpC2qI1KVTWpKd5gFpRiKsUmnsS2Dl9Nv8Ll89TEI WzCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=4rUOCii0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id t66-20020a0dd145000000b005a21e5580f0si254330ywd.532.2023.10.26.14.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 14:17:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=4rUOCii0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3F45E83C7592; Thu, 26 Oct 2023 14:17:38 -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 S231701AbjJZVRc (ORCPT + 99 others); Thu, 26 Oct 2023 17:17:32 -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 X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 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]); Thu, 26 Oct 2023 14:17:38 -0700 (PDT) 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