All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Guenter Roeck <linux@roeck-us.net>, Janne Grunau <j@jannau.net>,
	Simon Ser <contact@emersion.fr>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	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 <wonchung@google.com>
Subject: Re: [RFC PATCH v1 01/12] Revert "drm/sysfs: Link DRM connectors to corresponding Type-C connectors"
Date: Wed, 6 Sep 2023 15:53:14 +0300	[thread overview]
Message-ID: <20230906125314.GI17308@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAA8EJpratbBybgk8woD3maA=J_HuQis44Unq0n+c_UvaFs__AA@mail.gmail.com>

On Wed, Sep 06, 2023 at 03:48:35PM +0300, Dmitry Baryshkov wrote:
> On Wed, 6 Sept 2023 at 15:44, Heikki Krogerus wrote:
> > On Tue, Sep 05, 2023 at 01:56:59PM +0300, Dmitry Baryshkov wrote:
> > > On Tue, 5 Sept 2023 at 11:50, Heikki Krogerus wrote:
> > > > 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.
> 
> The problem is that right now this component registration has become
> mandatory. And if I set the kdev->fwnode manually (like in the patch
> 2), the kernel hangs inside the component code.
> That's why I proposed to move the components to the place where they
> are really necessary, e.g. i915 and amd drivers.

I'm all for keeping the component framework out of common code. I
dislike that framework with passion, and still haven't lost all hopes of
replacing it with something better.

-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	dri-devel@lists.freedesktop.org,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Janne Grunau <j@jannau.net>, Robert Foss <rfoss@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Andy Gross <agross@kernel.org>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Jonas Karlman <jonas@kwiboo.se>,
	linux-arm-msm@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bjorn Andersson <andersson@kernel.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Won Chung <wonchung@google.com>,
	freedreno@lists.freedesktop.org
Subject: Re: [RFC PATCH v1 01/12] Revert "drm/sysfs: Link DRM connectors to corresponding Type-C connectors"
Date: Wed, 6 Sep 2023 15:53:14 +0300	[thread overview]
Message-ID: <20230906125314.GI17308@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAA8EJpratbBybgk8woD3maA=J_HuQis44Unq0n+c_UvaFs__AA@mail.gmail.com>

On Wed, Sep 06, 2023 at 03:48:35PM +0300, Dmitry Baryshkov wrote:
> On Wed, 6 Sept 2023 at 15:44, Heikki Krogerus wrote:
> > On Tue, Sep 05, 2023 at 01:56:59PM +0300, Dmitry Baryshkov wrote:
> > > On Tue, 5 Sept 2023 at 11:50, Heikki Krogerus wrote:
> > > > 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.
> 
> The problem is that right now this component registration has become
> mandatory. And if I set the kdev->fwnode manually (like in the patch
> 2), the kernel hangs inside the component code.
> That's why I proposed to move the components to the place where they
> are really necessary, e.g. i915 and amd drivers.

