Skip to content

Commit b19d69c

Browse files
committed
Merge tag 'usb-3.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are a bunch of USB fixes for 3.13-rc3. Nothing major, but we seem to have an argument about a XHCI fix, so I'm not including a revert that Sarah requested, because that breaks a USB network driver, and I can't revert the USB network driver fix without reintroducing other bugs that it fixed. So as it is, everything should now be working. Worse case, I can revert the XHCI fix before 3.13-final is out, but it seems to work well here with my testing, so all should be good. Other than that, some driver updates based on reports" * tag 'usb-3.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (40 commits) usb: hub: Use correct reset for wedged USB3 devices that are NOTATTACHED usb: ohci-pxa27x: include linux/dma-mapping.h USB: cdc-acm: Added support for the Lenovo RD02-D400 USB Modem usb: tools: fix a regression issue that gcc can't link to pthread USB: switch maintainership of chipidea to Peter USB: pl2303: fixed handling of CS5 setting USB: ftdi_sio: fixed handling of unsupported CSIZE setting USB: mos7840: correct handling of CS5 setting USB: spcp8x5: correct handling of CS5 setting usb: wusbcore: fix deadlock in wusbhc_gtk_rekey usb: wusbcore: do device lookup while holding the hc mutex usb: wusbcore: send keepalives to unauthenticated devices USB: option: support new huawei devices USB: serial: option: blacklist interface 1 for Huawei E173s-6 usb: xhci: Link TRB must not occur within a USB payload burst usb: gadget: f_mass_storage: call try_to_freeze only when its safe usb: gadget: tcm_usb_gadget: mark bot_cleanup_old_alt static usb: gadget: ffs: fix sparse warning usb: gadget: zero: module parameters can be static usb: gadget: storage: fix sparse warning ...
2 parents 7d49efe + 2d51f3c commit b19d69c

36 files changed

Lines changed: 471 additions & 265 deletions

‎MAINTAINERS‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,8 @@ S: Maintained
21382138
F: Documentation/zh_CN/
21392139

21402140
CHIPIDEA USB HIGH SPEED DUAL ROLE CONTROLLER
2141-
M: Alexander Shishkin <alexander.shishkin@linux.intel.com>
2141+
M: Peter Chen <Peter.Chen@freescale.com>
2142+
T: git://github.com/hzpeterchen/linux-usb.git
21422143
L: linux-usb@vger.kernel.org
21432144
S: Maintained
21442145
F: drivers/usb/chipidea/

‎drivers/usb/class/cdc-acm.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,8 @@ static int acm_reset_resume(struct usb_interface *intf)
15151515

15161516
static const struct usb_device_id acm_ids[] = {
15171517
/* quirky and broken devices */
1518+
{ USB_DEVICE(0x17ef, 0x7000), /* Lenovo USB modem */
1519+
.driver_info = NO_UNION_NORMAL, },/* has no union descriptor */
15181520
{ USB_DEVICE(0x0870, 0x0001), /* Metricom GS Modem */
15191521
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
15201522
},

‎drivers/usb/core/hub.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4832,8 +4832,9 @@ static void hub_events(void)
48324832
hub->ports[i - 1]->child;
48334833

48344834
dev_dbg(hub_dev, "warm reset port %d\n", i);
4835-
if (!udev || !(portstatus &
4836-
USB_PORT_STAT_CONNECTION)) {
4835+
if (!udev ||
4836+
!(portstatus & USB_PORT_STAT_CONNECTION) ||
4837+
udev->state == USB_STATE_NOTATTACHED) {
48374838
status = hub_port_reset(hub, i,
48384839
NULL, HUB_BH_RESET_TIME,
48394840
true);

‎drivers/usb/dwc3/ep0.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
459459
dep = dwc3_wIndex_to_dep(dwc, wIndex);
460460
if (!dep)
461461
return -EINVAL;
462+
if (set == 0 && (dep->flags & DWC3_EP_WEDGE))
463+
break;
462464
ret = __dwc3_gadget_ep_set_halt(dep, set);
463465
if (ret)
464466
return -EINVAL;

‎drivers/usb/dwc3/gadget.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,17 +1200,14 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
12001200
else
12011201
dep->flags |= DWC3_EP_STALL;
12021202
} else {
1203-
if (dep->flags & DWC3_EP_WEDGE)
1204-
return 0;
1205-
12061203
ret = dwc3_send_gadget_ep_cmd(dwc, dep->number,
12071204
DWC3_DEPCMD_CLEARSTALL, &params);
12081205
if (ret)
12091206
dev_err(dwc->dev, "failed to %s STALL on %s\n",
12101207
value ? "set" : "clear",
12111208
dep->name);
12121209
else
1213-
dep->flags &= ~DWC3_EP_STALL;
1210+
dep->flags &= ~(DWC3_EP_STALL | DWC3_EP_WEDGE);
12141211
}
12151212

12161213
return ret;

‎drivers/usb/gadget/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ config USB_CONFIGFS_PHONET
682682
config USB_CONFIGFS_MASS_STORAGE
683683
boolean "Mass storage"
684684
depends on USB_CONFIGFS
685+
depends on BLOCK
685686
select USB_F_MASS_STORAGE
686687
help
687688
The Mass Storage Gadget acts as a USB Mass Storage disk drive.

‎drivers/usb/gadget/composite.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ static void reset_config(struct usb_composite_dev *cdev)
593593
bitmap_zero(f->endpoints, 32);
594594
}
595595
cdev->config = NULL;
596+
cdev->delayed_status = 0;
596597
}
597598

