From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.52.15 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796202420; b=IfDcN+D1Cxl0sJRCVAUZ9p1gAPBZ/4Jf5mAwkSYkL/blW70IGdOUKnDyR07ZwqpZnEH2 fb/WfZevI75NuRrFilH7krN7uQfWrNd8Qu5BDPJj9b27iO+4wdQDcc17Psb77vyY4Uybi tczz39OhZ1cPYhE0ZlkGUIgs5x/z2f9z3Ll8pxvGFj2WPkV634IwLAwp1nPFTV9MNknyR F+ue6TNYfPd0x31SJuoR1ydevUdchPEGoIMj37jRrZ3v3BFEpg5yAVZx+wC7o9qa3XuFH 056Z+/rKx+cT9NA3iom+BsdCW0SHm4t96DRA5+V4XsFgbDSJJ1UKGXbN/trkq4+9Bhw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796202420; h=DMARC-Filter:DKIM-Signature:Received:Received:Message-ID:Date: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=yNqWEnvq1adF3bzfuVVmTsl2dTdzbG0UVv+3kAt4tYw=; b=Z3qj7K4h0B/1caYb0IP67Zxq3GPtDDm2+snJ44zphYG+p1Ag86/FiZ8cOva60GHpkc0u KDOIINR+Ld7bLL8TH0UefQLL8HfJY+A840L3nyUn6Z2NxTBBkccDg/C3asL1zmfH2uBqW L/XYueE5FEDFQx8EiiYGJsl47JZp49c9W26WlMOV8HQnw2L3qg49ZbloIKMUfFi2SMtiA H47TNc/Ro08NjJfrwo8sIhnxjbgfTYzfmqs5dN3AFwFQyJL5BkrujS6uFMx1IZEdnF1im N52lHQ0NYTgdntClex+p9rud/GDC85xnd++iQiaFX2uST+PHNrtNVz0BHCaw0w8Uv4A== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=EvESbd9F; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.52.15 Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11011015.outbound.protection.outlook.com [52.101.52.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0C43606A31A; Wed, 2 Dec 2026 09:06:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C0C43606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=EvESbd9F ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=E4JyOWw3KDmuCZMm15k3lXBCtkMPGsI09ciuCRvAV4yW51VWEFV52EmxL9adtcUUTFd4c8IKcOxiDhhtj66oOJBE+asEZ6MrVuhkvwWk/2w2AwLsAFv/qWB0XYf/gGeBnpOyT0oqxEtxFlEk11I5O1YkL59PgeWhXZma9kh+akhm9c2Bc3cIqxqc8BwMWChyqOxi3ihRcUitwzIb+lzP3U7F5mk9bd25d0jfU04p1Lm1XllG37vmse9TePa1py6DE+eoaHMzcayT+66xgus0IAK+GwwlXGhk1I1DHTdZRXFHL7bsZuC64BRU1/xWKZkeInduFtawUopn7gbnsxMzLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yNqWEnvq1adF3bzfuVVmTsl2dTdzbG0UVv+3kAt4tYw=; b=wWiYJRX7L8TscFh5L20r8cW9Z7Kvfe8A2mPBnXXkaXTFq/iCFI2N4NBtGKpk8QNAND3DtyqQXJOBvJpmVkbfG9WTwm2Z3faVtsXav23+e7k0jpsem/kXPXNvkBPrEmgZ4Ghz6zpo8mPjmoJuOW9hRQD1sd3yh3uLuVvCP2iyYVuf1a28x9fmlqhNbEKY1Xo1k1/1zJsZC+8GOzmKiYyuzrhPBXvLVBmHFkkgbeTcuQWVK8WsOrZJZl+ZcYKGFzBZ7HpBD2tX0FNYe77HJrhpaxwDZjxOsc/fk8t1Cr11in8Ow84N85WRe5vjANx4nfstY12TO/EGvDDVCG9XYSaniA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yNqWEnvq1adF3bzfuVVmTsl2dTdzbG0UVv+3kAt4tYw=; b=EvESbd9FfGgw9qoJoDtl5RRYGILsVP5PZvLWTmL7I1jGS1/jQyAQIK7aFGti+07fDYXIB8B1Dl+XWiyBjR5fPkMn5+UoFDfPCloIwOwSci2I/vM3m0qMkXeFMgPPyoL9G/enmEW96z1FdrFcrxvi5cpAu3yt5p5uuynLQ0FoNzI= Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CY5PR12MB6252.namprd12.prod.outlook.com (2603:10b6:930:20::17) by SA5PPFE3F7EF2AE.namprd12.prod.outlook.com (2603:10b6:80f:fc04::8e6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Wed, 2 Dec 2026 09:06:55 +0000 Received: from CY5PR12MB6252.namprd12.prod.outlook.com ([fe80::ab00:d77:6014:64a2]) by CY5PR12MB6252.namprd12.prod.outlook.com ([fe80::ab00:d77:6014:64a2%4]) with mapi id 15.21.0688.009; Wed, 2 Dec 2026 09:06:54 +0000 Message-ID: <04eb6085-8934-4950-a1bf-632f2b5c6b3f@amd.com> Date: Wed, 2 Dec 2026 14:35:38 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 00/24] soundwire: amd: SoundWire manager driver bug fixes To: vkoul@kernel.org, Pierre-Louis Bossart Cc: yung-chuan.liao@linux.intel.com, Basavaraj.Hiregoudar@amd.com, Sunil-kumar.Dommati@amd.com, venkataprasad.potturu@amd.com, Syed.SabaKareem@amd.com, Mario.Limonciello@amd.com, Richard.Gong@amd.com, Poojitha.N@amd.com, lee@kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261124085033.682755-1-Vijendar.Mukunda@amd.com> Content-Language: en-US From: "Mukunda,Vijendar" In-Reply-To: <20261124085033.682755-1-Vijendar.Mukunda@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MA5PR01CA0040.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:1d6::6) To CY5PR12MB6252.namprd12.prod.outlook.com (2603:10b6:930:20::17) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6252:EE_|SA5PPFE3F7EF2AE:EE_ X-MS-Office365-Filtering-Correlation-Id: d3e4bb9c-a650-4889-1043-08df50539bef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|366016|1800799024|376014|6133799003|18002099003|22082099003|10067099003|56012099006|261102123227099003|261028144727099003|261009223027099003|261022113327099003|261021121427099003|261026140227099003|261022075727099003|261021123027099003|261026121527099003|261022105027099003|11063799006; X-Microsoft-Antispam-Message-Info: poPVMF+FMuRrQ5gy5vCdH3LEC/Axr6fpBF0E4QyQeKCS429B86ZuX6J03hlNfk3qfTDAMWVnO/OqS2O7bux2ssuJ+SuJRph6tJFDI+6B1lurIjOj5+USsCw24HzzSpW0gyup0M51xYZNfJnq+9HuVTbAlOsQ4kN01EI8jydu2effuRl4vWYdhYE+GauhpnFh69KPFYk/5jjUKS2bDkOf0/j5t6A8iuLcqQCHPB7rCF+6F/R2p2xhsuu8wR+9cvqfW2TKUEZ9pWcgvKTN7UBgqH7Z4uk3/hu7d56kMOha4tExEiFjrwfearGHFEguAJvzR7z600jq2V0p2oQQRSfAL5fmD+CxYYCxDoFo0tsudcnpQGF95hDAcXgRt2zco5iIoM0if3IKEUrtS+ikqGd5obvl1x4mvs0TQIAr+LSZ9QiCpjpZSeUYGztZ5Lfp9yvGwGwaId2U/ncQOxsO5HP4zjMqbL5j4D2OXSMvnV1xBdPXJqfiKaygq1AFF+18mHVvX4b021AawkcyUVsqwCI7A6MKD3hCtSqqtTayUq+QncTZBP+b5cPd0KIPvzBL2GHAy0noeDgeavMUtcOJMjtP9WAKXv9CNRjqqoAUeRPRof/qeCWr9Fmi/IQWdoCpKhdJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6252.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(376014)(6133799003)(18002099003)(22082099003)(10067099003)(56012099006)(261102123227099003)(261028144727099003)(261009223027099003)(261022113327099003)(261021121427099003)(261026140227099003)(261022075727099003)(261021123027099003)(261026121527099003)(261022105027099003)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?V0sxNWtGMXNUQTdTYllYZHplR1dnT2w1QmVlZzZ0UC9OejhqeGVXSWVDd2dz?= =?utf-8?B?N20wYldCaHN5ZXMvZnFMWkk3VmpBZXY4ZXVVQUg3SmRGV2R4RWNGWHU4TkEz?= =?utf-8?B?RUtXcnY4WDl0Kzd6Lzk5NWxQNVBzV3ErT24xeGNqMUs5MEVLbVRPTGdKMFZr?= =?utf-8?B?alVYUHVPNU55ZFozeVFzNGZZVXNpU0prT3AwaXFOM3BSWitpamxLa3ByeE02?= =?utf-8?B?ZXdkcWJ5eFV1QzluajZSVzdlZnhEY0Vrc1pTUldqeVBERlZOK0NYaXRTK2th?= =?utf-8?B?UE5VOGxhT1VqeGp6bkdUUStDb2JXU012QkVOUzNQL1gzL1djUVVLRkZpdEw5?= =?utf-8?B?QlZ0TnpWTG5KejgxTUZROEo4VFpyemcxSWdaMXFQMGluOGxleHNDVkxjRFdF?= =?utf-8?B?YnBpcmdmdktidlFhWlpFajlWbmNEenhyM2hENkpRbXdD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JZbldpeDVocmJZUjc0V0NmTHlkRTUzcEhsV2ppSjljamJtRTJh?= =?utf-8?B?UkYra0dsVTR3c2k4Z3dFeWNSdW4wT0RMNWpGRzlyUFlKcnltYUU4UT09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3e4bb9c-a650-4889-1043-08df50539bef X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6252.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 09:06:54.1050 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TJSZ/4O698eUoCa43CdZpPVYwjLLWT/JwUFrmSA+yceMvWJvhqwU/+QIXcqPoqy8k6qhZRrxZl113/9LqQsIZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA5PPFE3F7EF2AE On 11/24/26 14:18, Vijendar Mukunda wrote: > This series collects bug fixes for the AMD SoundWire manager driver > (ACP6.3/7.0/7.1/7.2). The patches address correctness issues across > six areas. Patches 9, 12, 13, 15, 20, and 21 fix issues reported by > Lee Jones . > > Wake interrupt handling (patches 1-8): fixes reported on OEM platforms > running ACP6.3/7.0/7.1/7.2. Consolidate pad register macros into > amd_init.h, add correct SCHMEN/OE programming for ACP 7.0/7.1/7.2, > introduce D0/D3 PM pad helpers, track full pad teardown across > suspend/resume, fix missing wake interrupt and group wake-arming calls > in runtime suspend, fix the IRQ thread dropping STATUS_0TO7 on > simultaneous wake and state-change events, remove the spurious > STATUS_8TO11 clear in amd_sdw_process_wake_event(), and fix a missing > wake interrupt for ACP6.3 in POWER_OFF suspend. > > Command response handling (patches 9-11): fix silent widening of > -ETIMEDOUT to u64 (reported by Lee Jones), cache the last successful > PING result to avoid spurious disconnect warnings on transient timeouts, > and add lockdep_assert_held() to enforce the msg_lock contract. > > Work-queue and driver lifecycle (patches 12-16): fix drain ordering in > the remove path and defer dev_set_drvdata() until after INIT_WORK() to > close a concurrent-remove window (both reported by Lee Jones), guard > pm_runtime_disable() against unpaired calls, guard IRQ work execution > with the interrupt_enabled flag using WRITE_ONCE/READ_ONCE, clear stale > ACP_SW_STATE_CHANGE_STATUS registers before re-enabling interrupt > delivery, and add explanatory comments in amd_disable_sdw_interrupts() > and amd_sdw_irq_thread() (reported by Lee Jones), and fix *sdw_ctx leak > when sdw_amd_startup() fails. Companion NULL-check patches are already > merged in Mark Brown's ASoC tree: > 34ea81a7f284 ("ASoC: SOF: amd: guard adata->sdw dereferences with > NULL check in IRQ handler") > 41e06aaef9c0 ("ASoC: amd: ps: guard adata->sdw dereferences with > NULL check in IRQ handler") > > Power management (patches 17-20): propagate amd_init_sdw_manager() > errors on POWER_OFF resume, drop amd_deinit_sdw_manager() in POWER_OFF > suspend, replace the open-coded >= ACP70 comparison with an explicit > switch/case, and fix interrupt-gate and work-drain ordering in PM ops > (reported by Lee Jones). > > Drvdata and register safety (patches 21-23): add a NULL drvdata guard > in sdw_amd_startup() (reported by Lee Jones), and fix shared-register > read-modify-write races in amd_sdw_set_device_state() and > amd_sdw_host_wake_enable() by holding acp_sdw_lock. > > Generic bus fix (patch 24): fix deadlock in sdw_handle_slave_alerts() > when the parent manager is in RPM_SUSPENDING. The manager's > runtime_suspend callback blocks in cancel_work_sync() waiting for the > alert work to complete, while the alert work blocks waiting for the > manager to complete its suspend. The fix checks the manager PM state > directly via slave->bus->dev->parent using pm_runtime_get_if_active(); > if the manager is not RPM_ACTIVE, return early to defer the alert, > avoiding dropped alerts when the slave is RPM_SUSPENDED but the manager > is still active. If the manager is active, use pm_runtime_resume_and_get() > for the slave for correct error-path PM reference accounting. > > Changes since v8: > - Patch 24: correct Fixes tag to commit aa79293517b3 ("soundwire: bus: > fix io error when processing alert event"), which introduced > pm_runtime_get_sync() into sdw_handle_slave_alerts(); rework deadlock > condition to check manager PM state via > pm_runtime_get_if_active(slave->bus->dev->parent) instead of slave > state: if manager is not RPM_ACTIVE return early to defer the alert, > avoiding dropped alerts when slave is RPM_SUSPENDED but manager is > active; replace pm_runtime_get_sync() with pm_runtime_resume_and_get() > for correct error-path PM reference accounting; add have_mgr_ref > boolean and mgr_put: label to track and release the manager reference. > - Link to v8: > https://lore.kernel.org/linux-sound/20261123170520.1380924-1-Vijendar.Mukunda@amd.com > > Changes since v7: > - Patch 15: expand beyond the interrupt_enabled guard to also clear > stale ACP_SW_STATE_CHANGE_STATUS_0TO7 and _8TO11 registers in > amd_enable_sdw_interrupts() before re-enabling interrupt delivery, > add STATUS clears in the ACP6.3 POWER_OFF_MODE wake-re-enable block > in amd_suspend_runtime(), and add explanatory comments in > amd_disable_sdw_interrupts() and amd_sdw_irq_thread(). Rename to > "guard IRQ work with interrupt_enabled and clear STATUS". > - Add patch 24: fix deadlock in sdw_handle_slave_alerts() caused by > pm_runtime_get_sync() blocking when the parent manager is in > RPM_SUSPENDING; replace with pm_runtime_get_if_active() conditioned > on pm_runtime_status_suspended(). > - Link to v7: > https://lore.kernel.org/linux-sound/20261118104353.331556-1-Vijendar.Mukunda@amd.com > > Changes since v6: > - Patch 7: drop Fixes tag; the STATUS_8TO11 double-clear is an > irq-thread logic bug not attributable to a single introducing commit. > - Patch 16: change approach to publish *sdw_ctx = ctx before > sdw_amd_startup() and reset *sdw_ctx = NULL on startup failure before > calling sdw_amd_exit(); update commit description to match. With this > ordering *sdw_ctx is visible before amd_enable_sdw_interrupts() so the > IRQ handler window between interrupt enable and ctx publication is > closed. > - Link to v6: > https://lore.kernel.org/linux-sound/20261117070906.803139-1-Vijendar.Mukunda@amd.com > > Changes since v5: > - Drop patch 10 (return response on IMM status cleanup timeout) and > patch 11 (clarify bad-state guard poll omission in IMM_RES_VALID > path): dropped after review feedback. > - Patch 2: rename disable_oe to needs_schmen_oe for clarity; update > Fixes tags to cite ACP 7.x introduction commits instead of the > ACP 6.3-only refactor commit: > commit 2c0ae8ef1e5e ("soundwire: amd: add support for ACP7.0 & ACP7.1 platforms") > commit 34b1cb4ec286 ("soundwire: amd: Add support for acp7.2 platform") > - Patch 4: use "POWER_OFF_MODE runtime suspend" instead of > "wake-armed runtime suspend" for precision. > - Patch 5: add commit description explaining why the early return > before wake-arming is correct when amd_deinit_sdw_manager() fails; > update Fixes tag to commit dcc48a73eae7 ("soundwire: amd: change the > soundwire wake enable/disable sequence"). > - Patch 8: update Fixes tag to correct commit SHA. > - Patch 9: drop dev_err_ratelimited() calls for ping status timeout; > the error is already tracked via the cache introduced in patch 10. > - Patch 14: update Fixes tag to commit ed5e8741b8db ("soundwire: amd: > refactor amd soundwire manager device node creation"), which introduced > the partial-init startup sequence that makes the unconditional > pm_runtime_disable() incorrect. > - Patch 15: add WRITE_ONCE() for all stores to interrupt_enabled and > READ_ONCE() for the load in amd_sdw_irq_thread(); restore > interrupt_enabled in the ACP6.3-specific wake-re-enable block in > amd_suspend_runtime() POWER_OFF_MODE; guard IRQ work execution > instead of scheduling. > - Patch 16: simplify to single-problem description (ctx leak on > startup failure); remove the concurrent IRQ handler race rationale. > Two ASoC companion patches addressing the IRQ handler NULL dereference > window (adata->sdw dereferenced without NULL check between > amd_enable_sdw_interrupts() and *sdw_ctx assignment) have been posted > and merged in Mark Brown's ASoC tree: > 34ea81a7f284 ("ASoC: SOF: amd: guard adata->sdw dereferences with > NULL check in IRQ handler") > 41e06aaef9c0 ("ASoC: amd: ps: guard adata->sdw dereferences with > NULL check in IRQ handler") > - Patch 19: add WRITE_ONCE(interrupt_enabled, true) in the ACP6.3 > wake-re-enable block in amd_suspend_runtime() POWER_OFF_MODE. > - Patch 20: expand description to explain the redundant > amd_sdw_wake_enable(false) calls and clarify CLK_STOP_MODE > interrupt handling through D3. > - Link to v5: > https://lore.kernel.org/linux-sound/20261107154659.3358223-1-Vijendar.Mukunda@amd.com/ > > Changes since v4: > - Add patches 1-8 (OEM-reported wake interrupt fixes for > ACP6.3/7.0/7.1/7.2): pad register macro consolidation, SCHMEN/OE > programming for ACP 7.0/7.1/7.2, D0/D3 PM helpers, pad teardown > tracking, missing wake interrupt in runtime suspend, STATUS_0TO7 > race fix (promoted from patch 12/13 in v4), STATUS_8TO11 fix > reworked to a targeted removal of the clear in > amd_sdw_process_wake_event(), and ACP6.3 POWER_OFF wake fix. > - Add patch 11: clarify bad-state guard poll omission in > IMM_RES_VALID path. > - Add patch 15: defer dev_set_drvdata() until after INIT_WORK(). > - Add patches 17-18: guard IRQ work with interrupt_enabled flag; > delay *sdw_ctx publication until after startup succeeds > (supersedes v4 patch 7 ctx-leak fix with a more robust approach). > - Add patches 23-25: NULL drvdata guard in sdw_amd_startup(), and > shared-register RMW races in amd_sdw_set_device_state() and > amd_sdw_host_wake_enable(). > - Drop v4 patch 7 (fix ctx leak when sdw_amd_startup() fails): > superseded by patch 18. > - Link to v4: > https://lore.kernel.org/all/20261026044507.2310694-1-Vijendar.Mukunda@amd.com/ > > Changes since v3: > - Add patch 12/13 to fix IRQ thread dropping STATUS_0TO7 when a > wake event and a device-state change arrive simultaneously. > - Add patch 13/13 to fix STATUS_8TO11 double-clear race in the > wake handler introduced by the simultaneous-wake fix. > - Add lockdep_assert_held() to amd_sdw_read_ping_status() (patch 4/13) > to enforce the msg_lock contract machine-checkably. > - Add return response on IMM status cleanup timeout (patch 2/13). > - Update patch 11/13 (fix interrupt gate and work drain ordering in PM > ops) to also fix amd_sdw_wake_enable() ordering in both CLK_STOP_MODE > paths: move the call to after amd_enable_sdw_interrupts() so the > unconditional interrupt mask write does not clobber the wake bit. > > Changes since v2: > - Update comment for ping_slave_stat variable description in patch 3/13. > - Split the remove path work drain and pm ops guard patch into separate > patches (patches 5/13 and 6/13) to improve clarity and maintainability. > > Changes since v1: > - Rework patch 1 to fix the u64 return type properly via out-parameter. @Vinod, @Pierre-Louis, Could you please review patches 01-23 from this series? Patch 24 (soundwire: bus: use pm_runtime_get_if_active() in sdw_handle_slave_alerts()) has been posted as a standalone commit for upstream review and is being discussed separately here: https://lore.kernel.org/linux-sound/d6cff6e3-d8d4-4612-a08e-365bc36ce3aa@amd.com Please exclude patch 24 from your review of this AMD series. > > Vijendar Mukunda (24): > soundwire: amd: consolidate pad register macros into amd_init.h > soundwire: amd: program pad SCHMEN and OE control for ACP 7.0/7.1/7.2 > soundwire: amd: add pad ctrl helpers for D0/D3 PM transitions > soundwire: amd: track full pad teardown across suspend/resume > soundwire: amd: fix missing wake interrupt and group wake-arming calls > in runtime suspend > soundwire: amd: fix IRQ thread dropping STATUS_0TO7 on simultaneous > wake > soundwire: amd: remove STATUS_8TO11 clear from > amd_sdw_process_wake_event() > soundwire: amd: fix missing wake interrupt for ACP6.3 in POWER_OFF > suspend > soundwire: amd: fix SDW command timeout return value handling > soundwire: amd: cache ping slave status to avoid spurious disconnect > on timeout > soundwire: amd: assert msg_lock is held in amd_sdw_read_ping_status() > soundwire: amd: fix work drain ordering in remove path > soundwire: amd: defer dev_set_drvdata() until after INIT_WORK() > soundwire: amd: pm_runtime guard in remove path > soundwire: amd: guard IRQ work with interrupt_enabled and clear STATUS > soundwire: amd: fix *sdw_ctx leak when sdw_amd_startup() fails > soundwire: amd: propagate amd_init_sdw_manager() error on resume > soundwire: amd: drop amd_deinit_sdw_manager() in POWER_OFF suspend > soundwire: amd: replace >= ACP70 with explicit switch/case in PM paths > soundwire: amd: fix interrupt gate and work drain ordering in PM ops > soundwire: amd: check for NULL manager drvdata in sdw_amd_startup() > soundwire: amd: fix shared-register RMW race in > amd_sdw_set_device_state() > soundwire: amd: fix shared-register RMW race in > amd_sdw_host_wake_enable() > soundwire: bus: use pm_runtime_get_if_active() in > sdw_handle_slave_alerts() > > drivers/soundwire/amd_init.c | 76 ++++-- > drivers/soundwire/amd_init.h | 18 ++ > drivers/soundwire/amd_manager.c | 372 ++++++++++++++++++++++++------ > drivers/soundwire/amd_manager.h | 10 - > drivers/soundwire/bus.c | 52 ++++- > include/linux/soundwire/sdw_amd.h | 15 ++ > 6 files changed, 434 insertions(+), 109 deletions(-) >