Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp437570rwl; Wed, 9 Aug 2023 17:35:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhy2szZCofewAdt5nNCtm6+uOeUYc871wK36zaNQQS5U2HRwwwNcvRfJFTqcSbhll7MgI4 X-Received: by 2002:a17:906:51c9:b0:997:caf0:9945 with SMTP id v9-20020a17090651c900b00997caf09945mr602964ejk.12.1691627717960; Wed, 09 Aug 2023 17:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691627717; cv=none; d=google.com; s=arc-20160816; b=u/is0Dcv0qN/btH8w/dbDFkCrD3NzGDfOImMGd5n5pfEldOgnuvC6zmiEP1ck3XpFv gijZ2UQIZM3tQwTuHIhiwGOmPwABwMoRGtAVWsN0i7xWLpa1CKOdm3VAcvATMe1vR18F +C2qr4Z+xbDoQ90CqxJxLxZtieGDIFTXLanbNbQMIbXr/Jro8nSgizafoVICCxcV2xiZ fuCcne6RSaa0yv8E64f7FPfhisqdZhV/E5sNCz7NA3lH/Ll6/tjjNJynPHkkEV0sg/CG 7j+XAv2oA8V5f1YRR49fgfrLa2s89OAy2ku+VRHSRWwYtuF/mDsJyEPwJMyCP97KX7/U ECwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=pLSYjP2sXr5CVAg3y9Dx2h0xXqQ0wra7MWxyV/0mYlg=; fh=Xw/VMYCR0Jmys7ElLSdKnfuDd2oLBHcT0rWdu0kEZ6k=; b=LxDkzDq5WGV3dOkymMA1ETHjpqcETWkpTVhiSsZG+IsYY6bWU3ovcP63KizD2W4Gq1 aOXF5EY60YNSFSK/WhwQC9Pz0AGc5YubhonHCJ6TyjOyr6HJ2b6mRY0AsaM3sIcbtLUS EQyH+AgwrPEDxEfyrR487dc+gy0rRLLfSmhPotYLTswSNVuW4sEKtuwnqZWE0Yq05cs4 DU732PdxK5UAlQiQz5jxZjlgNlz2dvc54gmYSXxO1W+45hYsQX1I7TLmKZTnkzeke+pP vmIVtvu0cjCl84dYgDvWdbFPGn6xVNKyYh6w/afvWPrdHZ8EEcCXRaE4akqgyokr47oH RNow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fVQ4RhlT; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c16-20020a170906925000b009886d385534si352656ejx.950.2023.08.09.17.34.53; Wed, 09 Aug 2023 17:35:17 -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=@kernel.org header.s=k20201202 header.b=fVQ4RhlT; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231183AbjHIXVz (ORCPT + 99 others); Wed, 9 Aug 2023 19:21:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbjHIXVy (ORCPT ); Wed, 9 Aug 2023 19:21:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F1F4E5B; Wed, 9 Aug 2023 16:21:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F3C1164C55; Wed, 9 Aug 2023 23:21:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 489BAC433C7; Wed, 9 Aug 2023 23:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691623312; bh=USqhI4biVjQf9mLtB0Gt5vcC0I3am7Ah63j8X0xD5/c=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=fVQ4RhlTZ1mE48I0JR0BsvFE8xh3saTwun0k7uP9RFr4CYOBrTHbNcZf6teey9EBy NMQC0lRTVWC7/ZOjxasN0Gd+XlaW4DucpO0IEvTY7Z7uJaHdp8BvPwwu+kctZkmRtp 8Wx/P2Gdibgfrjk5m+NNTWRrVLZiCMXAj0T5vd90oGc+GDSgJdtrZRpbo4iJamT1jp R0/KB4/NcUy1QhYOsP+DY/QEUWmveJb1kUyzHRrjL3hFrytK7amMNxIC8XthtTm/Nu Q5h9udHmF1UkGdglSW+XYjGtYLc/yqt0Dy+XH2zluz26ZhHnMKJI/tkAAzMoiJl4qo ceSrI94DH84DA== Message-ID: <088cc246369820d5a426bc8823c85c8e.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230721-clk-fix-kunit-lockdep-v1-0-32cdba4c8fc1@kernel.org> References: <20230721-clk-fix-kunit-lockdep-v1-0-32cdba4c8fc1@kernel.org> Subject: Re: [PATCH 0/2] clk: kunit: Fix the lockdep warnings From: Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Maxime Ripard , Guenter Roeck , kernel test robot , kunit-dev@googlegroups.com To: Maxime Ripard , Michael Turquette Date: Wed, 09 Aug 2023 16:21:50 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 +kunit-dev Quoting Maxime Ripard (2023-07-21 00:09:31) > Hi, >=20 > Here's a small series to address the lockdep warning we have when > running the clk kunit tests with lockdep enabled. >=20 > For the record, it can be tested with: >=20 > $ ./tools/testing/kunit/kunit.py run \ > --kunitconfig=3Ddrivers/clk \ > --cross_compile aarch64-linux-gnu- --arch arm64 \ > --kconfig_add CONFIG_DEBUG_KERNEL=3Dy \ > --kconfig_add CONFIG_PROVE_LOCKING=3Dy >=20 > Let me know what you think, Thanks for doing this. I want to roll these helpers into the clk_kunit.c file that I had created for some other clk tests[1]. That's mostly because clk.c is already super long and adding kunit code there makes that problem worse. I'll try to take that patch out of the rest of the series and then add this series on top and resend. I don't know what to do about the case where CONFIG_KUNIT=3Dm though. We have to export clk_prepare_lock/unlock()? I really don't want to do that even if kunit is enabled (see EXPORT_SYMBOL_IF_KUNIT). Maybe if there was a GPL version of that, so proprietary modules can't get at kernel internals on kunit enabled kernels. But I also like the approach taken here of adding a small stub around the call to make sure a test is running. Maybe I'll make a kunit namespaced exported gpl symbol that bails if a test isn't running and calls the clk_prepare_lock/unlock functions inside clk.c and then move the rest of the code to clk_kunit.c to get something more strict. [1] https://lore.kernel.org/all/20230327222159.3509818-9-sboyd@kernel.org/