From patchwork Wed May 10 15:19:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9720035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B6EB60236 for ; Wed, 10 May 2017 15:19:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 445FC28613 for ; Wed, 10 May 2017 15:19:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3777628618; Wed, 10 May 2017 15:19:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C72F028613 for ; Wed, 10 May 2017 15:19:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3187F6E390; Wed, 10 May 2017 15:19:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E6056E394 for ; Wed, 10 May 2017 15:19:40 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id 6so9039322wrb.1 for ; Wed, 10 May 2017 08:19:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=4aQW6H1uUzMjfpTtS+3W35nakqVOQBnlV6zW1Sx8buM=; b=E914QVkBdty5FrCZjyA2W2Qng+Bc6Qw3F1nZh92aVQLcadSwmpKFAWzMz7q9qpdg+U jzcTEB5D1IDyD1V1VL1ie28+pgLPrrwsUAAoAnGD6e06k6WTMm5PLKwZcoDm4j7H0qSe CGo0ZRKF5ozxgi+BKFp5VusASK8C3di/2zSDY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4aQW6H1uUzMjfpTtS+3W35nakqVOQBnlV6zW1Sx8buM=; b=VFcIkMu924qcCAQr7iVIxzVBjRcsqCL9ZzbezTfsTg3h3jZ19rT1u1Cw3njp3nuarR 2pC4Ak19JLLh4agqRxiK1zfgsD9x3TFxE7144S8sRdLQALBZgjeVHmW5pcJ4sEQXbZLF sGfGfGMyWFFYawFtzQ8ZfwuFY0eACrv063ifyb92g4szStJC73jnkZTCt7+9Tbm3U+7V gVmg5n/VISMpLzkttr48kU1t4CHZWLBdMJYA8JLCfCgDZ2X0VWdThZmhuHSqq0A6Oz7f JNugfFQUigaVfL++/vpV+OtZd777WDj0RKIbNje1GPx7oxm16IqS4MMPQXEzATk9f1Uj B6tw== X-Gm-Message-State: AODbwcABSzzeH85Io1MwIm/3tJ5hvBVUwXzfu47FQwuAAi3on5DaK0hO ZtO4SbFFoZ5AAQ== X-Received: by 10.80.146.154 with SMTP id k26mr4792946eda.23.1494429578853; Wed, 10 May 2017 08:19:38 -0700 (PDT) Received: from wespe.ffwll.local ([2a02:168:5640:0:6631:50ff:fe8d:fd2e]) by smtp.gmail.com with ESMTPSA id m9sm1386177edm.62.2017.05.10.08.19.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 08:19:37 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 10 May 2017 17:19:32 +0200 Message-Id: <1494429572-15118-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.5.5 Cc: Daniel Vetter , Daniel Vetter Subject: [Intel-gfx] [PATCH] drm/i915: Fix __intel_wait_for_register_fw to not sleep in atomic X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP The unconditionally fallback to the blocking wait_for resulted in impressive fireworks at boot-up on my snb here. Make sure if we set the slow timeout to 0 that we never ever sleep. The tail of the callchain was intel_wait_for_register -> __intel_wait_for_register_fw -> usleep_range -> BOOM It blew up in intel_crt_detect load detection code on the ADPA_CRT_HOTPLUG_FORCE_TRIGGER in the ADPA register. v2: Shut up gcc. Fixes: 0564654340e2 ("drm/i915: Acquire uncore.lock over intel_uncore_wait_for_register()") Cc: Chris Wilson Cc: Michal Wajdeczko Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: Daniel Vetter Cc: Jani Nikula Reviewed-by: Chris Wilson Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_uncore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index aa9d3065853c..08abb2cb7837 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -1598,7 +1598,7 @@ int __intel_wait_for_register_fw(struct drm_i915_private *dev_priv, unsigned int slow_timeout_ms, u32 *out_value) { - u32 reg_value; + u32 reg_value = 0; #define done (((reg_value = I915_READ_FW(reg)) & mask) == value) int ret; @@ -1609,7 +1609,7 @@ int __intel_wait_for_register_fw(struct drm_i915_private *dev_priv, ret = -ETIMEDOUT; if (fast_timeout_us && fast_timeout_us <= 20000) ret = _wait_for_atomic(done, fast_timeout_us, 0); - if (ret) + if (ret && slow_timeout_ms) ret = wait_for(done, slow_timeout_ms); if (out_value)