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 C39E0EB8FBD for ; Wed, 6 Sep 2023 12:45:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232964AbjIFMpC (ORCPT ); Wed, 6 Sep 2023 08:45:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240784AbjIFMpA (ORCPT ); Wed, 6 Sep 2023 08:45:00 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7C16171F; Wed, 6 Sep 2023 05:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694004295; x=1725540295; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=2WFFdBuEq97dJvORezwILe9aKvh+wu88t3sQ9yPyujk=; b=QXfN3zJSqnbjdtkqE6NQ86Sb1faEN/fOrfP4HVoJ871eWeY1RdSS4R8J yvUvBSANhTLm/Hyv37EL0hGG/bybAT4RngiA1j2q15zx1t/ybSlU7TcV2 wLc1VRAbOyhZIxXWdqeQ7t+z50BWey52zYCGHwrsU01H2pXt0UB8B4/CV 87FwZLm5yGa1ipLixboUXZ4BDhHJshODzjqUMq0MWI/cQ6SstFlunVsKt QAKmZwQaKE+YUQt6UiOnJIkgH1kZfDXXWHXT4X0MQpNNWJ2TVBklfrTWQ Aa9tp3aast6MwqdyhVwNs0SGitgoD+Ist85VpoeGsDO0Mqj6PXdtowKXb g==; X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="367280616" X-IronPort-AV: E=Sophos;i="6.02,232,1688454000"; d="scan'208";a="367280616" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2023 05:44:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="1072369586" X-IronPort-AV: E=Sophos;i="6.02,232,1688454000"; d="scan'208";a="1072369586" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga005.fm.intel.com with SMTP; 06 Sep 2023 05:44:47 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 06 Sep 2023 15:44:46 +0300 Date: Wed, 6 Sep 2023 15:44:46 +0300 From: Heikki Krogerus To: Dmitry Baryshkov Cc: David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Bryan O'Donoghue , Guenter Roeck , Janne Grunau , Simon Ser , Andy Gross , Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, freedreno@lists.freedesktop.org, Won Chung Subject: Re: [RFC PATCH v1 01/12] Revert "drm/sysfs: Link DRM connectors to corresponding Type-C connectors" Message-ID: References: <20230903214150.2877023-1-dmitry.baryshkov@linaro.org> <20230903214150.2877023-2-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Tue, Sep 05, 2023 at 01:56:59PM +0300, Dmitry Baryshkov wrote: > Hi Heikki, > > On Tue, 5 Sept 2023 at 11:50, Heikki Krogerus > wrote: > > > > Hi Dmitry, > > > > On Mon, Sep 04, 2023 at 12:41:39AM +0300, Dmitry Baryshkov wrote: > > > The kdev->fwnode pointer is never set in drm_sysfs_connector_add(), so > > > dev_fwnode() checks never succeed, making the respective commit NOP. > > > > That's not true. The dev->fwnode is assigned when the device is > > created on ACPI platforms automatically. If the drm_connector fwnode > > member is assigned before the device is registered, then that fwnode > > is assigned also to the device - see drm_connector_acpi_find_companion(). > > > > But please note that even if drm_connector does not have anything in > > its fwnode member, the device may still be assigned fwnode, just based > > on some other logic (maybe in drivers/acpi/acpi_video.c?). > > > > > And if drm_sysfs_connector_add() is modified to set kdev->fwnode, it > > > breaks drivers already using components (as it was pointed at [1]), > > > resulting in a deadlock. Lockdep trace is provided below. > > > > > > Granted these two issues, it seems impractical to fix this commit in any > > > sane way. Revert it instead. > > > > I think there is already user space stuff that relies on these links, > > so I'm not sure you can just remove them like that. If the component > > framework is not the correct tool here, then I think you need to > > suggest some other way of creating them. > > The issue (that was pointed out during review) is that having a > component code in the framework code can lead to lockups. With the > patch #2 in place (which is the only logical way to set kdev->fwnode > for non-ACPI systems) probing of drivers which use components and set > drm_connector::fwnode breaks immediately. > > Can we move the component part to the respective drivers? With the > patch 2 in place, connector->fwnode will be copied to the created > kdev's fwnode pointer. > > Another option might be to make this drm_sysfs component registration optional. You don't need to use the component framework at all if there is a better way of determining the connection between the DP and its Type-C connector (I'm assuming that that's what this series is about). You just need the symlinks, not the component. thanks, -- heikki 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 EFFC4EB8FBB for ; Wed, 6 Sep 2023 12:44:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4389510E624; Wed, 6 Sep 2023 12:44:58 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A56F10E624; Wed, 6 Sep 2023 12:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694004296; x=1725540296; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=2WFFdBuEq97dJvORezwILe9aKvh+wu88t3sQ9yPyujk=; b=jTUo27EVW1UHBU4kEyc+EWCDNMZ6m4qShYetPrL+c08GjJHbg5RuzEP8 X4nPtZIWshCXEL/6KR90XhXzUJTXjY/OaXviOf8POkXRGC6BiDljRto/0 iGaQn2rGtA3pbcPyxp77lJlaVyEY+Cp7nBBueB88q4WC5xXE8NH+jDiZ/ 4IVTe2g8hnB34t1mrrKsrE8/1X+z18RgLcLWyp3/UYQXBIzvAFWSAncHU MNw4eoAXbdLKowX8oj8tFNgRA+ysRQt9eWxFyrc57NYDWYlYAuSe+/YdH m3QRME5RSWevthGGAT9ZbbRMb7gwIFM8wVei1FfqB7RURRdbYFsx63MQu A==; X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="367280628" X-IronPort-AV: E=Sophos;i="6.02,232,1688454000"; d="scan'208";a="367280628" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2023 05:44:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="1072369586" X-IronPort-AV: E=Sophos;i="6.02,232,1688454000"; d="scan'208";a="1072369586" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga005.fm.intel.com with SMTP; 06 Sep 2023 05:44:47 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 06 Sep 2023 15:44:46 +0300 Date: Wed, 6 Sep 2023 15:44:46 +0300 From: Heikki Krogerus To: Dmitry Baryshkov Subject: Re: [RFC PATCH v1 01/12] Revert "drm/sysfs: Link DRM connectors to corresponding Type-C connectors" Message-ID: References: <20230903214150.2877023-1-dmitry.baryshkov@linaro.org> <20230903214150.2877023-2-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: , Cc: dri-devel@lists.freedesktop.org, Laurent Pinchart , Andrzej Hajda , Janne Grunau , Robert Foss , Jernej Skrabec , Andy Gross , Bryan O'Donoghue , Guenter Roeck , Thomas Zimmermann , Jonas Karlman , linux-arm-msm@vger.kernel.org, Maxime Ripard , Neil Armstrong , Greg Kroah-Hartman , Bjorn Andersson , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Won Chung , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Sep 05, 2023 at 01:56:59PM +0300, Dmitry Baryshkov wrote: > Hi Heikki, > > On Tue, 5 Sept 2023 at 11:50, Heikki Krogerus > wrote: > > > > Hi Dmitry, > > > > On Mon, Sep 04, 2023 at 12:41:39AM +0300, Dmitry Baryshkov wrote: > > > The kdev->fwnode pointer is never set in drm_sysfs_connector_add(), so > > > dev_fwnode() checks never succeed, making the respective commit NOP. > > > > That's not true. The dev->fwnode is assigned when the device is > > created on ACPI platforms automatically. If the drm_connector fwnode > > member is assigned before the device is registered, then that fwnode > > is assigned also to the device - see drm_connector_acpi_find_companion(). > > > > But please note that even if drm_connector does not have anything in > > its fwnode member, the device may still be assigned fwnode, just based > > on some other logic (maybe in drivers/acpi/acpi_video.c?). > > > > > And if drm_sysfs_connector_add() is modified to set kdev->fwnode, it > > > breaks drivers already using components (as it was pointed at [1]), > > > resulting in a deadlock. Lockdep trace is provided below. > > > > > > Granted these two issues, it seems impractical to fix this commit in any > > > sane way. Revert it instead. > > > > I think there is already user space stuff that relies on these links, > > so I'm not sure you can just remove them like that. If the component > > framework is not the correct tool here, then I think you need to > > suggest some other way of creating them. > > The issue (that was pointed out during review) is that having a > component code in the framework code can lead to lockups. With the > patch #2 in place (which is the only logical way to set kdev->fwnode > for non-ACPI systems) probing of drivers which use components and set > drm_connector::fwnode breaks immediately. > > Can we move the component part to the respective drivers? With the > patch 2 in place, connector->fwnode will be copied to the created > kdev's fwnode pointer. > > Another option might be to make this drm_sysfs component registration optional. You don't need to use the component framework at all if there is a better way of determining the connection between the DP and its Type-C connector (I'm assuming that that's what this series is about). You just need the symlinks, not the component. thanks, -- heikki