Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7480088ybi; Thu, 1 Aug 2019 08:48:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9w10eiJlp0sTmeq3qw2PGSdm8b88N9RINdEQT87Qb5lbd/50wwmi5TMnwIFWBL30DHSSV X-Received: by 2002:a17:902:20c8:: with SMTP id v8mr127368701plg.284.1564674503669; Thu, 01 Aug 2019 08:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564674503; cv=none; d=google.com; s=arc-20160816; b=k8ih47vLAaZIaz4GqnMgoDMDgWgqtWLj7GsLn6ma4iI2/SEPuZOFucnCzVrccVMXTb pcSMn4/eVAT5ySA3eiJTzC1+BiXxvHXoAKCMVSMApZWPmXNPYqbBfmRqlmr8NlA9hmGI dcXW05/REuExYy0FzU+LFfZYSLZLCM14MAo5E6Oh8hGB2uvoJPP7i0trIH4N5gcHl+m6 Rj9Xfj0DtSpP4M/zRj0ACgtIigGTz3DtNPinJ3LfDssR6xA9pC5zfZ7dGoVVl0fE5AbG Whp1nRsg8r2puFPFayF6V/F0f7hmhSoCRP67ySS8ti+imc66LRoX5qWDk2YfuHs6w6Or 8EmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=g+rmhc6zy++T+50eqIo6ggUyCQD6Pxxd+ByjsIkrW6w=; b=P1eKNHu18zBB6+sTHh9ogc537mjVdEA9Gl/o8HeeTgpE/Lyz1brttY3Q+Vev6ZbmFA bMCMuNELeHIn21u7xqgnzvmznSBXO0NGU6MDjdLCsIRSxUOU9Xfc+JpjnDQYJFoiaU4l Fw3F6X5CIkrFzI8kTSGbQwX5Uqoq3x2FHhNWAnLvoyxz10kZjqCvqwBRD+/RM+dd4GiH rEsA7EdQXAGkPDLEvEwOUxkkMAgxzGmfD8CWTg6vpUjSIzB009ZfGe2d2ft398j8UfvH RQudYu3C25+jJdbPFY7iX/BEoLpwe9wFWs9/KWgan5UTPnZsEaCPRcAE6kuEM4KtBpZs e/nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=ilJgHqVm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j17si1720788pgn.433.2019.08.01.08.48.08; Thu, 01 Aug 2019 08:48:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=ilJgHqVm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732375AbfHAPLe (ORCPT + 99 others); Thu, 1 Aug 2019 11:11:34 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:35120 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728691AbfHAPLe (ORCPT ); Thu, 1 Aug 2019 11:11:34 -0400 Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9740ACC; Thu, 1 Aug 2019 17:11:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1564672291; bh=vt6Ktjk94ec1H6hufUnNflRQrJSB88KbpfXxlHfnRKg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ilJgHqVmCANyv1bVzbJWbOqH+FJvEwfI+a8Dc6Lj4+LvDruwo5Tv+HlLwjsLlK6s+ f3NlqMceQJErBx2u4YHuIBEDH3iLriggbNaaJyjkjcgm1OM4BmiVIIuqom7k/5IjPq Qhl3kFsOFtFnW8bqI9hXItXcivySMiGneLVNiAZs= Date: Thu, 1 Aug 2019 18:11:29 +0300 From: Laurent Pinchart To: Jacopo Mondi Cc: Kieran Bingham , David Airlie , Daniel Vetter , fabrizio.castro@bp.renesas.com, "open list:DRM DRIVERS FOR RENESAS" , "open list:DRM DRIVERS FOR RENESAS" , open list Subject: Re: [PATCH] drm: rcar_lvds: Fix dual link mode operations Message-ID: <20190801151129.GF5024@pendragon.ideasonboard.com> References: <20190723165700.13124-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190723165700.13124-1-jacopo+renesas@jmondi.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Jacopo, Thank you for the patch. On Tue, Jul 23, 2019 at 06:57:00PM +0200, Jacopo Mondi wrote: > The R-Car LVDS encoder units support dual-link operations by splitting > the pixel output between the primary encoder and the companion one. s/the companion one/its companion/ > > In order for the primary encoder to succesfully control the companion's > operations this should not fail at probe time and register itself its > associated drm bridge so that the primary one can find it. This is hard to parse. > Currently the companion encoder fails at probe time, causing the > registration of the primary to fail preventing the whole DU unit to be > registered correctly. > > Fixes: fa440d870358 ("drm: rcar-du: lvds: Add support for dual-link mode") > Reported-by: Fabrizio Castro > Signed-off-by: Jacopo Mondi > > --- > The "Fixes" tag refers to a patch currently part of the > renesas-drivers-2019-07-09-v5.2 branch of Geert's renesas-drivers tree. > > drivers/gpu/drm/rcar-du/rcar_lvds.c | 31 +++++++++++++++++++++-------- > 1 file changed, 23 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c > index bada7ee98544..8b015ba95895 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c > +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c > @@ -767,14 +767,29 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds) > of_node_put(remote_input); > of_node_put(remote); > > - /* > - * On D3/E3 the LVDS encoder provides a clock to the DU, which can be > - * used for the DPAD output even when the LVDS output is not connected. > - * Don't fail probe in that case as the DU will need the bridge to > - * control the clock. > - */ > - if (lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL) > - return ret == -ENODEV ? 0 : ret; > + switch (ret) { > + case -ENODEV: > + /* > + * On D3/E3 the LVDS encoder provides a clock to the DU, which > + * can be used for the DPAD output even when the LVDS output is > + * not connected. Don't fail probe in that case as the DU will > + * need the bridge to control the clock. > + */ > + if (lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL) > + ret = 0; > + break; > + case -ENXIO: > + /* > + * When the LVDS output is used in dual link mode, the > + * companion encoder fails at > + * 'rcar_lvds_parse_dt_companion()'. Don't fail probe in > + * that case as the master encoder will need the companion's > + * bridge to control its operations. > + */ > + if (lvds->info->quirks & RCAR_LVDS_QUIRK_DUAL_LINK) > + ret = 0; As -ENXIO can only be returned by rcar_lvds_parse_dt_companion(), and rcar_lvds_parse_dt_companion() is only called when the RCAR_LVDS_QUIRK_DUAL_LINK flag is set, this essentially means that you always zero the error returned from rcar_lvds_parse_dt_companion(). This is both complicated and too drastic as the second -ENXIO error case shouldn't be ignored. It would be better and simpler to return 0 from rcar_lvds_parse_dt_companion() when the renesas,companion property can't be found. > + break; > + } > > return ret; > } -- Regards, Laurent Pinchart