Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7469856ybi; Mon, 8 Jul 2019 22:36:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNYfv22Sz0SqmJ/Da4CAFCNrD9tl+OKaMRsg+JmW6jm4vQIaaEYE3caWuEUQ/sHfDuT2xM X-Received: by 2002:a17:90a:2247:: with SMTP id c65mr29407428pje.24.1562650585077; Mon, 08 Jul 2019 22:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562650585; cv=none; d=google.com; s=arc-20160816; b=B8fyrixextIqEIwd/4/Vmp+t8y0iVEi0oxnAPIRKenxzDZ/JYmmqVnP72yZQy/Y1f2 zAZXffEPw/6wXbyaRhPnj1jiMMR1GD6GF0uJDUbLlZkBQ6INunf7YZabXZsWBtKKRxc8 uB1IuH5GmK0yc0PozXaqw94rJ/nyrJAXoyc5Q2b0iED3NO/ygxcoNu6gAVlqRYjBJVsk Onv2NdOhOMP0U7LpNG81shSNCHI4RPe+46pNY65301b2HSU2isEg8z08OgcfiW9jiZMd rA4m8gvvU0KJ74Azitscfe+ag/o3pgKWdBk+tzBABY0i23pQ1fZx/oPU+SsT0Fq0xRpQ XL9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=V5gJWPHe+ON2iDj7iWFxs2l0G5bn1wyiP+yzEtHEr2g=; b=lMWLirvx2XsdJWpn9qk0ZcS1kusAc8ghn4IZ4LAT60+ablZTjSL8di+L1dYRtbX7W1 skak9tWR6ySmLNrSaZdxx+7ED7A4zzsZY4p+HJ99PauM3j2ZtEzImh7zQtx5j6fNoJpr 6FNErg3BDL4wV/cO1npNTg3tWylEfJ8q8iajjTGD5OTLOo+xNu4/x40BvrSleiniqbdo 3UBwiBkEztioiDBkSYg3BaaTaKxzV75G1fvlbArFlBCL4ktOAVyzgLU9a8zBvEwqFziY HMZHutqsu1zTcn6Cf06OC9yGe5pw+2oVvTqdtupXRjVXE6oQMwLkil5ReBX8kxiE8CQd mAfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f34si20397671plf.305.2019.07.08.22.36.09; Mon, 08 Jul 2019 22:36:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726010AbfGIFfk (ORCPT + 99 others); Tue, 9 Jul 2019 01:35:40 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50210 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfGIFfj (ORCPT ); Tue, 9 Jul 2019 01:35:39 -0400 Received: by mail-wm1-f67.google.com with SMTP id v15so1677352wml.0 for ; Mon, 08 Jul 2019 22:35:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=V5gJWPHe+ON2iDj7iWFxs2l0G5bn1wyiP+yzEtHEr2g=; b=FClI9IcThvfxcq0xjsySjFPLtwbrAhZDyylKa3vCOumsBVvReaz7VDrIytBXxMc/MH KooUHPuMGFnNiPPDjoRwi9bGEyFEFMYfGp5TIO8PG4ZpIb5856nM/poXBxw0Rukivjr/ jdz2NKOwK1tC9sGkIks/U4KrZzszBg/mDcumofbP7xRd4bmjOOIyoNadDJEUfTlWL+WQ 5tTFwy4fkbJfeLniZF9mn3aN3PG4NKTSFd/UZxP4ONjlS+IotjOSnCxF6f5knXxmitsU fuDLsj08Mytb4lyjMp7HO1k6hED0+n2FtrZd8c6tCxhSxipH54mLZiebZIBUF2mGI3kl f5Lw== X-Gm-Message-State: APjAAAUAM3E0zm+vUVqd/UjNCYmlPAvYBWAfbxM/7Uuova2Ydrvji93R J9s1w8kRB/XDdb1CJM9BDsgoZ+pg X-Received: by 2002:a1c:a514:: with SMTP id o20mr20574269wme.149.1562650537043; Mon, 08 Jul 2019 22:35:37 -0700 (PDT) Received: from ?IPv6:2a0b:e7c0:0:107::49? ([2a0b:e7c0:0:107::49]) by smtp.gmail.com with ESMTPSA id x24sm1740609wmh.5.2019.07.08.22.35.35 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jul 2019 22:35:36 -0700 (PDT) Subject: Re: [PATCH 4/4] tty: n_gsm: add ioctl to map serial device to mux'ed tty To: =?UTF-8?Q?Martin_Hundeb=c3=b8ll?= , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Esben Haabendal , =?UTF-8?Q?Sean_Nyekj=c3=a6r?= References: <20190708190252.24628-1-martin@geanix.com> <20190708190252.24628-4-martin@geanix.com> From: Jiri Slaby Openpgp: preference=signencrypt Autocrypt: addr=jslaby@suse.com; prefer-encrypt=mutual; keydata= mQINBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3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sr4qHsnCYZWtEY2pCsOT6BE28qcbAU15ORMq0nQ/yNh3s/WBlv0XCP1gvGOGf+x UiE2YQEsGgjs8v719sguok8eADBbfmumerh/8RhPKRuTWxrXdNq/pu0n7hA6Btx7NYjBnnD8 lV8Qlb0lencEUBXNFDmdWussMAlnxjmKhZyb30m1IgjFfG30UloZzUGCyLkr/53JMovAswmC IHNtXHwb58Ikn1i2U049aFso+WtDz4BjnYBqCL1Y2F7pd8l2HmDqm2I4gubffSaRHiBbqcSB lXIjJOrd6Q66u5+1Yv32qk/nOL542syYtFDH2J5wM2AWvfjZH1tMOVvVMu5Fv7+0n3x/9shY ivRypCapDfcWBGGsbX5eaXpRfInaMTGaU7wmWO44Z5diHpmQgTLOrN9/MEtdkK6OVhAMVenI w1UnZnA+ZfaZYShi5oFTQk3vAz7/NaA5/bNHCES4PcDZw7Y/GiIh/JQR8H1JKZ99or9LjFeg HrC8YQ1nzkeDfsLtYM11oC3peHa5AiXLmCuSC9ammQ3LhkfET6N42xTu2A== Message-ID: <15a4b2ad-cdb9-a679-156d-62aa6fddb85a@suse.com> Date: Tue, 9 Jul 2019 07:35:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190708190252.24628-4-martin@geanix.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08. 07. 19, 21:02, Martin Hundebøll wrote: > Guessing the base tty for a gsm0710 multiplexed serial device is not > currently possible, which makes it racy to use with multiple modems. > > Add a way to map the physical serial tty to its related mux devices > using a ioctl. ... > --- a/Documentation/serial/n_gsm.rst > +++ b/Documentation/serial/n_gsm.rst ... > @@ -58,6 +61,11 @@ Major parts of the initialization program : > c.mtu = 127; > /* set the new configuration */ > ioctl(fd, GSMIOC_SETCONF, &c); > + /* get and print base gsmtty device node */ > + ioctl(fd, GSMIOC_GETBASE, &base); > + /* the base node is used for mux control by the driver */ > + printf(first muxed line: /dev/gsmtty%i\n", base + 1); Missing " there. > --- a/drivers/tty/n_gsm.c > +++ b/drivers/tty/n_gsm.c ... > @@ -2623,6 +2624,11 @@ static int gsmld_ioctl(struct tty_struct *tty, struct file *file, > if (copy_from_user(&c, (void *)arg, sizeof(c))) > return -EFAULT; > return gsm_config(gsm, &c); > + case GSMIOC_GETBASE: > + base = mux_num_to_base(gsm); > + if (copy_to_user((void *)arg, &base, sizeof(base))) put_user would be more appropriate (and easier) for an int here. thanks, -- js suse labs