Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp273029yba; Mon, 20 May 2019 08:28:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxv8gQTyE0NQbGxhyKPBq8UgbFhDgH7jWu/MjMOWvoZgrWXolGJa+k1op8cB/Ft412FAIUt X-Received: by 2002:aa7:9a95:: with SMTP id w21mr61262194pfi.248.1558366111454; Mon, 20 May 2019 08:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558366111; cv=none; d=google.com; s=arc-20160816; b=f7IPQz5VJudGyx3gNQIK6MNQTbNn/3fVWbz7SepLngqXcDql+rnavwXR6PCuRJ1SnR EgcgllxRhoa81w1xlF9VY/mItMNSG72NOGMAE3dqpCDGeMmgTJng7GvPgXuk39Loj2ns gDmu1pgyv1987+lDZh3aQmf4y2ndB8bo7IfGmVy0zXhuUqiX4Vhxjnb6LMcuKWj+Xo3T Jq/yiyK85LRK24MrSPhk5Pw8Xl+aDIFyKr8jZCzo+Y29bobHX5UPBt5H8Z8EL/taCtfM zpcxKwdArIrJkOYS7ugww5wJLzkOnTV2q1uLMfEdqXytBdK7aq9WYI4yfOEZT6ZcmrWD 4TTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NhOHFl71wkY2LZsCKbGZaVieZZOdiAwDHsMOioMZ6bg=; b=xF78ZVJybI1OmIpr29P7MVnF27qye7fGkDS37Fz/MrgH8z7koVapAKrucxbuRaioZp npVKPh5yfRrN8QtogRrfA0yPtUU1aKP/yMBoTLPgLc0io052WeI2YDhM9SApMSB8P31q Dj364nU76Az2frGP7gnLTTKYueG/BiZL2f31eREMaN7s4FSmeuHwWQAWA4I2AvPluLaw aVOfZhFDxo0fmwW/jJ+BmXJiZuanz6q64oxPlb+vceGKeVBL8ZchF3ulyt1dw35/shiK oop5on79vi06tpXxv7576kpB/9nlbxmUALX0lPYIJXtmYz+yKwIskDBVctWc8s4J9Y27 j02A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZbXlO3kl; 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 z12si11582132pgv.400.2019.05.20.08.28.16; Mon, 20 May 2019 08:28:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ZbXlO3kl; 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 S2388483AbfETMWo (ORCPT + 99 others); Mon, 20 May 2019 08:22:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:36824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388474AbfETMWm (ORCPT ); Mon, 20 May 2019 08:22:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7460220656; Mon, 20 May 2019 12:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558354961; bh=aF7HKBpx3gAIndsX2zacYPEs1qyN60O2fhVkQ2N/6AQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZbXlO3klYGoB0qHuuzY4hjOXtXYDTw7CYAxtBVvNMMo340OafyL+wlZzXQgdrdTu+ mFSO1s3/8Wr5XXmk6HvK4PapJU84wVRAXbl+kAaZySI7K5c994ap8jIc27Bt7yhIqo e3YcrIJsGN5DvNtBkJWZQkhHuFk6y0WGn97gBhTk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Libin Yang , Takashi Iwai , Pierre-Louis Bossart , Mark Brown Subject: [PATCH 4.19 042/105] ASoC: codec: hdac_hdmi add device_link to card device Date: Mon, 20 May 2019 14:13:48 +0200 Message-Id: <20190520115249.934598402@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Libin Yang commit 01c8327667c249818d3712c3e25c7ad2aca7f389 upstream. In resume from S3, HDAC HDMI codec driver dapm event callback may be operated before HDMI codec driver turns on the display audio power domain because of the contest between display driver and hdmi codec driver. This patch adds the device_link between soc card device (consumer) and hdmi codec device (supplier) to make sure the sequence is always correct. Signed-off-by: Libin Yang Reviewed-by: Takashi Iwai Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/hdac_hdmi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1829,6 +1829,17 @@ static int hdmi_codec_probe(struct snd_s hdmi->card = dapm->card->snd_card; /* + * Setup a device_link between card device and HDMI codec device. + * The card device is the consumer and the HDMI codec device is + * the supplier. With this setting, we can make sure that the audio + * domain in display power will be always turned on before operating + * on the HDMI audio codec registers. + * Let's use the flag DL_FLAG_AUTOREMOVE_CONSUMER. This can make + * sure the device link is freed when the machine driver is removed. + */ + device_link_add(component->card->dev, &hdev->dev, DL_FLAG_RPM_ACTIVE | + DL_FLAG_AUTOREMOVE_CONSUMER); + /* * hdac_device core already sets the state to active and calls * get_noresume. So enable runtime and set the device to suspend. */