From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,T_DKIM_INVALID, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74CE1C4646D for ; Mon, 6 Aug 2018 19:43:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23E0021A63 for ; Mon, 6 Aug 2018 19:43:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="bbMPQGA6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23E0021A63 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732579AbeHFVxn (ORCPT ); Mon, 6 Aug 2018 17:53:43 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:43716 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731143AbeHFVxn (ORCPT ); Mon, 6 Aug 2018 17:53:43 -0400 Received: by mail-ed1-f67.google.com with SMTP id j21-v6so3332750edp.10 for ; Mon, 06 Aug 2018 12:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=AAH2DZZlRxXs+lGxhonaJAm3wnkPvGBVewhynb6ZLW4=; b=bbMPQGA6bbOQPWkFt+taTZxAHZYngZ81KxE13dxwrorxZlAQ10dWZGcM1x8NwrDxJy fFbGK7CGY/y/a6W9oOJ9i5a6p9Ov2q4OZmk+pop2au/nIuh3fu7x2n9b8xyxs4zAsjD/ WiPKy1Nw/KcvOeswKKmXl4vIyEO50NksH5v5U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=AAH2DZZlRxXs+lGxhonaJAm3wnkPvGBVewhynb6ZLW4=; b=fwI8kbfVUzMYCJwMWZ6GZvUIwE2j5DPm5SsViDY9+tsr5UYAGa3/EDDt5bbInbsUNA N3cKZHWXc744Rg8HIt6Hm+RlirkbBg4ngj5C2DwwbtzSLvmvtS8peSfiIXPCXRnA+Tnl I0Rl6es4nuWxfVQW4Xnl2cY5YKA93c3WtarDSTyM6s5V8ZYGk4dpI2Nd0yT3e0VhEv6/ cP3l31lXr2a1u0FJrgtEYWnXxe1te5b76nNZXvMVvdu8+wBoNldh8XeWVXqg19Gy0Gt9 bKqHVnZ+SasThxpFr4f2klP1XdQ2XNPEwZNmW5hfG192REQ9sYbtdOKC4aytOrbC/TKy COIQ== X-Gm-Message-State: AOUpUlFouu5HENixMIVavR6sTvtTCiUrui1MQ39FJdqLgBdvwEq0voBA cmwAB7pXZ5nsOR61EikUVTT+KbOKCi4= X-Google-Smtp-Source: AAOMgpfx+8i7DeCcLhhpPV+dyNQNLPCAzCEC6nx2iuZVpoOjRK/D8Hw5h0ArOwbBmEOnL1ubRG/Dvg== X-Received: by 2002:a50:8818:: with SMTP id b24-v6mr20211788edb.274.1533584586135; Mon, 06 Aug 2018 12:43:06 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56fc:0:d707:d7d8:b180:96e5]) by smtp.gmail.com with ESMTPSA id p20-v6sm4963619edr.12.2018.08.06.12.43.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Aug 2018 12:43:05 -0700 (PDT) Date: Mon, 6 Aug 2018 21:43:03 +0200 From: Daniel Vetter To: Lukas Wunner Cc: Lyude Paul , Daniel Vetter , David Airlie , nouveau@lists.freedesktop.org, Karol Herbst , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v3 3/8] drm/fb_helper: Introduce hotplug_suspend/resume() Message-ID: <20180806194303.GT3008@phenom.ffwll.local> Mail-Followup-To: Lukas Wunner , Lyude Paul , David Airlie , nouveau@lists.freedesktop.org, Karol Herbst , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20180731003954.19962-1-lyude@redhat.com> <20180731003954.19962-4-lyude@redhat.com> <20180806084322.GK3008@phenom.ffwll.local> <4e72a10062166d646ebd3eb28b6c186d4c00a63f.camel@redhat.com> <20180806193457.GA7028@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180806193457.GA7028@wunner.de> X-Operating-System: Linux phenom 4.14.0-3-amd64 User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 06, 2018 at 09:34:57PM +0200, Lukas Wunner wrote: > On Mon, Aug 06, 2018 at 03:15:31PM -0400, Lyude Paul wrote: > > You did mention in the review of one of my other patches that we should avoid > > disabling polling during runtime suspend, and you're definitely right. I feel > > a bit silly for not remembering that since I was the one who made it so that > > i915 does polling in runtime suspend for chips without RPM HPD detection in > > the first place because it was causing people's displays not to come up on > > vlv... > > Anyway: I think if we just leave output polling enabled during runtime suspend > > that might actually fix all of the fb_helper locking issues since we won't > > need to wait on any of the output poll workers to finish, at least I think it > > should: I'll confirm this when I get into the office > > Quoth Imre Deak: > > "In i915 polling is on during runtime suspend only if there are outputs > without hotplug interrupt support. A special case is when an output has > working HPD interrupts when in D0, but no interrupts when runtime > suspended. For these we start polling (from a scheduled work) in the > runtime suspend hook and stop it in the runtime resume hook (again from > a scheduled work)." > https://lkml.org/lkml/2018/2/12/330 > > nouveau only uses runtime PM on discrete GPUs in dual GPU laptops. > Resuming the GPU from D3cold to D0 every few seconds to poll the > outputs would waste too much power on such machines. > > The question is, why is polling running at all, since all modern > laptops have HPD-capable ports such as DP? Note we don't fully sync with the poll worker here, we just update the polling flags and let the poll worker lazily notice the change (and stop itsefl). That avoids the deadlock. It also means that the poll worker must call pm_runtime_get() in all the right places though. On resume we need to kick it again, but that doesn't have a deadlock potential. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH v3 3/8] drm/fb_helper: Introduce hotplug_suspend/resume() Date: Mon, 6 Aug 2018 21:43:03 +0200 Message-ID: <20180806194303.GT3008@phenom.ffwll.local> References: <20180731003954.19962-1-lyude@redhat.com> <20180731003954.19962-4-lyude@redhat.com> <20180806084322.GK3008@phenom.ffwll.local> <4e72a10062166d646ebd3eb28b6c186d4c00a63f.camel@redhat.com> <20180806193457.GA7028@wunner.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: <20180806193457.GA7028@wunner.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Lukas Wunner Cc: David Airlie , nouveau@lists.freedesktop.org, Karol Herbst , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org List-Id: nouveau.vger.kernel.org T24gTW9uLCBBdWcgMDYsIDIwMTggYXQgMDk6MzQ6NTdQTSArMDIwMCwgTHVrYXMgV3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