Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9059878rwr; Thu, 11 May 2023 09:25:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5SDb0RnEXsRUpZgO+EU/2pvwOm/5qT04JjtpqEWVwlTaVZea/YSFsqcP1VZhvcgygPjMtN X-Received: by 2002:a17:90b:164d:b0:247:2874:a6a6 with SMTP id il13-20020a17090b164d00b002472874a6a6mr21785871pjb.2.1683822302779; Thu, 11 May 2023 09:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683822302; cv=none; d=google.com; s=arc-20160816; b=pBRuiPfoUh97pW3Rv0RXcYPwRjpcbWR8YE03Z9AEiOArp8VP/v/Mjtc2bvoO+VeMnY BfW+ztxILiymYMHkxSRY3ACVPiHqor3ugzYWorrdNHGgc82zNCRRu1/KPKQfu9Z5qwig f/rW4Q3ZOxLzgBJUKP7GCC4cf3wwG7vyJQcNvuKO1VKq7fqwxGgVzwNxXN12hlap1N08 ztcEEQtQcTe/uQbjoFJ88MosPEf2nj2Z6Pic6pgYgKDQH33eYDYRwpztCxjiqfR4jf7A hKt/gIgW2lfVSt7il9zNb8jkc70aYu1Yv+CY5edR++mzedY8Y0NMqz9IKwCYGE31kp03 MebA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=WRhpvyCu89WPSAHsc0asRkGoo6WfDe1xD0MYCg5WQWg=; b=G1hZjXQbroYl8FcpCKBhW3EyCqBaxmktXAE6SZbmwd6/Dvo9p1/UzuwDXNrPeS/sLT 4S9JBWJpg/pilHZebXlq100MHP7oaLUUrYqzz+PUyA6EJB66APNn6WYGqzoLT4rI9BAy x293J3jfSfFPsJy/YkWdClJ5yIAvT5Z+HZ3XsHm9AL82FlZ9sGKcCF3AfWDy2wV8XK+C Zogqu6QpAuP40yGs4mCgSBz+Gwj93/XkPvXPAWQnkWio9x5JGG4zgSxQISN7tAZYlowy UfFQVBOa8Av5AFvHfdPwm5CgT7blne6OalWPd9bLPsoaHjgmyV4p2A2VOEFs9St4rPjQ I+Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vFduNp+A; 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 i17-20020a17090acf9100b0024e60919369si5691351pju.172.2023.05.11.09.24.47; Thu, 11 May 2023 09:25:02 -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=vFduNp+A; 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 S238731AbjEKQQa (ORCPT + 99 others); Thu, 11 May 2023 12:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238150AbjEKQQ3 (ORCPT ); Thu, 11 May 2023 12:16:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DC232681; Thu, 11 May 2023 09:16:27 -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 F15C5619A5; Thu, 11 May 2023 16:16:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F355C4339E; Thu, 11 May 2023 16:16:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683821786; bh=37BLDMCQApsAYWkD2Fzkf9WBWnl8ntaXgQXEeNJfu6g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vFduNp+AFVlR1whHWfYkSSUXtqdrbdmkSvG29SAJ52Fo0fYb7Za4cEdoiqrLKFoYL iSxEE9zmu3ljSqd/ykPAiKPbHFmZEAE1o8IX7Ej6ylyQIXFcaEUyThU73H1xSACKcl C21nEWbeImzjsQ4YRDUrYy+Zko54/xhHj5BKauuFicWNrXtohDqx3uzj2zl5iPetw+ YIU3Rb8GqcklpcVqBigUvTcg4DWNkPz7YgxoDE114K1RL3FrUjyDCS+gxyYwoBVJHc hCYVzN3MlxvSYrvIn07dnnqa3Kn+SrwUmJASt2EoZCRo3auEAQigxFq/XbVB5NVXsx yTieR1wDilSVA== Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-192cfb46e75so4017367fac.3; Thu, 11 May 2023 09:16:26 -0700 (PDT) X-Gm-Message-State: AC+VfDxQJoHFS3yu9RLiSqx35BMhtUMKgjelLHf5bmZczhHUpOsDgeJ1 c/2Ch3vtUdDgl1NyEExNNAuVuBkrVaoEj38uloI= X-Received: by 2002:a05:6870:a455:b0:196:3004:cc07 with SMTP id n21-20020a056870a45500b001963004cc07mr4435471oal.39.1683821785529; Thu, 11 May 2023 09:16:25 -0700 (PDT) MIME-Version: 1.0 References: <4cb758c7-f4f5-820c-c7e7-5b900ccc2534@kernel.org> In-Reply-To: <4cb758c7-f4f5-820c-c7e7-5b900ccc2534@kernel.org> From: Masahiro Yamada Date: Fri, 12 May 2023 01:15:49 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: make localmodconfig doesn't work for thunderbolt To: Jiri Slaby Cc: Linux Kbuild mailing list , andreas.noever@gmail.com, michael.jamet@intel.com, Mika Westerberg , YehezkelShB@gmail.com, USB list , Linux kernel mailing list , Steven Rostedt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 +CC Steven Rostedt, author of streamline_config.pl On Wed, May 10, 2023 at 8:01=E2=80=AFPM Jiri Slaby w= rote: > > Hi, > > if I use localmodconfig for example like this: > mkdir /tmp/tb/ > echo thunderbolt >/tmp/tb/lsmod > make O=3D/tmp/tb LSMOD=3D/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} :=3D 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) { > $_ =3D convert_vars($_, %make_vars); > > # collect objects after obj-$(CONFIG_FOO_BAR) > - if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=3D\s*(.*)/) { > + if (/obj-\$[({](CONFIG_[^})]*)[)}]\s*[+:]?=3D\s*(.*)/) { > $var =3D $1; > $objs =3D $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. There is no good reason to support only $(), but not ${}. 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} +=3D 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. It disables unneeded CONFIG options, but it does not enable needed CONFIG options. If I start from allnoconfig (i.e. CONFIG_USB4 is unset), I see the warning. $ echo thunderbolt >/tmp/tb/lsmod $ make -s O=3D/tmp/tb allnoconfig $ make O=3D/tmp/tb LSMOD=3D/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 warn= ing. $ echo thunderbolt >/tmp/tb/lsmod $ make -s O=3D/tmp/tb allmodconfig $ make O=3D/tmp/tb LSMOD=3D/tmp/tb/lsmod localmodconfig GEN Makefile using config: '.config' --=20 Best Regards Masahiro Yamada