diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-31 17:06:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-31 17:06:31 -0500 |
commit | fb1c6348b22dde3ef75b53ec23982bf1bc617c32 (patch) | |
tree | 0bdc36714292dfa63b27321db8391681a790e183 | |
parent | abfa44b5fd4a2f5d7549005bec465d4823a263ff (diff) | |
parent | 6b28405395f7ec492ea69f541cc774adcb9e00ca (diff) |
Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (26 commits)
staging: r8712u: Add new device IDs
staging: brcm80211: fix suspend/resume issue in brcmsmac
staging: brcm80211: remove assert to avoid panic since 2.6.37 kernel
Staging: iio: Aditional fixpoint formatted output bugfix
staging: usbip: vhci: use urb->dev->portnum to find port
staging: usbip: vhci: handle EAGAIN from SO_RCVTIMEO
staging: usbip: vhci: friendly log messages for connection errors
staging: usbip: vhci: refuse to enqueue for dead connections
staging: usbip: vhci: give back URBs from in-flight unlink requests
staging: usbip: vhci: update reference count for usb_device
staging: usbip: stub: update refcounts for devices and interfaces
staging: tidspbridge: replace mbox callback with notifier_call
staging: comedi: ni_labpc: Use shared IRQ for PCMCIA card
Staging: speakup: &&/|| confusion in silent_store()
iio: Fixpoint formatted output bugfix
staging: rt2860: Fix incorrect netif_stop_queue usage warning
staging: r8712u: Fix memory leak in firmware loading
staging: tidspbridge: configure full L1 MMU range
staging: rt2870sta: Add ID for Linksys WUSB100v2
Staging: xgfib: put parenthesis in the right place
...
27 files changed, 294 insertions, 134 deletions
diff --git a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c index 0e298dba9fc8..29b8ab44ea47 100644 --- a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c +++ b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c | |||
@@ -360,8 +360,8 @@ int PSSendOps(void *arg) | |||
360 | status = 1; | 360 | status = 1; |
361 | goto complete; | 361 | goto complete; |
362 | } | 362 | } |
363 | len = (firmware->size > MAX_BDADDR_FORMAT_LENGTH)? MAX_BDADDR_FORMAT_LENGTH: firmware->size; | 363 | len = min(firmware->size, MAX_BDADDR_FORMAT_LENGTH - 1); |
364 | memcpy(config_bdaddr, firmware->data,len); | 364 | memcpy(config_bdaddr, firmware->data, len); |
365 | config_bdaddr[len] = '\0'; | 365 | config_bdaddr[len] = '\0'; |
366 | write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); | 366 | write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); |
367 | A_RELEASE_FIRMWARE(firmware); | 367 | A_RELEASE_FIRMWARE(firmware); |
diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c index bdd629d72a75..f1235884cc5d 100644 --- a/drivers/staging/brcm80211/sys/wl_mac80211.c +++ b/drivers/staging/brcm80211/sys/wl_mac80211.c | |||
@@ -209,11 +209,8 @@ static void wl_ops_stop(struct ieee80211_hw *hw) | |||
209 | struct wl_info *wl = hw->priv; | 209 | struct wl_info *wl = hw->priv; |
210 | ASSERT(wl); | 210 | ASSERT(wl); |
211 | WL_LOCK(wl); | 211 | WL_LOCK(wl); |
212 | wl_down(wl); | ||
213 | ieee80211_stop_queues(hw); | 212 | ieee80211_stop_queues(hw); |
214 | WL_UNLOCK(wl); | 213 | WL_UNLOCK(wl); |
215 | |||
216 | return; | ||
217 | } | 214 | } |
218 | 215 | ||
219 | static int | 216 | static int |
@@ -246,7 +243,14 @@ wl_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
246 | static void | 243 | static void |
247 | wl_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | 244 | wl_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) |
248 | { | 245 | { |
249 | return; | 246 | struct wl_info *wl; |
247 | |||
248 | wl = HW_TO_WL(hw); | ||
249 | |||
250 | /* put driver in down state */ | ||
251 | WL_LOCK(wl); | ||
252 | wl_down(wl); | ||
253 | WL_UNLOCK(wl); | ||
250 | } | 254 | } |
251 | 255 | ||
252 | static int | 256 | static int |
@@ -779,7 +783,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs, | |||
779 | wl_found++; | 783 | wl_found++; |
780 | return wl; | 784 | return wl; |
781 | 785 | ||
782 | fail: | 786 | fail: |
783 | wl_free(wl); | 787 | wl_free(wl); |
784 | fail1: | 788 | fail1: |
785 | return NULL; | 789 | return NULL; |
@@ -1090,7 +1094,6 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1090 | return 0; | 1094 | return 0; |
1091 | } | 1095 | } |
1092 | 1096 | ||
1093 | #ifdef LINUXSTA_PS | ||
1094 | static int wl_suspend(struct pci_dev *pdev, pm_message_t state) | 1097 | static int wl_suspend(struct pci_dev *pdev, pm_message_t state) |
1095 | { | 1098 | { |
1096 | struct wl_info *wl; | 1099 | struct wl_info *wl; |
@@ -1105,11 +1108,12 @@ static int wl_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1105 | return -ENODEV; | 1108 | return -ENODEV; |
1106 | } | 1109 | } |
1107 | 1110 | ||
1111 | /* only need to flag hw is down for proper resume */ | ||
1108 | WL_LOCK(wl); | 1112 | WL_LOCK(wl); |
1109 | wl_down(wl); | ||
1110 | wl->pub->hw_up = false; | 1113 | wl->pub->hw_up = false; |
1111 | WL_UNLOCK(wl); | 1114 | WL_UNLOCK(wl); |
1112 | pci_save_state(pdev, wl->pci_psstate); | 1115 | |
1116 | pci_save_state(pdev); | ||
1113 | pci_disable_device(pdev); | 1117 | pci_disable_device(pdev); |
1114 | return pci_set_power_state(pdev, PCI_D3hot); | 1118 | return pci_set_power_state(pdev, PCI_D3hot); |
1115 | } | 1119 | } |
@@ -1133,7 +1137,7 @@ static int wl_resume(struct pci_dev *pdev) | |||
1133 | if (err) | 1137 | if (err) |
1134 | return err; | 1138 | return err; |
1135 | 1139 | ||
1136 | pci_restore_state(pdev, wl->pci_psstate); | 1140 | pci_restore_state(pdev); |
1137 | 1141 | ||
1138 | err = pci_enable_device(pdev); | 1142 | err = pci_enable_device(pdev); |
1139 | if (err) | 1143 | if (err) |
@@ -1145,13 +1149,12 @@ static int wl_resume(struct pci_dev *pdev) | |||
1145 | if ((val & 0x0000ff00) != 0) | 1149 | if ((val & 0x0000ff00) != 0) |
1146 | pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); | 1150 | pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); |
1147 | 1151 | ||
1148 | WL_LOCK(wl); | 1152 | /* |
1149 | err = wl_up(wl); | 1153 | * done. driver will be put in up state |
1150 | WL_UNLOCK(wl); | 1154 | * in wl_ops_add_interface() call. |
1151 | 1155 | */ | |
1152 | return err; | 1156 | return err; |
1153 | } | 1157 | } |
1154 | #endif /* LINUXSTA_PS */ | ||
1155 | 1158 | ||
1156 | static void wl_remove(struct pci_dev *pdev) | 1159 | static void wl_remove(struct pci_dev *pdev) |
1157 | { | 1160 | { |
@@ -1184,14 +1187,12 @@ static void wl_remove(struct pci_dev *pdev) | |||
1184 | } | 1187 | } |
1185 | 1188 | ||
1186 | static struct pci_driver wl_pci_driver = { | 1189 | static struct pci_driver wl_pci_driver = { |
1187 | .name = "brcm80211", | 1190 | .name = "brcm80211", |
1188 | .probe = wl_pci_probe, | 1191 | .probe = wl_pci_probe, |
1189 | #ifdef LINUXSTA_PS | 1192 | .suspend = wl_suspend, |
1190 | .suspend = wl_suspend, | 1193 | .resume = wl_resume, |
1191 | .resume = wl_resume, | 1194 | .remove = __devexit_p(wl_remove), |
1192 | #endif /* LINUXSTA_PS */ | 1195 | .id_table = wl_id_table, |
1193 | .remove = __devexit_p(wl_remove), | ||
1194 | .id_table = wl_id_table, | ||
1195 | }; | 1196 | }; |
1196 | 1197 | ||
1197 | /** | 1198 | /** |
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c index 1d5d01ac0a9b..a1303863686c 100644 --- a/drivers/staging/brcm80211/sys/wlc_mac80211.c +++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c | |||
@@ -5126,7 +5126,6 @@ wlc_sendpkt_mac80211(struct wlc_info *wlc, struct sk_buff *sdu, | |||
5126 | fifo = prio2fifo[prio]; | 5126 | fifo = prio2fifo[prio]; |
5127 | 5127 | ||
5128 | ASSERT((uint) skb_headroom(sdu) >= TXOFF); | 5128 | ASSERT((uint) skb_headroom(sdu) >= TXOFF); |
5129 | ASSERT(!(sdu->cloned)); | ||
5130 | ASSERT(!(sdu->next)); | 5129 | ASSERT(!(sdu->next)); |
5131 | ASSERT(!(sdu->prev)); | 5130 | ASSERT(!(sdu->prev)); |
5132 | ASSERT(fifo < NFIFO); | 5131 | ASSERT(fifo < NFIFO); |
diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index 4d1868d04bac..0728c3c0cb0e 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c | |||
@@ -575,7 +575,8 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, | |||
575 | /* grab our IRQ */ | 575 | /* grab our IRQ */ |
576 | if (irq) { | 576 | if (irq) { |
577 | isr_flags = 0; | 577 | isr_flags = 0; |
578 | if (thisboard->bustype == pci_bustype) | 578 | if (thisboard->bustype == pci_bustype |
579 | || thisboard->bustype == pcmcia_bustype) | ||
579 | isr_flags |= IRQF_SHARED; | 580 | isr_flags |= IRQF_SHARED; |
580 | if (request_irq(irq, labpc_interrupt, isr_flags, | 581 | if (request_irq(irq, labpc_interrupt, isr_flags, |
581 | driver_labpc.driver_name, dev)) { | 582 | driver_labpc.driver_name, dev)) { |
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index b3d05fcfe6d2..4fb809485d9e 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c | |||
@@ -368,6 +368,7 @@ static int blkvsc_probe(struct device *device) | |||
368 | blkdev->gd->first_minor = 0; | 368 | blkdev->gd->first_minor = 0; |
369 | blkdev->gd->fops = &block_ops; | 369 | blkdev->gd->fops = &block_ops; |
370 | blkdev->gd->private_data = blkdev; | 370 | blkdev->gd->private_data = blkdev; |
371 | blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device); | ||
371 | sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum); | 372 | sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum); |
372 | 373 | ||
373 | blkvsc_do_inquiry(blkdev); | 374 | blkvsc_do_inquiry(blkdev); |
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c index df9cd131e953..0edbe7483a4c 100644 --- a/drivers/staging/hv/netvsc.c +++ b/drivers/staging/hv/netvsc.c | |||
@@ -1279,7 +1279,7 @@ static void netvsc_channel_cb(void *context) | |||
1279 | /* ASSERT(device); */ | 1279 | /* ASSERT(device); */ |
1280 | 1280 | ||
1281 | packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char), | 1281 | packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char), |
1282 | GFP_KERNEL); | 1282 | GFP_ATOMIC); |
1283 | if (!packet) | 1283 | if (!packet) |
1284 | return; | 1284 | return; |
1285 | buffer = packet; | 1285 | buffer = packet; |
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index 0147b407512c..54706a16dc0a 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c | |||
@@ -358,7 +358,6 @@ static int netvsc_probe(struct device *device) | |||
358 | 358 | ||
359 | /* Set initial state */ | 359 | /* Set initial state */ |
360 | netif_carrier_off(net); | 360 | netif_carrier_off(net); |
361 | netif_stop_queue(net); | ||
362 | 361 | ||
363 | net_device_ctx = netdev_priv(net); | 362 | net_device_ctx = netdev_priv(net); |
364 | net_device_ctx->device_ctx = device_ctx; | 363 | net_device_ctx->device_ctx = device_ctx; |
diff --git a/drivers/staging/iio/adc/ad7476_core.c b/drivers/staging/iio/adc/ad7476_core.c index deb68c8a6e18..b8b54da67c63 100644 --- a/drivers/staging/iio/adc/ad7476_core.c +++ b/drivers/staging/iio/adc/ad7476_core.c | |||
@@ -68,7 +68,7 @@ static ssize_t ad7476_show_scale(struct device *dev, | |||
68 | /* Corresponds to Vref / 2^(bits) */ | 68 | /* Corresponds to Vref / 2^(bits) */ |
69 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; | 69 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; |
70 | 70 | ||
71 | return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); | 71 | return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); |
72 | } | 72 | } |
73 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0); | 73 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0); |
74 | 74 | ||
diff --git a/drivers/staging/iio/adc/ad7887_core.c b/drivers/staging/iio/adc/ad7887_core.c index 685908995d49..5d85efab658c 100644 --- a/drivers/staging/iio/adc/ad7887_core.c +++ b/drivers/staging/iio/adc/ad7887_core.c | |||
@@ -68,7 +68,7 @@ static ssize_t ad7887_show_scale(struct device *dev, | |||
68 | /* Corresponds to Vref / 2^(bits) */ | 68 | /* Corresponds to Vref / 2^(bits) */ |
69 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; | 69 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; |
70 | 70 | ||
71 | return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); | 71 | return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); |
72 | } | 72 | } |
73 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7887_show_scale, NULL, 0); | 73 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7887_show_scale, NULL, 0); |
74 | 74 | ||
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c index 6309d521a864..89ccf375a188 100644 --- a/drivers/staging/iio/adc/ad799x_core.c +++ b/drivers/staging/iio/adc/ad799x_core.c | |||
@@ -432,7 +432,7 @@ static ssize_t ad799x_show_scale(struct device *dev, | |||
432 | /* Corresponds to Vref / 2^(bits) */ | 432 | /* Corresponds to Vref / 2^(bits) */ |
433 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; | 433 | unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; |
434 | 434 | ||
435 | return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); | 435 | return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); |
436 | } | 436 | } |
437 | 437 | ||
438 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad799x_show_scale, NULL, 0); | 438 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad799x_show_scale, NULL, 0); |
diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c index e3387cd31145..0f87ecac82fc 100644 --- a/drivers/staging/iio/dac/ad5446.c +++ b/drivers/staging/iio/dac/ad5446.c | |||
@@ -87,7 +87,7 @@ static ssize_t ad5446_show_scale(struct device *dev, | |||
87 | /* Corresponds to Vref / 2^(bits) */ | 87 | /* Corresponds to Vref / 2^(bits) */ |
88 | unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; | 88 | unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; |
89 | 89 | ||
90 | return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); | 90 | return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); |
91 | } | 91 | } |
92 | static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0); | 92 | static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0); |
93 | 93 | ||
diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 701561d6b6fd..236dd36d349a 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c | |||
@@ -484,8 +484,6 @@ struct net_device *RtmpPhyNetDevInit(struct rt_rtmp_adapter *pAd, | |||
484 | net_dev->ml_priv = (void *)pAd; | 484 | net_dev->ml_priv = (void *)pAd; |
485 | pAd->net_dev = net_dev; | 485 | pAd->net_dev = net_dev; |
486 | 486 | ||
487 | netif_stop_queue(net_dev); | ||
488 | |||
489 | return net_dev; | 487 | return net_dev; |
490 | 488 | ||
491 | } | 489 | } |
diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c index ee68d51caa4e..322bf49ee906 100644 --- a/drivers/staging/rt2860/usb_main_dev.c +++ b/drivers/staging/rt2860/usb_main_dev.c | |||
@@ -106,6 +106,7 @@ struct usb_device_id rtusb_usb_id[] = { | |||
106 | {USB_DEVICE(0x0411, 0x016f)}, /* MelCo.,Inc. WLI-UC-G301N */ | 106 | {USB_DEVICE(0x0411, 0x016f)}, /* MelCo.,Inc. WLI-UC-G301N */ |
107 | {USB_DEVICE(0x1737, 0x0070)}, /* Linksys WUSB100 */ | 107 | {USB_DEVICE(0x1737, 0x0070)}, /* Linksys WUSB100 */ |
108 | {USB_DEVICE(0x1737, 0x0071)}, /* Linksys WUSB600N */ | 108 | {USB_DEVICE(0x1737, 0x0071)}, /* Linksys WUSB600N */ |
109 | {USB_DEVICE(0x1737, 0x0078)}, /* Linksys WUSB100v2 */ | ||
109 | {USB_DEVICE(0x0411, 0x00e8)}, /* Buffalo WLI-UC-G300N */ | 110 | {USB_DEVICE(0x0411, 0x00e8)}, /* Buffalo WLI-UC-G300N */ |
110 | {USB_DEVICE(0x050d, 0x815c)}, /* Belkin F5D8053 */ | 111 | {USB_DEVICE(0x050d, 0x815c)}, /* Belkin F5D8053 */ |
111 | {USB_DEVICE(0x100D, 0x9031)}, /* Motorola 2770 */ | 112 | {USB_DEVICE(0x100D, 0x9031)}, /* Motorola 2770 */ |
diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl8712/hal_init.c index 32088a641eba..84be383abec3 100644 --- a/drivers/staging/rtl8712/hal_init.c +++ b/drivers/staging/rtl8712/hal_init.c | |||
@@ -128,12 +128,13 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) | |||
128 | u8 *ptmpchar = NULL, *ppayload, *ptr; | 128 | u8 *ptmpchar = NULL, *ppayload, *ptr; |
129 | struct tx_desc *ptx_desc; | 129 | struct tx_desc *ptx_desc; |
130 | u32 txdscp_sz = sizeof(struct tx_desc); | 130 | u32 txdscp_sz = sizeof(struct tx_desc); |
131 | u8 ret = _FAIL; | ||
131 | 132 | ||
132 | ulfilelength = rtl871x_open_fw(padapter, &phfwfile_hdl, &pmappedfw); | 133 | ulfilelength = rtl871x_open_fw(padapter, &phfwfile_hdl, &pmappedfw); |
133 | if (pmappedfw && (ulfilelength > 0)) { | 134 | if (pmappedfw && (ulfilelength > 0)) { |
134 | update_fwhdr(&fwhdr, pmappedfw); | 135 | update_fwhdr(&fwhdr, pmappedfw); |
135 | if (chk_fwhdr(&fwhdr, ulfilelength) == _FAIL) | 136 | if (chk_fwhdr(&fwhdr, ulfilelength) == _FAIL) |
136 | goto exit_fail; | 137 | goto firmware_rel; |
137 | fill_fwpriv(padapter, &fwhdr.fwpriv); | 138 | fill_fwpriv(padapter, &fwhdr.fwpriv); |
138 | /* firmware check ok */ | 139 | /* firmware check ok */ |
139 | maxlen = (fwhdr.img_IMEM_size > fwhdr.img_SRAM_size) ? | 140 | maxlen = (fwhdr.img_IMEM_size > fwhdr.img_SRAM_size) ? |
@@ -141,7 +142,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) | |||
141 | maxlen += txdscp_sz; | 142 | maxlen += txdscp_sz; |
142 | ptmpchar = _malloc(maxlen + FWBUFF_ALIGN_SZ); | 143 | ptmpchar = _malloc(maxlen + FWBUFF_ALIGN_SZ); |
143 | if (ptmpchar == NULL) | 144 | if (ptmpchar == NULL) |
144 | return _FAIL; | 145 | goto firmware_rel; |
145 | 146 | ||
146 | ptx_desc = (struct tx_desc *)(ptmpchar + FWBUFF_ALIGN_SZ - | 147 | ptx_desc = (struct tx_desc *)(ptmpchar + FWBUFF_ALIGN_SZ - |
147 | ((addr_t)(ptmpchar) & (FWBUFF_ALIGN_SZ - 1))); | 148 | ((addr_t)(ptmpchar) & (FWBUFF_ALIGN_SZ - 1))); |
@@ -273,11 +274,13 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) | |||
273 | goto exit_fail; | 274 | goto exit_fail; |
274 | } else | 275 | } else |
275 | goto exit_fail; | 276 | goto exit_fail; |
276 | return _SUCCESS; | 277 | ret = _SUCCESS; |
277 | 278 | ||
278 | exit_fail: | 279 | exit_fail: |
279 | kfree(ptmpchar); | 280 | kfree(ptmpchar); |
280 | return _FAIL; | 281 | firmware_rel: |
282 | release_firmware((struct firmware *)phfwfile_hdl); | ||
283 | return ret; | ||
281 | } | 284 | } |
282 | 285 | ||
283 | uint rtl8712_hal_init(struct _adapter *padapter) | 286 | uint rtl8712_hal_init(struct _adapter *padapter) |
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index a692ee88b9e9..21ce2af447b5 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c | |||
@@ -47,54 +47,123 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, | |||
47 | static void r871xu_dev_remove(struct usb_interface *pusb_intf); | 47 | static void r871xu_dev_remove(struct usb_interface *pusb_intf); |
48 | 48 | ||
49 | static struct usb_device_id rtl871x_usb_id_tbl[] = { | 49 | static struct usb_device_id rtl871x_usb_id_tbl[] = { |
50 | /*92SU | 50 | |
51 | * Realtek */ | 51 | /* RTL8188SU */ |
52 | {USB_DEVICE(0x0bda, 0x8171)}, | 52 | /* Realtek */ |
53 | {USB_DEVICE(0x0bda, 0x8172)}, | 53 | {USB_DEVICE(0x0BDA, 0x8171)}, |
54 | {USB_DEVICE(0x0bda, 0x8173)}, | 54 | {USB_DEVICE(0x0bda, 0x8173)}, |
55 | {USB_DEVICE(0x0bda, 0x8174)}, | ||
56 | {USB_DEVICE(0x0bda, 0x8712)}, | 55 | {USB_DEVICE(0x0bda, 0x8712)}, |
57 | {USB_DEVICE(0x0bda, 0x8713)}, | 56 | {USB_DEVICE(0x0bda, 0x8713)}, |
58 | {USB_DEVICE(0x0bda, 0xC512)}, | 57 | {USB_DEVICE(0x0bda, 0xC512)}, |
59 | /* Abocom */ | 58 | /* Abocom */ |
60 | {USB_DEVICE(0x07B8, 0x8188)}, | 59 | {USB_DEVICE(0x07B8, 0x8188)}, |
60 | /* ASUS */ | ||
61 | {USB_DEVICE(0x0B05, 0x1786)}, | ||
62 | {USB_DEVICE(0x0B05, 0x1791)}, /* 11n mode disable */ | ||
63 | /* Belkin */ | ||
64 | {USB_DEVICE(0x050D, 0x945A)}, | ||
61 | /* Corega */ | 65 | /* Corega */ |
62 | {USB_DEVICE(0x07aa, 0x0047)}, | 66 | {USB_DEVICE(0x07AA, 0x0047)}, |
63 | /* Dlink */ | 67 | /* D-Link */ |
64 | {USB_DEVICE(0x07d1, 0x3303)}, | 68 | {USB_DEVICE(0x2001, 0x3306)}, |
65 | {USB_DEVICE(0x07d1, 0x3302)}, | 69 | {USB_DEVICE(0x07D1, 0x3306)}, /* 11n mode disable */ |
66 | {USB_DEVICE(0x07d1, 0x3300)}, | 70 | /* Edimax */ |
67 | /* Dlink for Skyworth */ | 71 | {USB_DEVICE(0x7392, 0x7611)}, |
68 | {USB_DEVICE(0x14b2, 0x3300)}, | ||
69 | {USB_DEVICE(0x14b2, 0x3301)}, | ||
70 | {USB_DEVICE(0x14b2, 0x3302)}, | ||
71 | /* EnGenius */ | 72 | /* EnGenius */ |
72 | {USB_DEVICE(0x1740, 0x9603)}, | 73 | {USB_DEVICE(0x1740, 0x9603)}, |
73 | {USB_DEVICE(0x1740, 0x9605)}, | 74 | /* Hawking */ |
75 | {USB_DEVICE(0x0E66, 0x0016)}, | ||
76 | /* Hercules */ | ||
77 | {USB_DEVICE(0x06F8, 0xE034)}, | ||
78 | {USB_DEVICE(0x06F8, 0xE032)}, | ||
79 | /* Logitec */ | ||
80 | {USB_DEVICE(0x0789, 0x0167)}, | ||
81 | /* PCI */ | ||
82 | {USB_DEVICE(0x2019, 0xAB28)}, | ||
83 | {USB_DEVICE(0x2019, 0xED16)}, | ||
84 | /* Sitecom */ | ||
85 | {USB_DEVICE(0x0DF6, 0x0057)}, | ||
86 | {USB_DEVICE(0x0DF6, 0x0045)}, | ||
87 | {USB_DEVICE(0x0DF6, 0x0059)}, /* 11n mode disable */ | ||
88 | {USB_DEVICE(0x0DF6, 0x004B)}, | ||
89 | {USB_DEVICE(0x0DF6, 0x0063)}, | ||
90 | /* Sweex */ | ||
91 | {USB_DEVICE(0x177F, 0x0154)}, | ||
92 | /* Thinkware */ | ||
93 | {USB_DEVICE(0x0BDA, 0x5077)}, | ||
94 | /* Toshiba */ | ||
95 | {USB_DEVICE(0x1690, 0x0752)}, | ||
96 | /* - */ | ||
97 | {USB_DEVICE(0x20F4, 0x646B)}, | ||
98 | {USB_DEVICE(0x083A, 0xC512)}, | ||
99 | |||
100 | /* RTL8191SU */ | ||
101 | /* Realtek */ | ||
102 | {USB_DEVICE(0x0BDA, 0x8172)}, | ||
103 | /* Amigo */ | ||
104 | {USB_DEVICE(0x0EB0, 0x9061)}, | ||
105 | /* ASUS/EKB */ | ||
106 | {USB_DEVICE(0x0BDA, 0x8172)}, | ||
107 | {USB_DEVICE(0x13D3, 0x3323)}, | ||
108 | {USB_DEVICE(0x13D3, 0x3311)}, /* 11n mode disable */ | ||
109 | {USB_DEVICE(0x13D3, 0x3342)}, | ||
110 | /* ASUS/EKBLenovo */ | ||
111 | {USB_DEVICE(0x13D3, 0x3333)}, | ||
112 | {USB_DEVICE(0x13D3, 0x3334)}, | ||
113 | {USB_DEVICE(0x13D3, 0x3335)}, /* 11n mode disable */ | ||
114 | {USB_DEVICE(0x13D3, 0x3336)}, /* 11n mode disable */ | ||
115 | /* ASUS/Media BOX */ | ||
116 | {USB_DEVICE(0x13D3, 0x3309)}, | ||
74 | /* Belkin */ | 117 | /* Belkin */ |
75 | {USB_DEVICE(0x050d, 0x815F)}, | 118 | {USB_DEVICE(0x050D, 0x815F)}, |
76 | {USB_DEVICE(0x050d, 0x945A)}, | 119 | /* D-Link */ |
77 | {USB_DEVICE(0x050d, 0x845A)}, | 120 | {USB_DEVICE(0x07D1, 0x3302)}, |
78 | /* Guillemot */ | 121 | {USB_DEVICE(0x07D1, 0x3300)}, |
79 | {USB_DEVICE(0x06f8, 0xe031)}, | 122 | {USB_DEVICE(0x07D1, 0x3303)}, |
80 | /* Edimax */ | 123 | /* Edimax */ |
81 | {USB_DEVICE(0x7392, 0x7611)}, | ||
82 | {USB_DEVICE(0x7392, 0x7612)}, | 124 | {USB_DEVICE(0x7392, 0x7612)}, |
83 | {USB_DEVICE(0x7392, 0x7622)}, | 125 | /* EnGenius */ |
84 | /* Sitecom */ | 126 | {USB_DEVICE(0x1740, 0x9605)}, |
85 | {USB_DEVICE(0x0DF6, 0x0045)}, | 127 | /* Guillemot */ |
128 | {USB_DEVICE(0x06F8, 0xE031)}, | ||
86 | /* Hawking */ | 129 | /* Hawking */ |
87 | {USB_DEVICE(0x0E66, 0x0015)}, | 130 | {USB_DEVICE(0x0E66, 0x0015)}, |
88 | {USB_DEVICE(0x0E66, 0x0016)}, | 131 | /* Mediao */ |
89 | {USB_DEVICE(0x0b05, 0x1786)}, | ||
90 | {USB_DEVICE(0x0b05, 0x1791)}, /* 11n mode disable */ | ||
91 | |||
92 | {USB_DEVICE(0x13D3, 0x3306)}, | 132 | {USB_DEVICE(0x13D3, 0x3306)}, |
93 | {USB_DEVICE(0x13D3, 0x3309)}, | 133 | /* PCI */ |
134 | {USB_DEVICE(0x2019, 0xED18)}, | ||
135 | {USB_DEVICE(0x2019, 0x4901)}, | ||
136 | /* Sitecom */ | ||
137 | {USB_DEVICE(0x0DF6, 0x0058)}, | ||
138 | {USB_DEVICE(0x0DF6, 0x0049)}, | ||
139 | {USB_DEVICE(0x0DF6, 0x004C)}, | ||
140 | {USB_DEVICE(0x0DF6, 0x0064)}, | ||
141 | /* Skyworth */ | ||
142 | {USB_DEVICE(0x14b2, 0x3300)}, | ||
143 | {USB_DEVICE(0x14b2, 0x3301)}, | ||
144 | {USB_DEVICE(0x14B2, 0x3302)}, | ||
145 | /* - */ | ||
146 | {USB_DEVICE(0x04F2, 0xAFF2)}, | ||
147 | {USB_DEVICE(0x04F2, 0xAFF5)}, | ||
148 | {USB_DEVICE(0x04F2, 0xAFF6)}, | ||
149 | {USB_DEVICE(0x13D3, 0x3339)}, | ||
150 | {USB_DEVICE(0x13D3, 0x3340)}, /* 11n mode disable */ | ||
151 | {USB_DEVICE(0x13D3, 0x3341)}, /* 11n mode disable */ | ||
94 | {USB_DEVICE(0x13D3, 0x3310)}, | 152 | {USB_DEVICE(0x13D3, 0x3310)}, |
95 | {USB_DEVICE(0x13D3, 0x3311)}, /* 11n mode disable */ | ||
96 | {USB_DEVICE(0x13D3, 0x3325)}, | 153 | {USB_DEVICE(0x13D3, 0x3325)}, |
97 | {USB_DEVICE(0x083A, 0xC512)}, | 154 | |
155 | /* RTL8192SU */ | ||
156 | /* Realtek */ | ||
157 | {USB_DEVICE(0x0BDA, 0x8174)}, | ||
158 | {USB_DEVICE(0x0BDA, 0x8174)}, | ||
159 | /* Belkin */ | ||
160 | {USB_DEVICE(0x050D, 0x845A)}, | ||
161 | /* Corega */ | ||
162 | {USB_DEVICE(0x07AA, 0x0051)}, | ||
163 | /* Edimax */ | ||
164 | {USB_DEVICE(0x7392, 0x7622)}, | ||
165 | /* NEC */ | ||
166 | {USB_DEVICE(0x0409, 0x02B6)}, | ||
98 | {} | 167 | {} |
99 | }; | 168 | }; |
100 | 169 | ||
@@ -103,8 +172,20 @@ MODULE_DEVICE_TABLE(usb, rtl871x_usb_id_tbl); | |||
103 | static struct specific_device_id specific_device_id_tbl[] = { | 172 | static struct specific_device_id specific_device_id_tbl[] = { |
104 | {.idVendor = 0x0b05, .idProduct = 0x1791, | 173 | {.idVendor = 0x0b05, .idProduct = 0x1791, |
105 | .flags = SPEC_DEV_ID_DISABLE_HT}, | 174 | .flags = SPEC_DEV_ID_DISABLE_HT}, |
175 | {.idVendor = 0x0df6, .idProduct = 0x0059, | ||
176 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
177 | {.idVendor = 0x13d3, .idProduct = 0x3306, | ||
178 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
106 | {.idVendor = 0x13D3, .idProduct = 0x3311, | 179 | {.idVendor = 0x13D3, .idProduct = 0x3311, |
107 | .flags = SPEC_DEV_ID_DISABLE_HT}, | 180 | .flags = SPEC_DEV_ID_DISABLE_HT}, |
181 | {.idVendor = 0x13d3, .idProduct = 0x3335, | ||
182 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
183 | {.idVendor = 0x13d3, .idProduct = 0x3336, | ||
184 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
185 | {.idVendor = 0x13d3, .idProduct = 0x3340, | ||
186 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
187 | {.idVendor = 0x13d3, .idProduct = 0x3341, | ||
188 | .flags = SPEC_DEV_ID_DISABLE_HT}, | ||
108 | {} | 189 | {} |
109 | }; | 190 | }; |
110 | 191 | ||
diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 408bb9b3303e..07a7f5432597 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c | |||
@@ -332,7 +332,7 @@ static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr, | |||
332 | unsigned long flags; | 332 | unsigned long flags; |
333 | 333 | ||
334 | len = strlen(buf); | 334 | len = strlen(buf); |
335 | if (len > 0 || len < 3) { | 335 | if (len > 0 && len < 3) { |
336 | ch = buf[0]; | 336 | ch = buf[0]; |
337 | if (ch == '\n') | 337 | if (ch == '\n') |
338 | ch = '0'; | 338 | ch = '0'; |
diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c index e8f047e86a32..80183a7e6624 100644 --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | |||
@@ -986,12 +986,6 @@ static int __devinit synaptics_rmi4_probe | |||
986 | input_set_abs_params(rmi4_data->input_dev, ABS_MT_TOUCH_MAJOR, 0, | 986 | input_set_abs_params(rmi4_data->input_dev, ABS_MT_TOUCH_MAJOR, 0, |
987 | MAX_TOUCH_MAJOR, 0, 0); | 987 | MAX_TOUCH_MAJOR, 0, 0); |
988 | 988 | ||
989 | retval = input_register_device(rmi4_data->input_dev); | ||
990 | if (retval) { | ||
991 | dev_err(&client->dev, "%s:input register failed\n", __func__); | ||
992 | goto err_input_register; | ||
993 | } | ||
994 | |||
995 | /* Clear interrupts */ | 989 | /* Clear interrupts */ |
996 | synaptics_rmi4_i2c_block_read(rmi4_data, | 990 | synaptics_rmi4_i2c_block_read(rmi4_data, |
997 | rmi4_data->fn01_data_base_addr + 1, intr_status, | 991 | rmi4_data->fn01_data_base_addr + 1, intr_status, |
@@ -1003,15 +997,20 @@ static int __devinit synaptics_rmi4_probe | |||
1003 | if (retval) { | 997 | if (retval) { |
1004 | dev_err(&client->dev, "%s:Unable to get attn irq %d\n", | 998 | dev_err(&client->dev, "%s:Unable to get attn irq %d\n", |
1005 | __func__, platformdata->irq_number); | 999 | __func__, platformdata->irq_number); |
1006 | goto err_request_irq; | 1000 | goto err_unset_clientdata; |
1001 | } | ||
1002 | |||
1003 | retval = input_register_device(rmi4_data->input_dev); | ||
1004 | if (retval) { | ||
1005 | dev_err(&client->dev, "%s:input register failed\n", __func__); | ||
1006 | goto err_free_irq; | ||
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | return retval; | 1009 | return retval; |
1010 | 1010 | ||
1011 | err_request_irq: | 1011 | err_free_irq: |
1012 | free_irq(platformdata->irq_number, rmi4_data); | 1012 | free_irq(platformdata->irq_number, rmi4_data); |
1013 | input_unregister_device(rmi4_data->input_dev); | 1013 | err_unset_clientdata: |
1014 | err_input_register: | ||
1015 | i2c_set_clientdata(client, NULL); | 1014 | i2c_set_clientdata(client, NULL); |
1016 | err_query_dev: | 1015 | err_query_dev: |
1017 | if (platformdata->regulator_en) { | 1016 | if (platformdata->regulator_en) { |
diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 571864555ddd..27e0aa81a584 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c | |||
@@ -949,7 +949,7 @@ func_end: | |||
949 | * Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then | 949 | * Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then |
950 | * schedules a DPC to dispatch I/O. | 950 | * schedules a DPC to dispatch I/O. |
951 | */ | 951 | */ |
952 | void io_mbox_msg(u32 msg) | 952 | int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg) |
953 | { | 953 | { |
954 | struct io_mgr *pio_mgr; | 954 | struct io_mgr *pio_mgr; |
955 | struct dev_object *dev_obj; | 955 | struct dev_object *dev_obj; |
@@ -959,9 +959,9 @@ void io_mbox_msg(u32 msg) | |||
959 | dev_get_io_mgr(dev_obj, &pio_mgr); | 959 | dev_get_io_mgr(dev_obj, &pio_mgr); |
960 | 960 | ||
961 | if (!pio_mgr) | 961 | if (!pio_mgr) |
962 | return; | 962 | return NOTIFY_BAD; |
963 | 963 | ||
964 | pio_mgr->intr_val = (u16)msg; | 964 | pio_mgr->intr_val = (u16)((u32)msg); |
965 | if (pio_mgr->intr_val & MBX_PM_CLASS) | 965 | if (pio_mgr->intr_val & MBX_PM_CLASS) |
966 | io_dispatch_pm(pio_mgr); | 966 | io_dispatch_pm(pio_mgr); |
967 | 967 | ||
@@ -973,7 +973,7 @@ void io_mbox_msg(u32 msg) | |||
973 | spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags); | 973 | spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags); |
974 | tasklet_schedule(&pio_mgr->dpc_tasklet); | 974 | tasklet_schedule(&pio_mgr->dpc_tasklet); |
975 | } | 975 | } |
976 | return; | 976 | return NOTIFY_OK; |
977 | } | 977 | } |
978 | 978 | ||
979 | /* | 979 | /* |
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index a3b0a183d570..a3f69f6f505f 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c | |||
@@ -223,6 +223,10 @@ static struct bridge_drv_interface drv_interface_fxns = { | |||
223 | bridge_msg_set_queue_id, | 223 | bridge_msg_set_queue_id, |
224 | }; | 224 | }; |
225 | 225 | ||
226 | static struct notifier_block dsp_mbox_notifier = { | ||
227 | .notifier_call = io_mbox_msg, | ||
228 | }; | ||
229 | |||
226 | static inline void flush_all(struct bridge_dev_context *dev_context) | 230 | static inline void flush_all(struct bridge_dev_context *dev_context) |
227 | { | 231 | { |
228 | if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || | 232 | if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || |
@@ -553,7 +557,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, | |||
553 | * Enable Mailbox events and also drain any pending | 557 | * Enable Mailbox events and also drain any pending |
554 | * stale messages. | 558 | * stale messages. |
555 | */ | 559 | */ |
556 | dev_context->mbox = omap_mbox_get("dsp"); | 560 | dev_context->mbox = omap_mbox_get("dsp", &dsp_mbox_notifier); |
557 | if (IS_ERR(dev_context->mbox)) { | 561 | if (IS_ERR(dev_context->mbox)) { |
558 | dev_context->mbox = NULL; | 562 | dev_context->mbox = NULL; |
559 | pr_err("%s: Failed to get dsp mailbox handle\n", | 563 | pr_err("%s: Failed to get dsp mailbox handle\n", |
@@ -563,8 +567,6 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, | |||
563 | 567 | ||
564 | } | 568 | } |
565 | if (!status) { | 569 | if (!status) { |
566 | dev_context->mbox->rxq->callback = (int (*)(void *))io_mbox_msg; | ||
567 | |||
568 | /*PM_IVA2GRPSEL_PER = 0xC0;*/ | 570 | /*PM_IVA2GRPSEL_PER = 0xC0;*/ |
569 | temp = readl(resources->dw_per_pm_base + 0xA8); | 571 | temp = readl(resources->dw_per_pm_base + 0xA8); |
570 | temp = (temp & 0xFFFFFF30) | 0xC0; | 572 | temp = (temp & 0xFFFFFF30) | 0xC0; |
@@ -685,7 +687,7 @@ static int bridge_brd_stop(struct bridge_dev_context *dev_ctxt) | |||
685 | /* Disable the mailbox interrupts */ | 687 | /* Disable the mailbox interrupts */ |
686 | if (dev_context->mbox) { | 688 | if (dev_context->mbox) { |
687 | omap_mbox_disable_irq(dev_context->mbox, IRQ_RX); | 689 | omap_mbox_disable_irq(dev_context->mbox, IRQ_RX); |
688 | omap_mbox_put(dev_context->mbox); | 690 | omap_mbox_put(dev_context->mbox, &dsp_mbox_notifier); |
689 | dev_context->mbox = NULL; | 691 | dev_context->mbox = NULL; |
690 | } | 692 | } |
691 | /* Reset IVA2 clocks*/ | 693 | /* Reset IVA2 clocks*/ |
@@ -786,10 +788,7 @@ static int bridge_dev_create(struct bridge_dev_context | |||
786 | 788 | ||
787 | pt_attrs = kzalloc(sizeof(struct pg_table_attrs), GFP_KERNEL); | 789 | pt_attrs = kzalloc(sizeof(struct pg_table_attrs), GFP_KERNEL); |
788 | if (pt_attrs != NULL) { | 790 | if (pt_attrs != NULL) { |
789 | /* Assuming that we use only DSP's memory map | 791 | pt_attrs->l1_size = SZ_16K; /* 4096 entries of 32 bits */ |
790 | * until 0x4000:0000 , we would need only 1024 | ||
791 | * L1 enties i.e L1 size = 4K */ | ||
792 | pt_attrs->l1_size = 0x1000; | ||
793 | align_size = pt_attrs->l1_size; | 792 | align_size = pt_attrs->l1_size; |
794 | /* Align sizes are expected to be power of 2 */ | 793 | /* Align sizes are expected to be power of 2 */ |
795 | /* we like to get aligned on L1 table size */ | 794 | /* we like to get aligned on L1 table size */ |
diff --git a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h index 18aec55d8647..8242c70e09dd 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h | |||
@@ -72,22 +72,17 @@ extern void io_dpc(unsigned long ref_data); | |||
72 | /* | 72 | /* |
73 | * ======== io_mbox_msg ======== | 73 | * ======== io_mbox_msg ======== |
74 | * Purpose: | 74 | * Purpose: |
75 | * Main interrupt handler for the shared memory Bridge channel manager. | 75 | * Main message handler for the shared memory Bridge channel manager. |
76 | * Calls the Bridge's chnlsm_isr to determine if this interrupt is ours, | 76 | * Determine if this message is ours, then schedules a DPC to |
77 | * then schedules a DPC to dispatch I/O. | 77 | * dispatch I/O. |
78 | * Parameters: | 78 | * Parameters: |
79 | * ref_data: Pointer to the channel manager object for this board. | 79 | * self: Pointer to its own notifier_block struct. |
80 | * Set in an initial call to ISR_Install(). | 80 | * len: Length of message. |
81 | * msg: Message code received. | ||
81 | * Returns: | 82 | * Returns: |
82 | * TRUE if interrupt handled; FALSE otherwise. | 83 | * NOTIFY_OK if handled; NOTIFY_BAD otherwise. |
83 | * Requires: | ||
84 | * Must be in locked memory if executing in kernel mode. | ||
85 | * Must only call functions which are in locked memory if Kernel mode. | ||
86 | * Must only call asynchronous services. | ||
87 | * Interrupts are disabled and EOI for this interrupt has been sent. | ||
88 | * Ensures: | ||
89 | */ | 84 | */ |
90 | void io_mbox_msg(u32 msg); | 85 | int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg); |
91 | 86 | ||
92 | /* | 87 | /* |
93 | * ======== io_request_chnl ======== | 88 | * ======== io_request_chnl ======== |
diff --git a/drivers/staging/usbip/stub.h b/drivers/staging/usbip/stub.h index 30dbfb6d16f2..d73267961ef4 100644 --- a/drivers/staging/usbip/stub.h +++ b/drivers/staging/usbip/stub.h | |||
@@ -32,6 +32,7 @@ | |||
32 | 32 | ||
33 | struct stub_device { | 33 | struct stub_device { |
34 | struct usb_interface *interface; | 34 | struct usb_interface *interface; |
35 | struct usb_device *udev; | ||
35 | struct list_head list; | 36 | struct list_head list; |
36 | 37 | ||
37 | struct usbip_device ud; | 38 | struct usbip_device ud; |
diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index b186b5fed2b9..a7ce51cc8909 100644 --- a/drivers/staging/usbip/stub_dev.c +++ b/drivers/staging/usbip/stub_dev.c | |||
@@ -258,10 +258,11 @@ static void stub_shutdown_connection(struct usbip_device *ud) | |||
258 | static void stub_device_reset(struct usbip_device *ud) | 258 | static void stub_device_reset(struct usbip_device *ud) |
259 | { | 259 | { |
260 | struct stub_device *sdev = container_of(ud, struct stub_device, ud); | 260 | struct stub_device *sdev = container_of(ud, struct stub_device, ud); |
261 | struct usb_device *udev = interface_to_usbdev(sdev->interface); | 261 | struct usb_device *udev = sdev->udev; |
262 | int ret; | 262 | int ret; |
263 | 263 | ||
264 | usbip_udbg("device reset"); | 264 | usbip_udbg("device reset"); |
265 | |||
265 | ret = usb_lock_device_for_reset(udev, sdev->interface); | 266 | ret = usb_lock_device_for_reset(udev, sdev->interface); |
266 | if (ret < 0) { | 267 | if (ret < 0) { |
267 | dev_err(&udev->dev, "lock for reset\n"); | 268 | dev_err(&udev->dev, "lock for reset\n"); |
@@ -309,7 +310,8 @@ static void stub_device_unusable(struct usbip_device *ud) | |||
309 | * | 310 | * |
310 | * Allocates and initializes a new stub_device struct. | 311 | * Allocates and initializes a new stub_device struct. |
311 | */ | 312 | */ |
312 | static struct stub_device *stub_device_alloc(struct usb_interface *interface) | 313 | static struct stub_device *stub_device_alloc(struct usb_device *udev, |
314 | struct usb_interface *interface) | ||
313 | { | 315 | { |
314 | struct stub_device *sdev; | 316 | struct stub_device *sdev; |
315 | int busnum = interface_to_busnum(interface); | 317 | int busnum = interface_to_busnum(interface); |
@@ -324,7 +326,8 @@ static struct stub_device *stub_device_alloc(struct usb_interface *interface) | |||
324 | return NULL; | 326 | return NULL; |
325 | } | 327 | } |
326 | 328 | ||
327 | sdev->interface = interface; | 329 | sdev->interface = usb_get_intf(interface); |
330 | sdev->udev = usb_get_dev(udev); | ||
328 | 331 | ||
329 | /* | 332 | /* |
330 | * devid is defined with devnum when this driver is first allocated. | 333 | * devid is defined with devnum when this driver is first allocated. |
@@ -450,11 +453,12 @@ static int stub_probe(struct usb_interface *interface, | |||
450 | return err; | 453 | return err; |
451 | } | 454 | } |
452 | 455 | ||
456 | usb_get_intf(interface); | ||
453 | return 0; | 457 | return 0; |
454 | } | 458 | } |
455 | 459 | ||
456 | /* ok. this is my device. */ | 460 | /* ok. this is my device. */ |
457 | sdev = stub_device_alloc(interface); | 461 | sdev = stub_device_alloc(udev, interface); |
458 | if (!sdev) | 462 | if (!sdev) |
459 | return -ENOMEM; | 463 | return -ENOMEM; |
460 | 464 | ||
@@ -476,6 +480,8 @@ static int stub_probe(struct usb_interface *interface, | |||
476 | dev_err(&interface->dev, "create sysfs files for %s\n", | 480 | dev_err(&interface->dev, "create sysfs files for %s\n", |
477 | udev_busid); | 481 | udev_busid); |
478 | usb_set_intfdata(interface, NULL); | 482 | usb_set_intfdata(interface, NULL); |
483 | usb_put_intf(interface); | ||
484 | |||
479 | busid_priv->interf_count = 0; | 485 | busid_priv->interf_count = 0; |
480 | 486 | ||
481 | busid_priv->sdev = NULL; | 487 | busid_priv->sdev = NULL; |
@@ -545,6 +551,7 @@ static void stub_disconnect(struct usb_interface *interface) | |||
545 | if (busid_priv->interf_count > 1) { | 551 | if (busid_priv->interf_count > 1) { |
546 | busid_priv->interf_count--; | 552 | busid_priv->interf_count--; |
547 | shutdown_busid(busid_priv); | 553 | shutdown_busid(busid_priv); |
554 | usb_put_intf(interface); | ||
548 | return; | 555 | return; |
549 | } | 556 | } |
550 | 557 | ||
@@ -554,6 +561,9 @@ static void stub_disconnect(struct usb_interface *interface) | |||
554 | /* 1. shutdown the current connection */ | 561 | /* 1. shutdown the current connection */ |
555 | shutdown_busid(busid_priv); | 562 | shutdown_busid(busid_priv); |
556 | 563 | ||
564 | usb_put_dev(sdev->udev); | ||
565 | usb_put_intf(interface); | ||
566 | |||
557 | /* 3. free sdev */ | 567 | /* 3. free sdev */ |
558 | busid_priv->sdev = NULL; | 568 | busid_priv->sdev = NULL; |
559 | stub_device_free(sdev); | 569 | stub_device_free(sdev); |
diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/staging/usbip/stub_rx.c index 3de6fd2539dc..ae6ac82754a4 100644 --- a/drivers/staging/usbip/stub_rx.c +++ b/drivers/staging/usbip/stub_rx.c | |||
@@ -364,7 +364,7 @@ static struct stub_priv *stub_priv_alloc(struct stub_device *sdev, | |||
364 | 364 | ||
365 | static int get_pipe(struct stub_device *sdev, int epnum, int dir) | 365 | static int get_pipe(struct stub_device *sdev, int epnum, int dir) |
366 | { | 366 | { |
367 | struct usb_device *udev = interface_to_usbdev(sdev->interface); | 367 | struct usb_device *udev = sdev->udev; |
368 | struct usb_host_endpoint *ep; | 368 | struct usb_host_endpoint *ep; |
369 | struct usb_endpoint_descriptor *epd = NULL; | 369 | struct usb_endpoint_descriptor *epd = NULL; |
370 | 370 | ||
@@ -484,7 +484,7 @@ static void stub_recv_cmd_submit(struct stub_device *sdev, | |||
484 | int ret; | 484 | int ret; |
485 | struct stub_priv *priv; | 485 | struct stub_priv *priv; |
486 | struct usbip_device *ud = &sdev->ud; | 486 | struct usbip_device *ud = &sdev->ud; |
487 | struct usb_device *udev = interface_to_usbdev(sdev->interface); | 487 | struct usb_device *udev = sdev->udev; |
488 | int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction); | 488 | int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction); |
489 | 489 | ||
490 | 490 | ||
diff --git a/drivers/staging/usbip/vhci.h b/drivers/staging/usbip/vhci.h index 41a1fe5138f4..afc3b1a71881 100644 --- a/drivers/staging/usbip/vhci.h +++ b/drivers/staging/usbip/vhci.h | |||
@@ -100,9 +100,6 @@ struct vhci_hcd { | |||
100 | * But, the index of this array begins from 0. | 100 | * But, the index of this array begins from 0. |
101 | */ | 101 | */ |
102 | struct vhci_device vdev[VHCI_NPORTS]; | 102 | struct vhci_device vdev[VHCI_NPORTS]; |
103 | |||
104 | /* vhci_device which has not been assiged its address yet */ | ||
105 | int pending_port; | ||
106 | }; | 103 | }; |
107 | 104 | ||
108 | 105 | ||
@@ -119,6 +116,9 @@ void rh_port_disconnect(int rhport); | |||
119 | void vhci_rx_loop(struct usbip_task *ut); | 116 | void vhci_rx_loop(struct usbip_task *ut); |
120 | void vhci_tx_loop(struct usbip_task *ut); | 117 | void vhci_tx_loop(struct usbip_task *ut); |
121 | 118 | ||
119 | struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, | ||
120 | __u32 seqnum); | ||
121 | |||
122 | #define hardware (&the_controller->pdev.dev) | 122 | #define hardware (&the_controller->pdev.dev) |
123 | 123 | ||
124 | static inline struct vhci_device *port_to_vdev(__u32 port) | 124 | static inline struct vhci_device *port_to_vdev(__u32 port) |
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c index 08bd26a245d5..a35fe61268de 100644 --- a/drivers/staging/usbip/vhci_hcd.c +++ b/drivers/staging/usbip/vhci_hcd.c | |||
@@ -138,8 +138,6 @@ void rh_port_connect(int rhport, enum usb_device_speed speed) | |||
138 | * the_controller->vdev[rhport].ud.status = VDEV_CONNECT; | 138 | * the_controller->vdev[rhport].ud.status = VDEV_CONNECT; |
139 | * spin_unlock(&the_controller->vdev[rhport].ud.lock); */ | 139 | * spin_unlock(&the_controller->vdev[rhport].ud.lock); */ |
140 | 140 | ||
141 | the_controller->pending_port = rhport; | ||
142 | |||
143 | spin_unlock_irqrestore(&the_controller->lock, flags); | 141 | spin_unlock_irqrestore(&the_controller->lock, flags); |
144 | 142 | ||
145 | usb_hcd_poll_rh_status(vhci_to_hcd(the_controller)); | 143 | usb_hcd_poll_rh_status(vhci_to_hcd(the_controller)); |
@@ -559,6 +557,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
559 | struct device *dev = &urb->dev->dev; | 557 | struct device *dev = &urb->dev->dev; |
560 | int ret = 0; | 558 | int ret = 0; |
561 | unsigned long flags; | 559 | unsigned long flags; |
560 | struct vhci_device *vdev; | ||
562 | 561 | ||
563 | usbip_dbg_vhci_hc("enter, usb_hcd %p urb %p mem_flags %d\n", | 562 | usbip_dbg_vhci_hc("enter, usb_hcd %p urb %p mem_flags %d\n", |
564 | hcd, urb, mem_flags); | 563 | hcd, urb, mem_flags); |
@@ -574,6 +573,18 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
574 | return urb->status; | 573 | return urb->status; |
575 | } | 574 | } |
576 | 575 | ||
576 | vdev = port_to_vdev(urb->dev->portnum-1); | ||
577 | |||
578 | /* refuse enqueue for dead connection */ | ||
579 | spin_lock(&vdev->ud.lock); | ||
580 | if (vdev->ud.status == VDEV_ST_NULL || vdev->ud.status == VDEV_ST_ERROR) { | ||
581 | usbip_uerr("enqueue for inactive port %d\n", vdev->rhport); | ||
582 | spin_unlock(&vdev->ud.lock); | ||
583 | spin_unlock_irqrestore(&the_controller->lock, flags); | ||
584 | return -ENODEV; | ||
585 | } | ||
586 | spin_unlock(&vdev->ud.lock); | ||
587 | |||
577 | ret = usb_hcd_link_urb_to_ep(hcd, urb); | 588 | ret = usb_hcd_link_urb_to_ep(hcd, urb); |
578 | if (ret) | 589 | if (ret) |
579 | goto no_need_unlink; | 590 | goto no_need_unlink; |
@@ -592,8 +603,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
592 | __u8 type = usb_pipetype(urb->pipe); | 603 | __u8 type = usb_pipetype(urb->pipe); |
593 | struct usb_ctrlrequest *ctrlreq = | 604 | struct usb_ctrlrequest *ctrlreq = |
594 | (struct usb_ctrlrequest *) urb->setup_packet; | 605 | (struct usb_ctrlrequest *) urb->setup_packet; |
595 | struct vhci_device *vdev = | ||
596 | port_to_vdev(the_controller->pending_port); | ||
597 | 606 | ||
598 | if (type != PIPE_CONTROL || !ctrlreq) { | 607 | if (type != PIPE_CONTROL || !ctrlreq) { |
599 | dev_err(dev, "invalid request to devnum 0\n"); | 608 | dev_err(dev, "invalid request to devnum 0\n"); |
@@ -607,7 +616,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
607 | dev_info(dev, "SetAddress Request (%d) to port %d\n", | 616 | dev_info(dev, "SetAddress Request (%d) to port %d\n", |
608 | ctrlreq->wValue, vdev->rhport); | 617 | ctrlreq->wValue, vdev->rhport); |
609 | 618 | ||
610 | vdev->udev = urb->dev; | 619 | if (vdev->udev) |
620 | usb_put_dev(vdev->udev); | ||
621 | vdev->udev = usb_get_dev(urb->dev); | ||
611 | 622 | ||
612 | spin_lock(&vdev->ud.lock); | 623 | spin_lock(&vdev->ud.lock); |
613 | vdev->ud.status = VDEV_ST_USED; | 624 | vdev->ud.status = VDEV_ST_USED; |
@@ -627,8 +638,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
627 | "Get_Descriptor to device 0 " | 638 | "Get_Descriptor to device 0 " |
628 | "(get max pipe size)\n"); | 639 | "(get max pipe size)\n"); |
629 | 640 | ||
630 | /* FIXME: reference count? (usb_get_dev()) */ | 641 | if (vdev->udev) |
631 | vdev->udev = urb->dev; | 642 | usb_put_dev(vdev->udev); |
643 | vdev->udev = usb_get_dev(urb->dev); | ||
632 | goto out; | 644 | goto out; |
633 | 645 | ||
634 | default: | 646 | default: |
@@ -805,7 +817,6 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
805 | return 0; | 817 | return 0; |
806 | } | 818 | } |
807 | 819 | ||
808 | |||
809 | static void vhci_device_unlink_cleanup(struct vhci_device *vdev) | 820 | static void vhci_device_unlink_cleanup(struct vhci_device *vdev) |
810 | { | 821 | { |
811 | struct vhci_unlink *unlink, *tmp; | 822 | struct vhci_unlink *unlink, *tmp; |
@@ -813,11 +824,34 @@ static void vhci_device_unlink_cleanup(struct vhci_device *vdev) | |||
813 | spin_lock(&vdev->priv_lock); | 824 | spin_lock(&vdev->priv_lock); |
814 | 825 | ||
815 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_tx, list) { | 826 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_tx, list) { |
827 | usbip_uinfo("unlink cleanup tx %lu\n", unlink->unlink_seqnum); | ||
816 | list_del(&unlink->list); | 828 | list_del(&unlink->list); |
817 | kfree(unlink); | 829 | kfree(unlink); |
818 | } | 830 | } |
819 | 831 | ||
820 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) { | 832 | list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) { |
833 | struct urb *urb; | ||
834 | |||
835 | /* give back URB of unanswered unlink request */ | ||
836 | usbip_uinfo("unlink cleanup rx %lu\n", unlink->unlink_seqnum); | ||
837 | |||
838 | urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); | ||
839 | if (!urb) { | ||
840 | usbip_uinfo("the urb (seqnum %lu) was already given back\n", | ||
841 | unlink->unlink_seqnum); | ||
842 | list_del(&unlink->list); | ||
843 | kfree(unlink); | ||
844 | continue; | ||
845 | } | ||
846 | |||
847 | urb->status = -ENODEV; | ||
848 | |||
849 | spin_lock(&the_controller->lock); | ||
850 | usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb); | ||
851 | spin_unlock(&the_controller->lock); | ||
852 | |||
853 | usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb, urb->status); | ||
854 | |||
821 | list_del(&unlink->list); | 855 | list_del(&unlink->list); |
822 | kfree(unlink); | 856 | kfree(unlink); |
823 | } | 857 | } |
@@ -887,6 +921,10 @@ static void vhci_device_reset(struct usbip_device *ud) | |||
887 | vdev->speed = 0; | 921 | vdev->speed = 0; |
888 | vdev->devid = 0; | 922 | vdev->devid = 0; |
889 | 923 | ||
924 | if (vdev->udev) | ||
925 | usb_put_dev(vdev->udev); | ||
926 | vdev->udev = NULL; | ||
927 | |||
890 | ud->tcp_socket = NULL; | 928 | ud->tcp_socket = NULL; |
891 | 929 | ||
892 | ud->status = VDEV_ST_NULL; | 930 | ud->status = VDEV_ST_NULL; |
diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c index 8147d7202b2d..bf6991470941 100644 --- a/drivers/staging/usbip/vhci_rx.c +++ b/drivers/staging/usbip/vhci_rx.c | |||
@@ -23,16 +23,14 @@ | |||
23 | #include "vhci.h" | 23 | #include "vhci.h" |
24 | 24 | ||
25 | 25 | ||
26 | /* get URB from transmitted urb queue */ | 26 | /* get URB from transmitted urb queue. caller must hold vdev->priv_lock */ |
27 | static struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, | 27 | struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, |
28 | __u32 seqnum) | 28 | __u32 seqnum) |
29 | { | 29 | { |
30 | struct vhci_priv *priv, *tmp; | 30 | struct vhci_priv *priv, *tmp; |
31 | struct urb *urb = NULL; | 31 | struct urb *urb = NULL; |
32 | int status; | 32 | int status; |
33 | 33 | ||
34 | spin_lock(&vdev->priv_lock); | ||
35 | |||
36 | list_for_each_entry_safe(priv, tmp, &vdev->priv_rx, list) { | 34 | list_for_each_entry_safe(priv, tmp, &vdev->priv_rx, list) { |
37 | if (priv->seqnum == seqnum) { | 35 | if (priv->seqnum == seqnum) { |
38 | urb = priv->urb; | 36 | urb = priv->urb; |
@@ -63,8 +61,6 @@ static struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, | |||
63 | } | 61 | } |
64 | } | 62 | } |
65 | 63 | ||
66 | spin_unlock(&vdev->priv_lock); | ||
67 | |||
68 | return urb; | 64 | return urb; |
69 | } | 65 | } |
70 | 66 | ||
@@ -74,9 +70,11 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev, | |||
74 | struct usbip_device *ud = &vdev->ud; | 70 | struct usbip_device *ud = &vdev->ud; |
75 | struct urb *urb; | 71 | struct urb *urb; |
76 | 72 | ||
73 | spin_lock(&vdev->priv_lock); | ||
77 | 74 | ||
78 | urb = pickup_urb_and_free_priv(vdev, pdu->base.seqnum); | 75 | urb = pickup_urb_and_free_priv(vdev, pdu->base.seqnum); |
79 | 76 | ||
77 | spin_unlock(&vdev->priv_lock); | ||
80 | 78 | ||
81 | if (!urb) { | 79 | if (!urb) { |
82 | usbip_uerr("cannot find a urb of seqnum %u\n", | 80 | usbip_uerr("cannot find a urb of seqnum %u\n", |
@@ -161,7 +159,12 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, | |||
161 | return; | 159 | return; |
162 | } | 160 | } |
163 | 161 | ||
162 | spin_lock(&vdev->priv_lock); | ||
163 | |||
164 | urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); | 164 | urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); |
165 | |||
166 | spin_unlock(&vdev->priv_lock); | ||
167 | |||
165 | if (!urb) { | 168 | if (!urb) { |
166 | /* | 169 | /* |
167 | * I get the result of a unlink request. But, it seems that I | 170 | * I get the result of a unlink request. But, it seems that I |
@@ -190,6 +193,19 @@ static void vhci_recv_ret_unlink(struct vhci_device *vdev, | |||
190 | return; | 193 | return; |
191 | } | 194 | } |
192 | 195 | ||
196 | static int vhci_priv_tx_empty(struct vhci_device *vdev) | ||
197 | { | ||
198 | int empty = 0; | ||
199 | |||
200 | spin_lock(&vdev->priv_lock); | ||
201 | |||
202 | empty = list_empty(&vdev->priv_rx); | ||
203 | |||
204 | spin_unlock(&vdev->priv_lock); | ||
205 | |||
206 | return empty; | ||
207 | } | ||
208 | |||
193 | /* recv a pdu */ | 209 | /* recv a pdu */ |
194 | static void vhci_rx_pdu(struct usbip_device *ud) | 210 | static void vhci_rx_pdu(struct usbip_device *ud) |
195 | { | 211 | { |
@@ -202,11 +218,29 @@ static void vhci_rx_pdu(struct usbip_device *ud) | |||
202 | 218 | ||
203 | memset(&pdu, 0, sizeof(pdu)); | 219 | memset(&pdu, 0, sizeof(pdu)); |
204 | 220 | ||
205 | |||
206 | /* 1. receive a pdu header */ | 221 | /* 1. receive a pdu header */ |
207 | ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0); | 222 | ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0); |
223 | if (ret < 0) { | ||
224 | if (ret == -ECONNRESET) | ||
225 | usbip_uinfo("connection reset by peer\n"); | ||
226 | else if (ret == -EAGAIN) { | ||
227 | /* ignore if connection was idle */ | ||
228 | if (vhci_priv_tx_empty(vdev)) | ||
229 | return; | ||
230 | usbip_uinfo("connection timed out with pending urbs\n"); | ||
231 | } else if (ret != -ERESTARTSYS) | ||
232 | usbip_uinfo("xmit failed %d\n", ret); | ||
233 | |||
234 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); | ||
235 | return; | ||
236 | } | ||
237 | if (ret == 0) { | ||
238 | usbip_uinfo("connection closed"); | ||
239 | usbip_event_add(ud, VDEV_EVENT_DOWN); | ||
240 | return; | ||
241 | } | ||
208 | if (ret != sizeof(pdu)) { | 242 | if (ret != sizeof(pdu)) { |
209 | usbip_uerr("receiving pdu failed! size is %d, should be %d\n", | 243 | usbip_uerr("received pdu size is %d, should be %d\n", |
210 | ret, (unsigned int)sizeof(pdu)); | 244 | ret, (unsigned int)sizeof(pdu)); |
211 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); | 245 | usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); |
212 | return; | 246 | return; |
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c index 7016fdd2509f..e19b932492e1 100644 --- a/drivers/staging/xgifb/vb_setmode.c +++ b/drivers/staging/xgifb/vb_setmode.c | |||
@@ -3954,8 +3954,8 @@ void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, | |||
3954 | unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo) | 3954 | unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo) |
3955 | { | 3955 | { |
3956 | 3956 | ||
3957 | if ((((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) | 3957 | if ((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && |
3958 | && (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */ | 3958 | (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */ |
3959 | return 1; | 3959 | return 1; |
3960 | 3960 | ||
3961 | return 0; | 3961 | return 0; |
@@ -8773,7 +8773,7 @@ unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo, | |||
8773 | 8773 | ||
8774 | if (pVBInfo->IF_DEF_LVDS == 0) { | 8774 | if (pVBInfo->IF_DEF_LVDS == 0) { |
8775 | CRT2Index = CRT2Index >> 6; /* for LCD */ | 8775 | CRT2Index = CRT2Index >> 6; /* for LCD */ |
8776 | if (((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) { /*301b*/ | 8776 | if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /*301b*/ |
8777 | if (pVBInfo->LCDResInfo != Panel1024x768) | 8777 | if (pVBInfo->LCDResInfo != Panel1024x768) |
8778 | VCLKIndex = LCDXlat2VCLK[CRT2Index]; | 8778 | VCLKIndex = LCDXlat2VCLK[CRT2Index]; |
8779 | else | 8779 | else |