From patchwork Mon Aug 7 17:11:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 132297 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1611522vqr; Mon, 7 Aug 2023 10:49:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1ddElEMSncLcoJDkSCzGmO7sEG2lt3j8kCeboCwWmzrLeZVrbhlE/rwnVoI6GABly06Ts X-Received: by 2002:a17:902:7783:b0:1b5:4679:568f with SMTP id o3-20020a170902778300b001b54679568fmr7533057pll.45.1691430558197; Mon, 07 Aug 2023 10:49:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691430558; cv=none; d=google.com; s=arc-20160816; b=tDBAlE3WNLabFZOZcRghZR7HhAqgOSsks3HN9HHZP481Q16uWZBN8RvCCyRU8y73lk C7qQN7qf5jOsJQXnMqMZ1ChgxTOjzFBrelqB7JbLqP2kxfxkgSAYp8dTiDNpCX1nQmwO +FzWb+mF7LubXhrAm/iEjSwWD9+CNwa8U7BkLMh83xhYxi03lppw1E41RoZ/o1bkbka7 nO/6xGBMaXp5NAhlM+s0F1EDIeurLHQ6AuMc06VWG1s0QBm41YIO7TRUYujyt9ghLrll RE+JNw8N3G8E27QsTZdRcAzugadOu2Ouv165AUrX3uucZSQkoJ/4Bxgl5swhY0/M4gBJ 9k9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=o/ZrwT0NJoa3SvrfuTbm+aI37YIFG6qkhwqRx+xCrA0=; fh=vowAoJlRoNYczHkRJrZKttBOf0ibYDZ2E9dLjbtafYA=; b=x79BcsvmQkrX+64+oEV4P0gVcUHUdDHPuxkUULSClkamsyFSQG3ziqBxehEcsv+QuK AC7wBxIv5Iyzdjm8x5MhtFHO3W0zPSYUZEdpxPLDcTxTOYNhbwGdraqAliw1UpGXOiJF mkADY+3y0FStQXpk98zcXCbuPUlbFLkSXlB178JriOk0DplE+YCm1UieLpBdkPLXDEbO LKMtD67UacecYPyX3cU3tcRP3xXrsHYwH2PwZKH+ydcdkGsnOavOI2L+Xh/IlaV5TPoT JcE/xLHycz7sMotqUqQ698pkKqA9/7SxWJ0/SoFqpLaPkmZsoq6dCcL3/81RK3AQKTTw X7gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=UqwBSzb7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ki14-20020a170903068e00b001b9e9edea43si5917966plb.552.2023.08.07.10.49.03; Mon, 07 Aug 2023 10:49:18 -0700 (PDT) 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=@gmail.com header.s=20221208 header.b=UqwBSzb7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232201AbjHGRMl (ORCPT + 99 others); Mon, 7 Aug 2023 13:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbjHGRMX (ORCPT ); Mon, 7 Aug 2023 13:12:23 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDDB31BF1; Mon, 7 Aug 2023 10:12:08 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1bc1c1c68e2so29730565ad.3; Mon, 07 Aug 2023 10:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691428328; x=1692033128; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o/ZrwT0NJoa3SvrfuTbm+aI37YIFG6qkhwqRx+xCrA0=; b=UqwBSzb7bDmSyec+1PJCPQEzpyJ0+EdMmkMvCke7Wnea0hLj+c9hkMVwbEw5OIZlt7 2jFHWIlB3pNRnbenayfQHGZvj+rIIEnIdoYp6wuzuzdJuPV95bZa1c33CO6m1zvKYZN8 SDRrnOVcXFN2xJuq9TuOmPsyc5HHQEycjoC00VXy6zC+vja0xBQwcwhdO3dug+bY9yUz uItD6eYHilJWK3UpSAisNS3wT9CHEhIlEAsWVjwWDL64eFa4pFKQuuEhhneseSz94DT3 WhYkjovQZccQGJdgPZPdN4dhwG3euTQvC1g9vo6NR/WCZUDwvMeMpkkItLbFOxUoDpyG dObQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691428328; x=1692033128; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o/ZrwT0NJoa3SvrfuTbm+aI37YIFG6qkhwqRx+xCrA0=; b=acSsuaFsGj2csX7w+se2Ca7ioNUFD4HfSQglPAck/l7j9ZaunprmsguDKBRQ82mpCw Aj7OasZP6dA+CHvLk2mE95IH3Gi+Nets8F/VBQhSHOVBMTOJYN/I8ayOKLqmfjzQfL22 nvAKtL99W6G0zMDzZGXc14D3jWoImCMHpZlY9heEi4IJmwzSQgnCNvcIBrvfTwa4xTaK 497RRtDbvB9zeUAxCmVseUinIoAb9znoEQDJXg4sQs8iV3VhYdF1d860ryJ2tJ4sUBIg Vyjl4qlqSA5GBVbcT8y1esYoQ8SPqmYr5AeHJ1NAcWl2i4wvhcKSXpLL7+CL3bLu1HFq v2hQ== X-Gm-Message-State: AOJu0YzJom4AHvmx/C1FeRHpDvx7w90QDgsTOCh2Kxk3x9GAF3N7jP6J np6otGQhiqGajDtsDMXLVmE4nmorW5U= X-Received: by 2002:a17:902:ab0c:b0:1bb:b855:db3c with SMTP id ik12-20020a170902ab0c00b001bbb855db3cmr7406106plb.41.1691428327863; Mon, 07 Aug 2023 10:12:07 -0700 (PDT) Received: from localhost ([2a00:79e1:abd:4a00:6c80:7c10:75a0:44f4]) by smtp.gmail.com with ESMTPSA id v12-20020a170902b7cc00b001ac741dfd29sm7133303plz.295.2023.08.07.10.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 10:12:07 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , linux-pm@vger.kernel.org (open list:HIBERNATION (aka Software Suspend, aka swsusp)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v4 5/9] PM / QoS: Teach lockdep about dev_pm_qos_mtx locking order Date: Mon, 7 Aug 2023 10:11:39 -0700 Message-ID: <20230807171148.210181-6-robdclark@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230807171148.210181-1-robdclark@gmail.com> References: <20230807171148.210181-1-robdclark@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773593488916819098 X-GMAIL-MSGID: 1773593488916819098 From: Rob Clark Annotate dev_pm_qos_mtx to teach lockdep to scream about allocations that could trigger reclaim under dev_pm_qos_mtx. Signed-off-by: Rob Clark --- drivers/base/power/qos.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 5ec06585b6d1..63cb1086f195 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c @@ -1017,3 +1017,14 @@ void dev_pm_qos_hide_latency_tolerance(struct device *dev) pm_runtime_put(dev); } EXPORT_SYMBOL_GPL(dev_pm_qos_hide_latency_tolerance); + +static int __init dev_pm_qos_init(void) +{ + /* Teach lockdep about lock ordering wrt. shrinker: */ + fs_reclaim_acquire(GFP_KERNEL); + might_lock(&dev_pm_qos_mtx); + fs_reclaim_release(GFP_KERNEL); + + return 0; +} +early_initcall(dev_pm_qos_init);