Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3106494rdb; Wed, 13 Sep 2023 02:05:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvWkhanH50K9iewLDgxzAQ+f65wMApYr59fhND0LZSoBpzlQhnmsbiNdss36mtZAdtARtg X-Received: by 2002:a17:90b:a4d:b0:268:5919:a276 with SMTP id gw13-20020a17090b0a4d00b002685919a276mr1655392pjb.20.1694595912019; Wed, 13 Sep 2023 02:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694595911; cv=none; d=google.com; s=arc-20160816; b=bsUg9GMavYIEhs5ZmYBGgNnXzI/MaZADTi3YCONIxEq9SlNrV3HzLpk8nthq3x/1ga AawZutGOPfhsBetyfw9kZL9bhAyVI9keDj1MRKjKbKvYI1Yxj5lOj33iMnx6+0SS4QKw w5xqU/EK2byG4zWUB84dI+dpxfCYD7jSDjGS2cG20I5bIhW1Z2Gfy+H3IoVOMlXFKBpn HztUf6P+x2EL0e3U68IJ0RMd3P/RA/9fQK6vGCiI/8RApP5das2QEu1/duPmCrx4/eHJ tnTuX4H+fHqmegWSwjs1ZRHsCeMIfQqmCD0s7+QpfYFUtUEyqoHkRcc2Ovu1yAUCo018 nw+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=B0Ql+Umm198s7EODjUTAFVn1Eek/7t8Ja/ENb4v1xqU=; fh=0GHghEd6QiuAvoZNbqCBDaGW1TcJi3feUxYxMb8C3iI=; b=MhNLfmmUXH3BLSeYEBq6hSzdbKRENgtY3MyIKv5MRN+alwtW9EzBQ9MJgdt0qK9NR1 rQq2kpARGsGKsBvt7mzChU2QN50YjrEKT6KTARUh+305vGxAkfi1j2qtEZkCaFIOriKB 1mDCJazHXktULryfV5kMImAvYf4aSR+M1dkKq7dTw0zzTaCbKsgql/tA6ES5d9zbdVHK yrkItmi22DAWaKQu8ql/fv7RKTArE95r73nCAJ8TQYOy0BCcKrkzHyCClsibj4fgyRUZ bQlMPE+W/dYs8OnOdXhoIv6jTyR1SpWaaSdE35RxjCCtfrWBJxezmD+JXhwd/aiqRVeX LeDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TemaMNVN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id n14-20020a17090a2bce00b0025bf86c41absi1122151pje.151.2023.09.13.02.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 02:05:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TemaMNVN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A806181A9B4B; Tue, 12 Sep 2023 20:01:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233304AbjIMDAw (ORCPT + 99 others); Tue, 12 Sep 2023 23:00:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231181AbjIMDAv (ORCPT ); Tue, 12 Sep 2023 23:00:51 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F16171E; Tue, 12 Sep 2023 20:00:47 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-52e5900cf77so8111602a12.2; Tue, 12 Sep 2023 20:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694574046; x=1695178846; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=B0Ql+Umm198s7EODjUTAFVn1Eek/7t8Ja/ENb4v1xqU=; b=TemaMNVNrUp9WnJKSE+nzrvh+fLsA133vDvMBSDIs/EznNFxYyceoiXoV6eHSAI1IG FfyOwA2dhB2Lc9fQZMn+k1CPaNZmM7M6y5XRFQ1IXbLBZblMwAMXUL8JOlzGq/aT5Ehv lVxL+3xYIfH30XEaksvAvpQ2iyqqZPF/flOLVbxrsPOsrHdDj3oWBuH698ASRUHDgM5o rrfvaSsI3jYJEXQDV9lyHCUj8YVYZ8oPXlR3JwQLX3HvqbP3RA8Nxd7HS8s6fchgfoLc mJwO46sQQBQCFMl79H8hIsvLznGjmIjxNlVnCluF1L0Q90XbKzpIPesZqzd95jSO4K3+ xNDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694574046; x=1695178846; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B0Ql+Umm198s7EODjUTAFVn1Eek/7t8Ja/ENb4v1xqU=; b=R55HVhcsMtcmqhMI074IaiXfuTTstgcZNTGCfyO5xGJJhAFgW+9BTi5SB8dF8R4KDf NGxtdX+QKRCrIGArmW/+EqRnKg4YW0FmtGjvNnqFX9u+gYXzVfDnagcKnHuHIUSyskrM UcIehyC26mjAZqIMbm2dtDZajCZ4RayVfeM7dDkSjwO4rXvsGYQjmIWLd6j7TFxrtQhg m6bLGGFHGYMqyn+/sZcmcEagjjBeG03ZiKCiso3hM1uadNqkb4CpOioxDv2tGm0DIsmE 0HojFQolGu3dFD0ato8ceYhnULDZp/IkgpxQgu2GGpN1tafOJ691rBqxV2NlBFkJc38U /xdQ== X-Gm-Message-State: AOJu0Yx7TiNMym7fJc80/4G92zMqnPgVXAmsvJS9qD8MJCoOj+dMaX1A EGf2RVO4CMaXak/f/AvFNUUyMxdczo6RhjsY9e8= X-Received: by 2002:a05:6402:6c7:b0:525:570c:566b with SMTP id n7-20020a05640206c700b00525570c566bmr1017895edy.22.1694574045793; Tue, 12 Sep 2023 20:00:45 -0700 (PDT) MIME-Version: 1.0 References: <20230903214150.2877023-1-dmitry.baryshkov@linaro.org> <20230903214150.2877023-2-dmitry.baryshkov@linaro.org> <6b6bacee-f7b6-4cfe-be3d-24bda44bfbcf@linaro.org> In-Reply-To: <6b6bacee-f7b6-4cfe-be3d-24bda44bfbcf@linaro.org> From: Rob Clark Date: Tue, 12 Sep 2023 20:00:33 -0700 Message-ID: Subject: Re: [Freedreno] [RFC PATCH v1 01/12] Revert "drm/sysfs: Link DRM connectors to corresponding Type-C connectors" To: Dmitry Baryshkov Cc: Heikki Krogerus , dri-devel@lists.freedesktop.org, Laurent Pinchart , Andrzej Hajda , Janne Grunau , Robert Foss , David Airlie , Jernej Skrabec , Andy Gross , "Bryan O'Donoghue" , Guenter Roeck , Thomas Zimmermann , Jonas Karlman , linux-arm-msm@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Greg Kroah-Hartman , Bjorn Andersson , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Won Chung , Daniel Vetter , Simon Ser , freedreno@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 12 Sep 2023 20:01:25 -0700 (PDT) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email On Mon, Sep 11, 2023 at 2:15=E2=80=AFPM Dmitry Baryshkov wrote: > > On 06/09/2023 16:38, Heikki Krogerus wrote: > > 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: > >>>> 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 NO= P. > >>>>> > >>>>> That's not true. The dev->fwnode is assigned when the device is > >>>>> created on ACPI platforms automatically. If the drm_connector fwnod= e > >>>>> member is assigned before the device is registered, then that fwnod= e > >>>>> is assigned also to the device - see drm_connector_acpi_find_compan= ion(). > >>>>> > >>>>> But please note that even if drm_connector does not have anything i= n > >>>>> its fwnode member, the device may still be assigned fwnode, just ba= sed > >>>>> 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 link= s, > >>>>> so I'm not sure you can just remove them like that. If the componen= t > >>>>> 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 se= t > >>>> 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 registratio= n 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. > > > > So why can't we replace the component with the method you are > > proposing in this series of finding out the Type-C port also with > > i915, AMD, or whatever driver and platform (that's the only thing that > > component is used for)? > > The drm/msm driver uses drm_bridge for the pipeline (including the last > DP entry) and the drm_bridge_connector to create the connector. I think > that enabling i915 and AMD drivers to use drm_bridge fells out of scope > for this series. > > > > Determining the connection between a DP and its Type-C connector is > > starting to get really important, so ideally we have a common solution > > for that. > > Yes. This is what we have been discussing with Simon for quite some time > on #dri-devel. > > Unfortunately I think the solution that got merged was pretty much > hastened in instead of being well-thought. For example, it is also not > always possible to provide the drm_connector / typec_connector links (as > you can see from the patch7. Sometimes we can only express that this is > a Type-C DP connector, but we can not easily point it to the particular > USB-C port. > > So, I'm not sure, how can we proceed here. Currently merged patch breaks > drm/msm if we even try to use it by setting kdef->fwnode to > drm_connector->fwnode. The pointed out `drivers/usb/typec/port-mapper.c` > is an ACPI-only thing, which is not expected to work in a non-ACPI cases. In these cases we revert and try again next cycle BR, -R > > -- > With best wishes > Dmitry >