linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: bbpetkov@yahoo.de
Cc: lucy@keyspan.com, greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] keyspan: init termios properly
Date: Mon, 26 Nov 2007 14:18:52 -0800	[thread overview]
Message-ID: <20071126141852.a609cdb6.akpm@linux-foundation.org> (raw)
In-Reply-To: <20071118131130.GA3991@gollum.tnic>

On Sun, 18 Nov 2007 14:11:30 +0100
Borislav Petkov <bbpetkov@yahoo.de> wrote:

> On Thu, Nov 15, 2007 at 01:10:16PM -0800, Lucy McCoy wrote:
>  
> > static int keyspan_open (struct usb_serial_port *port, struct file *filp)
> > {
> > 	struct keyspan_port_private 	*p_priv;
> > 	struct keyspan_serial_private 	*s_priv;
> > 	struct usb_serial 		*serial = port->serial;
> > 	const struct keyspan_device_details	*d_details;
> > 	int				i, err;
> > 	struct urb			*urb;
> > 	
> > 	s_priv = usb_get_serial_data(serial);
> > 	p_priv = usb_get_serial_port_data(port);
> > 	d_details = p_priv->device_details;
> > 	
> > 	dbg("%s - port%d.", __FUNCTION__, port->number); 
> > 
> > 	/* Set some sane defaults */
> > 	p_priv->rts_state = 1;
> > 	p_priv->dtr_state = 1;
> > 	p_priv->baud = 9600;
> > 
> > 	/* set CTS/RTS handshake etc. */
> > 	p_priv->cflag = CS8;   /* 8/N/1  */
> > 	p_priv->flow_control = flow_none;
> > 
> > 	/* force baud and lcr to be set on open */
> > 	p_priv->old_baud = 0;
> > 	p_priv->old_cflag = 0;
> > 
> > 	p_priv->out_flip = 0;
> > 	p_priv->in_flip = 0;
> > 
> > 	/* Reset low level data toggle and start reading from endpoints */
> > 	for (i = 0; i < 2; i++) {
> > 		if ((urb = p_priv->in_urbs[i]) == NULL)
> > 			continue;
> > 		urb->dev = serial->dev;
> > 
> > 		/* make sure endpoint data toggle is synchronized with the device */
> > 		
> > 		usb_clear_halt(urb->dev, urb->pipe);
> > 
> > 		if ((err = usb_submit_urb(urb, GFP_KERNEL)) != 0) {
> > 			dbg("%s - submit urb %d failed (%d)", __FUNCTION__, i, err);
> > 		}
> > 	}
> > 
> > 	/* Reset low level data toggle on out endpoints */
> > 	for (i = 0; i < 2; i++) {
> > 		if ((urb = p_priv->out_urbs[i]) == NULL)
> > 			continue;
> > 		urb->dev = serial->dev;
> > 		/* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); */
> > 	}
> > 
> > 	keyspan_send_setup(port, 1);
> > 	//mdelay(100);
> > 	//keyspan_set_termios(port, NULL);
> > 
> > 	return (0);
> > }
> > 
> 
> yes, after testing this i can confirm that this one fixes the NULL ptr
> problem here so you might want to submit a proper patch to Greg.

I'll merge revert-keyspan-init-termios-properly.patch soon, but afaik we
are still awaiting the real fix for this problem?  

  reply	other threads:[~2007-11-26 22:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-15 21:10 [PATCH] keyspan: init termios properly Lucy McCoy
2007-11-16  6:24 ` Borislav Petkov
2007-11-18 13:11 ` Borislav Petkov
2007-11-26 22:18   ` Andrew Morton [this message]
2007-11-30  5:45     ` Borislav Petkov
2007-11-30 17:23       ` Lucy McCoy
2007-12-02  8:03         ` Borislav Petkov
2007-12-02 13:57           ` Alan Cox
2007-12-02 17:40             ` Borislav Petkov
  -- strict thread matches above, loose matches on Subject: below --
2007-11-03 10:03 Borislav Petkov
2007-11-15 17:49 ` Lucy McCoy
2007-11-15 20:09   ` Andrew Morton
2007-11-15 20:28     ` Lucy McCoy
2007-11-15 20:40   ` Borislav Petkov

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=20071126141852.a609cdb6.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bbpetkov@yahoo.de \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucy@keyspan.com \
    /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).