From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id CC1921F0989; Wed, 17 May 2017 03:44:26 -0400 (EDT) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) by befuddled.reisers.ca (Postfix) with ESMTPS id 1DE751F08AD for ; Wed, 17 May 2017 03:44:25 -0400 (EDT) Received: by mail-io0-x22d.google.com with SMTP id p24so4372458ioi.0 for ; Wed, 17 May 2017 00:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=8ELr3m2Wo23ohGFECgLiKA/77ryumRGo8dXJcXFnzMk=; b=eu9vlxFfvZ5WJZeBANSN98ph4Z2y4WwgSZ+oM8vayapAeY44n6iGqOy2A8kCAKenja R1HbomGQsgYl1t3MvYaz6QhYhPTQ86uIJyzrNIhRGM+siGboR+bV7s3aAWfW0evOBeWJ LyqNLOmemvqCOeFe64Jkl+OKmoB6ZU+nJNpLbqfTMp4cOHbUh47YCPpMEFY4icSBKN/K Pfzd+Cy3sTLQS5OkG7QwkvxUdmF9PeJmw/O9EOzRl8qm5Sbe8cYduxudnj6GoxphGNxa 3/sA2ldjoSNb818eKdsJf8brbSmELwEg9asKU8/f7xYAM+NdsvgSLWeBt7XpJCuLrqTE 7dQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8ELr3m2Wo23ohGFECgLiKA/77ryumRGo8dXJcXFnzMk=; b=ea8b31mh8AfvKQ6YpL/Zl31KGIhKIwrKRYdjxpnAO+gKPPQdTHaOGfnIEt8sf4hwam TbspROZW0sHHGDt6fCUcDQPVuSwkLnwGhFTrnCq9tPlDK+Os7LPynNWLB967d2AuUMLW nWC+NMEoeSbNbk3FNm790fvw/BeMmKiP4dk/pNPmFNoaKzA6jdcZBFYXyhGeYLz+MD5L EAdFp46AhC9NH9Mutd8EMUAbgs6j57whijNG/5Fbr+S9tWf0a3ZOhvAoCj01iQZff+vn ZcXeIhNaCJHlBq9PgRvCvydLGraELzt1xs7IFYSyEfWoqudkJy06aT7V68aUToZVU7PU cQPg== X-Gm-Message-State: AODbwcDtzqjxYHXEomvgbZVM3fY/VEtMdV6OfKPe1yoqrIDo172x0c4o NtgpbXYIFXIUB0xvE9Gk54uGfF4rww== X-Received: by 10.107.135.100 with SMTP id j97mr1872752iod.16.1495007059640; Wed, 17 May 2017 00:44:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.154.142 with HTTP; Wed, 17 May 2017 00:44:19 -0700 (PDT) In-Reply-To: <20170226010543.prrdalpdj5jfyzee@var.youpi.perso.aquilenet.fr> References: <20170225191801.GA4482@sanghar> <20170225192132.GA4492@sanghar> <20170226005342.fwm5wyilv6jewrbb@var.youpi.perso.aquilenet.fr> <20170226010543.prrdalpdj5jfyzee@var.youpi.perso.aquilenet.fr> From: Okash Khawaja Date: Wed, 17 May 2017 08:44:19 +0100 Message-ID: Subject: Re: [patch 1/6] tty_port: allow a port to be opened with a tty that has no file handle To: Samuel Thibault Cc: "Speakup is a screen review system for Linux." Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 May 2017 07:44:26 -0000 Hi, On Sun, Feb 26, 2017 at 1:05 AM, Samuel Thibault wrote: > Samuel Thibault, on dim. 26 f=C3=A9vr. 2017 01:53:42 +0100, wrote: >> Okash Khawaja, on sam. 25 f=C3=A9vr. 2017 19:21:32 +0000, wrote: >> > Allow access to TTY device from kernel. >> >> When opening the TTY from an application (e.g. echo foo > /dev/ttyS0), >> we get this: >> >> ttyS ttyS0: tty_open: tty->count(3) !=3D #fd's(2) >> ttyS ttyS0: tty_release: tty->count(3) !=3D #fd's(2) >> >> This is because the number of files in tty_files doesn't match the >> open count for tty. spk_ttyio_initialise_ldisc should thus mimic >> tty_open a bit more: after calling tty_open_by_driver, it should call >> tty_add_file(tty, NULL); to add an entry in the tty_files list (and why >> not calling check_tty_count too). And of course, the converse >> (tty_del_file) should be called by spk_ttyio_release between the >> tty_ldisc_flush call and tty_unlock. > > Oops, of course you don't have a filp to give to tty_del_file, so that > can't work. Ok, let's ignore the issue for now, applications are not > supposed to open the tty used by speakup anyway (and would get an EIO > error anyway). This issue with opening tty from userspace while it's in use from kernel. W= onder if this will rear its ugly head with rescpect to the recent patches?