From patchwork Wed Sep 7 10:13:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 603366 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 A90C4ECAAD3 for ; Wed, 7 Sep 2022 10:15:13 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6FD96E12; Wed, 7 Sep 2022 12:14:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6FD96E12 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1662545711; bh=GWdOYDWTZe6KtuZNLOmGwpYmgKHedyUzrMXPcn91HUY=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Gw6SxhU9CqWBjytdqatdz4+q5SsKbvFe40iu7ekO0FGr1ycMuCC2GFtQ27FFHsqHt jO1fqC/8BVI+eLIXKs5kjQOu4bAMWOofNc4iFMYlv0BpLlv6XspdQOtxiTBFvyMmAV 0MNYg8fPJ2PKSAk6CORI0FS7J2ofW+Ku99zrvWU4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 14627F8028D; Wed, 7 Sep 2022 12:14:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3171DF804B1; Wed, 7 Sep 2022 12:14:20 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (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 5B4AAF80118; Wed, 7 Sep 2022 12:14:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5B4AAF80118 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="SQi3tDQH" Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2877p1GG032346; Wed, 7 Sep 2022 05:14:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=IiVoG2fnJzlYy5zIJA+PVp/Rv31qKQR5pP87OgUZQuU=; b=SQi3tDQH1HHKmBemUnVJl6u++lrEr0kRo0xFv0DLLwLqBblQDn/Yf+qCinnDBKHZdWeF bAxHxKYdngd1ZCvCFJN1OBXrbZ31yKu16OVnXyh3jFI+GKrGKK73GJrJG1B4cBZ1nG7Z QjjwQtYICILOGkAoq5iJjUyu0bjfiXET/KZXaF+t6eEvHhUqxaXgzLuWcII3hNmw9sNe tFoBz0e6bcLDYYIVd91R1+9goh1xXz7mWYPyRGQa6q8soUS6WwMCoOyqNFiOnSe4UrBE q26t4PkAvQ0B2FF+fsS4I2XmClbYXtVQOYKkVcmGd/ogKl5lsdg5aQIF6O4/4F/Slodh KQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3jc3bpw4sn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Sep 2022 05:14:13 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.12; Wed, 7 Sep 2022 05:14:12 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.12 via Frontend Transport; Wed, 7 Sep 2022 05:14:12 -0500 Received: from debianA11184.ad.cirrus.com (unknown [198.61.65.149]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2C1FFB06; Wed, 7 Sep 2022 10:14:05 +0000 (UTC) From: Richard Fitzgerald To: , , , , , , , , , Subject: [PATCH 0/7] soundwire: Fix driver removal Date: Wed, 7 Sep 2022 11:13:55 +0100 Message-ID: <20220907101402.4685-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Proofpoint-GUID: zO4yBel3wvibvReJBzwxEzDL20GZCnK_ X-Proofpoint-ORIG-GUID: zO4yBel3wvibvReJBzwxEzDL20GZCnK_ X-Proofpoint-Spam-Reason: safe Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Richard Fitzgerald , linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Removal of child drivers and the bus driver was broken and would result in a slew of various errors. Most of these were caused by the code shutting down in the wrong order, shutting down the bus driver first. The bus driver should be shut down after the child drivers have been removed (compare with the I2C and SPI subsystem for example). These patches fix that. A secondary problem was over the cleanup of child drivers. The removal functions were not the opposite of the probe function, and the ownership of struct sdw_slave is tricky because it mixes two separate usages and currently has to be "owned" by the bus driver. Tested with 4 peripherals on 1 bus and 8 peripherals on 2 buses. Richard Fitzgerald (7): soundwire: bus: Do not forcibly disable child pm_runtime soundwire: intel_init: Separate shutdown and cleanup ASoC: SOF: Intel: Don't disable Soundwire interrupt before the bus has shut down soundwire: bus: Add remove callback to struct sdw_master_ops soundwire: intel: Don't disable interrupt until children are removed soundwire: intel: Don't disable pm_runtime until children are removed soundwire: bus: Fix premature removal of sdw_slave objects drivers/soundwire/bus.c | 37 ++++++++++++++++++++++++----- drivers/soundwire/intel.c | 13 ++++++++-- drivers/soundwire/intel_init.c | 25 +++++++++++++++---- drivers/soundwire/slave.c | 21 ++++++++++++---- include/linux/soundwire/sdw.h | 3 ++- include/linux/soundwire/sdw_intel.h | 2 ++ sound/soc/sof/intel/hda.c | 16 ++++++++++--- 7 files changed, 96 insertions(+), 21 deletions(-)