From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762130AbdAJKlI (ORCPT ); Tue, 10 Jan 2017 05:41:08 -0500 Received: from mail-wj0-f195.google.com ([209.85.210.195]:34925 "EHLO mail-wj0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762081AbdAJKlF (ORCPT ); Tue, 10 Jan 2017 05:41:05 -0500 Date: Tue, 10 Jan 2017 11:40:59 +0100 From: Daniel Vetter To: Sean Paul Cc: Peter Ujfalusi , freedesktop-bugs@paulsd.com, gleb@fastmail.com, Linux Kernel Mailing List , dri-devel , Daniel Vetter , stable@vger.kernel.org Subject: Re: [PATCH v2] drm: Schedule the output_poll_work with 1s delay if we have delayed event Message-ID: <20170110104059.drkmxkldy2fcb7mb@phenom.ffwll.local> Mail-Followup-To: Sean Paul , Peter Ujfalusi , freedesktop-bugs@paulsd.com, gleb@fastmail.com, Linux Kernel Mailing List , dri-devel , Daniel Vetter , stable@vger.kernel.org References: <20170109143158.21917-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 4.8.0-1-amd64 User-Agent: NeoMutt/20161126 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 09, 2017 at 11:50:59AM -0500, Sean Paul wrote: > On Mon, Jan 9, 2017 at 9:31 AM, Peter Ujfalusi wrote: > > Instead of scheduling the work to handle the initial delayed event, use 1s > > delay. > > > > This delay should not be needed, but Optimus/nouveau will fail in a > > mysterious way if the delayed event is handled as soon as possible like it > > Has anyone tried to demystify the failure? It seems like fixing the > root problem would be better than this. Peter is on it, but fixing the regression meanwhile has priority imo. > Perhaps we should just revert 339fd36238dd to fix stable. That will make people unhappy about the delay again, so I think 1s delay is the better option. > > Sean > > > is done in drm_helper_probe_single_connector_modes() in case the poll > > was enabled before. > > > > Reverting 339fd36238dd would give back the 10 sec (!) delay to handle the > > delayed event. Adding 1sec delay to the poll_work is enough to work around > > the issue in Optimus setups and gives shorter response on handling the > > initial delayed event. > > > > Fixes: 339fd36238dd ("drm: drm_probe_helper: Fix output_poll_work scheduling") > > Cc: stable@vger.kernel.org # v4.9 > > Signed-off-by: Peter Ujfalusi > > --- > > drivers/gpu/drm/drm_probe_helper.c | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c > > index 06a62e37fbdc..258abed43e38 100644 > > --- a/drivers/gpu/drm/drm_probe_helper.c > > +++ b/drivers/gpu/drm/drm_probe_helper.c > > @@ -146,8 +146,16 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev) > > drm_connector_list_iter_put(&conn_iter); > > > > if (dev->mode_config.delayed_event) { > > + /* I added a FIXME: heading here to make it stick out more, and then applied the patch. Thanks, Daniel > > + * Use short (1s) delay to handle the initial delayed event. > > + * This delay should not be needed, but Optimus/nouveau will > > + * fail in a mysterious way if the delayed event is handled as > > + * soon as possible like it is done in > > + * drm_helper_probe_single_connector_modes() in case the poll > > + * was enabled before. > > + */ > > poll = true; > > - delay = 0; > > + delay = HZ; > > } > > > > if (poll) > > -- > > 2.11.0 > > > > > > -- > Sean Paul, Software Engineer, Google / Chromium OS > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch