From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.241 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796049065; b=J3F5J1/cvAbxoT/ktLKXTMZpQwbETDbAPJijXFyVwLTTWhYyaokSXFSM3+5U4eO/+LzI 8GGe27FvnNInmra+tZfKHKWKbi5Gu623ls05r8l3CKRrYDt9SSYe8zbHrwgnc2mp9X1XA TH3MLsM1l81DjTxqRJn6B/gDk6DqHl0ZaTzHJpv83u261+6ThCLT6HYas6e6beCXp01HA dgQS6Gz4X5YVu9v4ey67SE2CtzQabBPVivQydwYHHiIhkm+9cRzwlU7Dp+Ib8SMCJchb4 G0MNGT68Ct6sTS9k6AzG04zoechJrT3I0CS+5LUN7yB7wg6YQXkkiJePGumNZe9OBhw== 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=oQ9USt2kSGofCw5PdMCCRP3BlL3yilEvwR/t5+t6THX+IYm7jAlVHsV7URx8INUd9jUb buv6dQcxgdItxYIjRvM/+MIpxEGCMQ/LeqtRf3i3bXY5a9LN5tAtBC0jMRuUuhzDe6/nO xjIUxxFppUaGb9rXNpm79I63qbVtDuwt2pc+49ggFt+SMrnd9A9Gfgpv///JYvXxnpXKq yTBLlVrYUKflpQOJCLfbgYPmhRSS/xSdtzQrlhy032cT98adr2TmftcF745IOs+LxmC+y twm2maFffUyfjKVyho7Hn0E7F8Rnf/nDsVVR9W9Pi5pyQz+Roks6tAK9idTVyj4hc+Q== 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.241 Received: from mta1.migadu.com (out-241.mta1.migadu.com [95.215.58.241]) (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 A0C02606A335 for ; Mon, 30 Nov 2026 14:31:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A0C02606A335 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-kernel@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-kernel@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-kernel@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.