Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2352405rdg; Mon, 16 Oct 2023 01:17:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyx0Yu7SOJPsWFbaCQpRvAKGdBDNGEXyEm6iRYpeTO1lzrIpBGPoHaCqx8vIqihnfVe4gf X-Received: by 2002:a05:6808:2985:b0:3b0:d583:dc4 with SMTP id ex5-20020a056808298500b003b0d5830dc4mr25967820oib.54.1697444275272; Mon, 16 Oct 2023 01:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697444275; cv=none; d=google.com; s=arc-20160816; b=YPEi+DEQp8WTnZxby4MTMslEryUx7YL0YsotyGb3G8UbnXXKr8ikm70OUeBfI8jMX+ 0SJ2oVt1kMyVyPARr6laGWbi/Q5H8oItySiokJL8aDui7LYdK5GABfDbaH+2Xp5u1Ba5 NDsQhhf7QMAwSYQSEOqb1H5uqg+tcNctxnSAg0ZS8/gPGUVSIes7UTfiGXgt4buROzzh 4JRfnR5p/rzNKaNVkb9xOitZZNAel4anTyf5B15MWxzM04m3k5Q2tWDWwynjTSKNPP5o lkqGr7S80sSk0ieis3ZSYj8rwSG/7Ua/QaXVcgsFcv+H+c3mDpSzQPKEfYxpP1e24Bn1 UQdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IMH2G+Nwn0MthOczjMbSF6N62Pb6c9MjUnOEH52a2Zo=; fh=XKDb/y/u7yzAgqmVqRASzTTwGC04tjaKZjyCUn2Pvrg=; b=KvewExqIxw99D0cFiA1JkO4q3y5tTIg8Ajnc/XvFR7TlehH9poJLttdkNlhdjqrfYe K1lZVkvZyuARYYr51+0Inef/3T1B2cGi6mD5Wf/c/kg2YoAGZjv3iL3PLoGbnqEF2fZx NMLPvkxnFYXFKpivb/vAmHqCz8sgUFihxAfSfQ8ShTE6AaSzgay8+L6COsYRH0NwX1Wh olEsqYRF/4MXEnhslKM8UE/iL/ug4Z6agXQmkAh2HCSuAO0DlmfJmKRdMAQkoyXD99Qq 6NyGzrEvuk5PObVd/TKl6MnGqS46bl1+hQkYfTEGu10Vxibp93UMmW3NNtOFPfXFu7dW d6Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Ove4ASLn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g28-20020a63375c000000b005a073e0cca1si1873027pgn.512.2023.10.16.01.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 01:17:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Ove4ASLn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4E6BD80B2323; Mon, 16 Oct 2023 01:17:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232515AbjJPIRw (ORCPT + 99 others); Mon, 16 Oct 2023 04:17:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232495AbjJPIRr (ORCPT ); Mon, 16 Oct 2023 04:17:47 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4DFCA1 for ; Mon, 16 Oct 2023 01:17:45 -0700 (PDT) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0EE1457E; Mon, 16 Oct 2023 10:17:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1697444257; bh=EftfoqGpdDus77//EOZMJorsdbgIE/1k/ECKENXGeo0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ove4ASLnI1xkDWh3D0UPJYm3A3yzl8x/HTcVunVopBNNknPPycXiL8Whlwsa6CHWy UR2ZzoWnlYhdUpotdsAyru/CJZBMcWgCXFdVtxS175AUp5wYL28IC4A7XEBgbCVpHe A4BYyFOGVKOHKRuX/ewRtt4ixIXMShRqyIPmB9JE= Date: Mon, 16 Oct 2023 11:17:49 +0300 From: Laurent Pinchart To: Alvin =?utf-8?Q?=C5=A0ipraga?= Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Alvin =?utf-8?Q?=C5=A0ipraga?= , Hans Verkuil Subject: Re: [PATCH] drm: bridge: adv7511: get edid in hpd_work to update CEC phys address Message-ID: <20231016081749.GE23177@pendragon.ideasonboard.com> References: <20231014-adv7511-cec-edid-v1-1-a58ceae0b57e@bang-olufsen.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231014-adv7511-cec-edid-v1-1-a58ceae0b57e@bang-olufsen.dk> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 16 Oct 2023 01:17:54 -0700 (PDT) Hi Alvin, Thank you for the patch. CC'ing Hans Verkuil, to review the CEC side. On Sat, Oct 14, 2023 at 09:43:01PM +0200, Alvin Šipraga wrote: > From: Alvin Šipraga > > The adv7511 driver is solely responsible for setting the physical > address of its CEC adapter. To do this, it must read the EDID. However, > EDID is only read when either the drm_bridge_funcs :: get_edid or > drm_connector_helper_funcs :: get_modes ops are called. Without loss of > generality, it cannot be assumed that these ops are called when a sink > gets attached. Therefore there exist scenarios in which the CEC physical > address will be invalid (f.f.f.f), rendering the CEC adapter inoperable. > > Address this problem by always fetching the EDID in the HPD work when we > detect a connection. The CEC physical address is set in the process. > > Signed-off-by: Alvin Šipraga > --- > Pardon the insertion of the ugly adv7511_get_edid() prototype, but I did > not want to clobber git history by rearranging a bunch of functions. If > this is the preferred approach I will happily re-spin the patch. There's nothing wrong in rearranging functions, it is actually preferred to adding forward declarations. You can submit a set of two patches, one to reorder the functions, and then a second one to fix the problem. This makes review easier by isolating the refactoring with no functional change from the functional changes. > --- > drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > index 2611afd2c1c1..3d32c109963c 100644 > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c > @@ -424,6 +424,9 @@ static bool adv7511_hpd(struct adv7511 *adv7511) > return false; > } > > +static struct edid *adv7511_get_edid(struct adv7511 *adv7511, > + struct drm_connector *connector); > + > static void adv7511_hpd_work(struct work_struct *work) > { > struct adv7511 *adv7511 = container_of(work, struct adv7511, hpd_work); > @@ -457,6 +460,9 @@ static void adv7511_hpd_work(struct work_struct *work) > if (adv7511->connector.dev) { > if (status == connector_status_disconnected) > cec_phys_addr_invalidate(adv7511->cec_adap); > + else > + adv7511_get_edid(adv7511, &adv7511->connector); > + > drm_kms_helper_hotplug_event(adv7511->connector.dev); > } else { > drm_bridge_hpd_notify(&adv7511->bridge, status); > -- Regards, Laurent Pinchart