Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9248013ybi; Wed, 10 Jul 2019 07:08:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoFIyzhwUr7EwTjdyQV67ylxxgo6UHaAvIfQJ+ol9tI+vzR8mJ8ivPiroGHJI21W7bBKC6 X-Received: by 2002:a17:90a:8d0d:: with SMTP id c13mr6929762pjo.137.1562767695800; Wed, 10 Jul 2019 07:08:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562767695; cv=none; d=google.com; s=arc-20160816; b=tj9ix+Ao813kYdpYHz42PcNVSiQH3pdSyoHxrLRlvGUeOBFvyNssLN1iHN3xUWvPd4 ACY8LisoLT0XvfjAiLOw1xQ44z2Ye7HYvps2JuC6Y71scsxVedkWAqSWwcp5DJF0AFqI sohUWYSG3f2HRmbdT1t3hDO3SKoGTyxjiqGIDIrjof7F7b3QA0IiQDWii0TcCyuZV6C1 Es2KAL4RbgIvmEQdtkdLn9dVtCFDZKfEh0CY44teHc63LkWgoSzBSvEkbv0fXn/JxrsS h+z7r8xB0N2sA44T3gs9bfxa4fr2MkvTupnTMdqCIE9YQA3wYT0waoixudPWNRPtMmkW MQGw== 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; bh=4Gd8GiiFm8EewxLR/RN7L6mvqXlEnNZ2o1g2EPuuqHQ=; b=W61OGcBwcsPD8ruYom8DBD7StMQNT53JVnO5iQIpXanV0iLezuAkC92bIkHG4I4Z3m lTv5jpHFOTVY41pvxkp/VtKMqmdt4T6GpNHgWSS/0FNBGK2YzXpywCqpjVU90M9u5RG+ dNCXAtBAlmplzE+4Rdtx9ECPHgtZp+wxfqI5FKWJUlYbfnHkwXo8ZYiAq1CkSijmedtX mo2SKzGohl8h5DGkCqLX7q5/PWQdoEGoWn1cg2VYWTZMma+LxzC/XK9BSIrkIGTyGZRc EwmWguh3IO7xsU6rzvBA3iOzgi/+kUWENx7vYg4UDkqq9e0JLR7zwqNpMyj+osQIY9Vc hZnw== ARC-Authentication-Results: i=1; mx.google.com; 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 s24si2450746pfh.227.2019.07.10.07.07.59; Wed, 10 Jul 2019 07:08:15 -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; 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 S1727813AbfGJOFM (ORCPT + 99 others); Wed, 10 Jul 2019 10:05:12 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:42617 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbfGJOFL (ORCPT ); Wed, 10 Jul 2019 10:05:11 -0400 X-Originating-IP: 86.250.200.211 Received: from localhost (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: maxime.ripard@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 6C62BE000B; Wed, 10 Jul 2019 14:05:04 +0000 (UTC) Date: Wed, 10 Jul 2019 16:05:04 +0200 From: Maxime Ripard To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Maarten Lankhorst , Sean Paul , Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] drm/modes: Skip invalid cmdline mode Message-ID: <20190710140504.t5lsk36gnn5cdn6b@flea> References: <20190709145151.23086-1-digetx@gmail.com> <20190710101229.54ufuhmh22dfxclr@flea> <4ad69d15-07f8-9753-72d6-a51402c94c20@gmail.com> <20190710125552.qvmnh6qs63ikiu2k@flea> <20190710130615.gvi2jwgr2cds66xr@flea> <75719cad-c65c-7ebc-3ea8-98134f86ddc3@gmail.com> <4a13f12f-05a7-473e-4e4e-7a7e32d09720@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bariuncpprpjv42x" Content-Disposition: inline In-Reply-To: <4a13f12f-05a7-473e-4e4e-7a7e32d09720@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --bariuncpprpjv42x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 10, 2019 at 04:29:19PM +0300, Dmitry Osipenko wrote: > This works: > > diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c > index 56d36779d213..e5a2f9c8f404 100644 > --- a/drivers/gpu/drm/drm_client_modeset.c > +++ b/drivers/gpu/drm/drm_client_modeset.c > @@ -182,6 +182,8 @@ drm_connector_pick_cmdline_mode(struct drm_connector *connector) > mode = drm_mode_create_from_cmdline_mode(connector->dev, cmdline_mode); > if (mode) > list_add(&mode->head, &connector->modes); > + else > + cmdline_mode->specified = false; Hmmm, it's not clear to me why that wouldn't be the case. If we come back to the beginning of that function, we retrieve the cmdline_mode buffer from the connector pointer, that will probably have been parsed a first time using drm_mode_create_from_cmdline_mode in drm_helper_probe_add_cmdline_mode. Now, I'm guessing that the issue is that in drm_mode_parse_command_line_for_connector, if we have a named mode, we just copy the mode over and set mode->specified. And we then move over to do other checks, and that's probably what fails and returns, but our drm_cmdline_mode will have been modified. I'm not entirely sure how to deal with that though. I guess we could allocate a drm_cmdline_mode structure on the stack, fill that, and if successful copy over its content to the one in drm_connector. That would allow us to only change the content on success, which is what I would expect from such a function? How does that sound? Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --bariuncpprpjv42x Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXSXwjwAKCRDj7w1vZxhR xbW+AP9G0wdD7eMxSNjs35WcStnrObO54j7WGEY71hdPnh7yDgD+Ky5utQLhxr2w LBn3jxYg3tyjfdWY04f+p6Cj0pBLhQI= =wZot -----END PGP SIGNATURE----- --bariuncpprpjv42x--