Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9933667ybi; Wed, 24 Jul 2019 12:35:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXBjXob74JEJSpW1V1eKWw3lD/o2eL1HLEQSGajiQQOfjCXwBJf3u+VMDr0/SbzxLx7XeP X-Received: by 2002:a17:902:9349:: with SMTP id g9mr85888414plp.262.1563996922913; Wed, 24 Jul 2019 12:35:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996922; cv=none; d=google.com; s=arc-20160816; b=li/4U6QvVPk0riOqomjkCGhq0a9zRJ50lH3WyioqhAdCmM+6cWzaC86dDKk2/OPa/D J3pdHwLuwhv8601DkWs9HfxckXx8aLGbmvwCsgvQs1k1P9uiT1IRGLGKztc65OKxSr9e YYYPfuSfdhuYZkW5Kz6KeWqAtqKdwexgZzeXywvFsZ7UacjNnESdD+S8Y1dju8+6Z4HU 3olcOHNJDNUulJGEiWjbldzKR9+LvzdK+r67kR+6wXfMCagMp/Vdyef5yV7I+MVq+HVX 1SSmsOyxI01a4VRTPQffMBeZhoDE31chU/5Gv1aoPYOOZiTWySDNliq3t3AzdFMNn7Dg VlmA== 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=PuDZFSfErke/SmoQOz0tYPKssWcM2dPoiNMoJ7Hsv+E=; b=WSof7GaYwTrrqMvBvb6qFfyKG31XNPAU6JbjOup4nNA1bElH/RraTSe62TZpvi6r0K 4XduYm9gt0ylVIfsp5FhiFlCBxMgtg/Tg2LDxzpFwaNr0gObbloBraJ0QaLND2rpU/lB 5r11Vo3mPkvZ71tt2IaVxLUoqIEi0bMw504iZ0gHp9bN+lXEnFxBUyWPH4e5stH5YTdb vfgrmUzLAFTMr55ce9ZAE4TUbbXSGM0ZiDzMJ4Y2IB8YHjsw9GEhCNXjaFnPfInYFbZt OvkEBG5VHSCK2M1ESvqPsU183DMzat4sXE95z+3gDt55lM3noWHwktANkWEM5OpNRaLG spGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bS8+c7Sb; 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 q15si14982917pfh.284.2019.07.24.12.35.08; Wed, 24 Jul 2019 12:35:22 -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=bS8+c7Sb; 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 S2388768AbfGXTdF (ORCPT + 99 others); Wed, 24 Jul 2019 15:33:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:54614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388751AbfGXTdB (ORCPT ); Wed, 24 Jul 2019 15:33:01 -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 8551820659; Wed, 24 Jul 2019 19:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996781; bh=9ji9QypqW4jWQNsf1EAynUSKTtksVznp7CxGOF3dS28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bS8+c7SbbiqWhry2m1hNSOGmWKeAzULaxWXdvLaS7I/iTrPWaioeD1RRVgL9ANaMb jSsemFADNMQz3Snr2t4tVChuYfvYFhA6q+H3ws/VaMapPPKQYaR0/0ouLi22mqPzHL /fGppzKBagt5h/Mrk+qiV/WpAzJyEGLutSleYr+o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , Takashi Iwai , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.2 163/413] ALSA: hdac: Fix codec name after machine driver is unloaded and reloaded Date: Wed, 24 Jul 2019 21:17:34 +0200 Message-Id: <20190724191746.722753187@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 [ Upstream commit 8a5b0177a7f6099ff534a4d9ce72673af5c3cade ] Currently on each driver reload internal counter is being increased. It causes failure to enumerate driver devices, as they have hardcoded: .codec_name = "ehdaudio0D2", As there is currently no devices with multiple hda codecs and there is currently no established way to reliably differentiate, between them, always assign bus->idx = 0; This fixes a problem when we unload and reload machine driver idx gets incremented, so .codec_name would've needed to be set to "ehdaudio1D2" after first reload and so on. Signed-off-by: Amadeusz Sławiński Acked-by: Takashi Iwai Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/hda/ext/hdac_ext_bus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/hda/ext/hdac_ext_bus.c b/sound/hda/ext/hdac_ext_bus.c index a3a113ef5d56..4f9f1d2a2ec5 100644 --- a/sound/hda/ext/hdac_ext_bus.c +++ b/sound/hda/ext/hdac_ext_bus.c @@ -85,7 +85,6 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev, const struct hdac_ext_bus_ops *ext_ops) { int ret; - static int idx; /* check if io ops are provided, if not load the defaults */ if (io_ops == NULL) @@ -96,7 +95,12 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev, return ret; bus->ext_ops = ext_ops; - bus->idx = idx++; + /* FIXME: + * Currently only one bus is supported, if there is device with more + * buses, bus->idx should be greater than 0, but there needs to be a + * reliable way to always assign same number. + */ + bus->idx = 0; bus->cmd_dma_state = true; return 0; -- 2.20.1