From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.242 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796049065; b=dcLIAAQyw7f1BxDsX3aeRD8ALNlHoTMA3kfGTVssYetfej6ngN7BmDLKexhWUZbn5KuI ryS9dNioQTUgcgIgeQUhfpjByL47VJ5x0BISn3vnKS7y1dHH95TfF3mEEg+5cv1Us+sy+ LpTpv/UaxAEEgFo6xZvdlx/2OmhoHJAIZJOyHW0W/vtSJV2rpjvvcY8UsBCLUe2FtbYaI AhcNjnhOdnz60JFgWbEBHPp5P4R7HYCSzcPJeF/DRXSg/7m1iP976/Gu394R6TfOeEd06 /pWfG/f6xZdH95fXb9+zzlUL6yUHRaPG5c5ZVA5y2y9sehpr2sKx8UjULOha/S3Yzdg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796049065; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=vxB8a+LLL4d4sEW16qAQcwfj7aamQ98DJAikDwpQGxw=; b=UVxa5o7TvlSbwTqLw/nUt29Lk/TCqzXHqLnT8qkh8Fmlc4ZwhzkYeX3KUpg1CECOeuCp bNeUmje8QlByoE9ExtiLfuUdBULGr+z6Sa9PZC00uOR0Qj83krDJvWZmvHlwMM6iEcfWL 52ZzpFj791Pc0Y+SEr4HAuDFg87RfpMwcZtgM9K1PJOK8lfeTOpu28Cae0QL9rwWWeMmN cXR+IZ8zfcKCGYig8WXvKFQdS+x2AXrOMSrQURjtu8E8KjjDjYmReRkCRfVogT5O/QgrK +/Ie7Q1XlyC6tTjtKLDHrylnAZgZxSpkn00PyLpkHkp08MwvPsb7m0oT/p0eMD+fs8w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=oHG6ntFz; arc=none smtp.remote-ip=95.215.58.242 Received: from mta1.migadu.com (out-242.mta1.migadu.com [95.215.58.242]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63611606A32C for ; Mon, 30 Nov 2026 14:31:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 63611606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=oHG6ntFz X-Envelope-To: linux-sound@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=NWEir44RqA84HZzGHlQJhTWNBHnoJVtZ7tgmt6aI+0w=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796049062; v=1; x=1796653862; b=oHG6ntFzXpooihAOIzqXoZCI1BQ+s+l7/xMa2q+1jep9kI5wshbADLtpuso8JDMkmQeeptNG gBYEDsgxPasr0TIGbM/VTSOJOYMdP4xjjrjSnKjiF6ATpZ53mdbx8WsTwvYYvjwjN4bKHZ5qq45 B8E2cmlfRQYi+abMzeebAPdo= X-Envelope-To: linux-sound@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id d217cbfad32df1f1; Mon, 30 Nov 2026 14:31:02 +0000 X-Mizu-Trace-ID: d217cbfad32df1f1 X-Migadu-Flow: FLOW_OUT Message-ID: <61ee2317-bbf0-42cd-a43c-b1374cb69c25@linux.dev> Date: Mon, 30 Nov 2026 15:16:50 +0100 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] soundwire: Suspend and resume asynchronously To: Richard Fitzgerald , Paul Menzel , Vinod Koul , Bard Liao Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com References: <20261127150101.48880-1-pmenzel@molgen.mpg.de> <04ea4610-91ba-48ad-8b70-37d2fcc81df1@opensource.cirrus.com> Content-Language: en-US From: Pierre-Louis Bossart In-Reply-To: <04ea4610-91ba-48ad-8b70-37d2fcc81df1@opensource.cirrus.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > 1. HEAD: arm and SYNCGO are not atomic across links (main concern) > > • Where: intel_start_bus() arms at intel_bus_common.c:30 and issues > SYNCGO at :41; intel_start_bus_after_reset() does the same at :108 > and :135. Arm and SYNCGO take shim_lock separately, and one SYNCGO > clears the arm bit (CMDSYNC) for every link (intel.c:525). > • Who is affected: with async links, intel_resume() starts every link > concurrently on every resume. multi_link is on by default > (intel_auxdevice.c:407-417), so this covers every Intel system with two > or more links, on both cAVS and ACE2.x. > • Bad ordering: link B arms, link A's SYNCGO clears B's arm, then B > writes the CONFIG_UPDATE that applies its sdw_cdns_init() settings, > which turn on multi-master (MMASTER) mode (cadence_master.c:1481), > without being armed. > • Unarmed CONFIG_UPDATEs are routine once a link is already in MMASTER > mode: exit_reset (cadence_master.c:1182), clock stop (:1737) and clock > restart (:1812). > • The update that first enters MMASTER mode is the one the comment > "follow recommended programming flows to avoid timeouts when gsync is > enabled" protects. > • The commit message says such an update is "applied right away", but > its 50-cycle trace never produced this ordering. > • If it fails: you get "cannot start bus during resume" > (intel_auxdevice.c:754). The link is powered down and runtime PM stays > disabled, because intel_suspend() disabled it (:653) and the re-enable > at :765 is skipped. Every codec on that link then times out until the > driver is rebound. > • Runtime resume: the commit message notes runtime resume isn't > serialized either. That's true, but it needs runtime resumes on two > links to coincide. HEAD makes this concurrency happen on every system > resume. > • Suggested fix: hold a mutex shared by all links of the controller from > arm to SYNCGO in both start_bus variants. Alternatives are to get Intel > to confirm the hardware behaviour, or to drop HEAD; only the combined > gain of both patches was measured. Both models found the same problem, that's impressive. I think it's enough to use shim_lock between sync_arm and the end of the CONFIG_UPDATE. sync_go only happens on a 4kHz basis, no reason to wait that long.