598599
static int set_config(struct usb_composite_dev *cdev,

‎drivers/usb/gadget/f_fs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ static struct ffs_data *ffs_data_new(void)
13041304
{
13051305
struct ffs_data *ffs = kzalloc(sizeof *ffs, GFP_KERNEL);
13061306
if (unlikely(!ffs))
1307-
return 0;
1307+
return NULL;
13081308

13091309
ENTER();
13101310

‎drivers/usb/gadget/f_mass_storage.c‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static int fsg_setup(struct usb_function *f,
523523
*/
524524
DBG(fsg, "bulk reset request\n");
525525
raise_exception(fsg->common, FSG_STATE_RESET);
526-
return DELAYED_STATUS;
526+
return USB_GADGET_DELAYED_STATUS;
527527

528528
case US_BULK_GET_MAX_LUN:
529529
if (ctrl->bRequestType !=
@@ -602,13 +602,14 @@ static bool start_out_transfer(struct fsg_common *common, struct fsg_buffhd *bh)
602602
return true;
603603
}
604604

605-
static int sleep_thread(struct fsg_common *common)
605+
static int sleep_thread(struct fsg_common *common, bool can_freeze)
606606
{
607607
int rc = 0;
608608

609609
/* Wait until a signal arrives or we are woken up */
610610
for (;;) {
611-
try_to_freeze();
611+
if (can_freeze)
612+
try_to_freeze();
612613
set_current_state(TASK_INTERRUPTIBLE);
613614
if (signal_pending(current)) {
614615
rc = -EINTR;
@@ -682,7 +683,7 @@ static int do_read(struct fsg_common *common)
682683
/* Wait for the next buffer to become available */
683684
bh = common->next_buffhd_to_fill;
684685
while (bh->state != BUF_STATE_EMPTY) {
685-
rc = sleep_thread(common);
686+
rc = sleep_thread(common, false);
686687
if (rc)
687688
return rc;
688689
}
@@ -937,7 +938,7 @@ static int do_write(struct fsg_common *common)
937938
}
938939

939940
/* Wait for something to happen */
940-
rc = sleep_thread(common);
941+
rc = sleep_thread(common, false);
941942
if (rc)
942943
return rc;
943944
}
@@ -1504,7 +1505,7 @@ static int throw_away_data(struct fsg_common *common)
15041505
}
15051506

15061507
/* Otherwise wait for something to happen */
1507-
rc = sleep_thread(common);
1508+
rc = sleep_thread(common, true);
15081509
if (rc)
15091510
return rc;
15101511
}
@@ -1625,7 +1626,7 @@ static int send_status(struct fsg_common *common)
16251626
/* Wait for the next buffer to become available */
16261627
bh = common->next_buffhd_to_fill;
16271628
while (bh->state != BUF_STATE_EMPTY) {
1628-
rc = sleep_thread(common);
1629+
rc = sleep_thread(common, true);
16291630
if (rc)
16301631
return rc;
16311632
}
@@ -1828,7 +1829,7 @@ static int do_scsi_command(struct fsg_common *common)
18281829
bh = common->next_buffhd_to_fill;
18291830
common->next_buffhd_to_drain = bh;
18301831
while (bh->state != BUF_STATE_EMPTY) {
1831-
rc = sleep_thread(common);
1832+
rc = sleep_thread(common, true);
18321833
if (rc)
18331834
return rc;
18341835
}
@@ -2174,7 +2175,7 @@ static int get_next_command(struct fsg_common *common)
21742175
/* Wait for the next buffer to become available */
21752176
bh = common->next_buffhd_to_fill;
21762177
while (bh->state != BUF_STATE_EMPTY) {
2177-
rc = sleep_thread(common);
2178+
rc = sleep_thread(common, true);
21782179
if (rc)
21792180
return rc;
21802181
}
@@ -2193,7 +2194,7 @@ static int get_next_command(struct fsg_common *common)
21932194

21942195
/* Wait for the CBW to arrive */
21952196
while (bh->state != BUF_STATE_FULL) {
2196-
rc = sleep_thread(common);
2197+
rc = sleep_thread(common, true);
21972198
if (rc)
21982199
return rc;
21992200
}
@@ -2379,7 +2380,7 @@ static void handle_exception(struct fsg_common *common)
23792380
}
23802381
if (num_active == 0)
23812382
break;
2382-
if (sleep_thread(common))
2383+
if (sleep_thread(common, true))
23832384
return;
23842385
}
23852386

@@ -2516,7 +2517,7 @@ static int fsg_main_thread(void *common_)
25162517
}
25172518

25182519
if (!common->running) {
2519-
sleep_thread(common);
2520+
sleep_thread(common, true);
25202521
continue;
25212522
}
25222523

@@ -3111,7 +3112,7 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f)
31113112
fsg->common->can_stall);
31123113
if (ret)
31133114
return ret;
3114-
fsg_common_set_inquiry_string(fsg->common, 0, 0);
3115+
fsg_common_set_inquiry_string(fsg->common, NULL, NULL);
31153116
ret = fsg_common_run_thread(fsg->common);
31163117
if (ret)
31173118
return ret;

‎drivers/usb/gadget/pxa25x_udc.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
*/
5555
#ifdef CONFIG_ARCH_PXA
5656
#include <mach/pxa25x-udc.h>
57+
#include <mach/hardware.h>
5758
#endif
5859

5960
#ifdef CONFIG_ARCH_LUBBOCK

0 commit comments

Comments
 (0)