From patchwork Tue Apr 10 06:57:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Shi, Yang A" X-Patchwork-Id: 10332399 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 494E8601A0 for ; Tue, 10 Apr 2018 06:51:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35FE328EC8 for ; Tue, 10 Apr 2018 06:51:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 315952948D; Tue, 10 Apr 2018 06:51:27 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 E820D28EC8 for ; Tue, 10 Apr 2018 06:50:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03E336E33E; Tue, 10 Apr 2018 06:50:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id E84756E33E for ; Tue, 10 Apr 2018 06:50:23 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Apr 2018 23:50:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,430,1517904000"; d="scan'208";a="190224517" Received: from shcsbb05.sh.intel.com ([10.239.147.132]) by orsmga004.jf.intel.com with ESMTP; 09 Apr 2018 23:50:22 -0700 From: Yang To: intel-gfx@lists.freedesktop.org Date: Tue, 10 Apr 2018 14:57:40 +0800 Message-Id: <1523343460-6646-1-git-send-email-yang.a.shi@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH] [v2]drm/i915: move audio component initialization before audio driver use it X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Shi , Bo He MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Yang Shi issue: snd_soc_skl meet "failed to add i915 component master (-19)" when platform don't connect any display output. i915 do initialization before than skl_probe, but if there is no display output connect, in function drm_dp_dpcd_access, there is a 32 retry for aux i2c transactions. It will meet timeout and do usleep. Then skl_probe function will be scheduled. It will call snd_hdac_i915_init, and it will meet "failed to add i915 component master" error. And whole snd_soc_skl initialization will be failed, audio can't work normally anymore. So i915 driver need to move intel_audio_init at the beginning of intel_modeset_init. This will make sure i915_audio_component_init process before snd_hdac_i915_init call it. V2: edit comments more clearly Signed-off-by: Bo He Signed-off-by: Yang Shi --- drivers/gpu/drm/i915/i915_drv.c | 2 -- drivers/gpu/drm/i915/intel_display.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 2f5209d..9d25d7e 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -1243,8 +1243,6 @@ static void i915_driver_register(struct drm_i915_private *dev_priv) if (IS_GEN5(dev_priv)) intel_gpu_ips_init(dev_priv); - intel_audio_init(dev_priv); - /* * Some ports require correctly set-up hpd registers for detection to * work properly (leading to ghost connected connector status), e.g. VGA diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f288bcc..a471c88 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -14468,6 +14468,8 @@ int intel_modeset_init(struct drm_device *dev) dev->mode_config.funcs = &intel_mode_funcs; + intel_audio_init(dev_priv); + init_llist_head(&dev_priv->atomic_helper.free_list); INIT_WORK(&dev_priv->atomic_helper.free_work, intel_atomic_helper_free_state_worker);