From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752822AbdBCH7k (ORCPT ); Fri, 3 Feb 2017 02:59:40 -0500 Received: from mga05.intel.com ([192.55.52.43]:51344 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbdBCH7i (ORCPT ); Fri, 3 Feb 2017 02:59:38 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,328,1477983600"; d="scan'208";a="816574256" From: Jani Nikula To: Shuah Khan , daniel.vetter@intel.com, seanpaul@chromium.org, airlied@linux.ie Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Shuah Khan Subject: Re: [PATCH] drm: change connector disconnected debug message to an error In-Reply-To: <9d3783d1-b8f8-bd82-3141-1897980197da@osg.samsung.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20170202025904.25810-1-shuahkh@osg.samsung.com> <874m0d0z7o.fsf@intel.com> <9d3783d1-b8f8-bd82-3141-1897980197da@osg.samsung.com> Date: Fri, 03 Feb 2017 09:59:35 +0200 Message-ID: <87vasryaag.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 02 Feb 2017, Shuah Khan wrote: > On 02/02/2017 01:32 AM, Jani Nikula wrote: >> On Thu, 02 Feb 2017, Shuah Khan wrote: >>> Change drm_helper_probe_single_connector_modes() to print an error to >>> report connector disconnected status instead of a debug message. >>> >>> When this condition occurs, application doesn't know the real error and >>> reports it as driver lacking support for mode setting. Change it to an >>> error to make it easier to debug. >> >> Please explain what makes this condition an error. Connectors get >> connected and disconnected, business as usual, why should this be an >> error? >> >> BR, >> Jani. > > Disconnecting connector itself isn't an error. When user-space tries > to access it, it would be useful to report the status that the connector > is disconnected. > > I use embedded system(s) that don't like it when HDMI is hot added or > removed. Also, because of return power, it is safer to disconnect HDMI > and then apply power to the board. It chased a few libdrm and user-space > dead ends before I enabled drm debug and was able to fix the real issue, > which is a disconnected cable. > > User-space prints rather confusing messages as it doesn't really know > the disconnected status as it isn't returned to it. > > I figured it might be a good idea to at least print a message and this can > be a notice or info instead of an error. I do think its is worth while in > some cases. Well, I still think having a debug message for debugging is the way to go, and that's what we have. Perhaps it is the userspace messages that need improvement instead? BR, Jani. > > thanks, > -- Shuah > > >> >> >>> >>> Signed-off-by: Shuah Khan >>> --- >>> drivers/gpu/drm/drm_probe_helper.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c >>> index ac953f0..6472b7f 100644 >>> --- a/drivers/gpu/drm/drm_probe_helper.c >>> +++ b/drivers/gpu/drm/drm_probe_helper.c >>> @@ -282,8 +282,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, >>> dev->mode_config.poll_running = drm_kms_helper_poll; >>> >>> if (connector->status == connector_status_disconnected) { >>> - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n", >>> - connector->base.id, connector->name); >>> + DRM_ERROR("[CONNECTOR:%d:%s] disconnected\n", >>> + connector->base.id, connector->name); >>> drm_mode_connector_update_edid_property(connector, NULL); >>> verbose_prune = false; >>> goto prune; >> > -- Jani Nikula, Intel Open Source Technology Center