Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2459728ybc; Wed, 13 Nov 2019 14:56:07 -0800 (PST) X-Google-Smtp-Source: APXvYqx58OJ70UFglFusM4HXPVj3dTmED1xWYh34hWKXrSEsmHT6Pf0lTUSwqIgPmLmkYk/ncVdl X-Received: by 2002:a17:906:4d91:: with SMTP id s17mr5324150eju.156.1573685767528; Wed, 13 Nov 2019 14:56:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573685767; cv=none; d=google.com; s=arc-20160816; b=q7YUzBQdpsG9Rw4FV1qBk7L/Jy5yMPPkFE0Elw4kT+QQ+XiuVqtkLVK7Q9iIwooe9T tMhzx3GMwUCOh1zOgXan/+yqiNkmZAis370ID0+QN8xHSPMOCjiLwTHyJ46sPGjf7t8e jU8eHzqsiFAhm/XJ0SDZJQspkt9ZfrB3tDrGAki+WQEtgosDL7wFsdRMeSw0xANs7ybf CBBDgK27cdhUn086nQQkfM8GdFSpoZ77vOpPr7nnZaKx5mlmQOjXPD2ruZkOueh2XCcl KIqhg7FKyRLbmQ9MovzBnnEX4k3rDn3ct59fTrMCtvyLEDFDxGHh48BPAX/XUvGEOG4R ZyJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YzThP7vqWAF2JKLOm94GCZOblrnMR8+6q3/EyLUdnt0=; b=zi9srUYnG9I9w+8bLMlxYWjZjdzKkLFHWnqodKTUqEu71DcMhjK84QJJWv40XsRJ3W 2ptJs05Y4xXof3UlrW6KLxuElJxTtRlfKVmVXVM+d17FGdSNPbjmqYoZWnbK1c2ESJWN nYlle4gyYWLwZ/2Fnl1goypYDh40eja/IHaVJ13AE7R9rmZ0tE5liD9Sry6AzkKdWC4f 89MzCqOzvsujZolnHuDBRcgNt2lMVRKgZirzCF67q4AUXsE2/SZN0CMkueNhIernvkS6 HQxNNP5YkU/2nBBK4064wHMWRmxVZ69GkDzIvCJ3jNsxJQOtg9XlBBaff5lqCcgS7zdh Wb+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=tSDAklaS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si2590098edb.362.2019.11.13.14.55.42; Wed, 13 Nov 2019 14:56:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=tSDAklaS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726410AbfKMWyn (ORCPT + 99 others); Wed, 13 Nov 2019 17:54:43 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43397 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbfKMWym (ORCPT ); Wed, 13 Nov 2019 17:54:42 -0500 Received: by mail-pg1-f196.google.com with SMTP id l24so2298322pgh.10 for ; Wed, 13 Nov 2019 14:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YzThP7vqWAF2JKLOm94GCZOblrnMR8+6q3/EyLUdnt0=; b=tSDAklaSoQvipGE27ua1O3lzpOd4kK5GoM9WC9l+9BqEgxiVPneK7Dqnxf/glB1p26 geJO7MDJ4zdV3iK3WmZsouncLPqY2Rf03BRL99x6kl4H6wlwqKYXJdKkXC/uzfs8tI2a tU+BzUeZNVJTDgf4ivkYrtP6JeNfXjnIoe8yLWcgRcYCMMMRH3f0wjwF1zbGDm4nRG5C Qgz8PxAeaQZf1xPoa8B9rTo+1yJYhamQ3l1NGfOeNXb84ZDRaYcS+1fZcT/e2gHU0/AQ 5A0lB7G7eGevTcarm5sQAZ5XFNvwmK6yUtoDcyD8lusEYl6kebRdprgHaq99MBcn5ul9 Tlhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YzThP7vqWAF2JKLOm94GCZOblrnMR8+6q3/EyLUdnt0=; b=kMpgyRFVTyDt2GLtHCe5XfXBAw1oFnoTC6Rxeoi4z2xSmo/d5Grz5/TY+5IawqIqE/ 9E3Tl6P0A8/2NIx1LhUCuKcNyfGOhhxk+UjeXtnwW4quDaXiEDxhHdYfFwulJ3JAOz76 e9e9HkSYtxLP6m6zGpvVxuEym9d8RErEFqn2kq0MXyukheMVOddR3Xi74X28IiPwhV7N uPWDtK5fDL70rBBICQzhQW+BRmRmJCoCetMVQcEZ7FWy1tutpqGTGyExhd0PnUKSvDTD 2e+PIDT5mya6utZtD8KKgAmJOsU0ep8+5jeghE7ME2TtPMhTY99Gj1UWvB67PX5CdnD4 e13A== X-Gm-Message-State: APjAAAUPZ8rPCFpFIudrLBTow+H91mVxFDCv8FVybQfYvnOHN03545m9 +FVAMj0p64ULJOCVTcodYY417SJAuLRV3Q== X-Received: by 2002:a65:68d7:: with SMTP id k23mr6395729pgt.157.1573685680314; Wed, 13 Nov 2019 14:54:40 -0800 (PST) Received: from nebulus.mtv.corp.google.com ([2620:15c:211:200:5404:91ba:59dc:9400]) by smtp.gmail.com with ESMTPSA id l21sm3250622pjt.28.2019.11.13.14.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 14:54:39 -0800 (PST) From: Mark Salyzyn To: linux-kernel@vger.kernel.org Cc: kernel-team@android.com, Mark Salyzyn , Tim Murray , Venkata Narendra Kumar Gutta , Luis Chamberlain , Greg Kroah-Hartman , "Rafael J . Wysocki" Subject: [PATCH v2] firmware_class: make firmware caching configurable Date: Wed, 13 Nov 2019 14:54:26 -0800 Message-Id: <20191113225429.118495-1-salyzyn@android.com> X-Mailer: git-send-email 2.24.0.rc1.363.gb1bccd3e3d-goog In-Reply-To: <20191113210124.59909-1-salyzyn@android.com> References: <20191113210124.59909-1-salyzyn@android.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Because firmware caching generates uevent messages that are sent over a netlink socket, it can prevent suspend on many platforms. It's also not always useful, so make it a configurable option. Signed-off-by: Mark Salyzyn Cc: Tim Murray Cc: Venkata Narendra Kumar Gutta Cc: Luis Chamberlain Cc: Greg Kroah-Hartman Cc: Rafael J. Wysocki Cc: linux-kernel@vger.kernel.org Cc: kernel-team@android.com --- v2 - move config from drivers/base/Kconfig to drivers/base/firmware_loader/Kconfig - drop blank line - default yes conditional on PM_SLEEP --- drivers/base/firmware_loader/Kconfig | 12 ++++++++++++ drivers/base/firmware_loader/main.c | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/base/firmware_loader/Kconfig b/drivers/base/firmware_loader/Kconfig index 3f9e274e2ed3..33e6552ddbb6 100644 --- a/drivers/base/firmware_loader/Kconfig +++ b/drivers/base/firmware_loader/Kconfig @@ -169,5 +169,17 @@ config FW_LOADER_COMPRESS be compressed with either none or crc32 integrity check type (pass "-C crc32" option to xz command). +config FW_CACHE + bool "Enable firmware caching during suspend" + depends on PM_SLEEP + default y if PM_SLEEP + help + Because firmware caching generates uevent messages that are sent + over a netlink socket, it can prevent suspend on many platforms. + It is also not always useful, so on such platforms we have the + option. + + If unsure, say Y. + endif # FW_LOADER endmenu diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index bf44c79beae9..1c9f03514a47 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -51,7 +51,7 @@ struct firmware_cache { struct list_head head; int state; -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_FW_CACHE /* * Names of firmware images which have been cached successfully * will be added into the below list so that device uncache @@ -556,7 +556,7 @@ static void fw_set_page_data(struct fw_priv *fw_priv, struct firmware *fw) (unsigned int)fw_priv->size); } -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_FW_CACHE static void fw_name_devm_release(struct device *dev, void *res) { struct fw_name_devm *fwn = res; @@ -1046,7 +1046,7 @@ request_firmware_nowait( } EXPORT_SYMBOL(request_firmware_nowait); -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_FW_CACHE static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain); /** -- 2.24.0.rc1.363.gb1bccd3e3d-goog