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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2D6DC7EE29 for ; Wed, 7 Jun 2023 06:56:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238467AbjFGG4V (ORCPT ); Wed, 7 Jun 2023 02:56:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237478AbjFGG4T (ORCPT ); Wed, 7 Jun 2023 02:56:19 -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 E7D5C1BC3; Tue, 6 Jun 2023 23:56:08 -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 7176D63B19; Wed, 7 Jun 2023 06:56:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A50E0C433EF; Wed, 7 Jun 2023 06:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686120967; bh=kxTWU5cvbYPXD97OfkZe5ZmWUKr+C21Zw9jRkJYbsMY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BDEk6rrM+92tjnJUIo7PJ6PVQsXMHm1goz4upfVYo17T9b4OBgbYwWBKZ8MpADWpS k34PbyoX2LXa5/BTSYCNa6XjLggLCYt9BFWVwkyXIr9DoEBug2nz7vGKcGgA3TII9w D64O22jrrQGHK02YQphKJdoMXRS9fvr7fkheX4XtQG+P1gortbckgLeUyVSg34AcGe V17l7nwTuMnhS6/GHMnKDb5oSHFQlHuNrGyJEvWkkFJZ2Q4KcWg491YMpxtykiXsGM AcM5AktF0GA+mm1dL12KMYjfkgnSA5WMSqsCIdJTiKd+rrRAQ8yfgvzPKUsw47vYyR +M58T5kpKH1Iw== Received: by pali.im (Postfix) id A1989759; Wed, 7 Jun 2023 08:56:04 +0200 (CEST) Date: Wed, 7 Jun 2023 08:56:04 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Matthew Garrett Cc: AceLan Kao , Hans de Goede , Mark Gross , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Kai-Heng Feng Subject: Re: [PATCH] platform/x86: dell-laptop: Add drm module soft dependency Message-ID: <20230607065604.yaivqbbd3dkawxo4@pali> References: <20230607034331.576623-1-acelan.kao@canonical.com> <20230607042032.GA28835@srcf.ucam.org> <20230607052724.GA29834@srcf.ucam.org> <20230607062341.GA30618@srcf.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230607062341.GA30618@srcf.ucam.org> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 07 June 2023 07:23:41 Matthew Garrett wrote: > On Wed, Jun 07, 2023 at 02:13:31PM +0800, AceLan Kao wrote: > > Matthew Garrett 於 2023年6月7日 週三 下午1:27寫道: > > > > > > On Wed, Jun 07, 2023 at 01:19:40PM +0800, AceLan Kao wrote: > > > > Gfx drivers(i915/amdgpu/nvidia) depend on the drm driver, so delaying > > > > the loading of dell_laptop after drm can ease the issue the most. > > > > Right, it's still possible to encounter the issue, unfortunately, we > > > > do not have a better solution for it at the moment. > > > > > > We could unregister inappropriate backlight drivers when a more > > > appropriate one is loaded, or the policy decision around which driver to > > > use could be made in userland? > > It's hard to decide which backlight driver is redundant, and it's kind of ugly > > to unregister the backlight driver which is registered by other driver and maybe > > problematic. > > But you're relying on registering the working backlight first, which is > an inherently racy thing? We shouldn't be relying on order of > initialisation to make this work, either we should only export a working > interface or we should expose enough information for whatever is using > the interfaces to make an appropriate policy decision itself. IIRC, drm drivers unregister redundant fbcon drivers (vesafb), so cannot drm drivers use similar strategy also for backlight drivers and unregister the redundant? If every backlight driver would have some "flag" which say if it should be unregistered by drm then maybe it could work? Or are there some other pitfalls?