Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp180918lqo; Tue, 7 May 2024 17:00:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXknF9SBg47bk4njcrtejnvFPBZ3oioow4hzxR7zh/9rQbBTRWfGxoSEiL/sMhaFWr58HqDJAFeebrYxuTI1CyKLRhqcZCxoau668wdyg== X-Google-Smtp-Source: AGHT+IELkqx/7pwr9Jg58F+8DIswZ8e4t5VXNF5l0FBzTlhC7i/8hskf13WiiRUvktJbrVeB1kTA X-Received: by 2002:a05:6a21:272f:b0:1af:6541:8a08 with SMTP id adf61e73a8af0-1afc8d3d455mr1339643637.20.1715126457333; Tue, 07 May 2024 17:00:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715126457; cv=pass; d=google.com; s=arc-20160816; b=fIoX7DD0b1DhMewPzqqekLzDP2Ghvw/Y3Of0q8YtQ9F+jLw3vWepD5JzLs9LmQNGfG UyJ+rPPnuorWRP9HMueGbgskArhRF8/1ovBr8KbHa4mz2faW+xj/CZZAa7QZzylVIykI zgW3+rK4HO1VjFEvSQkt56xq1G9h/OyzT2NffCZaF0YiM9lugDchiKQeq9bn8IngsguP pgxcOnvxDY6WbNbhLjHg3S2S+L/nIjjq2zTMfiutvH7o8dTe6SxqhGaL8Tr1HOD1qBVg lfEXgFbETCKF+a/1TSQO9o4oe1z+uP8EEiWN3594oTy9I4aZvPPSsJHUYUlKl5GNHEgo 8Pbg== 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=YURlqVcM/vLcButEHlB3UojbALwkTrAmSZgmBoGXsoqLzZSLIeTnI1sQmCZQpQb6NK VuEa/kI06du6+FL74MyxHv0LQh3mOGX9l4w/VvmC6+b+bOGn9jXMr1bOoUysvAX0PJAG 4pC+rUwRisv/+JlMyU7nd1oeknAs6hzk46X7txZpCU+vp35ArqaP7zXMAQAezbsMd6eb qPfPiMOVoIWeZvi+7xzGPOQL8ctNfg7V91zTIlu/IK2Ep6E/zNe5/VFlwOSnGzIJhLOK PAnjrWIMRyYq9KjkNCwpLvrzkFyUpwhsyPxO2aml2B43dqP8EX9o+j3av4qhdfBKUTCe vXNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OJ2pAqzV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172415-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s12-20020a056a00178c00b006f44c760c94si9733636pfg.59.2024.05.07.17.00.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 17:00:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OJ2pAqzV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172415-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 23C96B2648E for ; Tue, 7 May 2024 23:39:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF7E6137764; Tue, 7 May 2024 23:11:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OJ2pAqzV" 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 101A314B963; Tue, 7 May 2024 23:11:12 +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=1715123473; cv=none; b=YedJgDVVvlnOr0RWHIPlLVCdzZOMYVB0/UIBmXL3IgocQsIOZ5eFORqqT42Hn2La4h4TpZmMJA/IbZ/EJuXkRz4kuORzFleiqkIWHT4FLuacAfzRGcinWBcZ5/YPV7+6FkSNSBC73JPO0haEHRM3MoYJDAPuChlMe8G5V7/5ZjI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123473; c=relaxed/simple; bh=xexA27Mt4oEuII0u/q/FpJT4grps7/6vevw9C19Zmiw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UzhbklZJyvCaIADXBp+JifP4I7cS7rmlE8KO8XvwwIHBeJ1WHnICNZ+EGxgg1kqqu1AVZJAFhLegzwc/YI1HXDO4dyox1sVjdcIL8Bbrb4uWT3lM9z6+VfPwwE4bAW+V62ybozM9oywHfx4QX7pEkXcY8mfp9Zl5Banu1066uOk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OJ2pAqzV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE9BFC3277B; Tue, 7 May 2024 23:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123472; bh=xexA27Mt4oEuII0u/q/FpJT4grps7/6vevw9C19Zmiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OJ2pAqzVR4KefxGVnGNNe+ujbhAz10ks/ahvO2CMlY4cs8bVaaOsEIgPgR+3setbo 6suXHRhPcWx4up3wy91TW0gP4QhGgjksA7UB3IgMtj/UmV65oCM9o8RMHHvAPIqCG8 8PWSrbTMmtuRDrBlBjy0T644nYby5Xf9kVra0zshWQgi1+OlsEh5vWvGYz1NeLb0B6 ompYo7/6sUjn6bNF4MR7x92zNQe8933t8dYCcCBedD2KA6tgftbekmmpk9sZJeiTcC CyVSFLMOeJn/rSk7eRMIXSyiNfC2jB2VayL4euvopk8As70QAUX9HHxS/J7xhYrzSg jdM7iPAXbti3g== 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.6 20/43] ALSA: emu10k1: make E-MU FPGA writes potentially more reliable Date: Tue, 7 May 2024 19:09:41 -0400 Message-ID: <20240507231033.393285-20-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507231033.393285-1-sashal@kernel.org> References: <20240507231033.393285-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.6.30 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