Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6806508ybi; Wed, 5 Jun 2019 06:43:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOFA4ZKRKP7Q0BLiSRX4Wcob2NA6eLbtsVey6c2wTb/x04C+0SI9BO/IHrDPqyxpmHbGQE X-Received: by 2002:a17:90a:ad8b:: with SMTP id s11mr44697355pjq.48.1559742226414; Wed, 05 Jun 2019 06:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559742226; cv=none; d=google.com; s=arc-20160816; b=DJCOs28neCaypEfe1E7kRuDa0DqauiRfZZT4qBN3S6TOMdTqJDUaaKUG4YoGRc9lB2 N+Eimn9W9Rt0PqMQ72ajNv/+iGhlRtgrP//jIGYfVS93cdOYd5GvEd/jEJ/yFsR03JgX vjFW6Sf6z8Zb2R0BMo1sdZdZqIAr8YwGTtqF4aNu/9q3sQ0Xgw5wH1pqB44Ez8ZTzJu6 lUhP1oqLxQ5XiPsnP06YFaYPMAxkx3T9826LZ4LDPpedC/lil6g9H/yHJ8m2jfst1jFO FW+xEdIKJlEVOZ8eOycomUjK5oQ7qawVSaeoJwqCEOwFEhbuccQHf+NlTlJer52inLW2 Kxhw== 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 :message-id:date:subject:cc:to:from; bh=2SJ3kIf7TIWxQK4BP0M1E/enhuPEuiqF5leblkHuzZ8=; b=0GOSxUpoxfaZnT3sQ3K34UqzaS31ErFPwz7MY0vGHk5vSlbUSmJul6IDhPyamcwpmk sQQlflzVXlT3RmiERNo5iuzray1AgGnFgzGvlRD5JD71imqIMr77zpeCvEIUQJCGV1DY jNAuOz5KV41g9OZ6xG438kSfom8fRSp5HOdCQdFdVxpfBG9bxjhs1x4/9D2yDYwMZNQU Oysx3HIz43IjfGhMxhSV7ShesCB3JKqfjvGybWGdws4ABFp5oEQQo78wHc0UuPg+WWD5 7d2uJgb4k2vNhg9EVeoSHu+lCUpj+wIvIqjyz+2aB/uXjUcXKCRCHvuasREx4Kso0eWc egKw== 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 d124si31516331pfd.29.2019.06.05.06.43.29; Wed, 05 Jun 2019 06:43:46 -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 S1728034AbfFENmU (ORCPT + 99 others); Wed, 5 Jun 2019 09:42:20 -0400 Received: from mga14.intel.com ([192.55.52.115]:51941 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727923AbfFENmS (ORCPT ); Wed, 5 Jun 2019 09:42:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2019 06:42:17 -0700 X-ExtLoop1: 1 Received: from xxx.igk.intel.com ([10.237.93.170]) by orsmga004.jf.intel.com with ESMTP; 05 Jun 2019 06:42:14 -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 00/14] Fix driver reload issues Date: Wed, 5 Jun 2019 15:45:42 +0200 Message-Id: <20190605134556.10322-1-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.17.1 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 Hi, This series of patches introduces fixes to various issues found while trying to unload all snd* modules and then loading them again. This allows for modules to be really _modules_ and be unloaded and loaded on demand, making it easier to develop and test them without constant system reboots. There are some fixes in flow, either we don't initialize things before cleaning them up, clean up in wrong places or don't clean up at all. Other patches fix memory management problems, mostly things are not being freed. And finally there is few miscellaneous patches, please refer to specific patches to see what they do. This series was tested on SKL, BXT, GLK & KBL. Small note: Patch 2 in this series was already send to this list along with SOF counterpart, however it seems that there is some problem: https://mailman.alsa-project.org/pipermail/alsa-devel/2019-May/149638.html and related patch on SOF side (with discussion): https://mailman.alsa-project.org/pipermail/alsa-devel/2019-May/149640.html It is included in this patchset for completeness. Amadeusz Sławiński (14): ASoC: Intel: Skylake: Initialize lists before access so they are safe to use ALSA: hdac: fix memory release for SST and SOF drivers ALSA: hdac: Fix codec name after machine driver is unloaded and reloaded ASoC: compress: Fix memory leak from snd_soc_new_compress ASoC: Intel: Skylake: Don't return failure on machine driver reload ASoC: Intel: Skylake: Remove static table index when parsing topology ASoC: Intel: Skylake: Add function to cleanup debugfs interface ASoC: Intel: Skylake: Properly cleanup on component removal ASoC: Intel: Skylake: Fix NULL ptr dereference when unloading clk dev SoC: rt274: Fix internal jack assignment in set_jack callback ASoC: core: Tell codec that jack is being removed ASoC: Intel: hdac_hdmi: Set ops to NULL on remove ASoC: topology: Consolidate how dtexts and dvalues are freed ASoC: topology: Consolidate and fix asoc_tplg_dapm_widget_*_create flow sound/hda/ext/hdac_ext_bus.c | 12 ++- sound/soc/codecs/hdac_hdmi.c | 6 ++ sound/soc/codecs/rt274.c | 3 +- sound/soc/intel/skylake/skl-debug.c | 9 ++ sound/soc/intel/skylake/skl-pcm.c | 16 ++-- sound/soc/intel/skylake/skl-ssp-clk.c | 16 ++-- sound/soc/intel/skylake/skl-topology.c | 50 ++++++----- sound/soc/intel/skylake/skl-topology.h | 2 + sound/soc/intel/skylake/skl.c | 7 +- sound/soc/intel/skylake/skl.h | 5 ++ sound/soc/soc-compress.c | 17 ++-- sound/soc/soc-core.c | 1 + sound/soc/soc-topology.c | 114 ++++++++++++------------- 13 files changed, 143 insertions(+), 115 deletions(-) -- 2.17.1