Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2082167pxv; Sat, 24 Jul 2021 04:58:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9WX3H3IoWwUYJbJ6nwWIb95w437fYCg0NPUyZXAr5yL588SHubYqP1rT6lENG9rQYS3Uc X-Received: by 2002:aa7:c782:: with SMTP id n2mr10769576eds.77.1627127919628; Sat, 24 Jul 2021 04:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627127919; cv=none; d=google.com; s=arc-20160816; b=VrAD1chMHHs+L49OkWJnW58EK9nwa0qIj3F0uEP88MWRUd0SfNih9P/pfGvSZtvuAi a7dQIu+7k2Nk6wJMZh9RUKM7Ilzbzmix8XQ7Yla1kUaDOhmLoRjYD13HS7tEKDBk/b/I nJ+515tH5PeoCKUswlvYh3avvbtOqsnqj0NMH+Ocvn9UJ7fJotSS4N3+VjNoKS4dEuRe Qsy2EgxDnfvfN1Y9/l3x1pO63T3qULbnemDgFIu9gXbA89tZldkwPYd+USSXxU8F9I9m 3SCGjjDxoYEgVlducYKYKE/HJ3ntIa2Ck2RyfFVl7YbAZ5AAEUzJHaRPX+NJSL2cUzt6 0GMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5ecmJYDTU4H2+6YU9lzTZYX4lkMQWf98BwjDtmNcohA=; b=HMnk646AlyeHVP+3VSpiyvyXePYpmRj2TCjef1VG3LUnvKOxqku++bibQ4wZOqAqdU gmgluW7Ai/x3Y4+Rh5GXufrBi9YGvbNRe6dzBJJ1IUdphsT1JWob4WPgq7C92NNQv9Vg 1UeA81sgwG73a/HpjuHW53IJkZ9m6/zHrUxM/JDbwE0XyvJ/USpBzCA0kaSm/4q1RfNM FaHH3yyxS9leeO9daONQLDNXjNcWMuidyccADzfwVK54v1NNZ9WkjW+xWO17icYi1gpM +q04Jpii8NIEdwtk2Dp4i9DXGjKSKoSoqABxxbsMMyW+upZnPv4PChyIieZC9I4nATgr Ttxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GqiUR56g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si34832744edq.104.2021.07.24.04.58.17; Sat, 24 Jul 2021 04:58:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GqiUR56g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233768AbhGXLP7 (ORCPT + 99 others); Sat, 24 Jul 2021 07:15:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:58714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbhGXLP7 (ORCPT ); Sat, 24 Jul 2021 07:15:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F98760ED7 for ; Sat, 24 Jul 2021 11:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627127791; bh=Or9WH1pvmZ4tR0pQ+qn4WAUGeesVrTpQna1KRhoMf9k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GqiUR56gRh7BGaa5fFrU9Rxl8M2TrB00nMB8yg+92gB0euS8Aed0u+aaA8CISahNN ldX9XAFfH7P3QVljI3NsDjd4x12IxCk6nqoWDzkr4kbJeiC3zg65f4k4eaV4mv5E0V EyxiSqXXJ2scBbb2lUBTTqk5xs7btW2uq4Tnk7us8K9t+ZwBCPm2Jla+ibbFk/YEJY L4aq6GOaM93UE2knqwhdJzGn6cwlXQdgBf3aNdaYHncu9Le3egmawIOQBo1/y9rXLf +qYpUUY76vRC2vWNwEke7kgu9AQ//0V0DY8LLZ9hk97B1dMS+mpKeWPbRbL97Kc9cr aQGpVKBa/GK4Q== Received: by mail-wm1-f46.google.com with SMTP id j34-20020a05600c1c22b029024e75084404so2226623wms.1 for ; Sat, 24 Jul 2021 04:56:31 -0700 (PDT) X-Gm-Message-State: AOAM530a5Xl7a7yg7WV6OrTRpLQNRoU46JwNNv3blCnHylJbMfKzKNDh TOKqk2IOcx7lIHGMAPjh2pEJEh9/aLB8p9Sg2sY= X-Received: by 2002:a7b:c2fa:: with SMTP id e26mr18402161wmk.84.1627127789904; Sat, 24 Jul 2021 04:56:29 -0700 (PDT) MIME-Version: 1.0 References: <20210723224617.3088886-1-kherbst@redhat.com> In-Reply-To: From: Arnd Bergmann Date: Sat, 24 Jul 2021 13:56:11 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] nouveau: make backlight support non optional To: Karol Herbst Cc: Linux Kernel Mailing List , Lyude Paul , Ben Skeggs , Randy Dunlap , Daniel Vetter , ML nouveau , dri-devel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 24, 2021 at 11:55 AM Karol Herbst wrote: > > On Sat, Jul 24, 2021 at 8:55 AM Arnd Bergmann wrote: > > > > On Sat, Jul 24, 2021 at 12:47 AM Karol Herbst wrote: > > > > > > In the past this only led to compilation issues. Also the small amount of > > > extra .text shouldn't really matter compared to the entire nouveau driver > > > anyway. > > > > > > > > select DRM_TTM_HELPER > > > - select BACKLIGHT_CLASS_DEVICE if DRM_NOUVEAU_BACKLIGHT > > > - select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && INPUT > > > + select BACKLIGHT_CLASS_DEVICE > > > + select ACPI_VIDEO if ACPI && X86 && INPUT > > > select X86_PLATFORM_DEVICES if ACPI && X86 > > > select ACPI_WMI if ACPI && X86 > > > > I think the logic needs to be the reverse: instead of 'select > > BACKLIGHT_CLASS_DEVICE', > > this should be 'depends on BACKLIGHT_CLASS_DEVICE', and the same for ACPI_VIDEO. > > > > We may want to add 'default DRM || FB' to BACKLIGHT_CLASS_DEVICE in the > > process so we don't lose it for users doing 'make oldconfig' or 'make defconfig' > > > > I think the problem with > "depends" is that the user needs to enable backlight support first > before even seeing nouveau and I don't know if that makes sense. But > maybe "default" is indeed helping here in this case. In general, no driver should ever 'select' a subsystem. Otherwise you end up with two problems: - enabling this one driver suddenly makes all other drivers that have a dependency on this visible, and some of those might have a 'default y', so you end up with a ton of stuff in the kernel that would otherwise not be there. - It becomes impossible to turn it off as long as some driver has that 'select'. This is the pretty much the same problem as the one you describe, just the other side of it. - You run into dependency loops that prevent a successful build when some other driver has a 'depends on'. Preventing these loops was the main reason I said we should do this change. In theory we could change the other 85 drivers that use 'depends on' today, and make BACKLIGHT_CLASS_DEVICE a hidden symbol that only ever selected by the drivers that need it. This would avoid the third problem but not the other one. Arnd