From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DB56C433B4 for ; Thu, 8 Apr 2021 12:12:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0223261107 for ; Thu, 8 Apr 2021 12:12:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0223261107 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6B15A6B0080; Thu, 8 Apr 2021 08:12:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 688E86B0081; Thu, 8 Apr 2021 08:12:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 528988D0001; Thu, 8 Apr 2021 08:12:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 35B166B0080 for ; Thu, 8 Apr 2021 08:12:54 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DF01318360DD7 for ; Thu, 8 Apr 2021 12:12:53 +0000 (UTC) X-FDA: 78009088626.38.43307E0 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by imf06.hostedemail.com (Postfix) with ESMTP id 6CDB8C0007C1 for ; Thu, 8 Apr 2021 12:12:54 +0000 (UTC) Received: from mail-ot1-f49.google.com ([209.85.210.49]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MvJjz-1lm8ry1w3d-00rKvY for ; Thu, 08 Apr 2021 14:12:51 +0200 Received: by mail-ot1-f49.google.com with SMTP id h6-20020a0568300346b02901b71a850ab4so2033326ote.6 for ; Thu, 08 Apr 2021 05:12:50 -0700 (PDT) X-Gm-Message-State: AOAM533799dOIfN2jxuAslZmAc9yfwbIz/A5RCOVSofRexGECPiJ6uyj EpufRHFnEhU4AKFHRyBDYkvZ3g8+OGpjpazyEp4= X-Google-Smtp-Source: ABdhPJxHyCWMenVUxv33s1E6jvbsFFZTfTMiy2a27GKmZ/Mw2GJW7+vO9jPST57wudsWVl6e6VoT2RKQT0t6kEAsZEE= X-Received: by 2002:a9d:316:: with SMTP id 22mr7238748otv.210.1617883969787; Thu, 08 Apr 2021 05:12:49 -0700 (PDT) MIME-Version: 1.0 References: <20210408092011.52763-1-david@redhat.com> <20210408092011.52763-3-david@redhat.com> <7496ac87-9676-1b4e-3444-c2a662ec376b@redhat.com> <3a2d64a7-8425-8daf-17ee-95b9f0c635f9@redhat.com> In-Reply-To: <3a2d64a7-8425-8daf-17ee-95b9f0c635f9@redhat.com> From: Arnd Bergmann Date: Thu, 8 Apr 2021 14:12:33 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 2/2] drivers/gpu/drm: don't select DMA_CMA or CMA from aspeed or etnaviv To: David Hildenbrand Cc: Linux Kernel Mailing List , Linux-MM , Joel Stanley , David Airlie , Daniel Vetter , Andrew Jeffery , Lucas Stach , Russell King , Christian Gmeiner , Mike Rapoport , Bartlomiej Zolnierkiewicz , Linus Walleij , Michal Simek , Masahiro Yamada , Randy Dunlap , Peter Collingbourne , linux-aspeed , dri-devel , Linux ARM , The etnaviv authors , Linux Fbdev development list Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:N7zjMIYNHT/KcniJFAhQUIJf+VcTrEUs+e0qttMH2icM7PKyhp8 rVv4FTMLZz+UQJrZKJiRkGKHaeK1NuTsATC/F48qB/QFES2+8IkmnUnfmMDjqYhs92tAsw+ KnVnei9+RaT1nc9OouiafjOy3cCIgVvp3nk5gQ39E8uLxgoPiZ/hSun7SgEsrwcZ6dtFyth MhXSu6h/SunrUSu6Yxy7Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:I5wyP7Jjco0=:cQhBT8GbzHu9YzNpUwTQky rq5y6z0M72rqVoKhux3gXP/A3JnGH97wb2++mWSDpVJ80Qa2UM9Lu6nzUOzv7wyVyLN5TBz5u Nf4ylEKr1dkJH/Z5oZEaWzypOcLxQT2gM8H74AMRVRMdbiVx36iyZ4Eg/UdcW4hKdp4/1m7/6 szq+scdkm/TWWDbCEtvClQ6NeZFUxgcCJMstWGvyVcHwZmHlXZzbcLnixoeT0jacGORU0AHMK Zj1wLA4861X2LYgIn0XTLUfD1qt7dz7OdTsE0iCa0lf4IbWD4ZKS/TG/deAXUbba41/64Tsxn UyKmVIQ0vrtnGvgA2MoXBoIquMMXuTlMB8YW/mSh+K4VXth2JaeFh6C89ZrYAXbRstj750ZCu E9iJl8tbD5DcSI7Bb1JSLTCRTBBP/9IpP4/kTCCkKtUPHA9PQ21sETof6oft5IO0bv47lznYL h8FxTzhexoE/IY/78U8JfWUgSRQEeCYGiItA4N0eYZbqgd3xDPMZ/l+6k6r2/by9fLOgIW44S Ciouzok7l0i8nGKVijB+X/ZLv9LZQHwf2VFaP2JL18y39/4luwpQRAWa3DBApKy5eKqCMDawc 56EdcJLdjSNEpCBdljBkms84sNMu8FRkQ3 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6CDB8C0007C1 X-Stat-Signature: 9oi9u9sfb8szutnw7unyqtjpgbkzzih5 Received-SPF: none (arndb.de>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=mout.kundenserver.de; client-ip=217.72.192.73 X-HE-DKIM-Result: none/none X-HE-Tag: 1617883974-485340 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Apr 8, 2021 at 2:00 PM David Hildenbrand wrote: > > On 08.04.21 13:44, Arnd Bergmann wrote: > > On Thu, Apr 8, 2021 at 1:00 PM David Hildenbrand wrote: > >>> > >>> It is a somewhat awkward way to say "prevent this symbol from > >>> being =y if the dependency is =m". > >> > >> What would be the right thing to do in the case here then to achieve the > >> "if DRMA_ASPEED_GFX is enabled, also enable DMA_CMA id possible"? > >> > >> One approach could be to have for DMA_CMA > >> > >> default y if DRMA_ASPEED_GFX > >> > >> but it feels like the wrong way to tackle this. > > > > I'm still not sure what you are trying to achieve. Is the idea only to provide > > a useful default for DMA_CMA depending on which drivers are enabled? > > "Random drivers should not override a user configuration of core knobs > (e.g., CONFIG_DMA_CMA=n)." > > Let's assume I'm a distribution and want to set CONFIG_CMA=n or want to > set CONFIG_DMA_CMA=n with CONFIG_CMA=y; there is no way to do that with > e.g., DRMA_ASPEED_GFX=y because it will always override my (user!) > setting -- even though it doesn't really always need it. Using "select" > is the problem here. I agree on the part of removing the 'select' if we don't need it. The part I couldn't figure out was what the 'imply' is supposed to help with. Most other users that added imply tried (and failed) to fix a build problem. > > This is something you could do using a hidden helper symbol like > > > > config DRMA_ASPEED_GFX > > bool "Aspeed display driver" > > select DRM_WANT_CMA > > > > config DRM_WANT_CMA > > bool > > help > > Select this from any driver that benefits from CMA being enabled > > > > config DMA_CMA > > bool "Use CMA helpers for DRM" > > default DRM_WANT_CMA > > > > Arnd > > > > That's precisely what I had first, with an additional "WANT_CMA" -- but > looking at the number of such existing options (I was able to spot 1 !) > I wondered if there is a better approach to achieve the same; "imply" > sounded like a good candidate. I can probably find a couple more, but regardless of how many others exist, this would be a much clearer way of doing it than 'imply' since it has none of the ambiguity and misuse problems. I think the reason we don't see more is that generally speaking, those defaults are widely ignored anyway. You almost always start out with a defconfig file that contains everything you know you need, and then you add bits to that. Having the default in any form only helps to make that defconfig file one line shorter, while requiring other users to add another line to turn it off when they do not want it. Arnd