From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385629; b=oPVnGu266EjQNID6osAxPnZTIJilm0gC9xz96GVc7IM/Zan7VINLxcGAk2xuIB3bWRz+ OdgoE/0PTKRmdNF4S+N0quiEG/mvqSrWgjGdR6kQ/Yf6aq9PctvD3R62CZpipnwe8dOFv I82vyINemXsDf/LFdEMq9OCaGHP/kMsfEUkSs371Snx1Ugwa8EntSQR8FMDgZ10GT6B6S TWyPmKrjVpufU+X4Ffn7DjY4jKOPn0fi/5Aif7/FjtXutUYnmPoZuaaJNyr0jGQXGAvgS fGTOxrq8IYiPo12DbWNlYA9YKvZbWqXlgOw0j8dhXWhqqWGPMGYGk01Ugj+UKTHk10g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385629; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=3zoxSMxriDPAxv3tEQVbLgvyi//Z1yfKTOT7XgmLX0E=; b=fqR1fs0o/DsDvXsP/5ptojuh4o3zrSlEGH8w0qqUuLLAWZu9ii9Nk4EgjOTxswozpqO7 J6QsmZOJqmNVNT2GmBsGBDAewz99Bq3o9Bh3UwPoGzyl0UoE63qDmH0dqVAkTcmUVgOOa zzv8NR1tgYuBWAJK2YnA2Gb5uF4I9/qiQ8bQ5ICTbNDLLWGV813iMcmepjghtP/Br2RdB lXPoHJP6SWHAOOnBbJTLQU56aPa7weZ/wH5rWITqGbY6Ohv7Ph2sX6C4+GCrCCvKOzdAG 61Z6fjC7LNe9LDB7W4ZKwzyKxlqhXEixtLhCcE0n/J6/ZyPoaVTVVb+FVXSKgXO+5Tg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=t86ThZy3; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB06D606A322; Fri, 4 Dec 2026 12:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=t86ThZy3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E35821F000C2; Fri, 4 Dec 2026 12:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385629; bh=3zoxSMxriDPAxv3tEQVbLgvyi//Z1yfKTOT7XgmLX0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=t86ThZy3kq63STONkWSTl4UcjpRbIOa0b768YES2kcZ+PlOnR6rVAXDP0BtfA6ipU niW0ujZbgFlZmXZ7FcutysPMgpnU7rFu1+Q+6DoayobiPa8GIgzvlS6XaTpUfeU1LK nMSrQUVMpndZHmXGccqLTk0ahWqsShOsqiv80GKg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Josef Bacik Subject: [PATCH 6.6 0625/1167] comedi: addi_apci_1500: fix clearing of the gate enable Date: Fri, 4 Dec 2026 19:00:52 +0900 Message-ID: <20261204100718.345079325@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josef Bacik commit ade85ceef46892425a08f3ee52ca06729ee4922e upstream. INSN_CONFIG_SET_GATE_SRC reads the mode register of the counter/timer, is meant to clear the External Gate Enable bit, sets it again if the external gate was asked for, and writes the register back. The mask lacks its '~': all the bits but EGE are cleared instead. So - the external gate can be enabled but never be disabled again, and - the instruction wipes the mode (continuous or single cycle, external output, count and trigger enables, retrigger, duty cycle) which INSN_CONFIG_SET_COUNTER_MODE has programmed: the timer silently falls back to a single cycle pulse. With the right mask, the instruction only changes the gate bit. An application which sets the gate source after the counter mode now keeps the mode it has asked for. Fixes: a8c66b684efa ("staging: comedi: addi_apci_1500: rewrite the subdevice support functions") Cc: stable Signed-off-by: Josef Bacik Link: https://patch.msgid.link/20261027-llm-char-misc-comedi-v1-2-1899771ee15b@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- drivers/comedi/drivers/addi_apci_1500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/comedi/drivers/addi_apci_1500.c +++ b/drivers/comedi/drivers/addi_apci_1500.c @@ -696,7 +696,7 @@ static int apci1500_timer_insn_config(st return -EINVAL; val = z8536_read(dev, Z8536_CT_MODE_REG(chan)); - val &= Z8536_CT_MODE_EGE; + val &= ~Z8536_CT_MODE_EGE; if (data[1] == 1) val |= Z8536_CT_MODE_EGE; else if (data[1] > 1)