lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5hczq0yc72.wl-tiwai@suse.de>
Date:   Thu, 26 Aug 2021 08:03:45 +0200
From:   Takashi Iwai <tiwai@...e.de>
To:     Vitaly Rodionov <vitalyr@...nsource.cirrus.com>
Cc:     <alsa-devel@...a-project.org>, <patches@...nsource.cirrus.com>,
        Stefan Binding <sbinding@...nsource.cirrus.com>,
        Takashi Iwai <tiwai@...e.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] ALSA: hda/cs8409: Prevent pops and clicks during reboot

On Wed, 25 Aug 2021 20:04:05 +0200,
Vitaly Rodionov wrote:
> Actually when codec is suspended and we do reboot from UI, then sometimes we
> see suspend() calls in kernel log and no pops, but sometimes
> 
> we still have no suspend() on reboot and we hear pops. But when we do reboot
> from command line: > sudo reboot  then we always have pops and no suspend()
> called.
> 
> Then we have added extra logging and we can see that on reboot codec somehow
> getting resume() call and we run jack detect on resume that causing pops.

Hm, it's interesting who triggers the runtime resume.

> We were thinking about possible solution for that and we would propose some
> changes in generic code hda_bind.c:
> 
> static void hda_codec_driver_shutdown(struct device *dev) { +   if (codec->
> patch_ops.suspend) +      codec->patch_ops.suspend(codec);   
> snd_hda_codec_shutdown(dev_to_hda_codec(dev)); +  hda_codec_driver_remove
> (dev_to_hda_codec(dev)); }

Sorry, it's no-no.  The suspend can't be called unconditionally, and
the driver unbind must not be called in the callback itself.

Does the patch below work instead?


thanks,

Takashi

--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2356,8 +2356,11 @@ static void azx_shutdown(struct pci_dev *pci)
 	if (!card)
 		return;
 	chip = card->private_data;
-	if (chip && chip->running)
+	if (chip && chip->running) {
+		chip->bus.shutdown = 1;
+		cancel_work_sync(&bus->unsol_work);
 		azx_shutdown_chip(chip);
+	}
 }
 
 /* PCI IDs */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