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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDA13CFD31C for ; Mon, 24 Nov 2025 07:10:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 68E5410E068; Mon, 24 Nov 2025 07:10:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jn8gVZ0o"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2023810E068 for ; Mon, 24 Nov 2025 07:10:38 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 143AE43446; Mon, 24 Nov 2025 07:10:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62B46C4CEF1; Mon, 24 Nov 2025 07:10:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1763968237; bh=+YCaXkWU9YkNV0FRWVSw1NN872qKLHgrqDXqtDa6dJI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jn8gVZ0of5w9KSW/6XhTWgtPBbKeXjYsy1Tz7/knQXFS2NI1LeljWM4ESysUJV1fi iM9S79mQ5WVSRrpzSFjw6zAsnP6v7VF2erwC/MmnM6UablSJzgwywhIQpLl+T3Wsdf OHRxeObue89UUtbgEqb6NGnyZNBmz8pkePLuqF5A= Date: Mon, 24 Nov 2025 08:10:33 +0100 From: Greg Kroah-Hartman To: Chaoyi Chen Cc: Chaoyi Chen , Heikki Krogerus , Dmitry Baryshkov , Peter Chen , Luca Ceresoli , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Sandy Huang , Andy Yan , Yubing Zhang , Frank Wang , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Amit Sunil Dhamne , Dragan Simic , Johan Jonker , Diederik de Haas , Peter Robinson , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v10 01/11] usb: typec: Add notifier functions Message-ID: <2025112402-unopposed-polio-e6e9@gregkh> References: <20251120022343.250-1-kernel@airkyi.com> <20251120022343.250-2-kernel@airkyi.com> <2025112102-laurel-mulch-58e4@gregkh> <462ad1bd-7eec-4f26-b383-96b049e14559@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <462ad1bd-7eec-4f26-b383-96b049e14559@rock-chips.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Nov 24, 2025 at 09:40:03AM +0800, Chaoyi Chen wrote: > Hi Greg, > > On 11/21/2025 10:07 PM, Greg Kroah-Hartman wrote: > > On Thu, Nov 20, 2025 at 10:23:33AM +0800, Chaoyi Chen wrote: > > > From: Chaoyi Chen > > > > > > Some other part of kernel may want to know the event of typec bus. > > Be specific, WHAT part of the kernel will need to know this? > > For now, it is DRM. Then say this. > > And why a new notifier, why not just use the existing notifiers that you > > already have? And what is this going to be used for? > > We have discussed this before, but the current bus notifier cannot achieve the expected notification [0]. > > [0] https://lore.kernel.org/all/aPsuLREPS_FEV3DS@kuha.fi.intel.com/ Then you need to document the heck out of this in the changelog text. But I'm still not quite understanding why the bus notifier does not work here, as you only want this information if the usb device is bound to the bus there, you do not want to know this if it did not complete. That thread says you want this not "too late", but why? What is the problem there, and how will you handle your code getting loaded after the typec code is loaded? Notifier callbacks don't work for that situation, right? > > Notifiers are a pain, and should almost never be added. Use real > > function calls instead. > > In v6, I used direct function calls, but had to switch to notifiers because couldn't resolve the dependencies between DRM and Type-C [1]. Do you have any good ideas? Thank you. Only allow this DRM code to be built if typec code is enabled, do NOT use a select, use a depends in the drm code. thanks, greg k-h