Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp169888lqo; Tue, 7 May 2024 16:28:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlM1zjQTR21y2HbCncSDJJIlA8CVOb87P9fBCXtbOyxSfFPoXQUnY4v5lCu+8bN7IZwfsJdGj63QAxrP2u6a1DNRptAewYjJd7p4v17A== X-Google-Smtp-Source: AGHT+IFZ6tlVSs6bK1lrDURYs74X+nxCRBlvQHOTXiQPtDw39ESo1xwKequlsKNJ4xBA9Qs+DSpO X-Received: by 2002:a05:6358:52c9:b0:192:8935:4080 with SMTP id e5c5f4694b2df-192d291082fmr139473855d.5.1715124509087; Tue, 07 May 2024 16:28:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715124509; cv=pass; d=google.com; s=arc-20160816; b=P7QyrTbTZBArZrxamodTLAf4JDdODC3yP4ungruvmDnYXH0SuoSfiPMX6OZPPmrEi9 vdDdSeBF2wv80p1p2zBWBFkW/eA6BhpLbc3ew/fnzwbBf8DjaTmlIA8cAAVAD6QuWyNL ilOokvlPOhoHpM4WhwdLdDL+4d3J3OhlrphJqhsC9eQ+gaotr5DJTJyF+U0Tp19IRVVt jllfqimDpbnH/w8fIfrzw7exAw5canEqQzu2/QGtpQBuFqDS4caw9Y6f4jqQPiRD+10N fJ9t1eHOWXzS9fMy+ZNajfKBFSorfPAC0wErAfSz1G+tmsSqBjdv8LJA3caRhYU1sHKn E/4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zdSBnaUtlnymNdNhJl7KtD2A5JqoFBx0jvQCUcjivVc=; fh=xRRcpb6h8yMZMudBJxDGr3DNGuczvQ78km/oXOMkS+c=; b=scqZrB9ScPK5i2SDfJzfhWA3vohJ7PFaHj4rCPxn8ZL+yS+O2V7pYUwkw8+glePb83 a6aIMpSOzDu+px4PfkcDmRaefIBIASckC3Ou6QkH6BqAkNexkcib6dpq3TJPMb8YZFpT ZaLLzO2tcFQOH9AKG5pfGX5e8bANdXfIGMIFqwdUJvr/M+uZwxiKhSgHMfr2dIRREJq4 Ua4UOYOCIXRZTKLhkdrjNOW3bUQk4InNxWomIiQEutQc/9X/KhOO0bQ+TKEoQf5XrwIu gh20PedJJ5T3eTZvMSi054/yYVjV/o/VQoqGGIV9ipkuEkk50MSXtqYRzr0G+NEnBUIM ufeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X6qguEtH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w4-20020a636204000000b0061c41c8a4eesi9779830pgb.104.2024.05.07.16.28.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:28:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X6qguEtH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172367-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B56E52810F9 for ; Tue, 7 May 2024 23:28:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C97513E8AA; Tue, 7 May 2024 23:08:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X6qguEtH" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B6D11350E4; Tue, 7 May 2024 23:08:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123329; cv=none; b=Ysjb7ymWu07ne5ieL0ohPS8f3Z8Ii35J667l6eAGp66GvczwSB3XZeVhQjaQxIdMZUyTV5yFt3xfTzSUebyJTWTReALv1R6xpBcT4oucC1aeOBqWzGnmZSjG3zkUY0OcXm64E3jeTNPOZecwkUn+VYivSeMWsZ2v1IkdoWoNKsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123329; c=relaxed/simple; bh=xexA27Mt4oEuII0u/q/FpJT4grps7/6vevw9C19Zmiw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LK8NkuIy1XZpUZ/jfKsVdmNEKAiRtJyKn5IqmIie6wEcduXy5tHd4336wANVrqX8FtCyCt7bNlSNhpXeH/90Gsxr9cYVpymxRogQERDGVJMLT3hPrcL7eBCLZhVLnOjx1jJDSF6fkL2hTN+1eQa2ra9QNjn083KmrLa7z5O0HyM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X6qguEtH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43C1FC4AF63; Tue, 7 May 2024 23:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123329; bh=xexA27Mt4oEuII0u/q/FpJT4grps7/6vevw9C19Zmiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X6qguEtHtDUN04SmTGlJiPdm49qdoKE1DvMqVR4jyK8z5KxVlaiHamkqv1xzVRXhk +g87L4g2bCefrhI3G6k3/ymDuQG54ciRochXyU6r7LWJYCRCciQ/1s96A88W97YRoL B6HY+eYNFrsWDta2Z+OIWQ8IQmpNhZbuVlyWVVg0Te2BP4qHYbYxPMzb7HUP3+0If+ mZ8IPAXVawvn5jXWvirFnhU9mKG6n/jgijZ3ME9Tx6dBHIiu3J/x/RzQOssNJj4Vye mmr3SO4v6XiG/C/wmKcGOpM7cuwUNY89TccCQ9S6et+OS7gWuecmsjzrhaZXnUj5og 9f3Kx7yRD2l0A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Oswald Buddenhagen , Takashi Iwai , Sasha Levin , perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 25/52] ALSA: emu10k1: make E-MU FPGA writes potentially more reliable Date: Tue, 7 May 2024 19:06:51 -0400 Message-ID: <20240507230800.392128-25-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507230800.392128-1-sashal@kernel.org> References: <20240507230800.392128-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.9 Content-Transfer-Encoding: 8bit From: Oswald Buddenhagen [ Upstream commit 15c7e87aa88f0ab2d51c2e2123b127a6d693ca21 ] We did not delay after the second strobe signal, so another immediately following access could potentially corrupt the written value. This is a purely speculative fix with no supporting evidence, but after taking out the spinlocks around the writes, it seems plausible that a modern processor could be actually too fast. Also, it's just cleaner to be consistent. Signed-off-by: Oswald Buddenhagen Signed-off-by: Takashi Iwai Message-ID: <20240428093716.3198666-7-oswald.buddenhagen@gmx.de> Signed-off-by: Sasha Levin --- sound/pci/emu10k1/io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c index 74df2330015f6..5cb8acf5b158c 100644 --- a/sound/pci/emu10k1/io.c +++ b/sound/pci/emu10k1/io.c @@ -285,6 +285,7 @@ static void snd_emu1010_fpga_write_locked(struct snd_emu10k1 *emu, u32 reg, u32 outw(value, emu->port + A_GPIO); udelay(10); outw(value | 0x80 , emu->port + A_GPIO); /* High bit clocks the value into the fpga. */ + udelay(10); } void snd_emu1010_fpga_write(struct snd_emu10k1 *emu, u32 reg, u32 value) -- 2.43.0