From patchwork Thu Nov 9 10:49:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kahola X-Patchwork-Id: 10050773 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 C83A3601EB for ; Thu, 9 Nov 2017 10:53:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9CBB2AAE6 for ; Thu, 9 Nov 2017 10:53:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE5882AC32; Thu, 9 Nov 2017 10:53:29 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 51B552AAE6 for ; Thu, 9 Nov 2017 10:53:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63A1E6E869; Thu, 9 Nov 2017 10:53:28 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7A2C66E869 for ; Thu, 9 Nov 2017 10:53:26 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Nov 2017 02:53:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.44,369,1505804400"; d="scan'208"; a="1241955067" Received: from sorvi.fi.intel.com ([10.237.72.154]) by fmsmga002.fm.intel.com with ESMTP; 09 Nov 2017 02:53:25 -0800 From: Mika Kahola To: intel-gfx@lists.freedesktop.org Date: Thu, 9 Nov 2017 12:49:52 +0200 Message-Id: <1510224592-14732-1-git-send-email-mika.kahola@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH] drm/i915: Return early when pipes are not available 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 At least in Coffee Lake it happens that we start initiliazing audio when no display is connected. This was discovered by CI when running IGT test case drv_module_reload --r basic-no-display The issue here is that the 'intel_device_info_runtime_init()' sets num_pipes to 0 but before this happens the audio part has already started to initialize itself. Later on the num_pipes is updated to 0 in intel_device_info_runtime_init() and we hit that when audio part is digging out ELD. This causes a warning in dmesg. To fix this issue, let's check the number of available pipes when trying to read out ELD. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103206 Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/intel_audio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index 4705194..5e367b1 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c @@ -859,6 +859,9 @@ static int i915_audio_component_get_eld(struct device *kdev, int port, const u8 *eld; int ret = -EINVAL; + if (INTEL_INFO(dev_priv)->num_pipes == 0) + return ret; + mutex_lock(&dev_priv->av_mutex); intel_encoder = get_saved_enc(dev_priv, port, pipe);