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=1796388371; b=IRW0+zGvioZP8FT3z0x5MCIivkchfKTw71MRVV3mZo8jFzSXRDJmWdjeUN3ZUvWYRagQ tI2yRx36XooK9mqVoxaZ0uks/5Rtq9sNFsxVyDNedyieHgRxNKpIE6jBX9uDRMr7yjPXm FuBCcL3CKQYlfjv7p3n5gdacdJk71uaYRW7XuiyWdgoR2kSKHqXULW6iDUEQAHJ2Zre9v OIJZ/ODkf30kzul6tE3A+tKX+fjpnRyzulHgrapSR3P13ChDiogyO40Vj7j/gcNgd6pCp PAN4rYq3jsnZ9so6QpdQWMkpAhY+/eKqRlnefCpL3IB1b2WHjhNPmfo5ZcsS9kHNVSw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388371; 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=5GlXvUlZd8tiX0EM+GK9ronD8cqTrMleo9QCrvH0+ZY=; b=t3I/fY10rtMWimigh4E5iougVMXaOvtjiWRrZm/1MVtcx/tQttxVHlSxQEqSIl1CJ8mN TNPZQKNIs2rTtcpdJ/HlwnUO+BcrDT4JkX5I16oDd8WzQql3avyB+r8M1cYC/G8ygQ/gZ aDdLabKNKVx7uM5R8MAhd6JAH3J+r5q+rXJAIiYlZqZuI5mMVnNKQks+ABqYrzh7gO7A/ s0ehAlrLZicM81D7bzrN25v8DzvZ4+TmoabaWun6CApa4A2yyEeNhfczvj37xOWwSUkIy 878hmGyB6fJlkRnKQsZk3xcpnI1XfG+xcihjPZgJq5Hizai+4pQDCxLNlPgBCLwpm6w== 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=Ddwqrb1P; 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 4D853606A322; Fri, 4 Dec 2026 12:46:11 +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=Ddwqrb1P Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45B681F000CE; Fri, 4 Dec 2026 12:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388370; bh=5GlXvUlZd8tiX0EM+GK9ronD8cqTrMleo9QCrvH0+ZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ddwqrb1Pmqj2acAp3zfcjn2GCVJv36To4f/mAUfG2dCzHDBUDpweTDVz5OY1iuAqQ TqSPWuMg5HPQ7nkkzUfvSh/A6uT1ucIzZi5rAFpeNezoVvls0ZuHoe47wFX8BHuJww Rw1Iz0XlOpWfJYlXYrl4FULIgfHtziRzc/iokmI0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Josef Bacik Subject: [PATCH 6.1 0580/1059] comedi: addi_apci_1500: fix clearing of the gate enable Date: Fri, 4 Dec 2026 19:01:51 +0900 Message-ID: <20261204100659.185346477@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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)