All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: "Barry K. Nathan" <barryn@pobox.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH/RFC] 2.5.42 partial fix for older pl2303
Date: Sun, 13 Oct 2002 13:25:04 -0700	[thread overview]
Message-ID: <20021013202504.GA23533@kroah.com> (raw)
In-Reply-To: <20021013043008.GD10921@ip68-4-86-174.oc.oc.cox.net>

On Sat, Oct 12, 2002 at 09:30:08PM -0700, Barry K. Nathan wrote:
> On Sat, Oct 12, 2002 at 06:16:44PM -0700, Greg KH wrote:
> [snip stuff regarding pl2303 on 2.4.20-pre]
> > Now, would you mind taking a look at 2.5, and fixing this there too? :)
> 
> Here's a half-successful attempt. With this patch, the device no longer
> appears twice, and it always works on the first open (at least, so I've
> observed up to this point). The open following a successful open usually
> fails (roughly speaking, it appears to play dead), and the open following
> a failed open usually (always?) succeeds.
> 
> So, on my PL-2303, it's not perfect but it's certainly livable.
> 
> This patch is based on the one I did for 2.4, and in fact, this code
> functions when it's plugged into 2.4.20-pre10 instead of 2.5.42. In that
> scenario, the opens work 100% of the time.
> 
> I'd be interested in suggestions or comments regarding this patch.
> Anyone who has a PL-2303 working under 2.5 might want to try this patch
> just to make sure it doesn't kill their working setup.

Nice, I've added this to my tree.  I also made the following patch, to
fix up the proper return value for the probe() call, and fix a memory
leak.

Let me know if this patch causes any problems for you.

thanks,

greg k-h


diff -Nru a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
--- a/drivers/usb/serial/usb-serial.c	Sun Oct 13 13:35:48 2002
+++ b/drivers/usb/serial/usb-serial.c	Sun Oct 13 13:35:48 2002
@@ -1249,7 +1249,6 @@
 	}
 
 #if defined(CONFIG_USB_SERIAL_PL2303) || defined(CONFIG_USB_SERIAL_PL2303_MODULE)
-#if 1
 	/* BEGIN HORRIBLE HACK FOR PL2303 */ 
 	/* this is needed due to the looney way its endpoints are set up */
 	if (((dev->descriptor.idVendor == PL2303_VENDOR_ID) &&
@@ -1280,11 +1279,11 @@
 		 */
 		if (num_bulk_in == 0 || num_bulk_out == 0) {
 			info("PL-2303 hack: descriptors matched but endpoints did not");
-			return NULL;
+			kfree (serial);
+			return -ENODEV;
 		}
 	}
 	/* END HORRIBLE HACK FOR PL2303 */
-#endif
 #endif
 
 	/* found all that we need */

  reply	other threads:[~2002-10-13 20:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-09 23:36 [BUG] pl2303 oops in 2.4.20-pre10 (and 2.5 too) Barry K. Nathan
2002-10-09 23:53 ` Greg KH
2002-10-11  2:39   ` Barry K. Nathan
     [not found]     ` <20021011170623.GB4123@kroah.com>
2002-10-12  6:30       ` Barry K. Nathan
2002-10-12 20:56         ` Barry K. Nathan
2002-10-13  0:42           ` [PATCH] 2.4.20-pre10: make PL-2303 hack work again Barry K. Nathan
2002-10-13  1:16             ` Greg KH
2002-10-13  1:54               ` Barry K. Nathan
2002-10-13  4:30               ` [PATCH/RFC] 2.5.42 partial fix for older pl2303 Barry K. Nathan
2002-10-13 20:25                 ` Greg KH [this message]
2002-10-14  2:49                   ` Barry K. Nathan
2002-10-14  4:17                     ` Barry K. Nathan
2002-10-15  5:52                       ` Greg KH
2002-10-13  0:49           ` [BUG] pl2303 oops in 2.4.20-pre10 (and 2.5 too) Greg KH
2002-10-13  1:26             ` Barry K. Nathan

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=20021013202504.GA23533@kroah.com \
    --to=greg@kroah.com \
    --cc=barryn@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.