From patchwork Mon Dec 5 16:10:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 29747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2353447wrr; Mon, 5 Dec 2022 08:32:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf7SLNF2T41p4btNU+FqevKQXPmdq1Aoz9uwfHp6nC8WjO2Rrw2Mgpkei1/SIVZfKzCk4zge X-Received: by 2002:a17:902:bf44:b0:188:64b8:2402 with SMTP id u4-20020a170902bf4400b0018864b82402mr65346465pls.81.1670257935058; Mon, 05 Dec 2022 08:32:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670257935; cv=none; d=google.com; s=arc-20160816; b=X2+op6yjnMsm1JzUNrn5QPmS6c4e9s3nzjki9DREfm4MBaWlcK5k3TxZINMrHWfrsU Vw9A9G/fiBecDh+Sff7VxdPKWzq9M5MyWmt6iBr+wpwOTZkyVi2MI/bgM9Msk/ibY0wZ fabU+rJ0hmpvXbQyKSefnEeXZZNyDMFNo6oTPI1+iEZcO3pmDHm5oz1PBIQ9cKRk16dU Jf7785V1+DwhKqMXc1sICXLeg+17vWnpcZeQx83ggV3iwPYNZeNwfrf6343ZDS1YYouy YoLMTESSZskMZ1QS+erzNkBllfAs1a1Sc7lYbgjkiN7YMfxyMVUqY5SdJvqYDYOvtgND A2QA== 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=G8QffJLp3kw2N4r3vK4klTqQs8lga3DqRCR8wU17sc8=; b=sEdtzqAc+0MQ8ezfzpBm+PDdWQ5FO4tRF16rbx/gCIAcS52AzKUZxCt/mNjEFQ16zp p//g3ki+OpeLAdodSvA9gSFOfSnzRSrvRv2jlLG1A+k9Q0k+rleuCaOsj+xcAlSNtk3Y EVfYuHW0LZ88k8xyj+JiixWL2A9koSHjKN/kQz4T6q6OzVsgLXaTp99J0+eaVeLzSXLx oBMxmDnxSJNuH14V9bM83X6USK+eTnAEYk5kqB9wvVN2mWAnmckW6Y1njAntl3H7WC00 yhPKWv7mZ7d2U5zC7Bwz2P0eWRM3yjJ455Wh5w8TlOH1OB7lvik3HmCy7T1sIIwYWyqc Belw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oS4APd20; 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 t9-20020a17090340c900b00186897fb90dsi15090454pld.233.2022.12.05.08.32.01; Mon, 05 Dec 2022 08:32:15 -0800 (PST) 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=20210112 header.b=oS4APd20; 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 S232690AbiLEQKd (ORCPT + 99 others); Mon, 5 Dec 2022 11:10:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232589AbiLEQK2 (ORCPT ); Mon, 5 Dec 2022 11:10:28 -0500 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE52B1D0DE for ; Mon, 5 Dec 2022 08:10:22 -0800 (PST) Received: by mail-io1-xd34.google.com with SMTP id 3so1582570iou.12 for ; Mon, 05 Dec 2022 08:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=G8QffJLp3kw2N4r3vK4klTqQs8lga3DqRCR8wU17sc8=; b=oS4APd20UudCaozy0ge/CvTILvoX4Znvcg3LNw/GRV5Fp7HKZbMQ0E4UEUwQHB6Qwc TphBbuArSM654WXtLgtD2zWRBNVykIknWMMlurj4Gk0ue3eWL+chjQFvkUWbPdtcSAc7 Wf//nqV7IzshKpInzV5x/VYb6SIUWyt4X3eGdIFN4aO57hSCLkMhCNMC3u0HBon3HwsH /wDOqR4Did+T7TiW4/odGvX8lYf7ifdrpFJ4nxv32VHVjoz0g4Zi32vPafaE4kqe23gG gx3hxqtUJoorfbd8kzF+ssrHqa/01JDUhO8RvXqoSP+rfSdxgE4qulm/kSjeUuBkqYMa J9AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=G8QffJLp3kw2N4r3vK4klTqQs8lga3DqRCR8wU17sc8=; b=m9+veKVpPkME838tthAg/WBm0njin8re/TKEwjYAz19qGWgrcA2A+DepIbLOeq8NqA EE8S2UcXB5o8rLM/pW2HM2Kq0JMNoFOFFTLJsOUl/0WYOBu1eE/EF+49ngbLSRew82DM saUwjcE56mdbOp252uZ9GyL4qDrfhh7fgH2yr9ueyAUsRhV2LUgpn8UVzHK19ijyxrT5 ukPQ2Vz2UfQlBMhOwBhC7tdY9137AoM8r4qbV7upyBBmqigiN2X4E6j82yfQMdFU+s8s AmxzLJjhhzAqOHbMUFT+0Y8Qe+DzwWkNhieqUCGpACwkYeafABxfUQHr0TaLNgNu0lEt y1rQ== X-Gm-Message-State: ANoB5pnTMq/thGYhe/v19zbFSZqhNUVmyhlKk2RIiLpbWkuLYXdf/c1f epIGVPAXq8+1PpdxveHkSK//BsB2u0Y= X-Received: by 2002:a05:6638:2594:b0:387:cd46:4607 with SMTP id s20-20020a056638259400b00387cd464607mr25372349jat.225.1670256621877; Mon, 05 Dec 2022 08:10:21 -0800 (PST) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id g19-20020a05660226d300b006bcd45fe42bsm6017753ioo.29.2022.12.05.08.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Dec 2022 08:10:21 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com, ville.syrjala@linux.intel.com, daniel.vetter@ffwll.ch, seanpaul@chromium.org, robdclark@gmail.com, Jim Cromie Subject: [PATCH 1/2] drm: mark CONFIG_DRM_USE_DYNAMIC_DEBUG as BROKEN for now Date: Mon, 5 Dec 2022 09:10:04 -0700 Message-Id: <20221205161005.222274-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221205161005.222274-1-jim.cromie@gmail.com> References: <20221205161005.222274-1-jim.cromie@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_NONE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751392384341648146?= X-GMAIL-MSGID: =?utf-8?q?1751392384341648146?= CONFIG_DRM_USE_DYNAMIC_DEBUG=y has a regression, due to a chicken-egg initialization problem: 1- modprobe i915 i915 needs drm.ko, which is loaded 1st 2- "modprobe drm drm.debug=0x1ff" (virtual/implied) drm.debug is set post-initialization, from boot-args etc 3- `modprobe i915` finishes W/O drm.debug-on-dyndbg that just works, because drm_dbg* does drm_debug_enabled() to check __drm_debug & DRM_UT_ before printing. But the whole point of CONFIG_DRM_USE_DYNAMIC_DEBUG is to avoid that runtime test, by enabling (at end/after module_init) a static-key at selected callsites in the just-loaded module. And since drm.ko is loaded before all dependent modules, no other modules are "just-loaded", and their drm.debug callsites are not present yet, just those in drm.ko itself. CC: Signed-off-by: Jim Cromie --- .v2 - default=N, cuz CI tests BROKEN stuff too. @ville.syrjala --- drivers/gpu/drm/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 34f5a092c99e..5adc8d5b6a40 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -53,7 +53,8 @@ config DRM_DEBUG_MM config DRM_USE_DYNAMIC_DEBUG bool "use dynamic debug to implement drm.debug" - default y + default n + depends on BROKEN # chicken-egg initial enable problem depends on DRM depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE depends on JUMP_LABEL From patchwork Mon Dec 5 16:10:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 29748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2353697wrr; Mon, 5 Dec 2022 08:32:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf79S5vxF5lSsrWJT250Q8CpiD6MSOF+eWL0LNFc2+dJ8sTalW1HUz5TYRT2OZudvKHjbq8b X-Received: by 2002:a17:90a:8c83:b0:219:99cd:2951 with SMTP id b3-20020a17090a8c8300b0021999cd2951mr14958998pjo.16.1670257959418; Mon, 05 Dec 2022 08:32:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670257959; cv=none; d=google.com; s=arc-20160816; b=sAhfBoRItOmSI9A0lvzo81GokHgzssUyZgFPoLfIz/kvSy5okskqC5E7DcPMpxJsjC XBQAX08Gjwm7PN0N1SsGE859EUvtus1mwn63IW9zWlclZqSJDFFvZXOwkNpicdnPsuD1 I9XueDa5kXKv3NM7gwh5xT6jMI/BTAO5rUW8jv9wQ1Yy5PzO7IcdNFGmfSCkgl9zK6vs wPf7UJtzVO7iWkfQfzVGQ13OCLo7BMLheLdhJW23FhCfe+6U7crlZv5i2hg0yVHkUGCa 3pYl93Pq1jTLIRiso9mSuEPxFi2rAEv8uDf38T7P8Xu1nc4HHFyMhDy9lOQUNytRIXiB 8p+A== 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=M9ZyX2rEEt8xF2wnMR144cVYnIHvQWhY/Asi+jCe8jQ=; b=YZG578HqWPDkFLzWWk6pcvjWOWz4Na6KlhSrKLfMr2kvwpTL77nsGkOofkCIFNHxjo EEC7DyXSZLZWowU1bDNbbxwNaMGvBblNM8Xe20Y7Kj3kZTiz+ZMvgXCblmzZjvWBZ2os 8ZTXeLdMf6zit2M31g09KYojHF9kWIaFm58j3HEgRMVVdmfsw4NmsSst0ahZuDCABeS1 +oXDipQxoG7TCJf8ZvaUDfQ5EPcYo0wwX6UBxISybrdFaqRrWyEe5vxzHLbrhEgObJqi CLgeJd+KCXN3kNjxD4EVKVlZYVudx/7OQRlTib+pycU7DNblgoO8uNJywfvmulQ2fn+H mvCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="BbF+/9gx"; 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 s7-20020a056a0008c700b0053b36138dc5si16275250pfu.222.2022.12.05.08.32.26; Mon, 05 Dec 2022 08:32:39 -0800 (PST) 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=20210112 header.b="BbF+/9gx"; 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 S232860AbiLEQKh (ORCPT + 99 others); Mon, 5 Dec 2022 11:10:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232367AbiLEQK2 (ORCPT ); Mon, 5 Dec 2022 11:10:28 -0500 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DE071D0E8 for ; Mon, 5 Dec 2022 08:10:24 -0800 (PST) Received: by mail-il1-x12a.google.com with SMTP id z9so5278277ilu.10 for ; Mon, 05 Dec 2022 08:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=M9ZyX2rEEt8xF2wnMR144cVYnIHvQWhY/Asi+jCe8jQ=; b=BbF+/9gxLsIAvlzG5e99rniqZ8QtSEy3GUPRMo4iUlbF7n9TKdMzRkhwGZr0pZd83n BYSrKV8Z0spcFDmyZ5FkEKG78cH16hQo67px8xAk8O6oKXLKv1ko8/6J52VllQ/W4DM8 pb84giAl7+/Am6D/aSKiqNwJGp/2XqSLKCiVmJNIM8GTRXqvc+mwZ5nRSYDp9HC4nOWV JvN8sK2Cb4S/uzfEx1kCXSOfMkuBWHLYSPDeGXEjJYS3iVhxhC9EVsKKcpIFRJk0lw8Z XNYraRQUc6f8ZuPEZWCWHcqDcihYp5aTyh3XOsSwLQrObF3DOFgig2vf83ntzXv4Skfw jPsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=M9ZyX2rEEt8xF2wnMR144cVYnIHvQWhY/Asi+jCe8jQ=; b=wDC4RgI45uWaAfFA5h65ev48hcCVuIo6Gpc/zT1w8pxY0EkoG+ud2DnZRwBt8gPepz IH/yJj2Jpl5XF+vsj4otZBu6Wc0ibWC162ceQBlzSD0K+N1dkgH0nJKFzxVaqHnQCWH2 j/aIY9MLvcsDhe7XTlejskqFeclgBUOJTEDDtsvbUUJzC5tSxAFFaUAp47Z6SJ/yJtgZ V6b9oSLCg5+ZddQgQl4bmUlwlysmo+HW4kds60aJIhB2uZfLNg0zGKcJlUBNBZ+Rla6v af+iGhl47ZWd5eQExQ45vcAHLGzfuuN9KngUAr0U+neslD+QQ/OGnfgIuF3Hno3PvK1M UYuA== X-Gm-Message-State: ANoB5pldbkHqEg6sHnGaFYXnJqAwKGuVHpVr3HoYR+SJE3Y4uwPdqroV 8TkmIM5eLqigKKTBhWeZdBhFwGGflUs= X-Received: by 2002:a05:6e02:1e05:b0:302:cc74:920c with SMTP id g5-20020a056e021e0500b00302cc74920cmr31013025ila.262.1670256623097; Mon, 05 Dec 2022 08:10:23 -0800 (PST) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id g19-20020a05660226d300b006bcd45fe42bsm6017753ioo.29.2022.12.05.08.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Dec 2022 08:10:22 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com, ville.syrjala@linux.intel.com, daniel.vetter@ffwll.ch, seanpaul@chromium.org, robdclark@gmail.com, Jim Cromie Subject: [PATCH 2/2] drm_print: fix stale macro-name in comment Date: Mon, 5 Dec 2022 09:10:05 -0700 Message-Id: <20221205161005.222274-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221205161005.222274-1-jim.cromie@gmail.com> References: <20221205161005.222274-1-jim.cromie@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_NONE,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751392409745645624?= X-GMAIL-MSGID: =?utf-8?q?1751392409745645624?= Cited commit uses stale macro name, fix this, and explain better. When DRM_USE_DYNAMIC_DEBUG=y, DYNDBG_CLASSMAP_DEFINE() maps DRM_UT_* onto BITs in drm.debug. This still uses enum drm_debug_category, but it is somewhat indirect, with the ordered set of DRM_UT_* enum-vals. This requires that the macro args: DRM_UT_* list must be kept in sync and in order. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.") Signed-off-by: Jim Cromie --- . emphasize ABI non-change despite enum val change - Jani Nikula . reorder to back of patchset to follow API name changes. --- include/drm/drm_print.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a44fb7ef257f..e4c0c7e6d49d 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -276,7 +276,10 @@ static inline struct drm_printer drm_err_printer(const char *prefix) * */ enum drm_debug_category { - /* These names must match those in DYNAMIC_DEBUG_CLASSBITS */ + /* + * Keep DYNDBG_CLASSMAP_DEFINE args in sync with changes here, + * the enum-values define BIT()s in drm.debug, so are ABI. + */ /** * @DRM_UT_CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, * drm_memory.c, ...