diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-30 18:45:28 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-30 18:45:28 -0400 |
| commit | 9f2952dbcbc0a143cff19f2e44fc504901aad86f (patch) | |
| tree | 2294abc07403646fbb75d99e174be0f1edd62e52 | |
| parent | 59e7648644d114094525081c3614acefffae8de4 (diff) | |
| parent | b894f60a232d552fc18b018271c2893f0b0c1c15 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (22 commits)
USB: gadget: f_mass_storage: stale common->fsg value bug fix
USB: gadget: f_mass_storage: fixed fs descriptors not being updated
USB: musb: Enable the maximum supported burst mode for DMA
USB: musb: fix Blackfin ulpi stubs
USB: MUSB: make non-OMAP platforms build with CONFIG_PM=y
USB: musb_core: make disconnect and suspend interrupts work again
USB: obey the sysfs power/wakeup setting
USB: gadget eth: Fix calculate CRC32 in EEM
USB: qcserial: fix a memory leak in qcprobe error path
USB: gadget/printer, fix sleep inside atomic
USB: isp1362-hcd, fix double lock
USB: serial: ftdi: correct merge conflict with CONTEC id
USB: fix oops in usb_sg_init()
USB: s3c2410: deactivate endpoints before gadget unbinding
USB: ehci-mxc: bail out on transceiver problems
USB: otg/ulpi: bail out on read errors
usb: musb: Fix a bug by making suspend interrupt available in device mode
USB: r8a66597: Fix failure in change of status
USB: xHCI: Fix bug in link TRB activation change.
USB: gadget: g_fs: possible invalid pointer reference bug fixed
...
| -rw-r--r-- | drivers/usb/core/driver.c | 13 | ||||
| -rw-r--r-- | drivers/usb/core/message.c | 7 | ||||
| -rw-r--r-- | drivers/usb/gadget/f_eem.c | 3 | ||||
| -rw-r--r-- | drivers/usb/gadget/f_mass_storage.c | 194 | ||||
| -rw-r--r-- | drivers/usb/gadget/g_ffs.c | 11 | ||||
| -rw-r--r-- | drivers/usb/gadget/printer.c | 32 | ||||
| -rw-r--r-- | drivers/usb/gadget/s3c2410_udc.c | 6 | ||||
| -rw-r--r-- | drivers/usb/gadget/u_serial.c | 16 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-mxc.c | 13 | ||||
| -rw-r--r-- | drivers/usb/host/isp1362-hcd.c | 15 | ||||
| -rw-r--r-- | drivers/usb/host/r8a66597-hcd.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-ring.c | 62 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_core.c | 13 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_core.h | 6 | ||||
| -rw-r--r-- | drivers/usb/musb/musbhsdma.c | 13 | ||||
| -rw-r--r-- | drivers/usb/otg/ulpi.c | 17 | ||||
| -rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 1 | ||||
| -rw-r--r-- | drivers/usb/serial/ftdi_sio_ids.h | 7 | ||||
| -rw-r--r-- | drivers/usb/serial/qcserial.c | 3 |
19 files changed, 209 insertions, 225 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index de98a94d1853..a6bd53ace035 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
| @@ -1272,8 +1272,7 @@ static int usb_resume_both(struct usb_device *udev, pm_message_t msg) | |||
| 1272 | 1272 | ||
| 1273 | static void choose_wakeup(struct usb_device *udev, pm_message_t msg) | 1273 | static void choose_wakeup(struct usb_device *udev, pm_message_t msg) |
| 1274 | { | 1274 | { |
| 1275 | int w, i; | 1275 | int w; |
| 1276 | struct usb_interface *intf; | ||
| 1277 | 1276 | ||
| 1278 | /* Remote wakeup is needed only when we actually go to sleep. | 1277 | /* Remote wakeup is needed only when we actually go to sleep. |
| 1279 | * For things like FREEZE and QUIESCE, if the device is already | 1278 | * For things like FREEZE and QUIESCE, if the device is already |
| @@ -1285,16 +1284,10 @@ static void choose_wakeup(struct usb_device *udev, pm_message_t msg) | |||
| 1285 | return; | 1284 | return; |
| 1286 | } | 1285 | } |
| 1287 | 1286 | ||
| 1288 | /* If remote wakeup is permitted, see whether any interface drivers | 1287 | /* Enable remote wakeup if it is allowed, even if no interface drivers |
| 1289 | * actually want it. | 1288 | * actually want it. |
| 1290 | */ | 1289 | */ |
| 1291 | w = 0; | 1290 | w = device_may_wakeup(&udev->dev); |
| 1292 | if (device_may_wakeup(&udev->dev) && udev->actconfig) { | ||
| 1293 | for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { | ||
| 1294 | intf = udev->actconfig->interface[i]; | ||
| 1295 | w |= intf->needs_remote_wakeup; | ||
| 1296 | } | ||
| 1297 | } | ||
| 1298 | 1291 | ||
| 1299 | /* If the device is autosuspended with the wrong wakeup setting, | 1292 | /* If the device is autosuspended with the wrong wakeup setting, |
| 1300 | * autoresume now so the setting can be changed. | 1293 | * autoresume now so the setting can be changed. |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index a73e08fdab36..fd4c36ea5e46 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
| @@ -416,8 +416,11 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, | |||
| 416 | /* A length of zero means transfer the whole sg list */ | 416 | /* A length of zero means transfer the whole sg list */ |
| 417 | len = length; | 417 | len = length; |
| 418 | if (len == 0) { | 418 | if (len == 0) { |
| 419 | for_each_sg(sg, sg, nents, i) | 419 | struct scatterlist *sg2; |
| 420 | len += sg->length; | 420 | int j; |
| 421 | |||
| 422 | for_each_sg(sg, sg2, nents, j) | ||
| 423 | len += sg2->length; | ||
| 421 | } | 424 | } |
| 422 | } else { | 425 | } else { |
| 423 | /* | 426 | /* |
diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c index 38226e9a371d..95dd4662d6a8 100644 --- a/drivers/usb/gadget/f_eem.c +++ b/drivers/usb/gadget/f_eem.c | |||
| @@ -469,8 +469,7 @@ static int eem_unwrap(struct gether *port, | |||
| 469 | crc = get_unaligned_le32(skb->data + len | 469 | crc = get_unaligned_le32(skb->data + len |
| 470 | - ETH_FCS_LEN); | 470 | - ETH_FCS_LEN); |
| 471 | crc2 = ~crc32_le(~0, | 471 | crc2 = ~crc32_le(~0, |
| 472 | skb->data, | 472 | skb->data, len - ETH_FCS_LEN); |
| 473 | skb->len - ETH_FCS_LEN); | ||
| 474 | } else { | 473 | } else { |
| 475 | crc = get_unaligned_be32(skb->data + len | 474 | crc = get_unaligned_be32(skb->data + len |
| 476 | - ETH_FCS_LEN); | 475 | - ETH_FCS_LEN); |
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 7d05a0be5c60..4ce899c9b165 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c | |||
| @@ -321,8 +321,8 @@ struct fsg_dev; | |||
| 321 | /* Data shared by all the FSG instances. */ | 321 | /* Data shared by all the FSG instances. */ |
| 322 | struct fsg_common { | 322 | struct fsg_common { |
| 323 | struct usb_gadget *gadget; | 323 | struct usb_gadget *gadget; |
| 324 | struct fsg_dev *fsg; | 324 | struct fsg_dev *fsg, *new_fsg; |
| 325 | struct fsg_dev *prev_fsg; | 325 | wait_queue_head_t fsg_wait; |
| 326 | 326 | ||
| 327 | /* filesem protects: backing files in use */ | 327 | /* filesem protects: backing files in use */ |
| 328 | struct rw_semaphore filesem; | 328 | struct rw_semaphore filesem; |
| @@ -351,7 +351,6 @@ struct fsg_common { | |||
| 351 | enum fsg_state state; /* For exception handling */ | 351 | enum fsg_state state; /* For exception handling */ |
| 352 | unsigned int exception_req_tag; | 352 | unsigned int exception_req_tag; |
| 353 | 353 | ||
| 354 | u8 config, new_config; | ||
| 355 | enum data_direction data_dir; | 354 | enum data_direction data_dir; |
| 356 | u32 data_size; | 355 | u32 data_size; |
| 357 | u32 data_size_from_cmnd; | 356 | u32 data_size_from_cmnd; |
| @@ -595,7 +594,7 @@ static int fsg_setup(struct usb_function *f, | |||
| 595 | u16 w_value = le16_to_cpu(ctrl->wValue); | 594 | u16 w_value = le16_to_cpu(ctrl->wValue); |
| 596 | u16 w_length = le16_to_cpu(ctrl->wLength); | 595 | u16 w_length = le16_to_cpu(ctrl->wLength); |
| 597 | 596 | ||
| 598 | if (!fsg->common->config) | 597 | if (!fsg_is_set(fsg->common)) |
| 599 | return -EOPNOTSUPP; | 598 | return -EOPNOTSUPP; |
| 600 | 599 | ||
| 601 | switch (ctrl->bRequest) { | 600 | switch (ctrl->bRequest) { |
| @@ -2303,24 +2302,20 @@ static int alloc_request(struct fsg_common *common, struct usb_ep *ep, | |||
| 2303 | return -ENOMEM; | 2302 | return -ENOMEM; |
| 2304 | } | 2303 | } |
| 2305 | 2304 | ||
| 2306 | /* | 2305 | /* Reset interface setting and re-init endpoint state (toggle etc). */ |
| 2307 | * Reset interface setting and re-init endpoint state (toggle etc). | 2306 | static int do_set_interface(struct fsg_common *common, struct fsg_dev *new_fsg) |
| 2308 | * Call with altsetting < 0 to disable the interface. The only other | ||
| 2309 | * available altsetting is 0, which enables the interface. | ||
| 2310 | */ | ||
| 2311 | static int do_set_interface(struct fsg_common *common, int altsetting) | ||
| 2312 | { | 2307 | { |
| 2313 | int rc = 0; | 2308 | const struct usb_endpoint_descriptor *d; |
| 2314 | int i; | 2309 | struct fsg_dev *fsg; |
| 2315 | const struct usb_endpoint_descriptor *d; | 2310 | int i, rc = 0; |
| 2316 | 2311 | ||
| 2317 | if (common->running) | 2312 | if (common->running) |
| 2318 | DBG(common, "reset interface\n"); | 2313 | DBG(common, "reset interface\n"); |
| 2319 | 2314 | ||
| 2320 | reset: | 2315 | reset: |
| 2321 | /* Deallocate the requests */ | 2316 | /* Deallocate the requests */ |
| 2322 | if (common->prev_fsg) { | 2317 | if (common->fsg) { |
| 2323 | struct fsg_dev *fsg = common->prev_fsg; | 2318 | fsg = common->fsg; |
| 2324 | 2319 | ||
| 2325 | for (i = 0; i < FSG_NUM_BUFFERS; ++i) { | 2320 | for (i = 0; i < FSG_NUM_BUFFERS; ++i) { |
| 2326 | struct fsg_buffhd *bh = &common->buffhds[i]; | 2321 | struct fsg_buffhd *bh = &common->buffhds[i]; |
| @@ -2345,88 +2340,53 @@ reset: | |||
| 2345 | fsg->bulk_out_enabled = 0; | 2340 | fsg->bulk_out_enabled = 0; |
| 2346 | } | 2341 | } |
| 2347 | 2342 | ||
| 2348 | common->prev_fsg = 0; | 2343 | common->fsg = NULL; |
| 2344 | wake_up(&common->fsg_wait); | ||
| 2349 | } | 2345 | } |
| 2350 | 2346 | ||
| 2351 | common->running = 0; | 2347 | common->running = 0; |
| 2352 | if (altsetting < 0 || rc != 0) | 2348 | if (!new_fsg || rc) |
| 2353 | return rc; | 2349 | return rc; |
| 2354 | 2350 | ||
| 2355 | DBG(common, "set interface %d\n", altsetting); | 2351 | common->fsg = new_fsg; |
| 2352 | fsg = common->fsg; | ||
| 2356 | 2353 | ||
| 2357 | if (fsg_is_set(common)) { | 2354 | /* Enable the endpoints */ |
