diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-15 06:59:51 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-15 06:59:51 -0700 |
| commit | e41a99ca6591586ac2f8b883427c0cbb00d87114 (patch) | |
| tree | 6d5767517356d12251d0bb1ed857fbd74083522a /usb | |
| parent | b632b9a7f13fc9a82a43d8e0bd9d541060a75095 (diff) | |
| download | patches-e41a99ca6591586ac2f8b883427c0cbb00d87114.tar.gz | |
more bugfixes, and 2.6.31-rc3 resync
Diffstat (limited to 'usb')
| -rw-r--r-- | usb/usb-serial-full-autosuspend-support-for-the-option-driver.patch | 58 |
1 files changed, 25 insertions, 33 deletions
diff --git a/usb/usb-serial-full-autosuspend-support-for-the-option-driver.patch b/usb/usb-serial-full-autosuspend-support-for-the-option-driver.patch index adc9b123f35cb6..1fea6fed7f57e8 100644 --- a/usb/usb-serial-full-autosuspend-support-for-the-option-driver.patch +++ b/usb/usb-serial-full-autosuspend-support-for-the-option-driver.patch @@ -18,20 +18,20 @@ Tested-off-by: Zhao Ming <zhao.ming9@zte.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- - drivers/usb/serial/option.c | 134 +++++++++++++++++++++++++++++++++++++------- - 1 file changed, 115 insertions(+), 19 deletions(-) + drivers/usb/serial/option.c | 134 ++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 116 insertions(+), 18 deletions(-) --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -559,6 +559,7 @@ static struct usb_driver option_driver = +@@ -560,6 +560,7 @@ static struct usb_driver option_driver = + #ifdef CONFIG_PM + .suspend = usb_serial_suspend, .resume = usb_serial_resume, ++ .supports_autosuspend = 1, + #endif .id_table = option_ids, .no_dynamic_id = 1, -+ .supports_autosuspend = 1, - }; - - /* The card has three separate interfaces, which the serial driver -@@ -601,6 +602,12 @@ static int debug; +@@ -607,6 +608,12 @@ static int debug; #define IN_BUFLEN 4096 #define OUT_BUFLEN 4096 @@ -44,7 +44,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> struct option_port_private { /* Input endpoints and buffer for this port */ struct urb *in_urbs[N_IN_URB]; -@@ -609,6 +616,8 @@ struct option_port_private { +@@ -615,6 +622,8 @@ struct option_port_private { struct urb *out_urbs[N_OUT_URB]; u8 *out_buffer[N_OUT_URB]; unsigned long out_busy; /* Bit vector of URBs in use */ @@ -53,7 +53,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> /* Settings for the port */ int rts_state; /* Handshaking pins (outputs) */ -@@ -655,12 +664,17 @@ module_exit(option_exit); +@@ -661,12 +670,17 @@ module_exit(option_exit); static int option_probe(struct usb_serial *serial, const struct usb_device_id *id) { @@ -71,7 +71,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> return 0; } -@@ -717,12 +731,15 @@ static int option_write(struct tty_struc +@@ -723,12 +737,15 @@ static int option_write(struct tty_struc const unsigned char *buf, int count) { struct option_port_private *portdata; @@ -87,7 +87,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> dbg("%s: write (%d chars)", __func__, count); -@@ -744,17 +761,33 @@ static int option_write(struct tty_struc +@@ -750,17 +767,33 @@ static int option_write(struct tty_struc dbg("%s: endpoint %d buf %d", __func__, usb_pipeendpoint(this_urb->pipe), i); @@ -127,7 +127,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> portdata->tx_start_time[i] = jiffies; buf += todo; left -= todo; -@@ -798,7 +831,10 @@ static void option_indat_callback(struct +@@ -804,7 +837,10 @@ static void option_indat_callback(struct if (err) printk(KERN_ERR "%s: resubmit read urb failed. " "(%d)", __func__, err); @@ -138,7 +138,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } return; } -@@ -807,15 +843,21 @@ static void option_outdat_callback(struc +@@ -813,15 +849,21 @@ static void option_outdat_callback(struc { struct usb_serial_port *port; struct option_port_private *portdata; @@ -161,29 +161,21 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> for (i = 0; i < N_OUT_URB; ++i) { if (portdata->out_urbs[i] == urb) { smp_mb__before_clear_bit(); -@@ -831,7 +873,6 @@ static void option_instat_callback(struc - int status = urb->status; - struct usb_serial_port *port = urb->context; - struct option_port_private *portdata = usb_get_serial_port_data(port); -- struct usb_serial *serial = port->serial; - - dbg("%s", __func__); - dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata); -@@ -927,11 +968,13 @@ static int option_open(struct tty_struct +@@ -932,10 +974,13 @@ static int option_open(struct tty_struct struct usb_serial_port *port, struct file *filp) { struct option_port_private *portdata; + struct option_intf_private *intfdata; - struct usb_serial *serial = port->serial; ++ struct usb_serial *serial = port->serial; int i, err; struct urb *urb; portdata = usb_get_serial_port_data(port); -+ intfdata = port->serial->private; ++ intfdata = serial->private; dbg("%s", __func__); -@@ -950,6 +993,12 @@ static int option_open(struct tty_struct +@@ -954,6 +999,12 @@ static int option_open(struct tty_struct option_send_setup(port); @@ -196,7 +188,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> return 0; } -@@ -974,16 +1023,23 @@ static void option_close(struct usb_seri +@@ -978,16 +1029,23 @@ static void option_close(struct usb_seri int i; struct usb_serial *serial = port->serial; struct option_port_private *portdata; @@ -220,7 +212,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } } -@@ -1088,6 +1144,7 @@ static int option_startup(struct usb_ser +@@ -1092,6 +1150,7 @@ static int option_startup(struct usb_ser __func__, i); return 1; } @@ -228,8 +220,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> for (j = 0; j < N_IN_URB; j++) { buffer = (u8 *)__get_free_page(GFP_KERNEL); -@@ -1189,18 +1246,52 @@ static void option_release(struct usb_se - +@@ -1194,18 +1253,52 @@ static void option_release(struct usb_se + #ifdef CONFIG_PM static int option_suspend(struct usb_serial *serial, pm_message_t message) { + struct option_intf_private *intfdata = serial->private; @@ -283,7 +275,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> dbg("%s entered", __func__); /* get the interrupt URBs resubmitted unconditionally */ -@@ -1215,7 +1306,7 @@ static int option_resume(struct usb_seri +@@ -1220,7 +1313,7 @@ static int option_resume(struct usb_seri if (err < 0) { err("%s: Error %d for interrupt URB of port%d", __func__, err, i); @@ -292,7 +284,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } } -@@ -1223,27 +1314,32 @@ static int option_resume(struct usb_seri +@@ -1228,27 +1321,32 @@ static int option_resume(struct usb_seri /* walk all ports */ port = serial->port[i]; portdata = usb_get_serial_port_data(port); @@ -331,5 +323,5 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +err_out: + return err; } + #endif - MODULE_AUTHOR(DRIVER_AUTHOR); |