I'm all for keeping the component framework out of common code. I
dislike that framework with passion, and still haven't lost all hopes of
replacing it with something better.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-09-06 12:53 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-03 21:41 [RFC PATCH v1 00/12] drm,usb/typec: uABI for USB-C DisplayPort connectors Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 00/12] drm, usb/typec: " Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 01/12] Revert "drm/sysfs: Link DRM connectors to corresponding Type-C connectors" Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-05  8:49   ` Heikki Krogerus
2023-09-05  8:49     ` Heikki Krogerus
2023-09-05 10:56     ` Dmitry Baryshkov
2023-09-05 10:56       ` Dmitry Baryshkov
2023-09-06 12:44       ` Heikki Krogerus
2023-09-06 12:44         ` Heikki Krogerus
2023-09-06 12:48         ` Dmitry Baryshkov
2023-09-06 12:48           ` Dmitry Baryshkov
2023-09-06 12:53           ` Laurent Pinchart [this message]
2023-09-06 12:53             ` Laurent Pinchart
2023-09-06 14:32             ` Maxime Ripard
2023-09-06 14:32               ` Maxime Ripard
2023-09-06 13:38           ` Heikki Krogerus
2023-09-06 13:38             ` Heikki Krogerus
2023-09-11 21:15             ` Dmitry Baryshkov
2023-09-11 21:15               ` Dmitry Baryshkov
2023-09-12 11:05               ` Heikki Krogerus
2023-09-12 11:05                 ` Heikki Krogerus
2023-09-12 17:39                 ` Dmitry Baryshkov
2023-09-12 17:39                   ` Dmitry Baryshkov
2023-09-13  9:27                   ` Heikki Krogerus
2023-09-13  9:27                     ` Heikki Krogerus
2023-09-13 10:26                     ` Dmitry Baryshkov
2023-09-13 10:26                       ` Dmitry Baryshkov
2023-09-13 13:14                       ` Heikki Krogerus
2023-09-13 13:14                         ` Heikki Krogerus
2023-09-13 13:47                         ` Dmitry Baryshkov
2023-09-13 13:47                           ` Dmitry Baryshkov
2023-09-14  9:26                           ` Heikki Krogerus
2023-09-14  9:26                             ` Heikki Krogerus
2023-09-14  9:35                             ` Neil Armstrong
2023-09-14  9:35                               ` Neil Armstrong
2023-09-14 10:16                               ` Dmitry Baryshkov
2023-09-14 10:16                                 ` Dmitry Baryshkov
2023-09-14 10:40                             ` Dmitry Baryshkov
2023-09-14 10:40                               ` Dmitry Baryshkov
2023-09-14 14:55                               ` Heikki Krogerus
2023-09-14 14:55                                 ` Heikki Krogerus
2023-09-13  9:38                   ` Neil Armstrong
2023-09-13  9:38                     ` Neil Armstrong
2023-09-13 10:34                     ` Heikki Krogerus
2023-09-13 10:34                       ` Heikki Krogerus
2023-09-13  3:00               ` [Freedreno] " Rob Clark
2023-09-13  3:00                 ` Rob Clark
2023-09-03 21:41 ` [RFC PATCH v1 02/12] drm/sysfs: link DRM connector device to the connector's fw nodes Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 03/12] drm/connector: extend PATH property to covert Type-C case Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-10-03  9:15   ` Simon Ser
2023-10-03  9:15     ` Simon Ser
2023-09-03 21:41 ` [RFC PATCH v1 04/12] drm/bridge-connector: set the PATH property for the connector Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 05/12] drm/bridge: remove conditionals around devicetree pointers Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 06/12] soc: qcom: pmic_glink_altmode: fix DRM connector type Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-04 15:42   ` Bjorn Andersson
2023-09-04 15:42     ` Bjorn Andersson
2023-09-03 21:41 ` [RFC PATCH v1 07/12] soc: qcom: pmic_glink_altmode: report that this is a Type-C connector Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-04 15:43   ` Bjorn Andersson
2023-09-04 15:43     ` Bjorn Andersson
2023-09-04 15:45     ` Dmitry Baryshkov
2023-09-04 15:45       ` Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 08/12] usb: typec: support generating Type-C port names for userspace Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 09/12] usb: typec: tcpm: " Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 10/12] usb: typec: qcom: implement proper error path in probe() Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 11/12] usb: typec: qcom: extract DRM bridge functionality to separate file Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-03 21:41 ` [RFC PATCH v1 12/12] usb: typec: qcom: define the bridge's path Dmitry Baryshkov
2023-09-03 21:41   ` Dmitry Baryshkov
2023-09-15 12:14   ` Heikki Krogerus
2023-09-15 12:14     ` Heikki Krogerus
2023-10-23 18:24     ` Dmitry Baryshkov
2023-10-23 18:24       ` Dmitry Baryshkov
2023-10-30  8:19       ` Heikki Krogerus
2023-10-30  8:19         ` Heikki Krogerus
2023-10-30  9:47         ` Dmitry Baryshkov
2023-10-30  9:47           ` Dmitry Baryshkov
2023-10-30 10:13           ` Simon Ser
2023-10-30 10:13             ` Simon Ser
2023-10-30 10:22             ` Dmitry Baryshkov
2023-10-30 10:22               ` Dmitry Baryshkov
2023-10-30 10:26               ` Simon Ser
2023-10-30 10:26                 ` Simon Ser
2023-10-30 12:12                 ` Dmitry Baryshkov
2023-10-30 12:12                   ` Dmitry Baryshkov
2023-09-04 15:46 ` [RFC PATCH v1 00/12] drm,usb/typec: uABI for USB-C DisplayPort connectors Bjorn Andersson
2023-09-04 15:46   ` Bjorn Andersson
2023-09-04 15:49   ` Dmitry Baryshkov
2023-09-04 15:49     ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230906125314.GI17308@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=agross@kernel.org \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --cc=andrzej.hajda@intel.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=contact@emersion.fr \
    --cc=daniel@ffwll.ch \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=j@jannau.net \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=wonchung@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.