linux-hams.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ranch <linux-hams@trinnet.net>
To: Jean-Christian de Rivaz <jc@eclis.ch>,
	Thomas Osterried <thomas@osterried.de>,
	Ralf Baechle DL5RB <ralf@linux-mips.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	Peter Hurley <peter@hurleysoftware.com>
Cc: linux-hams@trinnet.net, linux-hams@vger.kernel.org
Subject: Re: [PATCH 1/1] Add poll method to mkiss let notify hangup to the user process.
Date: Fri, 2 Oct 2015 17:29:47 -0700	[thread overview]
Message-ID: <560F217B.6020106@trinnet.net> (raw)
In-Reply-To: <1443822373-18395-1-git-send-email-jc@eclis.ch>


Hello Jean-Christian, Everyone,

Thanks for working on this as I'm pretty sure I've bit hit by this panic 
as well though I wasn't able to reproduce it more readily. Anyway, if 
this is the proper fix moving forward, will the kernel not panic even if 
kissattach is not updated?  Can you also include the needed patch for 
the kissattach program to complete this solution?

--David


On 10/02/2015 02:46 PM, Jean-Christian de Rivaz wrote:
> Without this the application that use the mkiss line discipline have
> no way to terminate in case the corresponding serial device is
> removed, for example when a USB TNC is unplugged. The application must
> wait on poll().
>
> The kissattach application must be patched to take advantage of this
> feature.
>
> Signed-off-by: Jean-Christian de Rivaz <jc@eclis.ch>
> ---
>   drivers/net/hamradio/mkiss.c |   15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
> index fba41e9..50cd36c 100644
> --- a/drivers/net/hamradio/mkiss.c
> +++ b/drivers/net/hamradio/mkiss.c
> @@ -893,6 +893,20 @@ static long mkiss_compat_ioctl(struct tty_struct *tty, struct file *file,
>   #endif
>   
>   /*
> + * Waiting until hangup is the only allowed operation. This is used
> + * to notify the application in case the serial deivce is removed
> + * (ex. USB). The tty_ldisc_hangup() will wake up the process.
> + */
> +static unsigned int mkiss_poll(struct tty_struct *tty, struct file *file,
> +							poll_table *wait)
> +{
> +	poll_wait(file, &tty->read_wait, wait);
> +	poll_wait(file, &tty->write_wait, wait);
> +
> +	return 0;
> +}
> +
> +/*
>    * Handle the 'receiver data ready' interrupt.
>    * This function is called by the 'tty_io' module in the kernel when
>    * a block of data has been received, which can now be decapsulated
> @@ -969,6 +983,7 @@ static struct tty_ldisc_ops ax_ldisc = {
>   #ifdef CONFIG_COMPAT
>   	.compat_ioctl	= mkiss_compat_ioctl,
>   #endif
> +	.poll           = mkiss_poll,
>   	.receive_buf	= mkiss_receive_buf,
>   	.write_wakeup	= mkiss_write_wakeup
>   };


  reply	other threads:[~2015-10-03  0:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 17:21 AX25 mkiss interface not deleted when the serial port is removed Jean-Christian de Rivaz
2015-09-28 20:06 ` Jean-Christian de Rivaz
2015-09-28 23:13   ` Jean-Christian de Rivaz
2015-09-29  2:13     ` David Ranch
2015-09-29 15:31 ` Ralf Baechle DL5RB
2015-09-29 15:46   ` Jean-Christian de Rivaz
2015-09-29 16:49   ` David Ranch
2015-09-29 17:14     ` Ralf Baechle
2015-09-30  0:29   ` Jean-Christian de Rivaz
2015-09-30 20:22     ` Thomas Osterried
2015-09-30 23:04       ` Jean-Christian de Rivaz
2015-10-01  2:56         ` [PATCH 1/1] Force mkiss to reset the line discipline when serial device " jc
2015-10-01  7:31           ` Ralf Baechle
2015-10-01  9:18             ` [PATCH v2 " Jean-Christian de Rivaz
2015-10-01 16:56               ` Jean-Christian de Rivaz
2015-10-01 22:57                 ` Peter Hurley
2015-10-02  8:30                   ` Jean-Christian de Rivaz
2015-10-02 10:35                     ` Thomas Osterried
2015-10-02 13:48                       ` Jean-Christian de Rivaz
2015-10-02 17:25                         ` Jean-Christian de Rivaz
2015-10-02 21:46                           ` [PATCH 1/1] Add poll method to mkiss let notify hangup to the user process Jean-Christian de Rivaz
2015-10-03  0:29                             ` David Ranch [this message]
2015-10-03  1:02                               ` Jean-Christian de Rivaz
2016-02-11 19:14                               ` Thomas Osterried
2015-10-02 21:40                         ` [PATCH 1/1] Close the file descriptor and exit when the kernel notice hangup Jean-Christian de Rivaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560F217B.6020106@trinnet.net \
    --to=linux-hams@trinnet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jc@eclis.ch \
    --cc=jslaby@suse.com \
    --cc=linux-hams@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=ralf@linux-mips.org \
    --cc=thomas@osterried.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).