Received: by 2002:a05:6512:23a5:0:0:0:0 with SMTP id c37csp505250lfv; Tue, 15 Feb 2022 07:36:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxA3bff893t0AIOj4cKTo1UEtFMWdtnNwDjvvIyZUayuCpFOO4VydM/xdiq98GlFnUNUJGB X-Received: by 2002:aa7:c395:: with SMTP id k21mr4536206edq.436.1644939411617; Tue, 15 Feb 2022 07:36:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644939411; cv=none; d=google.com; s=arc-20160816; b=Z3lC50pbqgxSJ8jE97AcUnrHGwc5MCLeC+WArS7k4PGXNZOFms+uHev17wnHCEN9Q8 m4ALk7fYWG2WyDKCuID0vblsMaqKwiT5t7mZUQjwmbEannGx1kUV/zoD3E3BbjRtss56 gsYQfop4ZSlN1wXwlo7g/5sIlMZc3Hl67ZYJr6x/dv+gPJJvDNdggHqNCIZFoYEgNiDA 0gLh9UE6GIQPWSrK9t4SurCaJgF5wiBN7WsSD9r9gBj/Sc6H7BYfdIJiNx26JhKmsTbl Je23R0tcFkZe00zMaemw1kMOwhgJnClJncYc0jEFqe/PGaNFq56+sDRi3WTXd/xM22Zh bjaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=6lNlCoTfcpMqvqhkT68B9BYySvB6qEPhyvPf8Q7RTQA=; b=EWb8WkQ0uK+YGTf3Ly4CB3lCVsEBbvgfLIEGe7RBbahmoD3kmVnSuBbpxm7X2iDY7d qr6r1I3kiweNnC1W/vHFNAZ+5zMXhxigXdw4IAMsrwkp0eUb3JYrgPKEqJDDeOS7/DkN XvjJ39q/mQzrQ/mePFCWz0JHdqGAzV3gdPmAh7MI9faviK8YodjFeCC7L7PXx9ifXRii OS6kjkk0elTK7G6Nr4bmgEdM1GTMyKnZW9IvoOHcOXX/R8qLOSJizrsrUm+shN0eNVSP VnAYylpl7sGeedlnYQ+vPNnf7Ym0aSP+2g8fyLXwSfrSswLBd5YidzFKR7JFzl+Jqc2p mGcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@emersion.fr header.s=protonmail2 header.b=FV5jLIpD; 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=NONE dis=NONE) header.from=emersion.fr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u13si80781edq.3.2022.02.15.07.36.29; Tue, 15 Feb 2022 07:36:51 -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=@emersion.fr header.s=protonmail2 header.b=FV5jLIpD; 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=NONE dis=NONE) header.from=emersion.fr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238461AbiBONzz (ORCPT + 99 others); Tue, 15 Feb 2022 08:55:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236528AbiBONzx (ORCPT ); Tue, 15 Feb 2022 08:55:53 -0500 X-Greylist: delayed 97404 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 15 Feb 2022 05:55:43 PST Received: from mail-0201.mail-europe.com (mail-0201.mail-europe.com [51.77.79.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E082111089 for ; Tue, 15 Feb 2022 05:55:43 -0800 (PST) Date: Tue, 15 Feb 2022 13:55:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail2; t=1644933337; bh=6lNlCoTfcpMqvqhkT68B9BYySvB6qEPhyvPf8Q7RTQA=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=FV5jLIpDbsQD4XNbDQkQA59s8nRJV6faVAqWXc971NcsmVKHkV3WFz9CryCy95bLx 5fsjgglR+qDN2pAG4VVMHRwiAW7wXc36jCrXRS53wKMt7fzTzs55bc4vbCunEn3BAO Tmv6nP77HGsnX02nIOQ8IrjXl+VSweaREZ7QvAy0WPIyaIHZJiF+wUQhGw9MSGBfLo qgnWv3NMfCuRNuSAJUdB1Fg6FknYIt7YMJoCxO4gh+GCkoF+MPbXltblCW/FsJeHuv NvAiabP6tolfvRebFUuddQF+PsgMjroMmSaHLkMYJmetJAyvBb3HrcDh0oks/v4+3M J1BM1xgrLuF9A== To: Emil Velikov From: 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 Reply-To: Simon Ser Subject: Re: [Intel-gfx] [PATCH v8 1/3] gpu: drm: separate panel orientation property creating and value setting Message-ID: In-Reply-To: References: <20220208084234.1684930-1-hsinyi@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 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 followin= g > > warning. > > > > Add a function to create panel orientation property and set default val= ue > > to UNKNOWN, so drivers can call this function to init the property earl= ier > > , 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 m= y testing. What we can do is create the prop early during module load, and update it w= hen we read the EDID (at the place where we create it right now). User-space wi= ll receive a hotplug event after the EDID is read, so will be able to pick up = the new value if any.