Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934227AbdGTH3V (ORCPT ); Thu, 20 Jul 2017 03:29:21 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:34357 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933861AbdGTH3U (ORCPT ); Thu, 20 Jul 2017 03:29:20 -0400 Message-Id: <20170720072235.186761910@gmail.com> User-Agent: quilt/0.65 Date: Thu, 20 Jul 2017 08:22:35 +0100 From: Okash Khawaja To: Greg Kroah-Hartman , Jiri Slaby , Samuel Thibault , Alan Cox , linux-kernel@vger.kernel.org Cc: William Hubbs , Chris Brannon , Kirk Reiser , speakup@linux-speakup.org, devel@driverdev.osuosl.org Subject: [patch v3 0/3] tty contention resulting from tty_open_by_driver export In-Reply-To: <20170718144931.0f6c9634@alans-desktop> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 936 Lines: 21 Hi, I have updated the patches so that the exclusivity flag is in tty_port. When closing the struct - by calling tty_release_struct - we also need to reset the flag. One way to do that is to reset the flag inside tty_release_struct function, regardless of whether the tty was opened through tty_kopen or not. In order to keep the code clean, I have instead created a separate function called tty_kclose which is the same as tty_release_struct except that it also resets the exclusivity flag. As a result, any changes to tty_release_struct won't be in tty_kclose untless manually added. Please advise on this. Here is a summary of changes when compared to v2: - Patch 1 uses TTY_PORT_KOPENED flag instead of TTY_KOPENED and as a result adds helper functions to read and change the flag - Patch 1 adds tty_kclose function to close tty opened by tty_kopen - Patch 2 calls tty_kclose instead of tty_release_struct Thanks, Okash