Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2418438ybi; Mon, 17 Jun 2019 04:35:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyd4+QeZCpq0sjsfOpsSG6kU8AM7HlcIMzNqepUMGrlaxkMTS8EDQDUDG5LHj392aqNNz3L X-Received: by 2002:a62:e71a:: with SMTP id s26mr67036030pfh.89.1560771333346; Mon, 17 Jun 2019 04:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560771333; cv=none; d=google.com; s=arc-20160816; b=MztHoioLDWfFW8vPlkRkHvUPNL5zPsLhm3O0IglfClOC37uqOD+UoNyLFJLe5d5F11 cjunBOTna7f72CiAypklNdWzKhUemrVsXJZuC+pJes6rzvDBpvgmK1Nb7C5gdsT34Ydg 9KheAlvisY84EvtqugakO3ZLpbNehxHqjSwJ6z0tps4hlXDRLmBRAm8dV8bba7WCe3/R 0EfeunC1imD3W/CgFwvfC+Vo0yChZE4sW3t+xCn29Gmh7anneRGycRn2HgjeMW5Z1EOE sP2WQgDJOO0U+kTDW3pVG6lq9vFDIm0piZVJBnJXm5BmweNvtHjffMr2pkXd9j8G10SH +fQw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=aonOl+ILTUjVgGrxcyE3SQUuc9NVkibNw4kWyNrK5Co=; b=kSHqiqIHGd1yT/f5H3D8UyqyiUEirScZ2hvibqLNUIUIFzx0K0SbPQxLmd7CM9cqVZ LlZeU/UFCNv+tkBSjxEvxUxhwx40zAi5wgRolZFaFwVECEnBksKP1dq3KxmpDc+ui2WA d39umDYX+PU183n3T0G6KPU6j9Ip+33hZmn8nmlvfIQHvNIeYIF4zrLCfxrQR9hMnFhI 7bBmsTQAUUf6A7oJ+wy6qCiwcz+ZzK/5/LT4fwSuLzr8DP0Vwzj5r+c8nO9A7KwK3yqc 9gAtXan9lvxVF7yEf1l6NQqaMtmopt8oF71f+KrSmOCPQhdAMXzt7XRq4+4G9lOph4/9 Q8Yw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89si9969517plc.166.2019.06.17.04.35.18; Mon, 17 Jun 2019 04:35:33 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727900AbfFQLe7 (ORCPT + 99 others); Mon, 17 Jun 2019 07:34:59 -0400 Received: from mga12.intel.com ([192.55.52.136]:54390 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727755AbfFQLe5 (ORCPT ); Mon, 17 Jun 2019 07:34:57 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 04:34:56 -0700 X-ExtLoop1: 1 Received: from xxx.igk.intel.com ([10.237.93.170]) by fmsmga006.fm.intel.com with ESMTP; 17 Jun 2019 04:34:54 -0700 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= To: alsa-devel@alsa-project.org Cc: Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Pierre-Louis Bossart , Jie Yang , Cezary Rojewski , linux-kernel@vger.kernel.org, =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Subject: [PATCH v2 02/11] ALSA: hdac: Fix codec name after machine driver is unloaded and reloaded Date: Mon, 17 Jun 2019 13:36:35 +0200 Message-Id: <20190617113644.25621-3-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190617113644.25621-1-amadeuszx.slawinski@linux.intel.com> References: <20190617113644.25621-1-amadeuszx.slawinski@linux.intel.com> 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 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 --- 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.17.1