Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp240680rwd; Sat, 13 May 2023 17:30:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6vBoMI4CrfWGL6hgc37uMvlLsCN9A0eDvtqFcaF6FF4yBtVFZLbpHygvem6geHgoLcH1hp X-Received: by 2002:a05:6a21:32a2:b0:ff:6120:e9b9 with SMTP id yt34-20020a056a2132a200b000ff6120e9b9mr34771226pzb.39.1684024242286; Sat, 13 May 2023 17:30:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684024242; cv=none; d=google.com; s=arc-20160816; b=A3Bg14ClapNxOAWW8Gi2FbhiXlqIl38qUxRlQ7uPzTj9WKCIpOAZjGZo9b2g0i+CkY OZdQ+Vf0+cnRv7FqM6nYPreqIhNBOcPuh+3JjDpga7s41KQHcCOTuv2OC90BWIBK0gIW cg+u/B9lsZC1eu1kHKfcOtQSkZ0op0zOL1ZEuwReRmNiIU9gfYEb1n2NJNHNbpeOMQzI psTEXPgD+XVYmJfpuYkpi3jzkARPc09VCgU6xNCc98yGRa6ycWCzZGsug2pPc2AQ3FC1 JbosNTHgaRaedL6UMusToIVnpGH2V8zNm+6l9wB0A9LeLWOcWNdMyqyRCsgzZQFK8wi8 2YOQ== 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:subject:cc:to:from:date; bh=Vl7PGsaCH63raBtlgkPwT9b+SS1KuNM7M0N3PCRgsJs=; b=pwkZIvjzNUWvOfgVRG+43rJ90aOTalCrljNatwoiyP7Mk39fAocbWjJtRl632MGAKM zVu+Xy4j/+B0YKaS75t5nxRv+EvcWG619yiwnD+i2iqXOIcUvCYsk2LAIUSYRPsFwGUZ n/i8RZohP8PC7BPBmGdbDAoxilcYHo7PLek+PX+sEn3PFrJb/HwtCXBejlsjhc0JeT0o 0Lqs1UXZCxueBnrDJ9CxMHGuIMB6ZbM+8e9ZvzbIpxoTBNeEQGHhCowQXtEIXzcnCkbF R+KrmMofgYVnBzqn9xZCp8eBdvhDgrC1/XWXkoxK5DMSQblgIGJ5ZXpNF7izG4wnfQVB 7pyQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v1-20020a637a01000000b0052087b60637si13333381pgc.144.2023.05.13.17.30.29; Sat, 13 May 2023 17:30:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231640AbjEMX21 convert rfc822-to-8bit (ORCPT + 99 others); Sat, 13 May 2023 19:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjEMX20 (ORCPT ); Sat, 13 May 2023 19:28:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32C9D1FDE; Sat, 13 May 2023 16:28:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C1B6F60C2B; Sat, 13 May 2023 23:28:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AF2AC433D2; Sat, 13 May 2023 23:28:23 +0000 (UTC) Date: Sat, 13 May 2023 19:28:21 -0400 From: Steven Rostedt To: Masahiro Yamada Cc: Jiri Slaby , Linux Kbuild mailing list , andreas.noever@gmail.com, michael.jamet@intel.com, Mika Westerberg , YehezkelShB@gmail.com, USB list , Linux kernel mailing list Subject: Re: make localmodconfig doesn't work for thunderbolt Message-ID: <20230513192821.34ca93fd@rorschach.local.home> In-Reply-To: References: <4cb758c7-f4f5-820c-c7e7-5b900ccc2534@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On Fri, 12 May 2023 01:15:49 +0900 Masahiro Yamada wrote: > +CC Steven Rostedt, author of streamline_config.pl Thanks! > > > > On Wed, May 10, 2023 at 8:01 PM Jiri Slaby wrote: > > > > Hi, > > > > if I use localmodconfig for example like this: > > mkdir /tmp/tb/ > > echo thunderbolt >/tmp/tb/lsmod > > make O=/tmp/tb LSMOD=/tmp/tb/lsmod localmodconfig > > > > I get: > > using config: '.config' > > thunderbolt config not found!! > > > > $ grep 'USB4\>' /tmp/tb/.config > > # CONFIG_USB4 is not set > > > > I believe it's due to: > > obj-${CONFIG_USB4} := thunderbolt.o > > in drivers/thunderbolt/Makefile. I.e. ${} used instead of more common $(). > > > > But even if I change the parser: > > > > --- a/scripts/kconfig/streamline_config.pl > > +++ b/scripts/kconfig/streamline_config.pl > > @@ -317,7 +317,7 @@ foreach my $makefile (@makefiles) { > > $_ = convert_vars($_, %make_vars); > > > > # collect objects after obj-$(CONFIG_FOO_BAR) > > - if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) { > > + if (/obj-\$[({](CONFIG_[^})]*)[)}]\s*[+:]?=\s*(.*)/) { > > $var = $1; > > $objs = $2; > > > > > > I see: > > module thunderbolt did not have configs CONFIG_USB4 > > > > and: > > $ grep 'USB4\>' /tmp/tb/.config > > # CONFIG_USB4 is not set > > > > So two questions: > > 1) is ${} supported and should be the above change sent as a patch? Or > > should be drivers/thunderbolt/Makefile fixed to use $(). (And maybe > > other Makefiles too.) > > > I believe streamline_config.pl should be fixed. So do I. > > There is no good reason to support only $(), but not ${}. Agreed. > > > In fact, the comment line around line 395 of this script > uses the curly brace style. > > # a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o > > > > > > > > 2) how to fix that 'thunderbolt did not have configs'? > > That warning is CONFIG_USB4 was unset in the resulting .config. > > Was CONFIG_USB4 enabled before running localmodconfig? > > In my understanding, the purpose of localmodconfig > is to slim down the .config file. Correct. > > It disables unneeded CONFIG options, but > it does not enable needed CONFIG options. Also correct. > > > > > If I start from allnoconfig (i.e. CONFIG_USB4 is unset), I see the warning. > > $ echo thunderbolt >/tmp/tb/lsmod > $ make -s O=/tmp/tb allnoconfig > $ make O=/tmp/tb LSMOD=/tmp/tb/lsmod localmodconfig > GEN Makefile > using config: '.config' > module thunderbolt did not have configs CONFIG_USB4 > > > > If I start from allmodconfig (i.e. CONFIG_USB4 is m), I do not see the warning. > > $ echo thunderbolt >/tmp/tb/lsmod > $ make -s O=/tmp/tb allmodconfig > $ make O=/tmp/tb LSMOD=/tmp/tb/lsmod localmodconfig > GEN Makefile > using config: '.config' > I hate the inconsistency in the Makefile, but localmodconfig should be able to adapt to it. Acked-by: Steven Rostedt (Google) Thanks Jiri and Masamhiro! -- Steve