Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751800AbdIMELw (ORCPT ); Wed, 13 Sep 2017 00:11:52 -0400 Received: from mail-io0-f177.google.com ([209.85.223.177]:35621 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbdIMELs (ORCPT ); Wed, 13 Sep 2017 00:11:48 -0400 X-Google-Smtp-Source: AOwi7QCG3rSQlH3dy11ArLN/U7o/3h/769egMCC5iSbeVEJjbMXGR4aO4Yfdr52uWrB1wHYXWvGHWdGxwJzvRVaKMRY= MIME-Version: 1.0 In-Reply-To: <20170913004758.GA21439@kroah.com> References: <20170912165308.904472972@linuxfoundation.org> <20170912165310.407586301@linuxfoundation.org> <20170912172008.GF16216@wotan.suse.de> <20170913004758.GA21439@kroah.com> From: Linus Torvalds Date: Tue, 12 Sep 2017 21:11:46 -0700 X-Google-Sender-Auth: lSXN3SsctSGv23C94iUI43qPerY Message-ID: Subject: Re: [PATCH 4.13 20/27] Revert "firmware: add sanity check on shutdown/suspend" To: Greg Kroah-Hartman Cc: "Luis R. Rodriguez" , Linux Kernel Mailing List , stable , Gabriel C , Arend Van Spriel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3044 Lines: 71 On Tue, Sep 12, 2017 at 5:47 PM, Greg Kroah-Hartman wrote: > >> If reverting this commit please consider reverting also commit >> 06a45a93e7d34a ("firmware: move umh try locks into the umh code"). > > Ok, I can queue that revert up in my tree and will send it to Linus once > 4.14-rc1 is out. I want to see a _reason_ for that revert. The two have absolutely nothing to do with each other., Reverting one is *not* a reason for reverting the other. Commit 06a45a93e7d34a seems to be a cleanup. The arguments in 06a45a93e7d3 ("firmware: move umh try locks into the umh code") seem valid, and there's no real reason to worry about that FW_OPT_NOWAIT etc for the direct-from-filesystem loading. That's simply not sensible. That whole FW_OPT_NOWAIT thing only makes sense for the actual user-mode helper, so that commit actually seems to move the testing and the logic to a place that really does make sense. So why would we revert a commit that makes SENSE? In contrast, the commit that already got reverted, added random locking state logic associated with a callback that didn't actually make any sense in that context. Honestly, what we need here is less "let's do random changes", and more "have actual reasons for those changes". For example, I'm the first to tell people that they shouldn't just try to load firmware from random contexts. If you're bringing up a device, loading firmware might depend on *another* device that hasn't been brought up yet, and you might end up with essentially a deadlock waiting for IO from another device that just isn't going to happen. But we shouldn't fix that by then adding a flag that gets set asynchronously by some random callback, and that then causes a workqueue entry that *could* sleep to just fail. There's no "root cause logic" there. That's the wrong kind of random change. There may be a reason for it in some situation, but in another situation it just fails for no good reason. For example, what might be senseible is to add a warning that tries to verify that people do *not* do firmware loads from the ->resume() callbacks. But then it should literally check *that*: it could do something like WARN_ON_ONCE(current == resume_thread, "Firmware loading called synchronously during resume"); or whatever, exactly because it's obviously *not* ok to block the same process that is going to resume all the other devices that might be *needed* for the firmware loading. But on the other hand, if somebody then does an independent thread to resume their firmware, we could just block to wait for it - it wouldn't be the same kind of chicken-and-egg issue with IO at resume time. So instead of "arbitrary rules", there should be things that actually make sense. The commit that Luis now argues for _also_ reverting makes a lot of sense to me to keep. I'm not seeing why that should be reverted, when the _only_ reason seems to be some spiteful "well, if you reverted one commit, you should randomly revert another one too". Linus