Received: by 10.213.65.68 with SMTP id h4csp457513imn; Tue, 13 Mar 2018 09:39:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELuImXyDp3EaCz6V4axtslOgA0+rUSTv9e39Qa/QqhfK1+reeVRin651fnxXcB3/B74MG3Oi X-Received: by 2002:a17:902:6789:: with SMTP id g9-v6mr1126925plk.167.1520959197763; Tue, 13 Mar 2018 09:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520959197; cv=none; d=google.com; s=arc-20160816; b=gEykg/P+AmgW2Yvl8JFRNMFxD8dGiPIh6Cbo+v5JrE1nRcwxeCrh7JTTq8iAOfbK+y Sc7Nd8ThRgQZf0xRz+AQJLu7mWSm2hhMRoQ+t5xUO7LQk3r8HPjNqRfYXAFVazV8qFhq jA7X1J8GP5LFh3GFnFHh8Ce8vKJaQ0Je9De+lcOic3RWat2UwZaUYL9JUTOhx8T3XIKh 0hC5WgfgO9HCBmPvJnrBnNxgeNgn/oQAwpXUkM+zS+Lhm7yhbUK1pz7Uu7En2nUEgUlG OaWSdvfr4YKANuDB2xAtZpz8SbmeiR2NdGrMsZe22+1wCHcdgBn126DvNRUnAVHuchc+ nX1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:arc-authentication-results; bh=4FkVr78COZUxGiKHcYZzgNml95lX7IYNtAYb3uCqh7g=; b=l/W30YZWOrZ+gR1d23+AWGRHvY6gkD+RETH3+7tHk38xUM6Tt8GTRSWYkapFCQZjxs F6fR7d9Q6rD4W2clZ5AaUufYu3yrihhDV7BDey6T2KOzuSgaukH4j/ffOFzh/QUHhs3/ yjrgmFTk2ZIL8cXHU4cngVDIoxOPRk+xTeZgl0gvQiLDgM8upG8/uw5lwpsXbbw85UDg MKqMMjHe5QRtshwpFnCd6RGy1ALgmQT0ISQj//ypTO5GRTg2KewWjqNtS3n52VIg+UrP 1zQxEyoQp4JRpWBjOwtpAGTOA+QO5ZlelHMOpaDtTv9CumeKK0EeMG+lJV+rzh4VNVAu Zw9w== 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 v12-v6si289284plo.170.2018.03.13.09.39.43; Tue, 13 Mar 2018 09:39:57 -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 S1752918AbeCMQiX convert rfc822-to-8bit (ORCPT + 99 others); Tue, 13 Mar 2018 12:38:23 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:58318 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751999AbeCMQiS (ORCPT ); Tue, 13 Mar 2018 12:38:18 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 11013262-1500050 for multiple; Tue, 13 Mar 2018 16:38:13 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Arnd Bergmann , "Jani Nikula" , "Joonas Lahtinen" , "Rodrigo Vivi" , "David Airlie" From: Chris Wilson In-Reply-To: <20180313161952.552083-1-arnd@arndb.de> Cc: "Arnd Bergmann" , "Tvrtko Ursulin" , "Michal Wajdeczko" , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20180313161952.552083-1-arnd@arndb.de> Message-ID: <152095909165.515.12940408400999492012@mail.alporthouse.com> User-Agent: alot/0.3.6 Subject: Re: [PATCH] [v2] drm/i915/pmu: avoid -Wmaybe-uninitialized warning Date: Tue, 13 Mar 2018 16:38:11 +0000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Arnd Bergmann (2018-03-13 16:19:31) > The conditional spinlock confuses gcc into thinking the 'flags' value > might contain uninitialized data: > > drivers/gpu/drm/i915/i915_pmu.c: In function '__i915_pmu_event_read': > arch/x86/include/asm/paravirt_types.h:573:3: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > The code is correct, but it's easy to see how the compiler gets confused > here. This avoids the problem by pulling the lock outside of the function > into its only caller. > > Fixes: 1fe699e30113 ("drm/i915/pmu: Fix sleep under atomic in RC6 readout") > Signed-off-by: Arnd Bergmann Reviewed-by: Chris Wilson -Chris