From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 898DE36C5A1 for ; Sun, 19 Apr 2026 03:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776569243; cv=none; b=KGWqxhwuebHJW+BGSimaUHxbZYNumpnW3QM7XMTMz2vDnwxKRkTTBX3vGHZL1nX99c9ep0w3Tgsy9aOjGafjsY99vqqrRSb1V+mRbsj5kwNkaMAXFZxSIa99Bop7pbzDeF2sorUG/3gl7L8HaRtdOayKD0GEE3JpYK/+i/rV7tc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776569243; c=relaxed/simple; bh=sxyPbdnKee1O0+Y6CSiwsqaNHXus8cYPJ3uN1OWCzJ0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=J2Q24oaHixITpryqQ/kIb/rM/am8VMNzvOyVkmpCHXNecylTjDyLwQ7ZzLGaxfYX9iGNUuLXO8BIQhMuL1ZHdH4xVkQWeWp0bbev6kxZrRKNxrq3cByO1kEk7lH9sv2DqaeIocpVxmTXhaKLSjgmi4kQFn/kQMmcBs40yrULQoU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=a2pB3TRy; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a2pB3TRy" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2addb31945aso13080585ad.1 for ; Sat, 18 Apr 2026 20:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776569232; x=1777174032; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FpvRvMQTPx9sUe9bSbatRTALRpCc/0zQhkXDO/h/Er0=; b=a2pB3TRyB6CXJM8/aTXeW2QrI9Fzo2kgf6Ox6Jqwbv4z06KlEImJBxvjvyaM9JcDpI 46FUmBrK5o7zooUorOGEKJfD5a3lmfulPc11ct3zBXGjQyG36jcyekWVj89KmaUIh/4i ZneKEIy/jcfx8HRJr9Yyeg82i/WarP1+IiM2Rkw6b7k0ohVtID/bq1Z45xVCNiOLA+BG +aoeidem0sIlkZAARixRq+e0VNtjZ9Czox6NHeKygxvpspNb20whFhMaBo+20Rmh115l AsIv9gcTa8KqN1rblg8toVQLawkvNmbV1xBaPMXh+R69yVsO1J4c29mO65xKwHvl+XJ3 43Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776569232; x=1777174032; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FpvRvMQTPx9sUe9bSbatRTALRpCc/0zQhkXDO/h/Er0=; b=ami9igWOehXov2Zp34b0/skdXvSVTBFHxU2Dp30C4hhKhkE6fIOD7B1G7YlZCyqpGV EnYOoyvGNaeNS9Yud4nQ9iKFy2L6QfazdyWmTb7YVP675xR5L9o2aGXO15CMrJYh8WW/ bVE9USUTlnT1LjU/OpgGx9AfAR2ukfF1RArOjC/0ZMsEtNiJ34TNrJougawmZSno9Le1 p+4aux1+3NGKCzy8LQ3oLVPB3Nx4eDKy4LoTAcaDKOjAhTY/P4s2KJn6eHwXhJSgVG8K fVwNNQ0xjUfF4z5U6CNGw4ZWhNHelT9AyWT0+wOwtQ2TPNZaIqoFFKOJJCq53nmXiR/i s0cQ== X-Forwarded-Encrypted: i=1; AFNElJ9NpoS0wpthYja5CKr+YPsFOhUWdfGb5U2XAMYXcuQ1lnd7mXqgihtLG8FNPeEobczGJGoRyaK5Jb2n6cU=@vger.kernel.org X-Gm-Message-State: AOJu0YzXD9I8zHEICAEPtxnOxRmQh4430KT3zvmKC5inykul1AiawNoF zX4TzTo/KfRZwznHhhLXQIBCQIQfA5UfsqWvybgL8F+U9NiUh3TfCbqa X-Gm-Gg: AeBDietQibpAKWl80/ltAa+chehtYFXZpIWTZREnmTp5bDo8I4kLplSx0DiBvbCPKm8 lyFKQ+vPbWqA3vO1OWtgQOmmvFtQKVmf30R4+Xh/iONLWj5FvP3HiS+3srjO9fvGuDqEyU5ZI4t u+78ngq1epnSuv0kLl3uOxwW4E1SfM8PzcQlzO9rz5kVe53DgIxT7VyjFKriNdnRWQRqfHb2Vcr 14x02U3c8ERi1D1tDwLCkY6L9kC3BCS7lE4FkKtPA5s60Cbdh5V7OsjYQWADUIfkFHE5r5qJUaG iM/C9pfdwuqaCmXxeKlQmakL/z0gS5/s/gLIZMajuyAaj65GHMS4YQWsRarkDxsjp33J0qIqDcY H4Cl/2nfrQ+okKh8g1oWlmsMg6W09PMOeJ2UsDYx9HMIppIaq04LBVoHUyhawTK99zLWNEPC2W/ yAXEDputGvrJQY3B1KnF6JruQnBe6E4uxshVt0l9aAi5+cCzCpyNPk X-Received: by 2002:a17:902:e184:b0:2b4:5931:bc4c with SMTP id d9443c01a7336-2b5f9ecd237mr64143525ad.15.1776569231931; Sat, 18 Apr 2026 20:27:11 -0700 (PDT) Received: from arch.localdomain ([103.182.132.254]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b5fab0cf3bsm74202655ad.44.2026.04.18.20.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Apr 2026 20:27:11 -0700 (PDT) From: Debjeet Banerjee To: dtwlin@gmail.com Cc: johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, debjeetbanerjee48@gmail.com Subject: [PATCH] staging: greybus: uart: document c_cflag handling in set_termios Date: Sun, 19 Apr 2026 08:56:32 +0530 Message-ID: <20260419032632.35351-1-debjeetbanerjee48@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit gb_tty_set_termios() derives UART line configuration from a subset of termios->c_cflag bits, namely CSIZE, CSTOPB, PARENB, PARODD, CMSPAR, CRTSCTS, CLOCAL and CBAUD. Other c_cflag bits are not interpreted by the driver and are not represented in the Greybus UART protocol messages. The existing FIXME suggests clearing unsupported bits from termios. However, the driver already limits its behavior to the supported subset when constructing line coding, and unused bits are effectively ignored. No invalid or unsupported values are propagated to the hardware. Replace the FIXME with a comment documenting which c_cflag bits are consumed by the driver and clarifying that other bits are ignored. No functional change intended. Signed-off-by: Debjeet Banerjee --- drivers/staging/greybus/uart.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 7d060b4cd33d..49d685a6ad8c 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -494,8 +494,20 @@ static void gb_tty_set_termios(struct tty_struct *tty, (termios->c_cflag & CMSPAR ? 2 : 0) : 0; newline.data_bits = tty_get_char_size(termios->c_cflag); - - /* FIXME: needs to clear unsupported bits in the termios */ + /* + * The Greybus UART driver only interprets a subset of termios + * c_cflag bits when configuring line settings: + * + * - CSIZE via tty_get_char_size() for data bits + * - CSTOPB for stop-bit format + * - PARENB, PARODD, CMSPAR for parity encoding + * - CRTSCTS for hardware flow control + * - CLOCAL for modem control handling + * - CBAUD via C_BAUD() for baud rate and B0 semantics + * + * Other c_cflag bits are ignored as they are not represented in + * the Greybus UART protocol. + */ gb_tty->clocal = ((termios->c_cflag & CLOCAL) != 0); if (C_BAUD(tty) == B0) { -- 2.53.0