Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp346149pxb; Tue, 15 Feb 2022 14:59:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQS08GUdtjubQfU1KaKWWfvnY60tEtDBl1LYgDLlK6ey+YviYlKuhGUfSVJSxqz4BrKVoi X-Received: by 2002:a50:9543:0:b0:410:a4bf:6f92 with SMTP id v3-20020a509543000000b00410a4bf6f92mr75604eda.181.1644965996867; Tue, 15 Feb 2022 14:59:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644965996; cv=none; d=google.com; s=arc-20160816; b=ePgm/juu146NazQAsleIIztoFYic5UeldU2n8tQ5bbGMMIPOp/C9WxkLHfN4cjNPRJ TP6jQfuZVDJ0oYJzs5vXe+CQPTkdUz+D823ald9Uh9AbBO2ezCJXU1C9yphenv2/OAnk UXvR33c0LduwkBzu5N54QyFPEDOXqugGFVNccfi/VI0cVv306SGe5YIQcbUTYgXU3j4F qKsGeEw42W+qPfO/D/WAqsPoBqJ8kxqBbqjFc72Uz3blZObrtWlg/L15i+uOTfRk1hHV s11x2FgGPrKiQD8Eu+XV0PUjU10fn2ZjVV+ltzqqf/1G+eyXh1zk2n7KJX2iIVx9d4kD TraQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=K0ow2l97FBadE8xYyNQO77wV9BV8c9FeJliZ8Zblp7o=; b=B6s59gXhjycvKw6LHaTD+rxCmai702ubRJOH0v1ON9brZZHsfTKKilD7E2JxgzC4N+ Iwy0FnFGe1ABu4F54sJKqmXVZdpGHsuQxYuMbUKv/dPnmf6Kipc1aKNNIfx01p97N311 uBzkVPKdGZ3gEUvO84uS938zTKuCjD0UfRfhw0U6RLlCjvlj8ai6Q3zkJc0JS+28f0au Fxywi/6BgnMtpFrmoXzm58KLqYnG6Dm8F11bCw+tQXsjImgb5JQaDSHvF12WMQMdk4Wu 0BAmo6uzsfRy5Q2byM/j8NNqpFSL+ynCURz3LT/xVsYc7X6KeRZkgRLrxWLAJa3dYe5N jO7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OvCv7l+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf18si3193842ejc.602.2022.02.15.14.59.34; Tue, 15 Feb 2022 14:59:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OvCv7l+I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238735AbiBOOjK (ORCPT + 99 others); Tue, 15 Feb 2022 09:39:10 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:47928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbiBOOjI (ORCPT ); Tue, 15 Feb 2022 09:39:08 -0500 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1048E102405; Tue, 15 Feb 2022 06:38:58 -0800 (PST) Received: by mail-qk1-x731.google.com with SMTP id o10so17481320qkg.0; Tue, 15 Feb 2022 06:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K0ow2l97FBadE8xYyNQO77wV9BV8c9FeJliZ8Zblp7o=; b=OvCv7l+IVLWiIYmrA/eyOyIiGsNr6rEC7SJ7SI0ykniYkMXuIlbJcyiIniSJZegR2Q ltJkoPKJSaCAcHmU2ItgB4h4Q2BMMyJpPrb5qq2ol+JxDJQhMIir73svlUhYVpbFqcEI tJVivfur2J2rZ4jI/Uqc9oeXE3FMfu6wIDttguFk/9lgOFkcevAPJYhU6Zj7Fx8tZCuW ehg5xjdZQpWY7QJ1PPdvodk1qObW598mPzqHm2H6yM7E6tmgab8eRc6qu2hOx6UhhA7v NZkXXBD8h4kSdipkJVyWNWpwOCY2NbcsJRpT8LKWTFz26koS2tf+T93JWDH2qnn2Vihr UoGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K0ow2l97FBadE8xYyNQO77wV9BV8c9FeJliZ8Zblp7o=; b=NHLfp1sq8rWQ95mAa3gF0P0pcrMGUwx1KbtlLpO8RQHw88vYKWvDjWn+KTVbgLrFPZ Npk2ZC3RZVCqxzbkBSu9+2NyVTtTQw77y3lJ1qJARLDNrQMdjO6lWUmxoDZaujYOzCFX NVFAmjp1+051S6216rmMYLgqE3tgDx2WMqU22Wdfd/1su3GwtSyUP5crXXtzj3+N2gtN 6YPuRjNEEmMiKO1zIrV2ZhxHXbwi8Rc0RuGipyYWNzdoZn2xR70l1TxwqeNvweQ3ykFA 6LVr8wgMa0fK1FVgZWazhkoE0y5AIkI2iegMMiSWerhXlt2nY97FhGYUeuTIVov/TL3U V/Fg== X-Gm-Message-State: AOAM531hrU+eFEfm9z5y3ai05duPqwuBQzzRXwjl6+GeeJEEgFs2HEsW 31K8EdGNxq2j6gXmlaNBRE4rLuDoVf43w8jT+Ys= X-Received: by 2002:a05:620a:4042:: with SMTP id i2mr2065887qko.592.1644935937193; Tue, 15 Feb 2022 06:38:57 -0800 (PST) MIME-Version: 1.0 References: <20220208084234.1684930-1-hsinyi@chromium.org> In-Reply-To: From: Emil Velikov Date: Tue, 15 Feb 2022 14:38:45 +0000 Message-ID: Subject: Re: [Intel-gfx] [PATCH v8 1/3] gpu: drm: separate panel orientation property creating and value setting To: Simon Ser Cc: Hsin-Yi Wang , ML dri-devel , David Airlie , Daniel Vetter , amd-gfx mailing list , Intel Graphics Development , Chun-Kuang Hu , devicetree , "Linux-Kernel@Vger. Kernel. Org" , Maxime Ripard , Alex Deucher , Rob Herring , linux-mediatek@lists.infradead.org, Thomas Zimmermann , Harry Wentland , Matthias Brugger , LAKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Feb 2022 at 13:55, Simon Ser wrote: > > On Tuesday, February 15th, 2022 at 13:04, Emil Velikov wrote: > > > Greetings everyone, > > > > Padron for joining in so late o/ > > > > On Tue, 8 Feb 2022 at 08:42, Hsin-Yi Wang wrote: > > > > > > drm_dev_register() sets connector->registration_state to > > > DRM_CONNECTOR_REGISTERED and dev->registered to true. If > > > drm_connector_set_panel_orientation() is first called after > > > drm_dev_register(), it will fail several checks and results in following > > > warning. > > > > > > Add a function to create panel orientation property and set default value > > > to UNKNOWN, so drivers can call this function to init the property earlier > > > , and let the panel set the real value later. > > > > > > > The warning illustrates a genuine race condition, where userspace will > > read the old/invalid property value/state. So this patch masks away > > the WARNING without addressing the actual issue. > > Instead can we fix the respective drivers, so that no properties are > > created after drm_dev_register()? > > > > Longer version: > > As we look into drm_dev_register() it's in charge of creating the > > dev/sysfs nodes (et al). Note that connectors cannot disappear at > > runtime. > > For panel orientation, we are creating an immutable connector > > properly, meaning that as soon as drm_dev_register() is called we must > > ensure that the property is available (if applicable) and set to the > > correct value. > > Unfortunately we can't quite do this. To apply the panel orientation quirks we > need to grab the EDID of the eDP connector, and this happened too late in my > testing. > > What we can do is create the prop early during module load, and update it when > we read the EDID (at the place where we create it right now). User-space will > receive a hotplug event after the EDID is read, so will be able to pick up the > new value if any. Didn't quite get that, are you saying that a GETPROPERTY for the EDID, the ioctl blocks or that we get an empty EDID? The EDID hotplug even thing is neat - sounds like it also signals on panel orientation, correct? On such an event, which properties userspace should be re-fetching - everything or guess randomly? Looking through the documentation, I cannot see a clear answer :-\ Thanks Emil