diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-12 23:55:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-12 23:55:49 -0400 |
commit | 8c70aac04e01a08b7eca204312946206d1c1baac (patch) | |
tree | 07e9559e941f50c7abceed3d1459e8c8401d825d | |
parent | 06e727d2a5d9d889fabad35223ad77205a9bebb9 (diff) | |
parent | d8c778fdf2bcd42e495ca1ca67bca729639352b7 (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:
zcache: Fix build error when sysfs is not defined
zcache: Use div_u64 for 64-bit division
staging:rts_pstor: fix thread synchronization flow
drivers:staging:solo6x10:add the missed slab.h
staging: zcache: include module.h for MODULE_LICENSE
drivers/staging/hv/blkvsc_drv.c: eliminate NULL pointer dereference
Staging: Add clk API note to nvec/TODO
drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c: adjust array index
staging: more missing slab.h inclusions
drivers/staging/solo6x10/p2m.c needs slab.h
drivers/staging/solo6x10/core.c needs slab.h
drivers/staging/dt3155v4l/dt3155v4l.c needs slab.h
drivers/staging/speakup/devsynth.c: fix "buffer size is not provably correct" error
Staging: iio: add some unlocks to raw_read() functions
staging: ft1000_proc needs asm/io.h for inw/outw on sparc
staging: rtl8192u: declare MODULE_FIRMWARE
gma500: Fix clashes with DRM updates
staging: zcache: module is GPL
staging: fix zcache building
21 files changed, 111 insertions, 95 deletions
diff --git a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c index c01c0cb0af4e..b99a11a9dd69 100644 --- a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c +++ b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c | |||
@@ -812,7 +812,7 @@ int AthCreateCommandList(struct ps_cmd_packet **HciPacketList, u32 *numPackets) | |||
812 | for(count = 0; count < Patch_Count; count++) { | 812 | for(count = 0; count < Patch_Count; count++) { |
813 | 813 | ||
814 | AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Freeing Patch Buffer %d \r\n",count)); | 814 | AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Freeing Patch Buffer %d \r\n",count)); |
815 | kfree(RamPatch[Patch_Count].Data); | 815 | kfree(RamPatch[count].Data); |
816 | } | 816 | } |
817 | 817 | ||
818 | for(count = 0; count < Tag_Count; count++) { | 818 | for(count = 0; count < Tag_Count; count++) { |
diff --git a/drivers/staging/dt3155v4l/dt3155v4l.c b/drivers/staging/dt3155v4l/dt3155v4l.c index fe02d22274b4..05aa41cf875b 100644 --- a/drivers/staging/dt3155v4l/dt3155v4l.c +++ b/drivers/staging/dt3155v4l/dt3155v4l.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/stringify.h> | 22 | #include <linux/stringify.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/kthread.h> | 24 | #include <linux/kthread.h> |
25 | #include <linux/slab.h> | ||
25 | #include <media/v4l2-dev.h> | 26 | #include <media/v4l2-dev.h> |
26 | #include <media/v4l2-ioctl.h> | 27 | #include <media/v4l2-ioctl.h> |
27 | #include <media/videobuf2-dma-contig.h> | 28 | #include <media/videobuf2-dma-contig.h> |
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c index 627a98b4ec30..9e728b3415e3 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/string.h> | 22 | #include <linux/string.h> |
23 | #include <linux/vmalloc.h> | 23 | #include <linux/vmalloc.h> |
24 | #include <linux/netdevice.h> | 24 | #include <linux/netdevice.h> |
25 | #include <asm/io.h> | ||
25 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
26 | #include "ft1000.h" | 27 | #include "ft1000.h" |
27 | 28 | ||
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c index 3612574ca520..d286b2223181 100644 --- a/drivers/staging/hv/blkvsc_drv.c +++ b/drivers/staging/hv/blkvsc_drv.c | |||
@@ -325,7 +325,7 @@ static int blkvsc_do_operation(struct block_device_context *blkdev, | |||
325 | 325 | ||
326 | page_buf = alloc_page(GFP_KERNEL); | 326 | page_buf = alloc_page(GFP_KERNEL); |
327 | if (!page_buf) { | 327 | if (!page_buf) { |
328 | kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); | 328 | kmem_cache_free(blkdev->request_pool, blkvsc_req); |
329 | return -ENOMEM; | 329 | return -ENOMEM; |
330 | } | 330 | } |
331 | 331 | ||
@@ -422,7 +422,7 @@ cleanup: | |||
422 | 422 | ||
423 | __free_page(page_buf); | 423 | __free_page(page_buf); |
424 | 424 | ||
425 | kmem_cache_free(blkvsc_req->dev->request_pool, blkvsc_req); | 425 | kmem_cache_free(blkdev->request_pool, blkvsc_req); |
426 | 426 | ||
427 | return ret; | 427 | return ret; |
428 | } | 428 | } |
diff --git a/drivers/staging/iio/accel/adis16203_core.c b/drivers/staging/iio/accel/adis16203_core.c index bf1988884e93..cf5d15da76ad 100644 --- a/drivers/staging/iio/accel/adis16203_core.c +++ b/drivers/staging/iio/accel/adis16203_core.c | |||
@@ -311,13 +311,17 @@ static int adis16203_read_raw(struct iio_dev *indio_dev, | |||
311 | mutex_lock(&indio_dev->mlock); | 311 | mutex_lock(&indio_dev->mlock); |
312 | addr = adis16203_addresses[chan->address][0]; | 312 | addr = adis16203_addresses[chan->address][0]; |
313 | ret = adis16203_spi_read_reg_16(indio_dev, addr, &val16); | 313 | ret = adis16203_spi_read_reg_16(indio_dev, addr, &val16); |
314 | if (ret) | 314 | if (ret) { |
315 | mutex_unlock(&indio_dev->mlock); | ||
315 | return ret; | 316 | return ret; |
317 | } | ||
316 | 318 | ||
317 | if (val16 & ADIS16203_ERROR_ACTIVE) { | 319 | if (val16 & ADIS16203_ERROR_ACTIVE) { |
318 | ret = adis16203_check_status(indio_dev); | 320 | ret = adis16203_check_status(indio_dev); |
319 | if (ret) | 321 | if (ret) { |
322 | mutex_unlock(&indio_dev->mlock); | ||
320 | return ret; | 323 | return ret; |
324 | } | ||
321 | } | 325 | } |
322 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); | 326 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); |
323 | if (chan->scan_type.sign == 's') | 327 | if (chan->scan_type.sign == 's') |
diff --git a/drivers/staging/iio/accel/adis16204_core.c b/drivers/staging/iio/accel/adis16204_core.c index cfd09b3b9937..3e2b62654b7d 100644 --- a/drivers/staging/iio/accel/adis16204_core.c +++ b/drivers/staging/iio/accel/adis16204_core.c | |||
@@ -341,13 +341,17 @@ static int adis16204_read_raw(struct iio_dev *indio_dev, | |||
341 | mutex_lock(&indio_dev->mlock); | 341 | mutex_lock(&indio_dev->mlock); |
342 | addr = adis16204_addresses[chan->address][0]; | 342 | addr = adis16204_addresses[chan->address][0]; |
343 | ret = adis16204_spi_read_reg_16(indio_dev, addr, &val16); | 343 | ret = adis16204_spi_read_reg_16(indio_dev, addr, &val16); |
344 | if (ret) | 344 | if (ret) { |
345 | mutex_unlock(&indio_dev->mlock); | ||
345 | return ret; | 346 | return ret; |
347 | } | ||
346 | 348 | ||
347 | if (val16 & ADIS16204_ERROR_ACTIVE) { | 349 | if (val16 & ADIS16204_ERROR_ACTIVE) { |
348 | ret = adis16204_check_status(indio_dev); | 350 | ret = adis16204_check_status(indio_dev); |
349 | if (ret) | 351 | if (ret) { |
352 | mutex_unlock(&indio_dev->mlock); | ||
350 | return ret; | 353 | return ret; |
354 | } | ||
351 | } | 355 | } |
352 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); | 356 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); |
353 | if (chan->scan_type.sign == 's') | 357 | if (chan->scan_type.sign == 's') |
diff --git a/drivers/staging/iio/accel/adis16209_core.c b/drivers/staging/iio/accel/adis16209_core.c index 55f3a7bcaf0a..bec1fa8de9b9 100644 --- a/drivers/staging/iio/accel/adis16209_core.c +++ b/drivers/staging/iio/accel/adis16209_core.c | |||
@@ -337,13 +337,17 @@ static int adis16209_read_raw(struct iio_dev *indio_dev, | |||
337 | mutex_lock(&indio_dev->mlock); | 337 | mutex_lock(&indio_dev->mlock); |
338 | addr = adis16209_addresses[chan->address][0]; | 338 | addr = adis16209_addresses[chan->address][0]; |
339 | ret = adis16209_spi_read_reg_16(indio_dev, addr, &val16); | 339 | ret = adis16209_spi_read_reg_16(indio_dev, addr, &val16); |
340 | if (ret) | 340 | if (ret) { |
341 | mutex_unlock(&indio_dev->mlock); | ||
341 | return ret; | 342 | return ret; |
343 | } | ||
342 | 344 | ||
343 | if (val16 & ADIS16209_ERROR_ACTIVE) { | 345 | if (val16 & ADIS16209_ERROR_ACTIVE) { |
344 | ret = adis16209_check_status(indio_dev); | 346 | ret = adis16209_check_status(indio_dev); |
345 | if (ret) | 347 | if (ret) { |
348 | mutex_unlock(&indio_dev->mlock); | ||
346 | return ret; | 349 | return ret; |
350 | } | ||
347 | } | 351 | } |
348 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); | 352 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); |
349 | if (chan->scan_type.sign == 's') | 353 | if (chan->scan_type.sign == 's') |
diff --git a/drivers/staging/iio/accel/adis16240_core.c b/drivers/staging/iio/accel/adis16240_core.c index 4a4eafc58630..aee8b69173c4 100644 --- a/drivers/staging/iio/accel/adis16240_core.c +++ b/drivers/staging/iio/accel/adis16240_core.c | |||
@@ -370,13 +370,17 @@ static int adis16240_read_raw(struct iio_dev *indio_dev, | |||
370 | mutex_lock(&indio_dev->mlock); | 370 | mutex_lock(&indio_dev->mlock); |
371 | addr = adis16240_addresses[chan->address][0]; | 371 | addr = adis16240_addresses[chan->address][0]; |
372 | ret = adis16240_spi_read_reg_16(indio_dev, addr, &val16); | 372 | ret = adis16240_spi_read_reg_16(indio_dev, addr, &val16); |
373 | if (ret) | 373 | if (ret) { |
374 | mutex_unlock(&indio_dev->mlock); | ||
374 | return ret; | 375 | return ret; |
376 | } | ||
375 | 377 | ||
376 | if (val16 & ADIS16240_ERROR_ACTIVE) { | 378 | if (val16 & ADIS16240_ERROR_ACTIVE) { |
377 | ret = adis16240_check_status(indio_dev); | 379 | ret = adis16240_check_status(indio_dev); |
378 | if (ret) | 380 | if (ret) { |
381 | mutex_unlock(&indio_dev->mlock); | ||
379 | return ret; | 382 | return ret; |
383 | } | ||
380 | } | 384 | } |
381 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); | 385 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); |
382 | if (chan->scan_type.sign == 's') | 386 | if (chan->scan_type.sign == 's') |
diff --git a/drivers/staging/iio/gyro/adis16260_core.c b/drivers/staging/iio/gyro/adis16260_core.c index 05797f404bea..f2d43cfcc493 100644 --- a/drivers/staging/iio/gyro/adis16260_core.c +++ b/drivers/staging/iio/gyro/adis16260_core.c | |||
@@ -446,13 +446,17 @@ static int adis16260_read_raw(struct iio_dev *indio_dev, | |||
446 | mutex_lock(&indio_dev->mlock); | 446 | mutex_lock(&indio_dev->mlock); |
447 | addr = adis16260_addresses[chan->address][0]; | 447 | addr = adis16260_addresses[chan->address][0]; |
448 | ret = adis16260_spi_read_reg_16(indio_dev, addr, &val16); | 448 | ret = adis16260_spi_read_reg_16(indio_dev, addr, &val16); |
449 | if (ret) | 449 | if (ret) { |
450 | mutex_unlock(&indio_dev->mlock); | ||
450 | return ret; | 451 | return ret; |
452 | } | ||
451 | 453 | ||
452 | if (val16 & ADIS16260_ERROR_ACTIVE) { | 454 | if (val16 & ADIS16260_ERROR_ACTIVE) { |
453 | ret = adis16260_check_status(indio_dev); | 455 | ret = adis16260_check_status(indio_dev); |
454 | if (ret) | 456 | if (ret) { |
457 | mutex_unlock(&indio_dev->mlock); | ||
455 | return ret; | 458 | return ret; |
459 | } | ||
456 | } | 460 | } |
457 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); | 461 | val16 = val16 & ((1 << chan->scan_type.realbits) - 1); |
458 | if (chan->scan_type.sign == 's') | 462 | if (chan->scan_type.sign == 's') |
diff --git a/drivers/staging/nvec/TODO b/drivers/staging/nvec/TODO index 77b47f763f22..649d6b70deaa 100644 --- a/drivers/staging/nvec/TODO +++ b/drivers/staging/nvec/TODO | |||
@@ -4,5 +4,7 @@ ToDo list (incomplete, unordered) | |||
4 | - add compile as module support | 4 | - add compile as module support |
5 | - move nvec devices to mfd cells? | 5 | - move nvec devices to mfd cells? |
6 | - adjust to kernel style | 6 | - adjust to kernel style |
7 | 7 | - fix clk usage | |
8 | 8 | should not be using clk_get_sys(), but clk_get(&pdev->dev, conn) | |
9 | where conn is either NULL if the device only has one clock, or | ||
10 | the device specific name if it has multiple clocks. | ||
diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c index 6766f468639f..4bb5fffca5b9 100644 --- a/drivers/staging/rtl8192u/r819xU_firmware.c +++ b/drivers/staging/rtl8192u/r819xU_firmware.c | |||
@@ -399,10 +399,7 @@ download_firmware_fail: | |||
399 | 399 | ||
400 | } | 400 | } |
401 | 401 | ||
402 | 402 | MODULE_FIRMWARE("RTL8192U/boot.img"); | |
403 | 403 | MODULE_FIRMWARE("RTL8192U/main.img"); | |
404 | 404 | MODULE_FIRMWARE("RTL8192U/data.img"); | |
405 | |||
406 | |||
407 | |||
408 | 405 | ||
diff --git a/drivers/staging/rts_pstor/rtsx.c b/drivers/staging/rts_pstor/rtsx.c index 5ff59f27d101..16c73fbff51f 100644 --- a/drivers/staging/rts_pstor/rtsx.c +++ b/drivers/staging/rts_pstor/rtsx.c | |||
@@ -66,12 +66,6 @@ static int msi_en; | |||
66 | module_param(msi_en, int, S_IRUGO | S_IWUSR); | 66 | module_param(msi_en, int, S_IRUGO | S_IWUSR); |
67 | MODULE_PARM_DESC(msi_en, "enable msi"); | 67 | MODULE_PARM_DESC(msi_en, "enable msi"); |
68 | 68 | ||
69 | /* These are used to make sure the module doesn't unload before all the | ||
70 | * threads have exited. | ||
71 | */ | ||
72 | static atomic_t total_threads = ATOMIC_INIT(0); | ||
73 | static DECLARE_COMPLETION(threads_gone); | ||
74 | |||
75 | static irqreturn_t rtsx_interrupt(int irq, void *dev_id); | 69 | static irqreturn_t rtsx_interrupt(int irq, void *dev_id); |
76 | 70 | ||
77 | /*********************************************************************** | 71 | /*********************************************************************** |
@@ -192,7 +186,7 @@ static int queuecommand_lck(struct scsi_cmnd *srb, | |||
192 | /* enqueue the command and wake up the control thread */ | 186 | /* enqueue the command and wake up the control thread */ |
193 | srb->scsi_done = done; | 187 | srb->scsi_done = done; |
194 | chip->srb = srb; | 188 | chip->srb = srb; |
195 | up(&(dev->sema)); | 189 | complete(&dev->cmnd_ready); |
196 | 190 | ||
197 | return 0; | 191 | return 0; |
198 | } | 192 | } |
@@ -475,7 +469,7 @@ static int rtsx_control_thread(void *__dev) | |||
475 | current->flags |= PF_NOFREEZE; | 469 | current->flags |= PF_NOFREEZE; |
476 | 470 | ||
477 | for (;;) { | 471 | for (;;) { |
478 | if (down_interruptible(&dev->sema)) | 472 | if (wait_for_completion_interruptible(&dev->cmnd_ready)) |
479 | break; | 473 | break; |
480 | 474 | ||
481 | /* lock the device pointers */ | 475 | /* lock the device pointers */ |
@@ -557,8 +551,6 @@ SkipForAbort: | |||
557 | mutex_unlock(&dev->dev_mutex); | 551 | mutex_unlock(&dev->dev_mutex); |
558 | } /* for (;;) */ | 552 | } /* for (;;) */ |
559 | 553 | ||
560 | scsi_host_put(host); | ||
561 | |||
562 | /* notify the exit routine that we're actually exiting now | 554 | /* notify the exit routine that we're actually exiting now |
563 | * | 555 | * |
564 | * complete()/wait_for_completion() is similar to up()/down(), | 556 | * complete()/wait_for_completion() is similar to up()/down(), |
@@ -573,7 +565,7 @@ SkipForAbort: | |||
573 | * This is important in preemption kernels, which transfer the flow | 565 | * This is important in preemption kernels, which transfer the flow |
574 | * of execution immediately upon a complete(). | 566 | * of execution immediately upon a complete(). |
575 | */ | 567 | */ |
576 | complete_and_exit(&threads_gone, 0); | 568 | complete_and_exit(&dev->control_exit, 0); |
577 | } | 569 | } |
578 | 570 | ||
579 | 571 | ||
@@ -581,7 +573,6 @@ static int rtsx_polling_thread(void *__dev) | |||
581 | { | 573 | { |
582 | struct rtsx_dev *dev = (struct rtsx_dev *)__dev; | 574 | struct rtsx_dev *dev = (struct rtsx_dev *)__dev; |
583 | struct rtsx_chip *chip = dev->chip; | 575 | struct rtsx_chip *chip = dev->chip; |
584 | struct Scsi_Host *host = rtsx_to_host(dev); | ||
585 | struct sd_info *sd_card = &(chip->sd_card); | 576 | struct sd_info *sd_card = &(chip->sd_card); |
586 | struct xd_info *xd_card = &(chip->xd_card); | 577 | struct xd_info *xd_card = &(chip->xd_card); |
587 | struct ms_info *ms_card = &(chip->ms_card); | 578 | struct ms_info *ms_card = &(chip->ms_card); |
@@ -621,8 +612,7 @@ static int rtsx_polling_thread(void *__dev) | |||
621 | mutex_unlock(&dev->dev_mutex); | 612 | mutex_unlock(&dev->dev_mutex); |
622 | } | 613 | } |
623 | 614 | ||
624 | scsi_host_put(host); | 615 | complete_and_exit(&dev->polling_exit, 0); |
625 | complete_and_exit(&threads_gone, 0); | ||
626 | } | 616 | } |
627 | 617 | ||
628 | /* | 618 | /* |
@@ -699,29 +689,38 @@ static void rtsx_release_resources(struct rtsx_dev *dev) | |||
699 | { | 689 | { |
700 | printk(KERN_INFO "-- %s\n", __func__); | 690 | printk(KERN_INFO "-- %s\n", __func__); |
701 | 691 | ||
692 | /* Tell the control thread to exit. The SCSI host must | ||
693 | * already have been removed so it won't try to queue | ||
694 | * any more commands. | ||
695 | */ | ||
696 | printk(KERN_INFO "-- sending exit command to thread\n"); | ||
697 | complete(&dev->cmnd_ready); | ||
698 | if (dev->ctl_thread) | ||
699 | wait_for_completion(&dev->control_exit); | ||
700 | if (dev->polling_thread) | ||
701 | wait_for_completion(&dev->polling_exit); | ||
702 | |||
703 | wait_timeout(200); | ||
704 | |||
702 | if (dev->rtsx_resv_buf) { | 705 | if (dev->rtsx_resv_buf) { |
703 | dma_free_coherent(&(dev->pci->dev), HOST_CMDS_BUF_LEN, | 706 | dma_free_coherent(&(dev->pci->dev), RTSX_RESV_BUF_LEN, |
704 | dev->rtsx_resv_buf, dev->rtsx_resv_buf_addr); | 707 | dev->rtsx_resv_buf, dev->rtsx_resv_buf_addr); |
705 | dev->chip->host_cmds_ptr = NULL; | 708 | dev->chip->host_cmds_ptr = NULL; |
706 | dev->chip->host_sg_tbl_ptr = NULL; | 709 | dev->chip->host_sg_tbl_ptr = NULL; |
707 | } | 710 | } |
708 | 711 | ||
709 | pci_disable_device(dev->pci); | 712 | if (dev->irq > 0) |
710 | pci_release_regions(dev->pci); | ||
711 | |||
712 | if (dev->irq > 0) { | ||
713 | free_irq(dev->irq, (void *)dev); | 713 | free_irq(dev->irq, (void *)dev); |
714 | } | 714 | if (dev->chip->msi_en) |
715 | if (dev->chip->msi_en) { | ||
716 | pci_disable_msi(dev->pci); | 715 | pci_disable_msi(dev->pci); |
717 | } | 716 | if (dev->remap_addr) |
717 | iounmap(dev->remap_addr); | ||
718 | 718 | ||
719 | /* Tell the control thread to exit. The SCSI host must | 719 | pci_disable_device(dev->pci); |
720 | * already have been removed so it won't try to queue | 720 | pci_release_regions(dev->pci); |
721 | * any more commands. | 721 | |
722 | */ | 722 | rtsx_release_chip(dev->chip); |
723 | printk(KERN_INFO "-- sending exit command to thread\n"); | 723 | kfree(dev->chip); |
724 | up(&dev->sema); | ||
725 | } | 724 | } |
726 | 725 | ||
727 | /* First stage of disconnect processing: stop all commands and remove | 726 | /* First stage of disconnect processing: stop all commands and remove |
@@ -739,6 +738,7 @@ static void quiesce_and_remove_host(struct rtsx_dev *dev) | |||
739 | scsi_unlock(host); | 738 | scsi_unlock(host); |
740 | mutex_unlock(&dev->dev_mutex); | 739 | mutex_unlock(&dev->dev_mutex); |
741 | wake_up(&dev->delay_wait); | 740 | wake_up(&dev->delay_wait); |
741 | wait_for_completion(&dev->scanning_done); | ||
742 | 742 | ||
743 | /* Wait some time to let other threads exist */ | 743 | /* Wait some time to let other threads exist */ |
744 | wait_timeout(100); | 744 | wait_timeout(100); |
@@ -793,8 +793,7 @@ static int rtsx_scan_thread(void *__dev) | |||
793 | /* Should we unbind if no devices were detected? */ | 793 | /* Should we unbind if no devices were detected? */ |
794 | } | 794 | } |
795 | 795 | ||
796 | scsi_host_put(rtsx_to_host(dev)); | 796 | complete_and_exit(&dev->scanning_done, 0); |
797 | complete_and_exit(&threads_gone, 0); | ||
798 | } | 797 | } |
799 | 798 | ||
800 | static void rtsx_init_options(struct rtsx_chip *chip) | 799 | static void rtsx_init_options(struct rtsx_chip *chip) |
@@ -941,8 +940,11 @@ static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id | |||
941 | 940 | ||
942 | spin_lock_init(&dev->reg_lock); | 941 | spin_lock_init(&dev->reg_lock); |
943 | mutex_init(&(dev->dev_mutex)); | 942 | mutex_init(&(dev->dev_mutex)); |
944 | sema_init(&(dev->sema), 0); | 943 | init_completion(&dev->cmnd_ready); |
944 | init_completion(&dev->control_exit); | ||
945 | init_completion(&dev->polling_exit); | ||
945 | init_completion(&(dev->notify)); | 946 | init_completion(&(dev->notify)); |
947 | init_completion(&dev->scanning_done); | ||
946 | init_waitqueue_head(&dev->delay_wait); | 948 | init_waitqueue_head(&dev->delay_wait); |
947 | 949 | ||
948 | dev->pci = pci; | 950 | dev->pci = pci; |
@@ -992,28 +994,22 @@ static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id | |||
992 | pci_set_master(pci); | 994 | pci_set_master(pci); |
993 | synchronize_irq(dev->irq); | 995 | synchronize_irq(dev->irq); |
994 | 996 | ||
995 | err = scsi_add_host(host, &pci->dev); | ||
996 | if (err) { | ||
997 | printk(KERN_ERR "Unable to add the scsi host\n"); | ||
998 | goto errout; | ||
999 | } | ||
1000 | |||
1001 | rtsx_init_chip(dev->chip); | 997 | rtsx_init_chip(dev->chip); |
1002 | 998 | ||
1003 | /* Start up our control thread */ | 999 | /* Start up our control thread */ |
1004 | th = kthread_create(rtsx_control_thread, dev, CR_DRIVER_NAME); | 1000 | th = kthread_run(rtsx_control_thread, dev, CR_DRIVER_NAME); |
1005 | if (IS_ERR(th)) { | 1001 | if (IS_ERR(th)) { |
1006 | printk(KERN_ERR "Unable to start control thread\n"); | 1002 | printk(KERN_ERR "Unable to start control thread\n"); |
1007 | err = PTR_ERR(th); | 1003 | err = PTR_ERR(th); |
1008 | goto errout; | 1004 | goto errout; |
1009 | } | 1005 | } |
1006 | dev->ctl_thread = th; | ||
1010 | 1007 | ||
1011 | /* Take a reference to the host for the control thread and | 1008 | err = scsi_add_host(host, &pci->dev); |
1012 | * count it among all the threads we have launched. Then | 1009 | if (err) { |
1013 | * start it up. */ | 1010 | printk(KERN_ERR "Unable to add the scsi host\n"); |
1014 | scsi_host_get(rtsx_to_host(dev)); | 1011 | goto errout; |
1015 | atomic_inc(&total_threads); | 1012 | } |
1016 | wake_up_process(th); | ||
1017 | 1013 | ||
1018 | /* Start up the thread for delayed SCSI-device scanning */ | 1014 | /* Start up the thread for delayed SCSI-device scanning */ |
1019 | th = kthread_create(rtsx_scan_thread, dev, "rtsx-scan"); | 1015 | th = kthread_create(rtsx_scan_thread, dev, "rtsx-scan"); |
@@ -1024,28 +1020,17 @@ static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id | |||
1024 | goto errout; | 1020 | goto errout; |
1025 | } | 1021 | } |
1026 | 1022 | ||
1027 | /* Take a reference to the host for the scanning thread and | ||
1028 | * count it among all the threads we have launched. Then | ||
1029 | * start it up. */ | ||
1030 | scsi_host_get(rtsx_to_host(dev)); | ||
1031 | atomic_inc(&total_threads); | ||
1032 | wake_up_process(th); | 1023 | wake_up_process(th); |
1033 | 1024 | ||
1034 | /* Start up the thread for polling thread */ | 1025 | /* Start up the thread for polling thread */ |
1035 | th = kthread_create(rtsx_polling_thread, dev, "rtsx-polling"); | 1026 | th = kthread_run(rtsx_polling_thread, dev, "rtsx-polling"); |
1036 | if (IS_ERR(th)) { | 1027 | if (IS_ERR(th)) { |
1037 | printk(KERN_ERR "Unable to start the device-polling thread\n"); | 1028 | printk(KERN_ERR "Unable to start the device-polling thread\n"); |
1038 | quiesce_and_remove_host(dev); | 1029 | quiesce_and_remove_host(dev); |
1039 | err = PTR_ERR(th); | 1030 | err = PTR_ERR(th); |
1040 | goto errout; | 1031 | goto errout; |
1041 | } | 1032 | } |
1042 | 1033 | dev->polling_thread = th; | |
1043 | /* Take a reference to the host for the polling thread and | ||
1044 | * count it among all the threads we have launched. Then | ||
1045 | * start it up. */ | ||
1046 | scsi_host_get(rtsx_to_host(dev)); | ||
1047 | atomic_inc(&total_threads); | ||
1048 | wake_up_process(th); | ||
1049 | 1034 | ||
1050 | pci_set_drvdata(pci, dev); | 1035 | pci_set_drvdata(pci, dev); |
1051 | 1036 | ||
@@ -1108,16 +1093,6 @@ static void __exit rtsx_exit(void) | |||
1108 | 1093 | ||
1109 | pci_unregister_driver(&driver); | 1094 | pci_unregister_driver(&driver); |
1110 | 1095 | ||
1111 | /* Don't return until all of our control and scanning threads | ||
1112 | * have exited. Since each thread signals threads_gone as its | ||
1113 | * last act, we have to call wait_for_completion the right number | ||
1114 | * of times. | ||
1115 | */ | ||
1116 | while (atomic_read(&total_threads) > 0) { | ||
1117 | wait_for_completion(&threads_gone); | ||
1118 | atomic_dec(&total_threads); | ||
1119 | } | ||
1120 | |||
1121 | printk(KERN_INFO "%s module exit\n", CR_DRIVER_NAME); | 1096 | printk(KERN_INFO "%s module exit\n", CR_DRIVER_NAME); |
1122 | } | 1097 | } |
1123 | 1098 | ||
diff --git a/drivers/staging/rts_pstor/rtsx.h b/drivers/staging/rts_pstor/rtsx.h index 247615ba1d2a..86e47c2e3e3c 100644 --- a/drivers/staging/rts_pstor/rtsx.h +++ b/drivers/staging/rts_pstor/rtsx.h | |||
@@ -112,9 +112,16 @@ struct rtsx_dev { | |||
112 | /* locks */ | 112 | /* locks */ |
113 | spinlock_t reg_lock; | 113 | spinlock_t reg_lock; |
114 | 114 | ||
115 | struct task_struct *ctl_thread; /* the control thread */ | ||
116 | struct task_struct *polling_thread; /* the polling thread */ | ||
117 | |||
115 | /* mutual exclusion and synchronization structures */ | 118 | /* mutual exclusion and synchronization structures */ |
116 | struct semaphore sema; /* to sleep thread on */ | 119 | struct completion cmnd_ready; /* to sleep thread on */ |
120 | struct completion control_exit; /* control thread exit */ | ||
121 | struct completion polling_exit; /* polling thread exit */ | ||
117 | struct completion notify; /* thread begin/end */ | 122 | struct completion notify; /* thread begin/end */ |
123 | struct completion scanning_done; /* wait for scan thread */ | ||
124 | |||
118 | wait_queue_head_t delay_wait; /* wait during scan, reset */ | 125 | wait_queue_head_t delay_wait; /* wait during scan, reset */ |
119 | struct mutex dev_mutex; | 126 | struct mutex dev_mutex; |
120 | 127 | ||
diff --git a/drivers/staging/solo6x10/core.c b/drivers/staging/solo6x10/core.c index 76779949f141..f974f6412ad7 100644 --- a/drivers/staging/solo6x10/core.c +++ b/drivers/staging/solo6x10/core.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/pci.h> | 22 | #include <linux/pci.h> |
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <linux/slab.h> | ||
24 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
25 | #include "solo6x10.h" | 26 | #include "solo6x10.h" |
26 | #include "tw28.h" | 27 | #include "tw28.h" |
diff --git a/drivers/staging/solo6x10/enc.c b/drivers/staging/solo6x10/enc.c index 285f7f350062..de502599bb19 100644 --- a/drivers/staging/solo6x10/enc.c +++ b/drivers/staging/solo6x10/enc.c | |||
@@ -18,6 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/slab.h> | ||
21 | #include "solo6x10.h" | 22 | #include "solo6x10.h" |
22 | #include "osd-font.h" | 23 | #include "osd-font.h" |
23 | 24 | ||
diff --git a/drivers/staging/solo6x10/g723.c b/drivers/staging/solo6x10/g723.c index bd8eb92c94b1..59274bfca95b 100644 --- a/drivers/staging/solo6x10/g723.c +++ b/drivers/staging/solo6x10/g723.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/mempool.h> | 21 | #include <linux/mempool.h> |
22 | #include <linux/poll.h> | 22 | #include <linux/poll.h> |
23 | #include <linux/kthread.h> | 23 | #include <linux/kthread.h> |
24 | #include <linux/slab.h> | ||
24 | #include <linux/freezer.h> | 25 | #include <linux/freezer.h> |
25 | #include <sound/core.h> | 26 | #include <sound/core.h> |
26 | #include <sound/initval.h> | 27 | #include <sound/initval.h> |
diff --git a/drivers/staging/solo6x10/p2m.c b/drivers/staging/solo6x10/p2m.c index 5717eabb04a4..56210f0fc5ec 100644 --- a/drivers/staging/solo6x10/p2m.c +++ b/drivers/staging/solo6x10/p2m.c | |||
@@ -18,6 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/slab.h> | ||
21 | #include <linux/scatterlist.h> | 22 | #include <linux/scatterlist.h> |
22 | #include "solo6x10.h" | 23 | #include "solo6x10.h" |
23 | 24 | ||
diff --git a/drivers/staging/solo6x10/solo6x10.h b/drivers/staging/solo6x10/solo6x10.h index 17c06bd6cc91..abee7213202f 100644 --- a/drivers/staging/solo6x10/solo6x10.h +++ b/drivers/staging/solo6x10/solo6x10.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/list.h> | 28 | #include <linux/list.h> |
29 | #include <linux/wait.h> | 29 | #include <linux/wait.h> |
30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
31 | #include <linux/slab.h> | ||
31 | #include <asm/io.h> | 32 | #include <asm/io.h> |
32 | #include <linux/atomic.h> | 33 | #include <linux/atomic.h> |
33 | #include <linux/videodev2.h> | 34 | #include <linux/videodev2.h> |
diff --git a/drivers/staging/speakup/devsynth.c b/drivers/staging/speakup/devsynth.c index 39dc586fc8bb..940769ef883f 100644 --- a/drivers/staging/speakup/devsynth.c +++ b/drivers/staging/speakup/devsynth.c | |||
@@ -18,13 +18,14 @@ static ssize_t speakup_file_write(struct file *fp, const char *buffer, | |||
18 | { | 18 | { |
19 | size_t count = nbytes; | 19 | size_t count = nbytes; |
20 | const char *ptr = buffer; | 20 | const char *ptr = buffer; |
21 | int bytes; | 21 | size_t bytes; |
22 | unsigned long flags; | 22 | unsigned long flags; |
23 | u_char buf[256]; | 23 | u_char buf[256]; |
24 | |||
24 | if (synth == NULL) | 25 | if (synth == NULL) |
25 | return -ENODEV; | 26 | return -ENODEV; |
26 | while (count > 0) { | 27 | while (count > 0) { |
27 | bytes = min_t(size_t, count, sizeof(buf)); | 28 | bytes = min(count, sizeof(buf)); |
28 | if (copy_from_user(buf, ptr, bytes)) | 29 | if (copy_from_user(buf, ptr, bytes)) |
29 | return -EFAULT; | 30 | return -EFAULT; |
30 | count -= bytes; | 31 | count -= bytes; |
diff --git a/drivers/staging/zcache/Makefile b/drivers/staging/zcache/Makefile index f5ec64f94470..60daa272c204 100644 --- a/drivers/staging/zcache/Makefile +++ b/drivers/staging/zcache/Makefile | |||
@@ -1,3 +1,3 @@ | |||
1 | zcache-y := tmem.o | 1 | zcache-y := zcache-main.o tmem.o |
2 | 2 | ||
3 | obj-$(CONFIG_ZCACHE) += zcache.o | 3 | obj-$(CONFIG_ZCACHE) += zcache.o |
diff --git a/drivers/staging/zcache/zcache.c b/drivers/staging/zcache/zcache-main.c index 65a81a0d7c49..855a5bb56a47 100644 --- a/drivers/staging/zcache/zcache.c +++ b/drivers/staging/zcache/zcache-main.c | |||
@@ -19,6 +19,7 @@ | |||
19 | * http://marc.info/?l=linux-mm&m=127811271605009 | 19 | * http://marc.info/?l=linux-mm&m=127811271605009 |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/module.h> | ||
22 | #include <linux/cpu.h> | 23 | #include <linux/cpu.h> |
23 | #include <linux/highmem.h> | 24 | #include <linux/highmem.h> |
24 | #include <linux/list.h> | 25 | #include <linux/list.h> |
@@ -27,6 +28,7 @@ | |||
27 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
28 | #include <linux/types.h> | 29 | #include <linux/types.h> |
29 | #include <linux/atomic.h> | 30 | #include <linux/atomic.h> |
31 | #include <linux/math64.h> | ||
30 | #include "tmem.h" | 32 | #include "tmem.h" |
31 | 33 | ||
32 | #include "../zram/xvmalloc.h" /* if built in drivers/staging */ | 34 | #include "../zram/xvmalloc.h" /* if built in drivers/staging */ |
@@ -53,6 +55,9 @@ | |||
53 | 55 | ||
54 | #define MAX_CLIENTS 16 | 56 | #define MAX_CLIENTS 16 |
55 | #define LOCAL_CLIENT ((uint16_t)-1) | 57 | #define LOCAL_CLIENT ((uint16_t)-1) |
58 | |||
59 | MODULE_LICENSE("GPL"); | ||
60 | |||
56 | struct zcache_client { | 61 | struct zcache_client { |
57 | struct tmem_pool *tmem_pools[MAX_POOLS_PER_CLIENT]; | 62 | struct tmem_pool *tmem_pools[MAX_POOLS_PER_CLIENT]; |
58 | struct xv_pool *xvpool; | 63 | struct xv_pool *xvpool; |
@@ -1158,6 +1163,7 @@ static void *zcache_pampd_create(char *data, size_t size, bool raw, int eph, | |||
1158 | uint16_t client_id = get_client_id_from_client(cli); | 1163 | uint16_t client_id = get_client_id_from_client(cli); |
1159 | unsigned long zv_mean_zsize; | 1164 | unsigned long zv_mean_zsize; |
1160 | unsigned long curr_pers_pampd_count; | 1165 | unsigned long curr_pers_pampd_count; |
1166 | u64 total_zsize; | ||
1161 | 1167 | ||
1162 | if (eph) { | 1168 | if (eph) { |
1163 | ret = zcache_compress(page, &cdata, &clen); | 1169 | ret = zcache_compress(page, &cdata, &clen); |
@@ -1190,8 +1196,9 @@ static void *zcache_pampd_create(char *data, size_t size, bool raw, int eph, | |||
1190 | } | 1196 | } |
1191 | /* reject if mean compression is too poor */ | 1197 | /* reject if mean compression is too poor */ |
1192 | if ((clen > zv_max_mean_zsize) && (curr_pers_pampd_count > 0)) { | 1198 | if ((clen > zv_max_mean_zsize) && (curr_pers_pampd_count > 0)) { |
1193 | zv_mean_zsize = xv_get_total_size_bytes(cli->xvpool) / | 1199 | total_zsize = xv_get_total_size_bytes(cli->xvpool); |
1194 | curr_pers_pampd_count; | 1200 | zv_mean_zsize = div_u64(total_zsize, |
1201 | curr_pers_pampd_count); | ||
1195 | if (zv_mean_zsize > zv_max_mean_zsize) { | 1202 | if (zv_mean_zsize > zv_max_mean_zsize) { |
1196 | zcache_mean_compress_poor++; | 1203 | zcache_mean_compress_poor++; |
1197 | goto out; | 1204 | goto out; |
@@ -1929,9 +1936,9 @@ __setup("nofrontswap", no_frontswap); | |||
1929 | 1936 | ||
1930 | static int __init zcache_init(void) | 1937 | static int __init zcache_init(void) |
1931 | { | 1938 | { |
1932 | #ifdef CONFIG_SYSFS | ||
1933 | int ret = 0; | 1939 | int ret = 0; |
1934 | 1940 | ||
1941 | #ifdef CONFIG_SYSFS | ||
1935 | ret = sysfs_create_group(mm_kobj, &zcache_attr_group); | 1942 | ret = sysfs_create_group(mm_kobj, &zcache_attr_group); |
1936 | if (ret) { | 1943 | if (ret) { |
1937 | pr_err("zcache: can't create sysfs\n"); | 1944 | pr_err("zcache: can't create sysfs\n"); |