stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Roy Spliet <nouveau@spliet.org>,
	alsa-devel@alsa-project.org
Subject: Re: [PATCH AUTOSEL 4.9 03/13] ALSA: hda: Keep the controller initialization even if no codecs found
Date: Fri, 24 Apr 2020 14:45:55 +0200	[thread overview]
Message-ID: <s5hh7x9rr0c.wl-tiwai@suse.de> (raw)
In-Reply-To: <20200424122447.10882-3-sashal@kernel.org>

On Fri, 24 Apr 2020 14:24:36 +0200,
Sasha Levin wrote:
> 
> From: Takashi Iwai <tiwai@suse.de>
> 
> [ Upstream commit 9479e75fca370a5220784f7596bf598c4dad0b9b ]
> 
> Currently, when the HD-audio controller driver doesn't detect any
> codecs, it tries to abort the probe.  But this abort happens at the
> delayed probe, i.e. the primary probe call already returned success,
> hence the driver is never unbound until user does so explicitly.
> As a result, it may leave the HD-audio device in the running state
> without the runtime PM.  More badly, if the device is a HD-audio bus
> that is tied with a GPU, GPU cannot reach to the full power down and
> consumes unnecessarily much power.
> 
> This patch changes the logic after no-codec situation; it continues
> probing without the further codec initialization but keep the
> controller driver running normally.
> 
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207043
> Tested-by: Roy Spliet <nouveau@spliet.org>
> Link: https://lore.kernel.org/r/20200413082034.25166-5-tiwai@suse.de
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Sasha Levin <sashal@kernel.org>

Applying this without other commits isn't recommended, especially for
the older branches.  Maybe OK up from 4.19, but I'd avoid applying for
the older.


thanks,

Takashi



> ---
>  sound/pci/hda/hda_intel.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 5a578ebca1055..8b9d1c6574e43 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -1806,7 +1806,7 @@ static int azx_first_init(struct azx *chip)
>  	/* codec detection */
>  	if (!azx_bus(chip)->codec_mask) {
>  		dev_err(card->dev, "no codecs found!\n");
> -		return -ENODEV;
> +		/* keep running the rest for the runtime PM */
>  	}
>  
>  	if (azx_acquire_irq(chip, 0) < 0)
> @@ -2129,9 +2129,11 @@ static int azx_probe_continue(struct azx *chip)
>  #endif
>  
>  	/* create codec instances */
> -	err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]);
> -	if (err < 0)
> -		goto out_free;
> +	if (bus->codec_mask) {
> +		err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]);
> +		if (err < 0)
> +			goto out_free;
> +	}
>  
>  #ifdef CONFIG_SND_HDA_PATCH_LOADER
>  	if (chip->fw) {
> @@ -2145,7 +2147,7 @@ static int azx_probe_continue(struct azx *chip)
>  #endif
>  	}
>  #endif
> -	if ((probe_only[dev] & 1) == 0) {
> +	if (bus->codec_mask && !(probe_only[dev] & 1)) {
>  		err = azx_codec_configure(chip);
>  		if (err < 0)
>  			goto out_free;
> -- 
> 2.20.1
> 

  reply	other threads:[~2020-04-24 12:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 12:24 [PATCH AUTOSEL 4.9 01/13] xfs: fix partially uninitialized structure in xfs_reflink_remap_extent Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 02/13] ALSA: hda: Don't release card at firmware loading error Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 03/13] ALSA: hda: Keep the controller initialization even if no codecs found Sasha Levin
2020-04-24 12:45   ` Takashi Iwai [this message]
2020-05-01  0:56     ` Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 04/13] scsi: target: fix PR IN / READ FULL STATUS for FC Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 05/13] scsi: sg: add sg_remove_request in sg_common_write Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 06/13] objtool: Fix CONFIG_UBSAN_TRAP unreachable warnings Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 07/13] objtool: Support Clang non-section symbols in ORC dump Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 08/13] objtool: Fix switch table detection in .text.unlikely Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 09/13] xen/xenbus: ensure xenbus_map_ring_valloc() returns proper grant status Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 10/13] net/cxgb4: Check the return from t4_query_params properly Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 11/13] ext4: convert BUG_ON's to WARN_ON's in mballoc.c Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 12/13] of: unittest: kmemleak on changeset destroy Sasha Levin
2020-04-24 12:24 ` [PATCH AUTOSEL 4.9 13/13] hwmon: (jc42) Fix name to have no illegal characters Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hh7x9rr0c.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@spliet.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).