Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9254337pxu; Mon, 28 Dec 2020 10:32:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/hJWgi/UwrlZgr/8vBF8cIq1ORlFgAC0L46I5IUR4rtQ2IqgQEWP7n4Zna4rA4fXxVpLi X-Received: by 2002:aa7:d593:: with SMTP id r19mr43856801edq.246.1609180343912; Mon, 28 Dec 2020 10:32:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609180343; cv=none; d=google.com; s=arc-20160816; b=mHy9Tx3IJzw58mPMiG0Fv7DVvWfw7UOUXSUPrJgMNy7WsJxZG2qc6bd+NploI3ZcJm RoYmnIFS4TBELLam45gms28y60ZrDFqOzOTRsBa7YeB0+V49+YYN/61unYchT9KRsVZQ nJhpnhHe6G8yb+q/9GuSG5PW+BBqf6KL1JlofhGnKObu0L8/zLHWa3AmLpRK6wiu35Gs pa0qhUdqITa2XXl+UANnfVnYKQkECc3jMq3eVCJzm8XZqZHBkCi5nZIveNMv0yMFr+FW 7q7tetqAFd51BQVR8Zhi+yOk+NFl/VgzrdyklplgtWUxLLsylpKOdcMDjqJkJdwCJVtr nNLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TcjbU+GrYyLD/DminZojGLFCxEW9YWbBTE8T5EA8fK4=; b=Mwgscx8Iixx6qgGfvISvmcTGdA0HDo3W2aYGm+hgdwKz89R/Pemm3GlEea2vzdSvko 8pc6940jRO9Q8vCLWJ/65LCJuoJnNvav/BI1SpmDu9rGIWXcs8C8EuQ1PZ6Nc2bajhyH 2tYPjL7klU/a8lXemXvqXGW/nSL2T+r07GxKETOrey0/ksZH2NYN2i1Hvv80zDuC1/13 xEOl4eTKVLXGtSa3BONiUkEwCoYbxlxBzv3bYV366UWSa4cLZg1GLKFrlDsiT7hID6B4 2jMj2YEQZNRoLlUdFDEHAxR6VDGuiYbbbf1Tegd93HpMMTeoUJUWP7x4r+MOloBSSkDb imvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ox8v0E3t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz13si18757251ejc.437.2020.12.28.10.32.02; Mon, 28 Dec 2020 10:32:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ox8v0E3t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388030AbgL1Nd4 (ORCPT + 99 others); Mon, 28 Dec 2020 08:33:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:33656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390032AbgL1NdF (ORCPT ); Mon, 28 Dec 2020 08:33:05 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1567822B45; Mon, 28 Dec 2020 13:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609162344; bh=dGAgfHUs7t+JBDelGoAfsLvxPHJH/k+xqXBdSFcwdqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ox8v0E3tTlgo7otARhmDjYgNEJ437a0HCSpOGofxjw4KgMmbKwxlnHbKzcOKylcd9 +YPWFI/CVLBzbuNKXidb7CdkiMsHsW/jua9o8YMdp4eIuZlL8cLkxKo5AW3KEIpxha /dncZBhCzuIqbB8ulyRB3m7qnp++2N+0kj3azj5U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 4.19 271/346] ALSA: hda: Fix regressions on clear and reconfig sysfs Date: Mon, 28 Dec 2020 13:49:50 +0100 Message-Id: <20201228124932.871835037@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124919.745526410@linuxfoundation.org> References: <20201228124919.745526410@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit 2506318e382c4c7daa77bdc48f80a0ee82804588 upstream. It seems that the HD-audio clear and reconfig sysfs don't work any longer after the recent driver core change. There are multiple issues around that: the linked list corruption and the dead device handling. The former issue is fixed by another patch for the driver core itself, while the latter patch needs to be addressed in HD-audio side. This patch corresponds to the latter, it recovers those broken functions by replacing the device detach and attach actions with the standard core API functions, which are almost equivalent with unbind and bind actions. Fixes: 654888327e9f ("driver core: Avoid binding drivers to dead devices") Cc: BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209207 Link: https://lore.kernel.org/r/20201209150119.7705-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_sysfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -1782,7 +1782,7 @@ int snd_hda_codec_reset(struct hda_codec return -EBUSY; /* OK, let it free */ - snd_hdac_device_unregister(&codec->core); + device_release_driver(hda_codec_dev(codec)); /* allow device access again */ snd_hda_unlock_devices(bus); --- a/sound/pci/hda/hda_sysfs.c +++ b/sound/pci/hda/hda_sysfs.c @@ -138,7 +138,7 @@ static int reconfig_codec(struct hda_cod "The codec is being used, can't reconfigure.\n"); goto error; } - err = snd_hda_codec_configure(codec); + err = device_reprobe(hda_codec_dev(codec)); if (err < 0) goto error; err = snd_card_register(codec->card);