Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9420222pxu; Mon, 28 Dec 2020 15:56:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyr7ZdmB12MB9CjNeCa+yiMrwEn3LOCETKMh92u4x2SFmFRqcgrMj2huVGV73X1fsWl7Qi/ X-Received: by 2002:a50:ee1a:: with SMTP id g26mr44313061eds.68.1609199781697; Mon, 28 Dec 2020 15:56:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609199781; cv=none; d=google.com; s=arc-20160816; b=ajb1Ldv6k5VGu2qH3KLfkWSWm6/bd5vcuN6UfMgzR7G8Fr6AbaGqEo9uqvIYqR/IFh M8mbUT9uHt+2EfOu5EpUtgheAIykqnFWfAicRPPd0TbbnuNZn+lhhRho2idfW//2nHTM 2GDCCQ4aHtLkL1VQkqWrJCrOgIJf2w5++uCfBy57T+BaDdq4bYUF+G96804yhOjWBlVR PX6OFr8qQ4+RXSx4+SEd5u94eXlo8isB1Cw9ezalEbzJREXzDIeHg3Ti9emCVeYFwPfN ok6cOk3I5k+GFAPaxGvtaGIXgNjwcxuA23ovG9LMs0puJoPG5m1m5QG7H8CELZeburX9 nGrQ== 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=gwTpzQfYgrkSoIJcwG3AHo7rCFFS7wspxOHwLLvJHtY=; b=yHWgWMZW7PcH6CxGk4+a5Wp0ej71YWK9WYtfoA9KPmcmCZsMgYkhrbPSPqm44NYFXo lQZmlmnxtAfYfovL1ZJ729/kIwH3Z42No0Te3/QbhDRkTj6OCDjQdmh4jvdTjWYuu5m8 Ix8n69g6yRuVcw2x4HmHCBKvbqr7Lp7vOU75oLaShla8PBcS7bzQPC5J4q6h0ep28/lK DQKYpdtqqqaVQ6qX0ouMmSwi+FxN97CBnllG+X/QEu6dgPrUyfFtjYl3qBujaIN6gLjB 6Zh69AGK7eE3q9wSIpON7hJsS4lJwfqB8sgnRHp5pt2v8MJy+l90JzfW35BJgT00ioA/ cLIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ki3TSxhk; 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 j23si18528306ejb.158.2020.12.28.15.55.59; Mon, 28 Dec 2020 15:56:21 -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=Ki3TSxhk; 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 S2506289AbgL1Opm (ORCPT + 99 others); Mon, 28 Dec 2020 09:45:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:60210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730132AbgL1OYY (ORCPT ); Mon, 28 Dec 2020 09:24:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C17D6206D4; Mon, 28 Dec 2020 14:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165449; bh=mUtCs0MCTTK9O+rzbXF+dLhzq+gEwN4e6MqoQwPhUwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ki3TSxhkEc2x0OHiu94p6Yjhhigto+LUQ740hiyGk8iPIoMinn7DRTcNkH1BBA0pv noFzevsLm+4LuRyaMd8OhB3Oq2G4xaVeQ1b+rP3ik/gPnbOQllmb1lsVOxnYqJl/2h TRloB1IDVnVK8DVH3uouocIJozinvg/SdVeJr0Do= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 5.10 535/717] ALSA: hda: Fix regressions on clear and reconfig sysfs Date: Mon, 28 Dec 2020 13:48:53 +0100 Message-Id: <20201228125046.604257626@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 @@ -1803,7 +1803,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 @@ -139,7 +139,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);