Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4597702pxj; Wed, 12 May 2021 08:58:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/6t+weBdayG07HkY/4ijBofclQ9PcPY2VnPj7F5a+O+sCXm/QebNiJrsPfdqvP/GbOdVF X-Received: by 2002:a05:6808:3cf:: with SMTP id o15mr7830555oie.77.1620835092077; Wed, 12 May 2021 08:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835092; cv=none; d=google.com; s=arc-20160816; b=pg40ASDa9GIRp7JLIcPKmm6rghUecUry4xXY2GJlQK49vfd+HifF1ngm3yGxA5+nHu H961hM1DWv5jgZTZrPRCeQjdwF0G07YSOUZPtD/1as3eu00JhEYqES1e/d8P9Vq9a2hh 2U3YhG8SWefZV1D2hEHtjZKBJ+LG5Ii3i1G+QgeE6qSjaP6E9eSDeyXyjEZKrqcyWTo+ uC0LkpEbaTpy8JvEDACFpUBgB6tgeoep8L1MDbQE5czXOT2rQS+/MUQZGRY8khwVg7GX PHtvmCWNFCE6MeYdj5wBAGnMxFbAXpIMAdlQcnfnBBFosJ4EHCP4rQXXOJvbi+D+rIo5 ba7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cbHWjSOXjV58qH58iTZBiBeBo+4S429uWMOeUgHzDUI=; b=lRu1tPpY9cFcZg3MExRddeXmXweUvCFyim3IQZY7cSeRddsU39Ec8pBQBndVvTaYBx lxpD55QCZm/tppKtGy+CUTj880Z6o1/tGigJeXMZiDFPE52wZdBxkwOjj9nCaw3oKeP5 +s4uiqdrepiDIEDKTdrLkZoKDwhaYZgt/WGF2RddaKBgTzNfanjcskI0ogRvy1V2YsUY aaksCQKDiD6Bp1n+NOD2pcGFpzFqRsjMTWUR8KlDHRjbIIrt55qKtRjYW/AVGSw7m6zA jAQNAUVpKmmrSJ8ONkNgRheZ044AuL/LjJuwVnZG4umUUsGxipv/EEFYB6uNKgHlKaNG 2VVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yau6rK+w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si353404oos.10.2021.05.12.08.57.49; Wed, 12 May 2021 08:58:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yau6rK+w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235751AbhELPyn (ORCPT + 99 others); Wed, 12 May 2021 11:54:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:39912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234991AbhELP0L (ORCPT ); Wed, 12 May 2021 11:26:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D40DE619D2; Wed, 12 May 2021 15:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832276; bh=+lrkiU/LuudPPNZXSfuLmMdIO6mIg3MnqG45CYPeOXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yau6rK+w8kc7U9WrYmZPibhyg20og2O4oaK8SfsuQjB3Q3VbZpK033Qi2HS2FOXMu VUYyIDNiePevYH6OgxqECidmGPMmte1WtqxHeNIyfYmoBPxQVetYGm3H0KaBokdp+B 480Sv0xFD8t7ZMBI7ehxlvZ2aVBVdS9htZc4/0CI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Sasha Levin Subject: [PATCH 5.10 212/530] staging: fwserial: fix TIOCGSERIAL implementation Date: Wed, 12 May 2021 16:45:22 +0200 Message-Id: <20210512144826.814383087@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold [ Upstream commit 5e84a66f3682af4f177bb24bb2ad5135c51f764a ] TIOCSSERIAL is a horrid, underspecified, legacy interface which for most serial devices is only useful for setting the close_delay and closing_wait parameters. The xmit_fifo_size parameter could be used to set the hardware transmit fifo size of a legacy UART when it could not be detected, but the interface is limited to eight bits and should be left unset when not used. Fix the fwserial implementation by dropping its custom interpretation of the unused xmit_fifo_size field, which was overflowed with the driver FIFO size. Also leave the type and flags fields unset as these cannot be changed. The close_delay and closing_wait parameters returned by TIOCGSERIAL are specified in centiseconds. The driver does not yet support changing closing_wait, but let's report back the default value actually used (30 seconds). Fixes: 7355ba3445f2 ("staging: fwserial: Add TTY-over-Firewire serial driver") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210407102334.32361-5-johan@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/fwserial/fwserial.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 2888b80a2c1a..0f4655d7d520 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -1218,13 +1218,12 @@ static int get_serial_info(struct tty_struct *tty, struct fwtty_port *port = tty->driver_data; mutex_lock(&port->port.mutex); - ss->type = PORT_UNKNOWN; - ss->line = port->port.tty->index; - ss->flags = port->port.flags; - ss->xmit_fifo_size = FWTTY_PORT_TXFIFO_LEN; + ss->line = port->index; ss->baud_base = 400000000; ss->close_delay = jiffies_to_msecs(port->port.close_delay) / 10; + ss->closing_wait = 3000; mutex_unlock(&port->port.mutex); + return 0; } -- 2.30.2