From patchwork Fri Jan 13 19:03:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13100517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D1B1C54EBD for ; Fri, 13 Jan 2023 11:03:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6C741A72C; Fri, 13 Jan 2023 12:02:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6C741A72C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1673607820; bh=kNTjsqVnMTAp7iXpz8erOyW6Fpz6nYt3juM1BNvcuYA=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=ZXjWH+sP60Cfl5n9wr0vmA6o8OUl6rADP6D7DVC29OqYhM/kvhTpqCa9+OF2HpNzZ 2oUsixR8pdzJQ5dttkGf/QKqN9ySP/gYhAwV+WUixYwAwRKjdydIo1JF5oyQ+56pJR +UWXO0Q3Wn8dzZgH3MJXH1pVzXQw9Kajedbl6UZE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E4285F80425; Fri, 13 Jan 2023 12:02:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6361FF803DC; Fri, 13 Jan 2023 12:02:22 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D7278F8026D for ; Fri, 13 Jan 2023 12:02:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D7278F8026D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=iTbuZ4uI DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673607741; x=1705143741; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kNTjsqVnMTAp7iXpz8erOyW6Fpz6nYt3juM1BNvcuYA=; b=iTbuZ4uIBaNepq19AVX7ajcHAbdc4VNfXzM6B3cRMFqlf9mSFYItQWwj Rvn2Zk860vjDrQFNoJrLZsKTwv5LqPgl3FGl5tJRaOo8gl28NwRqVPc9/ Qcd2rCo6wQ+2RUC8hzr/uS/tQ3R1Mg0OcQ1L39UP9tew37ht8AQ9SCzP2 u7vIJGnTErX4d0+HKjRBqNgG6Kh4/me6hkjGzxlyzKLeuTIllo18j2oIZ wnsQBteR8Si82WiVIA3jM/KkTy3RuxvoGZ7mksQavQoP2fYb48YPCix/q Gpwj3zXd+ADm1eHrgc9v81gAFzRMTTsFTZIIA2DahqwNQ4cXhLCTHMVO3 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="325228480" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="325228480" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 03:02:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="832039902" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="832039902" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2023 03:02:14 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 1/3] ASoC: Intel: avs: Implement PCI shutdown Date: Fri, 13 Jan 2023 20:03:08 +0100 Message-Id: <20230113190310.1451693-2-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230113190310.1451693-1-amadeuszx.slawinski@linux.intel.com> References: <20230113190310.1451693-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cezary Rojewski , =?utf-8?q?Kornel_Dul=C4=99b?= =?utf-8?q?a?= , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , =?utf-8?q?Amad?= =?utf-8?q?eusz_S=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On shutdown reference to i915 driver needs to be released to not spam logs with unnecessary warnings. While at it do some additional cleanup to make sure DSP is powered down and interrupts from device are disabled. Fixes: 1affc44ea5dd ("ASoC: Intel: avs: PCI driver implementation") Reported-by: Kornel Dulęba Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/core.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c index 2ca24273c491..637501850728 100644 --- a/sound/soc/intel/avs/core.c +++ b/sound/soc/intel/avs/core.c @@ -481,6 +481,29 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) return ret; } +static void avs_pci_shutdown(struct pci_dev *pci) +{ + struct hdac_bus *bus = pci_get_drvdata(pci); + struct avs_dev *adev = hdac_to_avs(bus); + + cancel_work_sync(&adev->probe_work); + avs_ipc_block(adev->ipc); + + snd_hdac_stop_streams(bus); + avs_dsp_op(adev, int_control, false); + snd_hdac_ext_bus_ppcap_int_enable(bus, false); + snd_hdac_ext_bus_link_power_down_all(bus); + + snd_hdac_bus_stop_chip(bus); + snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, false); + + if (avs_platattr_test(adev, CLDMA)) + pci_free_irq(pci, 0, &code_loader); + pci_free_irq(pci, 0, adev); + pci_free_irq(pci, 0, bus); + pci_free_irq_vectors(pci); +} + static void avs_pci_remove(struct pci_dev *pci) { struct hdac_device *hdev, *save; @@ -739,6 +762,7 @@ static struct pci_driver avs_pci_driver = { .id_table = avs_ids, .probe = avs_pci_probe, .remove = avs_pci_remove, + .shutdown = avs_pci_shutdown, .driver = { .pm = &avs_dev_pm, }, From patchwork Fri Jan 13 19:03:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13100519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1A39C54EBE for ; Fri, 13 Jan 2023 11:04:10 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 89E45A726; Fri, 13 Jan 2023 12:03:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 89E45A726 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1673607843; bh=e1QC78rR4HTKqDhmLcw1pD1GEiCW3kyrm+s9+D5yXBE=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=FRkitpyZHRQUev+Ldedx4w8ECL1AeWZ8oDTm4JmQ0BSscU6c5CAlYdA5LwAtto5+U 0UWAm+WBxM3n/M1evsUjVtfZc+2GlFJwOPXosouQXfUiUcYzOS8Vwp2vMdaj9Tz0ri 2JowzLiq/krNfLF4wMWEA7ToQl07P6ry8tDgGpfA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 924BEF80539; Fri, 13 Jan 2023 12:02:25 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A1076F80425; Fri, 13 Jan 2023 12:02:23 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E7FE9F802E8 for ; Fri, 13 Jan 2023 12:02:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E7FE9F802E8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=N4TINUKG DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673607741; x=1705143741; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e1QC78rR4HTKqDhmLcw1pD1GEiCW3kyrm+s9+D5yXBE=; b=N4TINUKGRs41TmMhlZNKKTC4zcDZImgIoDOWVCnWNjLY9K2sQsBY5M5u t/LgEJgZLSUUGJl+mbkPyI1w8biAi6FsK2E5QZLMDGOxwnjjvbVXSbKvw 9bBqa0RpfsRO6674uyYTYIEnEZuRUV2mFhrYuHE5CccRN2atV2A+XJrS6 Shlj/MZiGmpjDfR66f9zjgGXi6szQJExBs9q9bB38DPvZOchFx8EEAAzr OVkGN1s8859LZ90CzVcuSvPxNZjf02vhNghKhx0OSZcrau53CYFiWFLLJ 2iKhF+hR4DEwmSZW7Dk9FDP3Qg1ZnQ43Im0L8J2yJnz1b/o4U/5JiVaGk w==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="325228490" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="325228490" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 03:02:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="832039928" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="832039928" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2023 03:02:16 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 2/3] ASoC: Intel: avs: Correctly access topology fiels Date: Fri, 13 Jan 2023 20:03:09 +0100 Message-Id: <20230113190310.1451693-3-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230113190310.1451693-1-amadeuszx.slawinski@linux.intel.com> References: <20230113190310.1451693-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cezary Rojewski , kernel test robot , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , =?utf-8?q?Amad?= =?utf-8?q?eusz_S=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Fixes following warning: sound/soc/intel/avs/topology.c:1636:20: sparse: sparse: restricted __le32 degrades to integer Reported-by: kernel test robot Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/avs/topology.c b/sound/soc/intel/avs/topology.c index 5fee7a8ec06a..cdb4ec500261 100644 --- a/sound/soc/intel/avs/topology.c +++ b/sound/soc/intel/avs/topology.c @@ -1633,7 +1633,7 @@ avs_control_load(struct snd_soc_component *comp, int index, struct snd_kcontrol_ size_t block_size; int ret; - switch (hdr->type) { + switch (le32_to_cpu(hdr->type)) { case SND_SOC_TPLG_TYPE_MIXER: tmc = container_of(hdr, typeof(*tmc), hdr); tuples = tmc->priv.array; From patchwork Fri Jan 13 19:03:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= X-Patchwork-Id: 13100518 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F41BEC54EBD for ; Fri, 13 Jan 2023 11:04:08 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 70CF7A720; Fri, 13 Jan 2023 12:03:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 70CF7A720 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1673607846; bh=jvIEaZNc9a/JtwZzFe9mobDzOIz8+rNt4DjJLjhg6cQ=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=hfRojz/ZwV1h+yWVzcgUzYOSCuIiiHlMDeDB5VXjhwKNamoOvHtYxOmvwOi3z1WfG 3rnWx6BfQ+aT38rni/FMl03Cc3JX7GmbB01ksrdMR7Wi/nxh7z2/A2g6w4XTchtthS HO3Yaad6TEXE1xV2BQgOy+QEyAyc5/Rve0kjSJJY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 24130F80543; Fri, 13 Jan 2023 12:02:26 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 84C6BF804A9; Fri, 13 Jan 2023 12:02:24 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D06FFF804A9 for ; Fri, 13 Jan 2023 12:02:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D06FFF804A9 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=n/woBrEa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673607743; x=1705143743; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jvIEaZNc9a/JtwZzFe9mobDzOIz8+rNt4DjJLjhg6cQ=; b=n/woBrEa09eLdeetCiRbZBiH4lQg9i1QiVcEAd7aLOYxJihcfiVpKtby 20Gj1E32Dl13VTdd+sK3Xn3ZdtsWAW9aq8KzJ5pJCo3QsyJeFhkP5B9fY vPxWOlwjrOxqDk5/t9RGa3GHOA6JEFvVPjvRFkEZtEU+gCt+hwmIFP8oP 1DDwmJB7h1uVD8BLUmbEAg1CYRMutPU4LIbad81k8lAu/OgoLQtmjBfb8 L3LT6IhuU34AZML/6tRdqCkuOeENtIoBaMS/hwMD36qR8aNBQU3jxQwy5 4Sd80mfhIbOg/4kuidkW6V4tEcAA/G8kbyk5bKd7eKw9xQsL81MNqk6XY Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="325228501" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="325228501" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 03:02:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="832039947" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="832039947" Received: from dev2 (HELO DEV2.igk.intel.com) ([10.237.148.94]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2023 03:02:18 -0800 From: =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= To: Mark Brown Subject: [PATCH 3/3] ASoC: Intel: avs: Use min_t instead of min with cast Date: Fri, 13 Jan 2023 20:03:10 +0100 Message-Id: <20230113190310.1451693-4-amadeuszx.slawinski@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230113190310.1451693-1-amadeuszx.slawinski@linux.intel.com> References: <20230113190310.1451693-1-amadeuszx.slawinski@linux.intel.com> MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cezary Rojewski , alsa-devel@alsa-project.org, Takashi Iwai , Pierre-Louis Bossart , =?utf-8?q?Amad?= =?utf-8?q?eusz_S=C5=82awi=C5=84ski?= Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Checkpatch script recommends using min_t instead of min with the cast. Fixes: 69b23b3937a1 ("ASoC: Intel: avs: Event tracing") Signed-off-by: Amadeusz Sławiński --- sound/soc/intel/avs/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/avs/trace.c b/sound/soc/intel/avs/trace.c index fcb7cfc823d6..c63eea909b5e 100644 --- a/sound/soc/intel/avs/trace.c +++ b/sound/soc/intel/avs/trace.c @@ -24,7 +24,7 @@ void trace_avs_msg_payload(const void *data, size_t size) while (remaining > 0) { u32 chunk; - chunk = min(remaining, (size_t)MAX_CHUNK_SIZE); + chunk = min_t(size_t, remaining, MAX_CHUNK_SIZE); trace_avs_ipc_msg_payload(data, chunk, offset, size); remaining -= chunk;