Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branches 'irq-core-for-linus' and 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
genirq: Fix up irq_node() for irq_data changes.
genirq: Add single IRQ reservation helper
genirq: Warn if enable_irq is called before irq is set up

* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
semaphore: Remove mutex emulation
staging: Final semaphore cleanup
jbd2: Convert jbd2_slab_create_sem to mutex
hpfs: Convert sbi->hpfs_creation_de to mutex

Fix up trivial change/delete conflicts with deleted 'dream' drivers
(drivers/staging/dream/camera/{mt9d112.c,mt9p012_fox.c,mt9t013.c,s5k3e2fx.c})

+36 -37
+2 -2
drivers/staging/ath6kl/os/linux/ar6000_raw_if.c
··· 198 198 199 199 for (streamID = HTC_RAW_STREAM_0; streamID < HTC_RAW_STREAM_NUM_MAX; streamID++) { 200 200 /* Initialize the data structures */ 201 - init_MUTEX(&arRaw->raw_htc_read_sem[streamID]); 202 - init_MUTEX(&arRaw->raw_htc_write_sem[streamID]); 201 + sema_init(&arRaw->raw_htc_read_sem[streamID], 1); 202 + sema_init(&arRaw->raw_htc_write_sem[streamID], 1); 203 203 init_waitqueue_head(&arRaw->raw_htc_read_queue[streamID]); 204 204 init_waitqueue_head(&arRaw->raw_htc_write_queue[streamID]); 205 205
+2 -2
drivers/staging/brcm80211/brcmfmac/dhd_linux.c
··· 1929 1929 goto fail; 1930 1930 1931 1931 net->netdev_ops = NULL; 1932 - init_MUTEX(&dhd->proto_sem); 1932 + sema_init(&dhd->proto_sem, 1); 1933 1933 /* Initialize other structure content */ 1934 1934 init_waitqueue_head(&dhd->ioctl_resp_wait); 1935 1935 init_waitqueue_head(&dhd->ctrl_wait); ··· 1977 1977 dhd->timer.function = dhd_watchdog; 1978 1978 1979 1979 /* Initialize thread based operation and lock */ 1980 - init_MUTEX(&dhd->sdsem); 1980 + sema_init(&dhd->sdsem, 1); 1981 1981 if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0)) 1982 1982 dhd->threads_only = true; 1983 1983 else
+1 -1
drivers/staging/brcm80211/sys/wl_mac80211.c
··· 866 866 spin_lock_init(&wl->rpcq_lock); 867 867 spin_lock_init(&wl->txq_lock); 868 868 869 - init_MUTEX(&wl->sem); 869 + sema_init(&wl->sem, 1); 870 870 #else 871 871 spin_lock_init(&wl->lock); 872 872 spin_lock_init(&wl->isr_lock);
+1 -1
drivers/staging/comedi/drivers/dt9812.c
··· 262 262 263 263 #define DT9812_NUM_SLOTS 16 264 264 265 - static DECLARE_MUTEX(dt9812_mutex); 265 + static DEFINE_SEMAPHORE(dt9812_mutex); 266 266 267 267 static const struct usb_device_id dt9812_table[] = { 268 268 {USB_DEVICE(0x0867, 0x9812)},
+2 -2
drivers/staging/comedi/drivers/usbdux.c
··· 315 315 */ 316 316 static struct usbduxsub usbduxsub[NUMUSBDUX]; 317 317 318 - static DECLARE_MUTEX(start_stop_sem); 318 + static DEFINE_SEMAPHORE(start_stop_sem); 319 319 320 320 /* 321 321 * Stops the data acquision ··· 2367 2367 dev_dbg(dev, "comedi_: usbdux: " 2368 2368 "usbduxsub[%d] is ready to connect to comedi.\n", index); 2369 2369 2370 - init_MUTEX(&(usbduxsub[index].sem)); 2370 + sema_init(&(usbduxsub[index].sem), 1); 2371 2371 /* save a pointer to the usb device */ 2372 2372 usbduxsub[index].usbdev = udev; 2373 2373
+2 -2
drivers/staging/comedi/drivers/usbduxfast.c
··· 199 199 */ 200 200 static struct usbduxfastsub_s usbduxfastsub[NUMUSBDUXFAST]; 201 201 202 - static DECLARE_MUTEX(start_stop_sem); 202 + static DEFINE_SEMAPHORE(start_stop_sem); 203 203 204 204 /* 205 205 * bulk transfers to usbduxfast ··· 1504 1504 "connect to comedi.\n", index); 1505 1505 #endif 1506 1506 1507 - init_MUTEX(&(usbduxfastsub[index].sem)); 1507 + sema_init(&(usbduxfastsub[index].sem), 1); 1508 1508 /* save a pointer to the usb device */ 1509 1509 usbduxfastsub[index].usbdev = udev; 1510 1510
+2 -2
drivers/staging/msm/msm_fb.c
··· 1158 1158 return ret; 1159 1159 } 1160 1160 1161 - DECLARE_MUTEX(msm_fb_pan_sem); 1161 + DEFINE_SEMAPHORE(msm_fb_pan_sem); 1162 1162 1163 1163 static int msm_fb_pan_display(struct fb_var_screeninfo *var, 1164 1164 struct fb_info *info) ··· 1962 1962 1963 1963 #endif 1964 1964 1965 - DECLARE_MUTEX(msm_fb_ioctl_ppp_sem); 1965 + DEFINE_SEMAPHORE(msm_fb_ioctl_ppp_sem); 1966 1966 DEFINE_MUTEX(msm_fb_ioctl_lut_sem); 1967 1967 DEFINE_MUTEX(msm_fb_ioctl_hist_sem); 1968 1968
+1 -1
drivers/staging/rtl8712/osdep_service.h
··· 161 161 162 162 static inline void _rtl_rwlock_init(struct semaphore *prwlock) 163 163 { 164 - init_MUTEX(prwlock); 164 + sema_init(prwlock, 1); 165 165 } 166 166 167 167 static inline void _init_listhead(struct list_head *list)
+1 -1
drivers/staging/smbfs/inode.c
··· 537 537 server->mnt = NULL; 538 538 server->sock_file = NULL; 539 539 init_waitqueue_head(&server->conn_wq); 540 - init_MUTEX(&server->sem); 540 + sema_init(&server->sem, 1); 541 541 INIT_LIST_HEAD(&server->entry); 542 542 INIT_LIST_HEAD(&server->xmitq); 543 543 INIT_LIST_HEAD(&server->recvq);
+1 -1
drivers/staging/westbridge/astoria/block/cyasblkdev_block.c
··· 157 157 /* pointer to west bridge block data device superstructure */ 158 158 static struct cyasblkdev_blk_data *gl_bd; 159 159 160 - static DECLARE_MUTEX(open_lock); 160 + static DEFINE_SEMAPHORE(open_lock); 161 161 162 162 /* local forwardd declarationss */ 163 163 static cy_as_device_handle *cyas_dev_handle;
+1 -1
drivers/staging/westbridge/astoria/block/cyasblkdev_queue.c
··· 334 334 335 335 init_completion(&bq->thread_complete); 336 336 init_waitqueue_head(&bq->thread_wq); 337 - init_MUTEX(&bq->thread_sem); 337 + sema_init(&bq->thread_sem, 1); 338 338 339 339 ret = kernel_thread(cyasblkdev_queue_thread, bq, CLONE_KERNEL); 340 340 if (ret >= 0) {
+2 -2
fs/hpfs/buffer.c
··· 14 14 #ifdef DEBUG_LOCKS 15 15 printk("lock creation\n"); 16 16 #endif 17 - down(&hpfs_sb(s)->hpfs_creation_de); 17 + mutex_lock(&hpfs_sb(s)->hpfs_creation_de); 18 18 } 19 19 20 20 void hpfs_unlock_creation(struct super_block *s) ··· 22 22 #ifdef DEBUG_LOCKS 23 23 printk("unlock creation\n"); 24 24 #endif 25 - up(&hpfs_sb(s)->hpfs_creation_de); 25 + mutex_unlock(&hpfs_sb(s)->hpfs_creation_de); 26 26 } 27 27 28 28 /* Map a sector into a buffer and return pointers to it and to the buffer. */
+1 -1
fs/hpfs/hpfs_fn.h
··· 87 87 unsigned *sb_bmp_dir; /* main bitmap directory */ 88 88 unsigned sb_c_bitmap; /* current bitmap */ 89 89 unsigned sb_max_fwd_alloc; /* max forwad allocation */ 90 - struct semaphore hpfs_creation_de; /* when creating dirents, nobody else 90 + struct mutex hpfs_creation_de; /* when creating dirents, nobody else 91 91 can alloc blocks */ 92 92 /*unsigned sb_mounting : 1;*/ 93 93 int sb_timeshift;
+1 -1
fs/hpfs/super.c
··· 491 491 sbi->sb_bmp_dir = NULL; 492 492 sbi->sb_cp_table = NULL; 493 493 494 - init_MUTEX(&sbi->hpfs_creation_de); 494 + mutex_init(&sbi->hpfs_creation_de); 495 495 496 496 uid = current_uid(); 497 497 gid = current_gid();
+4 -4
fs/jbd2/journal.c
··· 1838 1838 */ 1839 1839 #define JBD2_MAX_SLABS 8 1840 1840 static struct kmem_cache *jbd2_slab[JBD2_MAX_SLABS]; 1841 - static DECLARE_MUTEX(jbd2_slab_create_sem); 1842 1841 1843 1842 static const char *jbd2_slab_names[JBD2_MAX_SLABS] = { 1844 1843 "jbd2_1k", "jbd2_2k", "jbd2_4k", "jbd2_8k", ··· 1858 1859 1859 1860 static int jbd2_journal_create_slab(size_t size) 1860 1861 { 1862 + static DEFINE_MUTEX(jbd2_slab_create_mutex); 1861 1863 int i = order_base_2(size) - 10; 1862 1864 size_t slab_size; 1863 1865 ··· 1870 1870 1871 1871 if (unlikely(i < 0)) 1872 1872 i = 0; 1873 - down(&jbd2_slab_create_sem); 1873 + mutex_lock(&jbd2_slab_create_mutex); 1874 1874 if (jbd2_slab[i]) { 1875 - up(&jbd2_slab_create_sem); 1875 + mutex_unlock(&jbd2_slab_create_mutex); 1876 1876 return 0; /* Already created */ 1877 1877 } 1878 1878 1879 1879 slab_size = 1 << (i+10); 1880 1880 jbd2_slab[i] = kmem_cache_create(jbd2_slab_names[i], slab_size, 1881 1881 slab_size, 0, NULL); 1882 - up(&jbd2_slab_create_sem); 1882 + mutex_unlock(&jbd2_slab_create_mutex); 1883 1883 if (!jbd2_slab[i]) { 1884 1884 printk(KERN_EMERG "JBD2: no memory for jbd2_slab cache\n"); 1885 1885 return -ENOMEM;
+5
include/linux/irq.h
··· 412 412 irq_free_descs(irq, 1); 413 413 } 414 414 415 + static inline int irq_reserve_irq(unsigned int irq) 416 + { 417 + return irq_reserve_irqs(irq, 1); 418 + } 419 + 415 420 #endif /* CONFIG_GENERIC_HARDIRQS */ 416 421 417 422 #endif /* !CONFIG_S390 */
+1 -1
include/linux/irqnr.h
··· 43 43 else 44 44 45 45 #ifdef CONFIG_SMP 46 - #define irq_node(irq) (irq_to_desc(irq)->node) 46 + #define irq_node(irq) (irq_get_irq_data(irq)->node) 47 47 #else 48 48 #define irq_node(irq) 0 49 49 #endif
-6
include/linux/semaphore.h
··· 29 29 #define DEFINE_SEMAPHORE(name) \ 30 30 struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) 31 31 32 - #define DECLARE_MUTEX(name) \ 33 - struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) 34 - 35 32 static inline void sema_init(struct semaphore *sem, int val) 36 33 { 37 34 static struct lock_class_key __key; 38 35 *sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val); 39 36 lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); 40 37 } 41 - 42 - #define init_MUTEX(sem) sema_init(sem, 1) 43 - #define init_MUTEX_LOCKED(sem) sema_init(sem, 0) 44 38 45 39 extern void down(struct semaphore *sem); 46 40 extern int __must_check down_interruptible(struct semaphore *sem);
+4
kernel/irq/manage.c
··· 324 324 if (!desc) 325 325 return; 326 326 327 + if (WARN(!desc->irq_data.chip || !desc->irq_data.chip->irq_enable, 328 + KERN_ERR "enable_irq before setup/request_irq: irq %u\n", irq)) 329 + return; 330 + 327 331 chip_bus_lock(desc); 328 332 raw_spin_lock_irqsave(&desc->lock, flags); 329 333 __enable_irq(desc, irq, false);
+2 -6
scripts/checkpatch.pl
··· 2794 2794 WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr); 2795 2795 } 2796 2796 2797 - # check for semaphores used as mutexes 2798 - if ($line =~ /^.\s*(DECLARE_MUTEX|init_MUTEX)\s*\(/) { 2799 - WARN("mutexes are preferred for single holder semaphores\n" . $herecurr); 2800 - } 2801 - # check for semaphores used as mutexes 2802 - if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) { 2797 + # check for semaphores initialized locked 2798 + if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { 2803 2799 WARN("consider using a completion\n" . $herecurr); 2804 2800 2805 2801 }