···516516 default:517517 fprintf(stderr, "Unknown nla_type %d\n",518518 na->nla_type);519519+ case TASKSTATS_TYPE_NULL:519520 break;520521 }521522 na = (struct nlattr *) (GENLMSG_DATA(&msg) + len);
+99-111
Documentation/filesystems/Locking
···1818 char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen);19192020locking rules:2121- none have BKL2221 dcache_lock rename_lock ->d_lock may block2322d_revalidate: no no no yes2423d_hash no no no yes···4142 int (*rename) (struct inode *, struct dentry *,4243 struct inode *, struct dentry *);4344 int (*readlink) (struct dentry *, char __user *,int);4444- int (*follow_link) (struct dentry *, struct nameidata *);4545+ void * (*follow_link) (struct dentry *, struct nameidata *);4646+ void (*put_link) (struct dentry *, struct nameidata *, void *);4547 void (*truncate) (struct inode *);4648 int (*permission) (struct inode *, int, struct nameidata *);4949+ int (*check_acl)(struct inode *, int);4750 int (*setattr) (struct dentry *, struct iattr *);4851 int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);4952 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);5053 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);5154 ssize_t (*listxattr) (struct dentry *, char *, size_t);5255 int (*removexattr) (struct dentry *, const char *);5656+ void (*truncate_range)(struct inode *, loff_t, loff_t);5757+ long (*fallocate)(struct inode *inode, int mode, loff_t offset, loff_t len);5858+ int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);53595460locking rules:5555- all may block, none have BKL6161+ all may block5662 i_mutex(inode)5763lookup: yes5864create: yes···7066rename: yes (all) (see below)7167readlink: no7268follow_link: no6969+put_link: no7370truncate: yes (see below)7471setattr: yes7572permission: no7373+check_acl: no7674getattr: no7775setxattr: yes7876getxattr: no7977listxattr: no8078removexattr: yes7979+truncate_range: yes8080+fallocate: no8181+fiemap: no8182 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on8283victim.8384 cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.8485 ->truncate() is never called directly - it's a callback, not a8585-method. It's called by vmtruncate() - library function normally used by8686+method. It's called by vmtruncate() - deprecated library function used by8687->setattr(). Locking information above applies to that call (i.e. is8788inherited from ->setattr() - vmtruncate() is used when ATTR_SIZE had been8889passed).···10091 struct inode *(*alloc_inode)(struct super_block *sb);10192 void (*destroy_inode)(struct inode *);10293 void (*dirty_inode) (struct inode *);103103- int (*write_inode) (struct inode *, int);9494+ int (*write_inode) (struct inode *, struct writeback_control *wbc);10495 int (*drop_inode) (struct inode *);10596 void (*evict_inode) (struct inode *);10697 void (*put_super) (struct super_block *);···114105 int (*show_options)(struct seq_file *, struct vfsmount *);115106 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);116107 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);108108+ int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);117109118110locking rules:119111 All may block [not true, see below]120120- None have BKL121112 s_umount122113alloc_inode:123114destroy_inode:···136127show_options: no (namespace_sem)137128quota_read: no (see below)138129quota_write: no (see below)130130+bdev_try_to_free_page: no (see below)139131140132->statfs() has s_umount (shared) when called by ustat(2) (native or141133compat), but that's an accident of bad API; s_umount is used to pin···149139dqio_sem) (unless an admin really wants to screw up something and150140writes to quota files with quotas on). For other details about locking151141see also dquot_operations section.142142+->bdev_try_to_free_page is called from the ->releasepage handler of143143+the block device inode. See there for more details.152144153145--------------------------- file_system_type ---------------------------154146prototypes:155147 int (*get_sb) (struct file_system_type *, int,156148 const char *, void *, struct vfsmount *);149149+ struct dentry *(*mount) (struct file_system_type *, int,150150+ const char *, void *);157151 void (*kill_sb) (struct super_block *);158152locking rules:159159- may block BKL160160-get_sb yes no161161-kill_sb yes no153153+ may block154154+get_sb yes155155+mount yes156156+kill_sb yes162157163158->get_sb() returns error or 0 with locked superblock attached to the vfsmount164159(exclusive on ->s_umount).160160+->mount() returns ERR_PTR or the root dentry.165161->kill_sb() takes a write-locked superblock, does all shutdown work on it,166162unlocks and drops the reference.167163···192176 void (*freepage)(struct page *);193177 int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,194178 loff_t offset, unsigned long nr_segs);195195- int (*launder_page) (struct page *);179179+ int (*get_xip_mem)(struct address_space *, pgoff_t, int, void **,180180+ unsigned long *);181181+ int (*migratepage)(struct address_space *, struct page *, struct page *);182182+ int (*launder_page)(struct page *);183183+ int (*is_partially_uptodate)(struct page *, read_descriptor_t *, unsigned long);184184+ int (*error_remove_page)(struct address_space *, struct page *);196185197186locking rules:198187 All except set_page_dirty and freepage may block199188200200- BKL PageLocked(page) i_mutex201201-writepage: no yes, unlocks (see below)202202-readpage: no yes, unlocks203203-sync_page: no maybe204204-writepages: no205205-set_page_dirty no no206206-readpages: no207207-write_begin: no locks the page yes208208-write_end: no yes, unlocks yes209209-perform_write: no n/a yes210210-bmap: no211211-invalidatepage: no yes212212-releasepage: no yes213213-freepage: no yes214214-direct_IO: no215215-launder_page: no yes189189+ PageLocked(page) i_mutex190190+writepage: yes, unlocks (see below)191191+readpage: yes, unlocks192192+sync_page: maybe193193+writepages:194194+set_page_dirty no195195+readpages:196196+write_begin: locks the page yes197197+write_end: yes, unlocks yes198198+bmap:199199+invalidatepage: yes200200+releasepage: yes201201+freepage: yes202202+direct_IO:203203+get_xip_mem: maybe204204+migratepage: yes (both)205205+launder_page: yes206206+is_partially_uptodate: yes207207+error_remove_page: yes216208217209 ->write_begin(), ->write_end(), ->sync_page() and ->readpage()218210may be called from the request handler (/dev/loop).···300276not locked.301277302278 ->bmap() is currently used by legacy ioctl() (FIBMAP) provided by some303303-filesystems and by the swapper. The latter will eventually go away. All304304-instances do not actually need the BKL. Please, keep it that way and don't305305-breed new callers.279279+filesystems and by the swapper. The latter will eventually go away. Please,280280+keep it that way and don't breed new callers.306281307282 ->invalidatepage() is called when the filesystem must attempt to drop308283some or all of the buffers from the page when it is being truncated. It···322299getting mapped back in and redirtied, it needs to be kept locked323300across the entire operation.324301325325- Note: currently almost all instances of address_space methods are326326-using BKL for internal serialization and that's one of the worst sources327327-of contention. Normally they are calling library functions (in fs/buffer.c)328328-and pass foo_get_block() as a callback (on local block-based filesystems,329329-indeed). BKL is not needed for library stuff and is usually taken by330330-foo_get_block(). It's an overkill, since block bitmaps can be protected by331331-internal fs locking and real critical areas are much smaller than the areas332332-filesystems protect now.333333-334302----------------------- file_lock_operations ------------------------------335303prototypes:336336- void (*fl_insert)(struct file_lock *); /* lock insertion callback */337337- void (*fl_remove)(struct file_lock *); /* lock removal callback */338304 void (*fl_copy_lock)(struct file_lock *, struct file_lock *);339305 void (*fl_release_private)(struct file_lock *);340306341307342308locking rules:343343- BKL may block344344-fl_insert: yes no345345-fl_remove: yes no346346-fl_copy_lock: yes no347347-fl_release_private: yes yes309309+ file_lock_lock may block310310+fl_copy_lock: yes no311311+fl_release_private: maybe no348312349313----------------------- lock_manager_operations ---------------------------350314prototypes:351315 int (*fl_compare_owner)(struct file_lock *, struct file_lock *);352316 void (*fl_notify)(struct file_lock *); /* unblock callback */317317+ int (*fl_grant)(struct file_lock *, struct file_lock *, int);353318 void (*fl_release_private)(struct file_lock *);354319 void (*fl_break)(struct file_lock *); /* break_lease callback */320320+ int (*fl_mylease)(struct file_lock *, struct file_lock *);321321+ int (*fl_change)(struct file_lock **, int);355322356323locking rules:357357- BKL may block358358-fl_compare_owner: yes no359359-fl_notify: yes no360360-fl_release_private: yes yes361361-fl_break: yes no324324+ file_lock_lock may block325325+fl_compare_owner: yes no326326+fl_notify: yes no327327+fl_grant: no no328328+fl_release_private: maybe no329329+fl_break: yes no330330+fl_mylease: yes no331331+fl_change yes no362332363363- Currently only NFSD and NLM provide instances of this class. None of the364364-them block. If you have out-of-tree instances - please, show up. Locking365365-in that area will change.366333--------------------------- buffer_head -----------------------------------367334prototypes:368335 void (*b_end_io)(struct buffer_head *bh, int uptodate);···377364 void (*swap_slot_free_notify) (struct block_device *, unsigned long);378365379366locking rules:380380- BKL bd_mutex381381-open: no yes382382-release: no yes383383-ioctl: no no384384-compat_ioctl: no no385385-direct_access: no no386386-media_changed: no no387387-unlock_native_capacity: no no388388-revalidate_disk: no no389389-getgeo: no no390390-swap_slot_free_notify: no no (see below)367367+ bd_mutex368368+open: yes369369+release: yes370370+ioctl: no371371+compat_ioctl: no372372+direct_access: no373373+media_changed: no374374+unlock_native_capacity: no375375+revalidate_disk: no376376+getgeo: no377377+swap_slot_free_notify: no (see below)391378392379media_changed, unlock_native_capacity and revalidate_disk are called only from393380check_disk_change().···426413 unsigned long (*get_unmapped_area)(struct file *, unsigned long,427414 unsigned long, unsigned long, unsigned long);428415 int (*check_flags)(int);416416+ int (*flock) (struct file *, int, struct file_lock *);417417+ ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *,418418+ size_t, unsigned int);419419+ ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *,420420+ size_t, unsigned int);421421+ int (*setlease)(struct file *, long, struct file_lock **);429422};430423431424locking rules:432432- All may block.433433- BKL434434-llseek: no (see below)435435-read: no436436-aio_read: no437437-write: no438438-aio_write: no439439-readdir: no440440-poll: no441441-unlocked_ioctl: no442442-compat_ioctl: no443443-mmap: no444444-open: no445445-flush: no446446-release: no447447-fsync: no (see below)448448-aio_fsync: no449449-fasync: no450450-lock: yes451451-readv: no452452-writev: no453453-sendfile: no454454-sendpage: no455455-get_unmapped_area: no456456-check_flags: no425425+ All may block except for ->setlease.426426+ No VFS locks held on entry except for ->fsync and ->setlease.427427+428428+->fsync() has i_mutex on inode.429429+430430+->setlease has the file_list_lock held and must not sleep.457431458432->llseek() locking has moved from llseek to the individual llseek459433implementations. If your fs is not using generic_file_llseek, you···450450Note: this does not protect the file->f_pos against concurrent modifications451451since this is something the userspace has to take care about.452452453453-Note: ext2_release() was *the* source of contention on fs-intensive454454-loads and dropping BKL on ->release() helps to get rid of that (we still455455-grab BKL for cases when we close a file that had been opened r/w, but that456456-can and should be done using the internal locking with smaller critical areas).457457-Current worst offender is ext2_get_block()...458458-459459-->fasync() is called without BKL protection, and is responsible for460460-maintaining the FASYNC bit in filp->f_flags. Most instances call461461-fasync_helper(), which does that maintenance, so it's not normally462462-something one needs to worry about. Return values > 0 will be mapped to463463-zero in the VFS layer.453453+->fasync() is responsible for maintaining the FASYNC bit in filp->f_flags.454454+Most instances call fasync_helper(), which does that maintenance, so it's455455+not normally something one needs to worry about. Return values > 0 will be456456+mapped to zero in the VFS layer.464457465458->readdir() and ->ioctl() on directories must be changed. Ideally we would466459move ->readdir() to inode_operations and use a separate method for directory···463470464471->read on directories probably must go away - we should just enforce -EISDIR465472in sys_read() and friends.466466-467467-->fsync() has i_mutex on inode.468473469474--------------------------- dquot_operations -------------------------------470475prototypes:···498507 int (*access)(struct vm_area_struct *, unsigned long, void*, int, int);499508500509locking rules:501501- BKL mmap_sem PageLocked(page)502502-open: no yes503503-close: no yes504504-fault: no yes can return with page locked505505-page_mkwrite: no yes can return with page locked506506-access: no yes510510+ mmap_sem PageLocked(page)511511+open: yes512512+close: yes513513+fault: yes can return with page locked514514+page_mkwrite: yes can return with page locked515515+access: yes507516508517 ->fault() is called when a previously not present pte is about509518to be faulted in. The filesystem must find and return the page associated···530539531540(if you break something or notice that it is broken and do not fix it yourself532541- at least put it here)533533-534534-ipc/shm.c::shm_delete() - may need BKL.535535-->read() and ->write() in many drivers are (probably) missing BKL.
+1-1
Documentation/kernel-parameters.txt
···1759175917601760 nousb [USB] Disable the USB subsystem1761176117621762- nowatchdog [KNL] Disable the lockup detector.17621762+ nowatchdog [KNL] Disable the lockup detector (NMI watchdog).1763176317641764 nowb [ARM]17651765
+30-27
Documentation/scsi/scsi_mid_low_api.txt
···104410441045104510461046/**10471047- * queuecommand - queue scsi command, invoke 'done' on completion10471047+ * queuecommand - queue scsi command, invoke scp->scsi_done on completion10481048+ * @shost: pointer to the scsi host object10481049 * @scp: pointer to scsi command object10491049- * @done: function pointer to be invoked on completion10501050 *10511051 * Returns 0 on success.10521052 *···10741074 *10751075 * Other types of errors that are detected immediately may be10761076 * flagged by setting scp->result to an appropriate value,10771077- * invoking the 'done' callback, and then returning 0 from this10781078- * function. If the command is not performed immediately (and the10791079- * LLD is starting (or will start) the given command) then this10801080- * function should place 0 in scp->result and return 0.10771077+ * invoking the scp->scsi_done callback, and then returning 010781078+ * from this function. If the command is not performed10791079+ * immediately (and the LLD is starting (or will start) the given10801080+ * command) then this function should place 0 in scp->result and10811081+ * return 0.10811082 *10821083 * Command ownership. If the driver returns zero, it owns the10831083- * command and must take responsibility for ensuring the 'done'10841084- * callback is executed. Note: the driver may call done before10851085- * returning zero, but after it has called done, it may not10861086- * return any value other than zero. If the driver makes a10871087- * non-zero return, it must not execute the command's done10881088- * callback at any time.10841084+ * command and must take responsibility for ensuring the10851085+ * scp->scsi_done callback is executed. Note: the driver may10861086+ * call scp->scsi_done before returning zero, but after it has10871087+ * called scp->scsi_done, it may not return any value other than10881088+ * zero. If the driver makes a non-zero return, it must not10891089+ * execute the command's scsi_done callback at any time.10891090 *10901090- * Locks: struct Scsi_Host::host_lock held on entry (with "irqsave")10911091- * and is expected to be held on return.10911091+ * Locks: up to and including 2.6.36, struct Scsi_Host::host_lock10921092+ * held on entry (with "irqsave") and is expected to be10931093+ * held on return. From 2.6.37 onwards, queuecommand is10941094+ * called without any locks held.10921095 *10931096 * Calling context: in interrupt (soft irq) or process context10941097 *10951095- * Notes: This function should be relatively fast. Normally it will10961096- * not wait for IO to complete. Hence the 'done' callback is invoked 10971097- * (often directly from an interrupt service routine) some time after10981098- * this function has returned. In some cases (e.g. pseudo adapter 10991099- * drivers that manufacture the response to a SCSI INQUIRY)11001100- * the 'done' callback may be invoked before this function returns.11011101- * If the 'done' callback is not invoked within a certain period11021102- * the SCSI mid level will commence error processing.11031103- * If a status of CHECK CONDITION is placed in "result" when the11041104- * 'done' callback is invoked, then the LLD driver should 11051105- * perform autosense and fill in the struct scsi_cmnd::sense_buffer10981098+ * Notes: This function should be relatively fast. Normally it10991099+ * will not wait for IO to complete. Hence the scp->scsi_done11001100+ * callback is invoked (often directly from an interrupt service11011101+ * routine) some time after this function has returned. In some11021102+ * cases (e.g. pseudo adapter drivers that manufacture the11031103+ * response to a SCSI INQUIRY) the scp->scsi_done callback may be11041104+ * invoked before this function returns. If the scp->scsi_done11051105+ * callback is not invoked within a certain period the SCSI mid11061106+ * level will commence error processing. If a status of CHECK11071107+ * CONDITION is placed in "result" when the scp->scsi_done11081108+ * callback is invoked, then the LLD driver should perform11091109+ * autosense and fill in the struct scsi_cmnd::sense_buffer11061110 * array. The scsi_cmnd::sense_buffer array is zeroed prior to11071111 * the mid level queuing a command to an LLD.11081112 *11091113 * Defined in: LLD11101114 **/11111111- int queuecommand(struct scsi_cmnd * scp, 11121112- void (*done)(struct scsi_cmnd *))11151115+ int queuecommand(struct Scsi_Host *shost, struct scsi_cmnd * scp)111311161114111711151118/**
···7676 IT8152_PD_IRQ(0) Audio controller (ACR)7777 */7878#define IT8152_IRQ(x) (IRQ_BOARD_START + (x))7979+#define IT8152_LAST_IRQ (IRQ_BOARD_START + 40)79808081/* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */8182#define IT8152_LD_IRQ_COUNT 9
-3
arch/arm/include/asm/highmem.h
···2525extern void *kmap_high_get(struct page *page);2626extern void kunmap_high(struct page *page);27272828-extern void *kmap_high_l1_vipt(struct page *page, pte_t *saved_pte);2929-extern void kunmap_high_l1_vipt(struct page *page, pte_t saved_pte);3030-3128/*3229 * The following functions are already defined by <linux/highmem.h>3330 * when CONFIG_HIGHMEM is not set.
+3-3
arch/arm/include/asm/sizes.h
···1313 * along with this program; if not, write to the Free Software1414 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1515 */1616-/* DO NOT EDIT!! - this file automatically generated1717- * from .s file by awk -f s2h.awk1818- */1916/* Size definitions2017 * Copyright (C) ARM Limited 1998. All rights reserved.2118 */···22252326/* handy sizes */2427#define SZ_16 0x000000102828+#define SZ_32 0x000000202929+#define SZ_64 0x000000403030+#define SZ_128 0x000000802531#define SZ_256 0x000001002632#define SZ_512 0x000002002733
+1
arch/arm/include/asm/system.h
···150150#define rmb() dmb()151151#define wmb() mb()152152#else153153+#include <asm/memory.h>153154#define mb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)154155#define rmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)155156#define wmb() do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
+6
arch/arm/kernel/entry-common.S
···2929 ldr r1, [tsk, #TI_FLAGS]3030 tst r1, #_TIF_WORK_MASK3131 bne fast_work_pending3232+#if defined(CONFIG_IRQSOFF_TRACER)3333+ asm_trace_hardirqs_on3434+#endif32353336 /* perform architecture specific actions before user return */3437 arch_ret_to_user r1, lr···6865 tst r1, #_TIF_WORK_MASK6966 bne work_pending7067no_work_pending:6868+#if defined(CONFIG_IRQSOFF_TRACER)6969+ asm_trace_hardirqs_on7070+#endif7171 /* perform architecture specific actions before user return */7272 arch_ret_to_user r1, lr7373
-1
arch/arm/kernel/smp.c
···310310 * All kernel threads share the same mm context; grab a311311 * reference and switch to it.312312 */313313- atomic_inc(&mm->mm_users);314313 atomic_inc(&mm->mm_count);315314 current->active_mm = mm;316315 cpumask_set_cpu(cpu, mm_cpumask(mm));
···353353354354 @ Let us ensure we jump to resume_after_mmu only when the mcr above355355 @ actually took effect. They call it the "cpwait" operation.356356- mrc p15, 0, r1, c2, c0, 0 @ queue a dependency on CP15357357- sub pc, r2, r1, lsr #32 @ jump to virtual addr356356+ mrc p15, 0, r0, c2, c0, 0 @ queue a dependency on CP15357357+ sub pc, r2, r0, lsr #32 @ jump to virtual addr358358 nop359359 nop360360 nop
+19-18
arch/arm/mm/cache-feroceon-l2.c
···1313 */14141515#include <linux/init.h>1616+#include <linux/highmem.h>1617#include <asm/cacheflush.h>1717-#include <asm/kmap_types.h>1818-#include <asm/fixmap.h>1919-#include <asm/pgtable.h>2020-#include <asm/tlbflush.h>2118#include <plat/cache-feroceon-l2.h>2222-#include "mm.h"23192420/*2521 * Low-level cache maintenance operations.···3539 * between which we don't want to be preempted.3640 */37413838-static inline unsigned long l2_start_va(unsigned long paddr)4242+static inline unsigned long l2_get_va(unsigned long paddr)3943{4044#ifdef CONFIG_HIGHMEM4145 /*4242- * Let's do our own fixmap stuff in a minimal way here.4346 * Because range ops can't be done on physical addresses,4447 * we simply install a virtual mapping for it only for the4548 * TLB lookup to occur, hence no need to flush the untouched4646- * memory mapping. This is protected with the disabling of4747- * interrupts by the caller.4949+ * memory mapping afterwards (note: a cache flush may happen5050+ * in some circumstances depending on the path taken in kunmap_atomic).4851 */4949- unsigned long idx = KM_L2_CACHE + KM_TYPE_NR * smp_processor_id();5050- unsigned long vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);5151- set_pte_ext(TOP_PTE(vaddr), pfn_pte(paddr >> PAGE_SHIFT, PAGE_KERNEL), 0);5252- local_flush_tlb_kernel_page(vaddr);5353- return vaddr + (paddr & ~PAGE_MASK);5252+ void *vaddr = kmap_atomic_pfn(paddr >> PAGE_SHIFT);5353+ return (unsigned long)vaddr + (paddr & ~PAGE_MASK);5454#else5555 return __phys_to_virt(paddr);5656+#endif5757+}5858+5959+static inline void l2_put_va(unsigned long vaddr)6060+{6161+#ifdef CONFIG_HIGHMEM6262+ kunmap_atomic((void *)vaddr);5663#endif5764}5865···7576 */7677 BUG_ON((start ^ end) >> PAGE_SHIFT);77787878- raw_local_irq_save(flags);7979- va_start = l2_start_va(start);7979+ va_start = l2_get_va(start);8080 va_end = va_start + (end - start);8181+ raw_local_irq_save(flags);8182 __asm__("mcr p15, 1, %0, c15, c9, 4\n\t"8283 "mcr p15, 1, %1, c15, c9, 5"8384 : : "r" (va_start), "r" (va_end));8485 raw_local_irq_restore(flags);8686+ l2_put_va(va_start);8587}86888789static inline void l2_clean_inv_pa(unsigned long addr)···106106 */107107 BUG_ON((start ^ end) >> PAGE_SHIFT);108108109109- raw_local_irq_save(flags);110110- va_start = l2_start_va(start);109109+ va_start = l2_get_va(start);111110 va_end = va_start + (end - start);111111+ raw_local_irq_save(flags);112112 __asm__("mcr p15, 1, %0, c15, c11, 4\n\t"113113 "mcr p15, 1, %1, c15, c11, 5"114114 : : "r" (va_start), "r" (va_end));115115 raw_local_irq_restore(flags);116116+ l2_put_va(va_start);116117}117118118119static inline void l2_inv_all(void)
+21-36
arch/arm/mm/cache-xsc3l2.c
···1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA1818 */1919#include <linux/init.h>2020+#include <linux/highmem.h>2021#include <asm/system.h>2122#include <asm/cputype.h>2223#include <asm/cacheflush.h>2323-#include <asm/kmap_types.h>2424-#include <asm/fixmap.h>2525-#include <asm/pgtable.h>2626-#include <asm/tlbflush.h>2727-#include "mm.h"28242925#define CR_L2 (1 << 26)3026···6771 dsb();6872}69737474+static inline void l2_unmap_va(unsigned long va)7575+{7076#ifdef CONFIG_HIGHMEM7171-#define l2_map_save_flags(x) raw_local_save_flags(x)7272-#define l2_map_restore_flags(x) raw_local_irq_restore(x)7373-#else7474-#define l2_map_save_flags(x) ((x) = 0)7575-#define l2_map_restore_flags(x) ((void)(x))7777+ if (va != -1)7878+ kunmap_atomic((void *)va);7679#endif8080+}77817878-static inline unsigned long l2_map_va(unsigned long pa, unsigned long prev_va,7979- unsigned long flags)8282+static inline unsigned long l2_map_va(unsigned long pa, unsigned long prev_va)8083{8184#ifdef CONFIG_HIGHMEM8285 unsigned long va = prev_va & PAGE_MASK;···8489 /*8590 * Switching to a new page. Because cache ops are8691 * using virtual addresses only, we must put a mapping8787- * in place for it. We also enable interrupts for a8888- * short while and disable them again to protect this8989- * mapping.9292+ * in place for it.9093 */9191- unsigned long idx;9292- raw_local_irq_restore(flags);9393- idx = KM_L2_CACHE + KM_TYPE_NR * smp_processor_id();9494- va = __fix_to_virt(FIX_KMAP_BEGIN + idx);9595- raw_local_irq_restore(flags | PSR_I_BIT);9696- set_pte_ext(TOP_PTE(va), pfn_pte(pa >> PAGE_SHIFT, PAGE_KERNEL), 0);9797- local_flush_tlb_kernel_page(va);9494+ l2_unmap_va(prev_va);9595+ va = (unsigned long)kmap_atomic_pfn(pa >> PAGE_SHIFT);9896 }9997 return va + (pa_offset >> (32 - PAGE_SHIFT));10098#else···9710998110static void xsc3_l2_inv_range(unsigned long start, unsigned long end)99111{100100- unsigned long vaddr, flags;112112+ unsigned long vaddr;101113102114 if (start == 0 && end == -1ul) {103115 xsc3_l2_inv_all();···105117 }106118107119 vaddr = -1; /* to force the first mapping */108108- l2_map_save_flags(flags);109120110121 /*111122 * Clean and invalidate partial first cache line.112123 */113124 if (start & (CACHE_LINE_SIZE - 1)) {114114- vaddr = l2_map_va(start & ~(CACHE_LINE_SIZE - 1), vaddr, flags);125125+ vaddr = l2_map_va(start & ~(CACHE_LINE_SIZE - 1), vaddr);115126 xsc3_l2_clean_mva(vaddr);116127 xsc3_l2_inv_mva(vaddr);117128 start = (start | (CACHE_LINE_SIZE - 1)) + 1;···120133 * Invalidate all full cache lines between 'start' and 'end'.121134 */122135 while (start < (end & ~(CACHE_LINE_SIZE - 1))) {123123- vaddr = l2_map_va(start, vaddr, flags);136136+ vaddr = l2_map_va(start, vaddr);124137 xsc3_l2_inv_mva(vaddr);125138 start += CACHE_LINE_SIZE;126139 }···129142 * Clean and invalidate partial last cache line.130143 */131144 if (start < end) {132132- vaddr = l2_map_va(start, vaddr, flags);145145+ vaddr = l2_map_va(start, vaddr);133146 xsc3_l2_clean_mva(vaddr);134147 xsc3_l2_inv_mva(vaddr);135148 }136149137137- l2_map_restore_flags(flags);150150+ l2_unmap_va(vaddr);138151139152 dsb();140153}141154142155static void xsc3_l2_clean_range(unsigned long start, unsigned long end)143156{144144- unsigned long vaddr, flags;157157+ unsigned long vaddr;145158146159 vaddr = -1; /* to force the first mapping */147147- l2_map_save_flags(flags);148160149161 start &= ~(CACHE_LINE_SIZE - 1);150162 while (start < end) {151151- vaddr = l2_map_va(start, vaddr, flags);163163+ vaddr = l2_map_va(start, vaddr);152164 xsc3_l2_clean_mva(vaddr);153165 start += CACHE_LINE_SIZE;154166 }155167156156- l2_map_restore_flags(flags);168168+ l2_unmap_va(vaddr);157169158170 dsb();159171}···179193180194static void xsc3_l2_flush_range(unsigned long start, unsigned long end)181195{182182- unsigned long vaddr, flags;196196+ unsigned long vaddr;183197184198 if (start == 0 && end == -1ul) {185199 xsc3_l2_flush_all();···187201 }188202189203 vaddr = -1; /* to force the first mapping */190190- l2_map_save_flags(flags);191204192205 start &= ~(CACHE_LINE_SIZE - 1);193206 while (start < end) {194194- vaddr = l2_map_va(start, vaddr, flags);207207+ vaddr = l2_map_va(start, vaddr);195208 xsc3_l2_clean_mva(vaddr);196209 xsc3_l2_inv_mva(vaddr);197210 start += CACHE_LINE_SIZE;198211 }199212200200- l2_map_restore_flags(flags);213213+ l2_unmap_va(vaddr);201214202215 dsb();203216}
···140140 pte = TOP_PTE(vaddr);141141 return pte_page(*pte);142142}143143-144144-#ifdef CONFIG_CPU_CACHE_VIPT145145-146146-#include <linux/percpu.h>147147-148148-/*149149- * The VIVT cache of a highmem page is always flushed before the page150150- * is unmapped. Hence unmapped highmem pages need no cache maintenance151151- * in that case.152152- *153153- * However unmapped pages may still be cached with a VIPT cache, and154154- * it is not possible to perform cache maintenance on them using physical155155- * addresses unfortunately. So we have no choice but to set up a temporary156156- * virtual mapping for that purpose.157157- *158158- * Yet this VIPT cache maintenance may be triggered from DMA support159159- * functions which are possibly called from interrupt context. As we don't160160- * want to keep interrupt disabled all the time when such maintenance is161161- * taking place, we therefore allow for some reentrancy by preserving and162162- * restoring the previous fixmap entry before the interrupted context is163163- * resumed. If the reentrancy depth is 0 then there is no need to restore164164- * the previous fixmap, and leaving the current one in place allow it to165165- * be reused the next time without a TLB flush (common with DMA).166166- */167167-168168-static DEFINE_PER_CPU(int, kmap_high_l1_vipt_depth);169169-170170-void *kmap_high_l1_vipt(struct page *page, pte_t *saved_pte)171171-{172172- unsigned int idx, cpu;173173- int *depth;174174- unsigned long vaddr, flags;175175- pte_t pte, *ptep;176176-177177- if (!in_interrupt())178178- preempt_disable();179179-180180- cpu = smp_processor_id();181181- depth = &per_cpu(kmap_high_l1_vipt_depth, cpu);182182-183183- idx = KM_L1_CACHE + KM_TYPE_NR * cpu;184184- vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);185185- ptep = TOP_PTE(vaddr);186186- pte = mk_pte(page, kmap_prot);187187-188188- raw_local_irq_save(flags);189189- (*depth)++;190190- if (pte_val(*ptep) == pte_val(pte)) {191191- *saved_pte = pte;192192- } else {193193- *saved_pte = *ptep;194194- set_pte_ext(ptep, pte, 0);195195- local_flush_tlb_kernel_page(vaddr);196196- }197197- raw_local_irq_restore(flags);198198-199199- return (void *)vaddr;200200-}201201-202202-void kunmap_high_l1_vipt(struct page *page, pte_t saved_pte)203203-{204204- unsigned int idx, cpu = smp_processor_id();205205- int *depth = &per_cpu(kmap_high_l1_vipt_depth, cpu);206206- unsigned long vaddr, flags;207207- pte_t pte, *ptep;208208-209209- idx = KM_L1_CACHE + KM_TYPE_NR * cpu;210210- vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);211211- ptep = TOP_PTE(vaddr);212212- pte = mk_pte(page, kmap_prot);213213-214214- BUG_ON(pte_val(*ptep) != pte_val(pte));215215- BUG_ON(*depth <= 0);216216-217217- raw_local_irq_save(flags);218218- (*depth)--;219219- if (*depth != 0 && pte_val(pte) != pte_val(saved_pte)) {220220- set_pte_ext(ptep, saved_pte, 0);221221- local_flush_tlb_kernel_page(vaddr);222222- }223223- raw_local_irq_restore(flags);224224-225225- if (!in_interrupt())226226- preempt_enable();227227-}228228-229229-#endif /* CONFIG_CPU_CACHE_VIPT */
+1-1
arch/mn10300/kernel/irq.c
···459459 tmp = CROSS_GxICR(irq, new);460460461461 x &= GxICR_LEVEL | GxICR_ENABLE;462462- if (GxICR(irq) & GxICR_REQUEST) {462462+ if (GxICR(irq) & GxICR_REQUEST)463463 x |= GxICR_REQUEST | GxICR_DETECT;464464 CROSS_GxICR(irq, new) = x;465465 tmp = CROSS_GxICR(irq, new);
···8181 for (i = 0; i < ARRAY_SIZE(frqcr3_divisors); i++) {8282 int divisor = frqcr3_divisors[i];83838484- if (clk->ops->set_rate(clk, clk->parent->rate /8585- divisor, 0) == 0)8484+ if (clk->ops->set_rate(clk, clk->parent->rate / divisor) == 0)8685 break;8786 }8887
+5-11
arch/x86/kernel/microcode_intel.c
···364364365365 /* For performance reasons, reuse mc area when possible */366366 if (!mc || mc_size > curr_mc_size) {367367- if (mc)368368- vfree(mc);367367+ vfree(mc);369368 mc = vmalloc(mc_size);370369 if (!mc)371370 break;···373374374375 if (get_ucode_data(mc, ucode_ptr, mc_size) ||375376 microcode_sanity_check(mc) < 0) {376376- vfree(mc);377377 break;378378 }379379380380 if (get_matching_microcode(&uci->cpu_sig, mc, new_rev)) {381381- if (new_mc)382382- vfree(new_mc);381381+ vfree(new_mc);383382 new_rev = mc_header.rev;384383 new_mc = mc;385384 mc = NULL; /* trigger new vmalloc */···387390 leftover -= mc_size;388391 }389392390390- if (mc)391391- vfree(mc);393393+ vfree(mc);392394393395 if (leftover) {394394- if (new_mc)395395- vfree(new_mc);396396+ vfree(new_mc);396397 state = UCODE_ERROR;397398 goto out;398399 }···400405 goto out;401406 }402407403403- if (uci->mc)404404- vfree(uci->mc);408408+ vfree(uci->mc);405409 uci->mc = (struct microcode_intel *)new_mc;406410407411 pr_debug("CPU%d found a matching microcode update with version 0x%x (current=0x%x)\n",
+14-3
arch/x86/kernel/setup.c
···501501 return total << PAGE_SHIFT;502502}503503504504-#define DEFAULT_BZIMAGE_ADDR_MAX 0x37FFFFFF504504+/*505505+ * Keep the crash kernel below this limit. On 32 bits earlier kernels506506+ * would limit the kernel to the low 512 MiB due to mapping restrictions.507507+ * On 64 bits, kexec-tools currently limits us to 896 MiB; increase this508508+ * limit once kexec-tools are fixed.509509+ */510510+#ifdef CONFIG_X86_32511511+# define CRASH_KERNEL_ADDR_MAX (512 << 20)512512+#else513513+# define CRASH_KERNEL_ADDR_MAX (896 << 20)514514+#endif515515+505516static void __init reserve_crashkernel(void)506517{507518 unsigned long long total_mem;···531520 const unsigned long long alignment = 16<<20; /* 16M */532521533522 /*534534- * kexec want bzImage is below DEFAULT_BZIMAGE_ADDR_MAX523523+ * kexec want bzImage is below CRASH_KERNEL_ADDR_MAX535524 */536525 crash_base = memblock_find_in_range(alignment,537537- DEFAULT_BZIMAGE_ADDR_MAX, crash_size, alignment);526526+ CRASH_KERNEL_ADDR_MAX, crash_size, alignment);538527539528 if (crash_base == MEMBLOCK_ERROR) {540529 pr_info("crashkernel reservation failed - No suitable area found.\n");
···23942394 ASSERT(!VALID_PAGE(root));23952395 spin_lock(&vcpu->kvm->mmu_lock);23962396 kvm_mmu_free_some_pages(vcpu);23972397- sp = kvm_mmu_get_page(vcpu, i << 30, i << 30,23972397+ sp = kvm_mmu_get_page(vcpu, i << (30 - PAGE_SHIFT),23982398+ i << 30,23982399 PT32_ROOT_LEVEL, 1, ACC_ALL,23992400 NULL);24002401 root = __pa(sp->spt);
+16-8
arch/x86/oprofile/op_model_amd.c
···630630 return 0;631631}632632633633-/* initialize the APIC for the IBS interrupts if available */633633+/*634634+ * check and reserve APIC extended interrupt LVT offset for IBS if635635+ * available636636+ *637637+ * init_ibs() preforms implicitly cpu-local operations, so pin this638638+ * thread to its current CPU639639+ */640640+634641static void init_ibs(void)635642{643643+ preempt_disable();644644+636645 ibs_caps = get_ibs_caps();637637-638646 if (!ibs_caps)639639- return;647647+ goto out;640648641641- if (__init_ibs_nmi()) {649649+ if (__init_ibs_nmi() < 0)642650 ibs_caps = 0;643643- return;644644- }651651+ else652652+ printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", ibs_caps);645653646646- printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n",647647- (unsigned)ibs_caps);654654+out:655655+ preempt_enable();648656}649657650658static int (*create_arch_files)(struct super_block *sb, struct dentry *root);
+3
drivers/acpi/acpica/evgpeinit.c
···408408 return_ACPI_STATUS(AE_OK);409409 }410410411411+ /* Disable the GPE in case it's been enabled already. */412412+ (void)acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);413413+411414 /*412415 * Add the GPE information from above to the gpe_event_info block for413416 * use during dispatch of this GPE.
-5
drivers/acpi/battery.c
···130130 unsigned long flags;131131};132132133133-static int acpi_battery_update(struct acpi_battery *battery);134134-135133#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);136134137135inline int acpi_battery_present(struct acpi_battery *battery)···183185{184186 int ret = 0;185187 struct acpi_battery *battery = to_acpi_battery(psy);186186-187187- if (acpi_battery_update(battery))188188- return -ENODEV;189188190189 if (acpi_battery_present(battery)) {191190 /* run battery update only if it is present */
+60-37
drivers/acpi/scan.c
···705705}706706707707static acpi_status708708-acpi_bus_extract_wakeup_device_power_package(struct acpi_device *device,709709- union acpi_object *package)708708+acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,709709+ struct acpi_device_wakeup *wakeup)710710{711711- int i = 0;711711+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };712712+ union acpi_object *package = NULL;712713 union acpi_object *element = NULL;714714+ acpi_status status;715715+ int i = 0;713716714714- if (!device || !package || (package->package.count < 2))717717+ if (!wakeup)715718 return AE_BAD_PARAMETER;719719+720720+ /* _PRW */721721+ status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer);722722+ if (ACPI_FAILURE(status)) {723723+ ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));724724+ return status;725725+ }726726+727727+ package = (union acpi_object *)buffer.pointer;728728+729729+ if (!package || (package->package.count < 2)) {730730+ status = AE_BAD_DATA;731731+ goto out;732732+ }716733717734 element = &(package->package.elements[0]);718718- if (!element)719719- return AE_BAD_PARAMETER;735735+ if (!element) {736736+ status = AE_BAD_DATA;737737+ goto out;738738+ }720739 if (element->type == ACPI_TYPE_PACKAGE) {721740 if ((element->package.count < 2) ||722741 (element->package.elements[0].type !=723742 ACPI_TYPE_LOCAL_REFERENCE)724724- || (element->package.elements[1].type != ACPI_TYPE_INTEGER))725725- return AE_BAD_DATA;726726- device->wakeup.gpe_device =743743+ || (element->package.elements[1].type != ACPI_TYPE_INTEGER)) {744744+ status = AE_BAD_DATA;745745+ goto out;746746+ }747747+ wakeup->gpe_device =727748 element->package.elements[0].reference.handle;728728- device->wakeup.gpe_number =749749+ wakeup->gpe_number =729750 (u32) element->package.elements[1].integer.value;730751 } else if (element->type == ACPI_TYPE_INTEGER) {731731- device->wakeup.gpe_number = element->integer.value;732732- } else733733- return AE_BAD_DATA;752752+ wakeup->gpe_device = NULL;753753+ wakeup->gpe_number = element->integer.value;754754+ } else {755755+ status = AE_BAD_DATA;756756+ goto out;757757+ }734758735759 element = &(package->package.elements[1]);736760 if (element->type != ACPI_TYPE_INTEGER) {737737- return AE_BAD_DATA;761761+ status = AE_BAD_DATA;762762+ goto out;738763 }739739- device->wakeup.sleep_state = element->integer.value;764764+ wakeup->sleep_state = element->integer.value;740765741766 if ((package->package.count - 2) > ACPI_MAX_HANDLES) {742742- return AE_NO_MEMORY;767767+ status = AE_NO_MEMORY;768768+ goto out;743769 }744744- device->wakeup.resources.count = package->package.count - 2;745745- for (i = 0; i < device->wakeup.resources.count; i++) {770770+ wakeup->resources.count = package->package.count - 2;771771+ for (i = 0; i < wakeup->resources.count; i++) {746772 element = &(package->package.elements[i + 2]);747747- if (element->type != ACPI_TYPE_LOCAL_REFERENCE)748748- return AE_BAD_DATA;773773+ if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {774774+ status = AE_BAD_DATA;775775+ goto out;776776+ }749777750750- device->wakeup.resources.handles[i] = element->reference.handle;778778+ wakeup->resources.handles[i] = element->reference.handle;751779 }752780753753- acpi_gpe_can_wake(device->wakeup.gpe_device, device->wakeup.gpe_number);781781+ acpi_gpe_can_wake(wakeup->gpe_device, wakeup->gpe_number);754782755755- return AE_OK;783783+ out:784784+ kfree(buffer.pointer);785785+786786+ return status;756787}757788758789static void acpi_bus_set_run_wake_flags(struct acpi_device *device)···818787static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)819788{820789 acpi_status status = 0;821821- struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };822822- union acpi_object *package = NULL;823790 int psw_error;824791825825- /* _PRW */826826- status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer);827827- if (ACPI_FAILURE(status)) {828828- ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));829829- goto end;830830- }831831-832832- package = (union acpi_object *)buffer.pointer;833833- status = acpi_bus_extract_wakeup_device_power_package(device, package);792792+ status = acpi_bus_extract_wakeup_device_power_package(device->handle,793793+ &device->wakeup);834794 if (ACPI_FAILURE(status)) {835795 ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package"));836796 goto end;837797 }838838-839839- kfree(buffer.pointer);840798841799 device->wakeup.flags.valid = 1;842800 device->wakeup.prepare_count = 0;···13711351 struct acpi_bus_ops *ops = context;13721352 int type;13731353 unsigned long long sta;13541354+ struct acpi_device_wakeup wakeup;13741355 struct acpi_device *device;13751356 acpi_status status;13761357 int result;···13811360 return AE_OK;1382136113831362 if (!(sta & ACPI_STA_DEVICE_PRESENT) &&13841384- !(sta & ACPI_STA_DEVICE_FUNCTIONING))13631363+ !(sta & ACPI_STA_DEVICE_FUNCTIONING)) {13641364+ acpi_bus_extract_wakeup_device_power_package(handle, &wakeup);13851365 return AE_CTRL_DEPTH;13661366+ }1386136713871368 /*13881369 * We may already have an acpi_device from a previous enumeration. If
+11-11
drivers/ata/Kconfig
···128128129129 If unsure, say N.130130131131-config PATA_MPC52xx132132- tristate "Freescale MPC52xx SoC internal IDE"133133- depends on PPC_MPC52xx && PPC_BESTCOMM134134- select PPC_BESTCOMM_ATA135135- help136136- This option enables support for integrated IDE controller137137- of the Freescale MPC52xx SoC.138138-139139- If unsure, say N.140140-141131config PATA_OCTEON_CF142132 tristate "OCTEON Boot Bus Compact Flash support"143133 depends on CPU_CAVIUM_OCTEON···356366357367config PATA_CS5536358368 tristate "CS5536 PATA support"359359- depends on PCI && X86 && !X86_64369369+ depends on PCI360370 help361371 This option enables support for the AMD CS5536362372 companion chip used with the Geode LX processor family.···478488 controllers. If you wish to use only the SATA ports then select479489 the AHCI driver alone. If you wish to the use the PATA port or480490 both SATA and PATA include this driver.491491+492492+ If unsure, say N.493493+494494+config PATA_MPC52xx495495+ tristate "Freescale MPC52xx SoC internal IDE"496496+ depends on PPC_MPC52xx && PPC_BESTCOMM497497+ select PPC_BESTCOMM_ATA498498+ help499499+ This option enables support for integrated IDE controller500500+ of the Freescale MPC52xx SoC.481501482502 If unsure, say N.483503
···48074807{48084808 struct ata_device *dev = qc->dev;4809480948104810- if (ata_tag_internal(qc->tag))48114811- return;48124812-48134810 if (ata_is_nodata(qc->tf.protocol))48144811 return;48154812···48554858 if (unlikely(qc->err_mask))48564859 qc->flags |= ATA_QCFLAG_FAILED;4857486048584858- if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) {48594859- /* always fill result TF for failed qc */48614861+ /*48624862+ * Finish internal commands without any further processing48634863+ * and always with the result TF filled.48644864+ */48654865+ if (unlikely(ata_tag_internal(qc->tag))) {48604866 fill_result_tf(qc);48674867+ __ata_qc_complete(qc);48684868+ return;48694869+ }4861487048624862- if (!ata_tag_internal(qc->tag))48634863- ata_qc_schedule_eh(qc);48644864- else48654865- __ata_qc_complete(qc);48714871+ /*48724872+ * Non-internal qc has failed. Fill the result TF and48734873+ * summon EH.48744874+ */48754875+ if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) {48764876+ fill_result_tf(qc);48774877+ ata_qc_schedule_eh(qc);48664878 return;48674879 }48684880
+14-3
drivers/ata/libata-eh.c
···32753275 struct ata_port *ap = ata_is_host_link(link) ? link->ap : NULL;32763276 struct ata_eh_context *ehc = &link->eh_context;32773277 struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;32783278+ enum ata_lpm_policy old_policy = link->lpm_policy;32783279 unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM;32793280 unsigned int err_mask;32803281 int rc;···33393338 goto fail;33403339 }3341334033413341+ /*33423342+ * Low level driver acked the transition. Issue DIPM command33433343+ * with the new policy set.33443344+ */33453345+ link->lpm_policy = policy;33463346+ if (ap && ap->slave_link)33473347+ ap->slave_link->lpm_policy = policy;33483348+33423349 /* host config updated, enable DIPM if transitioning to MIN_POWER */33433350 ata_for_each_dev(dev, link, ENABLED) {33443351 if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) {···33623353 }33633354 }3364335533653365- link->lpm_policy = policy;33663366- if (ap && ap->slave_link)33673367- ap->slave_link->lpm_policy = policy;33683356 return 0;3369335733703358fail:33593359+ /* restore the old policy */33603360+ link->lpm_policy = old_policy;33613361+ if (ap && ap->slave_link)33623362+ ap->slave_link->lpm_policy = old_policy;33633363+33713364 /* if no device or only one more chance is left, disable LPM */33723365 if (!dev || ehc->tries[dev->devno] <= 2) {33733366 ata_link_printk(link, KERN_WARNING,
+3-4
drivers/ata/libata-sff.c
···15321532 if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR))15331533 return ata_sff_idle_irq(ap);15341534 break;15351535- case HSM_ST:15361536- case HSM_ST_LAST:15371537- break;15381538- default:15351535+ case HSM_ST_IDLE:15391536 return ata_sff_idle_irq(ap);15371537+ default:15381538+ break;15401539 }1541154015421541 /* check main status, clearing INTRQ if needed */
+14-6
drivers/ata/pata_cs5536.c
···3737#include <linux/delay.h>3838#include <linux/libata.h>3939#include <scsi/scsi_host.h>4040+4141+#ifdef CONFIG_X86_324042#include <asm/msr.h>4343+static int use_msr;4444+module_param_named(msr, use_msr, int, 0644);4545+MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");4646+#else4747+#undef rdmsr /* avoid accidental MSR usage on, e.g. x86-64 */4848+#undef wrmsr4949+#define rdmsr(x, y, z) do { } while (0)5050+#define wrmsr(x, y, z) do { } while (0)5151+#define use_msr 05252+#endif41534254#define DRV_NAME "pata_cs5536"4343-#define DRV_VERSION "0.0.7"5555+#define DRV_VERSION "0.0.8"44564557enum {4658 CFG = 0,···8775 IDE_ETC_NODMA = 0x03,8876};89779090-static int use_msr;9191-9278static const u32 msr_reg[4] = {9379 MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC,9480};···9888static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val)9989{10090 if (unlikely(use_msr)) {101101- u32 dummy;9191+ u32 dummy __maybe_unused;1029210393 rdmsr(msr_reg[reg], *val, dummy);10494 return 0;···304294MODULE_LICENSE("GPL");305295MODULE_DEVICE_TABLE(pci, cs5536);306296MODULE_VERSION(DRV_VERSION);307307-module_param_named(msr, use_msr, int, 0644);308308-MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");309297310298module_init(cs5536_init);311299module_exit(cs5536_exit);
+4-1
drivers/atm/atmtcp.c
···392392 atm_dev_put(dev);393393 return -EMEDIUMTYPE;394394 }395395- if (PRIV(dev)->vcc) return -EBUSY;395395+ if (PRIV(dev)->vcc) {396396+ atm_dev_put(dev);397397+ return -EBUSY;398398+ }396399 }397400 else {398401 int error;
+4-2
drivers/bluetooth/hci_ldisc.c
···311311312312 if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {313313 hu->proto->close(hu);314314- hci_unregister_dev(hdev);315315- hci_free_dev(hdev);314314+ if (hdev) {315315+ hci_unregister_dev(hdev);316316+ hci_free_dev(hdev);317317+ }316318 }317319 }318320}
+9-2
drivers/char/agp/intel-gtt.c
···11921192 writel(1, intel_private.i9xx_flush_page);11931193}1194119411951195-static void i965_write_entry(dma_addr_t addr, unsigned int entry,11951195+static void i965_write_entry(dma_addr_t addr,11961196+ unsigned int entry,11961197 unsigned int flags)11971198{11991199+ u32 pte_flags;12001200+12011201+ pte_flags = I810_PTE_VALID;12021202+ if (flags == AGP_USER_CACHED_MEMORY)12031203+ pte_flags |= I830_PTE_SYSTEM_CACHED;12041204+11981205 /* Shift high bits down */11991206 addr |= (addr >> 28) & 0xf0;12001200- writel(addr | I810_PTE_VALID, intel_private.gtt + entry);12071207+ writel(addr | pte_flags, intel_private.gtt + entry);12011208}1202120912031210static bool gen6_check_flags(unsigned int flags)
···3434#include "i915_drm.h"3535#include "i915_drv.h"3636#include "i915_trace.h"3737+#include "../../../platform/x86/intel_ips.h"3738#include <linux/pci.h>3839#include <linux/vgaarb.h>3940#include <linux/acpi.h>···18721871EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable);1873187218741873/**18741874+ * Tells the intel_ips driver that the i915 driver is now loaded, if18751875+ * IPS got loaded first.18761876+ *18771877+ * This awkward dance is so that neither module has to depend on the18781878+ * other in order for IPS to do the appropriate communication of18791879+ * GPU turbo limits to i915.18801880+ */18811881+static void18821882+ips_ping_for_i915_load(void)18831883+{18841884+ void (*link)(void);18851885+18861886+ link = symbol_get(ips_link_to_i915_driver);18871887+ if (link) {18881888+ link();18891889+ symbol_put(ips_link_to_i915_driver);18901890+ }18911891+}18921892+18931893+/**18751894 * i915_driver_load - setup chip and create an initial config18761895 * @dev: DRM device18771896 * @flags: startup flags···20952074 i915_mch_dev = dev_priv;20962075 dev_priv->mchdev_lock = &mchdev_lock;20972076 spin_unlock(&mchdev_lock);20772077+20782078+ ips_ping_for_i915_load();2098207920992080 return 0;21002081
+10
drivers/gpu/drm/i915/i915_reg.h
···24712471# define MARIUNIT_CLOCK_GATE_DISABLE (1 << 18)24722472# define SVSMUNIT_CLOCK_GATE_DISABLE (1 << 1)2473247324742474+#define PCH_3DCGDIS1 0x4602424752475+# define VFMUNIT_CLOCK_GATE_DISABLE (1 << 11)24762476+24742477#define FDI_PLL_FREQ_CTL 0x4603024752478#define FDI_PLL_FREQ_CHANGE_REQUEST (1<<24)24762479#define FDI_PLL_FREQ_LOCK_LIMIT_MASK 0xfff00···25912588#define ILK_DISPLAY_CHICKEN2 0x4200425922589#define ILK_DPARB_GATE (1<<22)25932590#define ILK_VSDPFD_FULL (1<<21)25912591+#define ILK_DISPLAY_CHICKEN_FUSES 0x4201425922592+#define ILK_INTERNAL_GRAPHICS_DISABLE (1<<31)25932593+#define ILK_INTERNAL_DISPLAY_DISABLE (1<<30)25942594+#define ILK_DISPLAY_DEBUG_DISABLE (1<<29)25952595+#define ILK_HDCP_DISABLE (1<<25)25962596+#define ILK_eDP_A_DISABLE (1<<24)25972597+#define ILK_DESKTOP (1<<23)25942598#define ILK_DSPCLK_GATE 0x4202025952599#define ILK_DPARB_CLK_GATE (1<<5)25962600/* According to spec this bit 7/8/9 of 0x42020 should be set to enable FBC */
···479479 uint16_t address = algo_data->address;480480 uint8_t msg[5];481481 uint8_t reply[2];482482+ unsigned retry;482483 int msg_bytes;483484 int reply_bytes;484485 int ret;···514513 break;515514 }516515517517- for (;;) {518518- ret = intel_dp_aux_ch(intel_dp,519519- msg, msg_bytes,520520- reply, reply_bytes);516516+ for (retry = 0; retry < 5; retry++) {517517+ ret = intel_dp_aux_ch(intel_dp,518518+ msg, msg_bytes,519519+ reply, reply_bytes);521520 if (ret < 0) {522521 DRM_DEBUG_KMS("aux_ch failed %d\n", ret);523522 return ret;524523 }524524+525525+ switch (reply[0] & AUX_NATIVE_REPLY_MASK) {526526+ case AUX_NATIVE_REPLY_ACK:527527+ /* I2C-over-AUX Reply field is only valid528528+ * when paired with AUX ACK.529529+ */530530+ break;531531+ case AUX_NATIVE_REPLY_NACK:532532+ DRM_DEBUG_KMS("aux_ch native nack\n");533533+ return -EREMOTEIO;534534+ case AUX_NATIVE_REPLY_DEFER:535535+ udelay(100);536536+ continue;537537+ default:538538+ DRM_ERROR("aux_ch invalid native reply 0x%02x\n",539539+ reply[0]);540540+ return -EREMOTEIO;541541+ }542542+525543 switch (reply[0] & AUX_I2C_REPLY_MASK) {526544 case AUX_I2C_REPLY_ACK:527545 if (mode == MODE_I2C_READ) {···548528 }549529 return reply_bytes - 1;550530 case AUX_I2C_REPLY_NACK:551551- DRM_DEBUG_KMS("aux_ch nack\n");531531+ DRM_DEBUG_KMS("aux_i2c nack\n");552532 return -EREMOTEIO;553533 case AUX_I2C_REPLY_DEFER:554554- DRM_DEBUG_KMS("aux_ch defer\n");534534+ DRM_DEBUG_KMS("aux_i2c defer\n");555535 udelay(100);556536 break;557537 default:558558- DRM_ERROR("aux_ch invalid reply 0x%02x\n", reply[0]);538538+ DRM_ERROR("aux_i2c invalid reply 0x%02x\n", reply[0]);559539 return -EREMOTEIO;560540 }561541 }542542+543543+ DRM_ERROR("too many retries, giving up\n");544544+ return -EREMOTEIO;562545}563546564547static int
+8-11
drivers/gpu/drm/i915/intel_ringbuffer.c
···696696 drm_i915_private_t *dev_priv = dev->dev_private;697697 u32 head;698698699699- head = intel_read_status_page(ring, 4);700700- if (head) {701701- ring->head = head & HEAD_ADDR;702702- ring->space = ring->head - (ring->tail + 8);703703- if (ring->space < 0)704704- ring->space += ring->size;705705- if (ring->space >= n)706706- return 0;707707- }708708-709699 trace_i915_ring_wait_begin (dev);710700 end = jiffies + 3 * HZ;711701 do {712712- ring->head = I915_READ_HEAD(ring) & HEAD_ADDR;702702+ /* If the reported head position has wrapped or hasn't advanced,703703+ * fallback to the slow and accurate path.704704+ */705705+ head = intel_read_status_page(ring, 4);706706+ if (head < ring->actual_head)707707+ head = I915_READ_HEAD(ring);708708+ ring->actual_head = head;709709+ ring->head = head & HEAD_ADDR;713710 ring->space = ring->head - (ring->tail + 8);714711 if (ring->space < 0)715712 ring->space += ring->size;
+3-2
drivers/gpu/drm/i915/intel_ringbuffer.h
···3030 struct drm_device *dev;3131 struct drm_gem_object *gem_object;32323333- unsigned int head;3434- unsigned int tail;3333+ u32 actual_head;3434+ u32 head;3535+ u32 tail;3536 int space;3637 struct intel_hw_status_page status_page;3738
···253253 case DRM_MODE_DPMS_SUSPEND:254254 case DRM_MODE_DPMS_OFF:255255 drm_vblank_pre_modeset(dev, radeon_crtc->crtc_id);256256- atombios_blank_crtc(crtc, ATOM_ENABLE);256256+ if (radeon_crtc->enabled)257257+ atombios_blank_crtc(crtc, ATOM_ENABLE);257258 if (ASIC_IS_DCE3(rdev))258259 atombios_enable_crtc_memreq(crtc, ATOM_DISABLE);259260 atombios_enable_crtc(crtc, ATOM_DISABLE);···531530 dp_clock = dig_connector->dp_clock;532531 }533532 }534534-533533+#if 0 /* doesn't work properly on some laptops */535534 /* use recommended ref_div for ss */536535 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {537536 if (ss_enabled) {···541540 }542541 }543542 }544544-543543+#endif545544 if (ASIC_IS_AVIVO(rdev)) {546545 /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */547546 if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1)
+12-15
drivers/gpu/drm/radeon/evergreen.c
···748748 unsigned i;749749 u32 tmp;750750751751+ WREG32(HDP_MEM_COHERENCY_FLUSH_CNTL, 0x1);752752+751753 WREG32(VM_CONTEXT0_REQUEST_RESPONSE, REQUEST_TYPE(1));752754 for (i = 0; i < rdev->usec_timeout; i++) {753755 /* read MC_STATUS */···19241922static int evergreen_gpu_soft_reset(struct radeon_device *rdev)19251923{19261924 struct evergreen_mc_save save;19271927- u32 srbm_reset = 0;19281925 u32 grbm_reset = 0;1929192619301927 dev_info(rdev->dev, "GPU softreset \n");···19621961 udelay(50);19631962 WREG32(GRBM_SOFT_RESET, 0);19641963 (void)RREG32(GRBM_SOFT_RESET);19651965-19661966- /* reset all the system blocks */19671967- srbm_reset = SRBM_SOFT_RESET_ALL_MASK;19681968-19691969- dev_info(rdev->dev, " SRBM_SOFT_RESET=0x%08X\n", srbm_reset);19701970- WREG32(SRBM_SOFT_RESET, srbm_reset);19711971- (void)RREG32(SRBM_SOFT_RESET);19721972- udelay(50);19731973- WREG32(SRBM_SOFT_RESET, 0);19741974- (void)RREG32(SRBM_SOFT_RESET);19751964 /* Wait a little for things to settle down */19761965 udelay(50);19771966 dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n",···19721981 RREG32(GRBM_STATUS_SE1));19731982 dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n",19741983 RREG32(SRBM_STATUS));19751975- /* After reset we need to reinit the asic as GPU often endup in an19761976- * incoherent state.19771977- */19781978- atom_asic_init(rdev->mode_info.atom_context);19791984 evergreen_mc_resume(rdev, &save);19801985 return 0;19811986}···25832596{25842597 int r;2585259825992599+ /* reset the asic, the gfx blocks are often in a bad state26002600+ * after the driver is unloaded or after a resume26012601+ */26022602+ if (radeon_asic_reset(rdev))26032603+ dev_warn(rdev->dev, "GPU reset failed !\n");25862604 /* Do not reset GPU before posting, on rv770 hw unlike on r500 hw,25872605 * posting will perform necessary task to bring back GPU into good25882606 * shape.···27042712 r = radeon_atombios_init(rdev);27052713 if (r)27062714 return r;27152715+ /* reset the asic, the gfx blocks are often in a bad state27162716+ * after the driver is unloaded or after a resume27172717+ */27182718+ if (radeon_asic_reset(rdev))27192719+ dev_warn(rdev->dev, "GPU reset failed !\n");27072720 /* Post card if necessary */27082721 if (!evergreen_card_posted(rdev)) {27092722 if (!rdev->bios) {
···315315 if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) {316316 /* the initial DDX does bad things with the CB size occasionally */317317 /* it rounds up height too far for slice tile max but the BO is smaller */318318- tmp = (height - 7) * 8 * bpe;319319- if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) {320320- dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i]));321321- return -EINVAL;322322- }318318+ /* r600c,g also seem to flush at bad times in some apps resulting in319319+ * bogus values here. So for linear just allow anything to avoid breaking320320+ * broken userspace.321321+ */323322 } else {324323 dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i]));325324 return -EINVAL;
+4-5
drivers/gpu/drm/radeon/radeon_device.c
···910910 radeon_pm_resume(rdev);911911 radeon_restore_bios_scratch_regs(rdev);912912913913- /* turn on display hw */914914- list_for_each_entry(connector, &dev->mode_config.connector_list, head) {915915- drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);916916- }917917-918913 radeon_fbdev_set_suspend(rdev, 0);919914 release_console_sem();920915···917922 radeon_hpd_init(rdev);918923 /* blat the mode back in */919924 drm_helper_resume_force_mode(dev);925925+ /* turn on display hw */926926+ list_for_each_entry(connector, &dev->mode_config.connector_list, head) {927927+ drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);928928+ }920929 return 0;921930}922931
+19
drivers/gpu/drm/radeon/radeon_drv.c
···232232233233static struct drm_driver kms_driver;234234235235+static void radeon_kick_out_firmware_fb(struct pci_dev *pdev)236236+{237237+ struct apertures_struct *ap;238238+ bool primary = false;239239+240240+ ap = alloc_apertures(1);241241+ ap->ranges[0].base = pci_resource_start(pdev, 0);242242+ ap->ranges[0].size = pci_resource_len(pdev, 0);243243+244244+#ifdef CONFIG_X86245245+ primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;246246+#endif247247+ remove_conflicting_framebuffers(ap, "radeondrmfb", primary);248248+ kfree(ap);249249+}250250+235251static int __devinit236252radeon_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)237253{254254+ /* Get rid of things like offb */255255+ radeon_kick_out_firmware_fb(pdev);256256+238257 return drm_get_pci_dev(pdev, ent, &kms_driver);239258}240259
···19001900 if (b3skb == NULL) {19011901 dev_err(cs->dev, "%s: out of memory\n", __func__);19021902 send_conf(iif, ap, skb, CAPI_MSGOSRESOURCEERR);19031903+ kfree(b3cmsg);19031904 return;19041905 }19051906 capi_cmsg2message(b3cmsg,
+1-1
drivers/leds/led-class.c
···267267 unsigned long *delay_off)268268{269269 if (led_cdev->blink_set &&270270- led_cdev->blink_set(led_cdev, delay_on, delay_off))270270+ !led_cdev->blink_set(led_cdev, delay_on, delay_off))271271 return;272272273273 /* blink with 1 Hz as default if nothing specified */
···522522523523 dev_dbg(ir->d.dev, LOGHEAD "poll called\n", ir->d.name, ir->d.minor);524524525525- if (!ir->attached) {526526- mutex_unlock(&ir->irctl_lock);525525+ if (!ir->attached)527526 return POLLERR;528528- }529527530528 poll_wait(file, &ir->buf->wait_poll, wait);531529···647649 if (!buf)648650 return -ENOMEM;649651650650- if (mutex_lock_interruptible(&ir->irctl_lock))651651- return -ERESTARTSYS;652652+ if (mutex_lock_interruptible(&ir->irctl_lock)) {653653+ ret = -ERESTARTSYS;654654+ goto out_unlocked;655655+ }652656 if (!ir->attached) {653653- mutex_unlock(&ir->irctl_lock);654654- return -ENODEV;657657+ ret = -ENODEV;658658+ goto out_locked;655659 }656660657661 if (length % ir->chunk_size) {658658- dev_dbg(ir->d.dev, LOGHEAD "read result = -EINVAL\n",659659- ir->d.name, ir->d.minor);660660- mutex_unlock(&ir->irctl_lock);661661- return -EINVAL;662662+ ret = -EINVAL;663663+ goto out_locked;662664 }663665664666 /*···709711 lirc_buffer_read(ir->buf, buf);710712 ret = copy_to_user((void *)buffer+written, buf,711713 ir->buf->chunk_size);712712- written += ir->buf->chunk_size;714714+ if (!ret)715715+ written += ir->buf->chunk_size;716716+ else717717+ ret = -EFAULT;713718 }714719 }715720716721 remove_wait_queue(&ir->buf->wait_poll, &wait);717722 set_current_state(TASK_RUNNING);723723+724724+out_locked:718725 mutex_unlock(&ir->irctl_lock);719726720727out_unlocked:721728 kfree(buf);722729 dev_dbg(ir->d.dev, LOGHEAD "read result = %s (%d)\n",723723- ir->d.name, ir->d.minor, ret ? "-EFAULT" : "OK", ret);730730+ ir->d.name, ir->d.minor, ret ? "<fail>" : "<ok>", ret);724731725732 return ret ? ret : written;726733}
+109-65
drivers/media/IR/mceusb.c
···3535#include <linux/device.h>3636#include <linux/module.h>3737#include <linux/slab.h>3838-#include <linux/usb.h>3938#include <linux/input.h>3939+#include <linux/usb.h>4040+#include <linux/usb/input.h>4041#include <media/ir-core.h>4141-#include <media/ir-common.h>42424343#define DRIVER_VERSION "1.91"4444#define DRIVER_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"···4949#define USB_BUFLEN 32 /* USB reception buffer length */5050#define USB_CTRL_MSG_SZ 2 /* Size of usb ctrl msg on gen1 hw */5151#define MCE_G1_INIT_MSGS 40 /* Init messages on gen1 hw to throw out */5252+#define MS_TO_NS(msec) ((msec) * 1000)52535354/* MCE constants */5455#define MCE_CMDBUF_SIZE 384 /* MCE Command buffer length */···7574#define MCE_PACKET_LENGTH_MASK 0x1f /* Packet length mask */76757776/* Sub-commands, which follow MCE_COMMAND_HEADER or MCE_HW_CMD_HEADER */7777+#define MCE_CMD_SIG_END 0x01 /* End of signal */7878#define MCE_CMD_PING 0x03 /* Ping device */7979#define MCE_CMD_UNKNOWN 0x04 /* Unknown */8080#define MCE_CMD_UNKNOWN2 0x05 /* Unknown */···9391#define MCE_CMD_G_TXMASK 0x13 /* Set TX port bitmask */9492#define MCE_CMD_S_RXSENSOR 0x14 /* Set RX sensor (std/learning) */9593#define MCE_CMD_G_RXSENSOR 0x15 /* Get RX sensor (std/learning) */9494+#define MCE_RSP_PULSE_COUNT 0x15 /* RX pulse count (only if learning) */9695#define MCE_CMD_TX_PORTS 0x16 /* Get number of TX ports */9796#define MCE_CMD_G_WAKESRC 0x17 /* Get wake source */9897#define MCE_CMD_UNKNOWN7 0x18 /* Unknown */···149146 MCE_GEN3,150147 MCE_GEN2_TX_INV,151148 POLARIS_EVK,149149+ CX_HYBRID_TV,152150};153151154152struct mceusb_model {155153 u32 mce_gen1:1;156154 u32 mce_gen2:1;157155 u32 mce_gen3:1;158158- u32 tx_mask_inverted:1;156156+ u32 tx_mask_normal:1;159157 u32 is_polaris:1;158158+ u32 no_tx:1;160159161160 const char *rc_map; /* Allow specify a per-board map */162161 const char *name; /* per-board name */···167162static const struct mceusb_model mceusb_model[] = {168163 [MCE_GEN1] = {169164 .mce_gen1 = 1,170170- .tx_mask_inverted = 1,165165+ .tx_mask_normal = 1,171166 },172167 [MCE_GEN2] = {173168 .mce_gen2 = 1,174169 },175170 [MCE_GEN2_TX_INV] = {176171 .mce_gen2 = 1,177177- .tx_mask_inverted = 1,172172+ .tx_mask_normal = 1,178173 },179174 [MCE_GEN3] = {180175 .mce_gen3 = 1,181181- .tx_mask_inverted = 1,176176+ .tx_mask_normal = 1,182177 },183178 [POLARIS_EVK] = {184179 .is_polaris = 1,···188183 * to allow testing it189184 */190185 .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW,191191- .name = "cx231xx MCE IR",186186+ .name = "Conexant Hybrid TV (cx231xx) MCE IR",187187+ },188188+ [CX_HYBRID_TV] = {189189+ .is_polaris = 1,190190+ .no_tx = 1, /* tx isn't wired up at all */191191+ .name = "Conexant Hybrid TV (cx231xx) MCE IR",192192 },193193};194194···283273 { USB_DEVICE(VENDOR_FORMOSA, 0xe03c) },284274 /* Formosa Industrial Computing */285275 { USB_DEVICE(VENDOR_FORMOSA, 0xe03e) },276276+ /* Fintek eHome Infrared Transceiver (HP branded) */277277+ { USB_DEVICE(VENDOR_FINTEK, 0x5168) },286278 /* Fintek eHome Infrared Transceiver */287279 { USB_DEVICE(VENDOR_FINTEK, 0x0602) },288280 /* Fintek eHome Infrared Transceiver (in the AOpen MP45) */···304292 { USB_DEVICE(VENDOR_NORTHSTAR, 0xe004) },305293 /* TiVo PC IR Receiver */306294 { USB_DEVICE(VENDOR_TIVO, 0x2000) },307307- /* Conexant SDK */295295+ /* Conexant Hybrid TV "Shelby" Polaris SDK */308296 { USB_DEVICE(VENDOR_CONEXANT, 0x58a1),309297 .driver_info = POLARIS_EVK },298298+ /* Conexant Hybrid TV RDU253S Polaris */299299+ { USB_DEVICE(VENDOR_CONEXANT, 0x58a5),300300+ .driver_info = CX_HYBRID_TV },310301 /* Terminating entry */311302 { }312303};···318303struct mceusb_dev {319304 /* ir-core bits */320305 struct ir_dev_props *props;321321- struct ir_raw_event rawir;306306+307307+ /* optional features we can enable */308308+ bool carrier_report_enabled;309309+ bool learning_enabled;322310323311 /* core device bits */324312 struct device *dev;···336318 /* buffers and dma */337319 unsigned char *buf_in;338320 unsigned int len_in;321321+ dma_addr_t dma_in;322322+ dma_addr_t dma_out;339323340324 enum {341325 CMD_HEADER = 0,···345325 CMD_DATA,346326 PARSE_IRDATA,347327 } parser_state;348348- u8 cmd, rem; /* Remaining IR data bytes in packet */349328350350- dma_addr_t dma_in;351351- dma_addr_t dma_out;329329+ u8 cmd, rem; /* Remaining IR data bytes in packet */352330353331 struct {354332 u32 connected:1;355355- u32 tx_mask_inverted:1;333333+ u32 tx_mask_normal:1;356334 u32 microsoft_gen1:1;335335+ u32 no_tx:1;357336 } flags;358337359338 /* transmit support */···427408 case MCE_CMD_UNKNOWN:428409 case MCE_CMD_S_CARRIER:429410 case MCE_CMD_S_TIMEOUT:430430- case MCE_CMD_G_RXSENSOR:411411+ case MCE_RSP_PULSE_COUNT:431412 datasize = 2;432413 break;414414+ case MCE_CMD_SIG_END:433415 case MCE_CMD_S_TXMASK:434416 case MCE_CMD_S_RXSENSOR:435417 datasize = 1;···453433 return;454434455435 /* skip meaningless 0xb1 0x60 header bytes on orig receiver */456456- if (ir->flags.microsoft_gen1 && !out)436436+ if (ir->flags.microsoft_gen1 && !out && !offset)457437 skip = 2;458438459439 if (len <= skip)···511491 break;512492 case MCE_COMMAND_HEADER:513493 switch (subcmd) {494494+ case MCE_CMD_SIG_END:495495+ dev_info(dev, "End of signal\n");496496+ break;514497 case MCE_CMD_PING:515498 dev_info(dev, "Ping\n");516499 break;···548525 inout, data1 == 0x02 ? "short" : "long");549526 break;550527 case MCE_CMD_G_RXSENSOR:551551- if (len == 2)528528+ /* aka MCE_RSP_PULSE_COUNT */529529+ if (out)552530 dev_info(dev, "Get receive sensor\n");553553- else554554- dev_info(dev, "Received pulse count is %d\n",531531+ else if (ir->learning_enabled)532532+ dev_info(dev, "RX pulse count: %d\n",555533 ((data1 << 8) | data2));556534 break;557535 case MCE_RSP_CMD_INVALID:···748724 return ret ? ret : n;749725}750726751751-/* Sets active IR outputs -- mce devices typically (all?) have two */727727+/* Sets active IR outputs -- mce devices typically have two */752728static int mceusb_set_tx_mask(void *priv, u32 mask)753729{754730 struct mceusb_dev *ir = priv;755731756756- if (ir->flags.tx_mask_inverted)732732+ if (ir->flags.tx_mask_normal)733733+ ir->tx_mask = mask;734734+ else757735 ir->tx_mask = (mask != MCE_DEFAULT_TX_MASK ?758736 mask ^ MCE_DEFAULT_TX_MASK : mask) << 1;759759- else760760- ir->tx_mask = mask;761737762738 return 0;763739}···776752777753 if (carrier == 0) {778754 ir->carrier = carrier;779779- cmdbuf[2] = 0x01;755755+ cmdbuf[2] = MCE_CMD_SIG_END;780756 cmdbuf[3] = MCE_IRDATA_TRAILER;781757 dev_dbg(ir->dev, "%s: disabling carrier "782758 "modulation\n", __func__);···806782 return carrier;807783}808784785785+/*786786+ * We don't do anything but print debug spew for many of the command bits787787+ * we receive from the hardware, but some of them are useful information788788+ * we want to store so that we can use them.789789+ */790790+static void mceusb_handle_command(struct mceusb_dev *ir, int index)791791+{792792+ u8 hi = ir->buf_in[index + 1] & 0xff;793793+ u8 lo = ir->buf_in[index + 2] & 0xff;794794+795795+ switch (ir->buf_in[index]) {796796+ /* 2-byte return value commands */797797+ case MCE_CMD_S_TIMEOUT:798798+ ir->props->timeout = MS_TO_NS((hi << 8 | lo) / 2);799799+ break;800800+801801+ /* 1-byte return value commands */802802+ case MCE_CMD_S_TXMASK:803803+ ir->tx_mask = hi;804804+ break;805805+ case MCE_CMD_S_RXSENSOR:806806+ ir->learning_enabled = (hi == 0x02);807807+ break;808808+ default:809809+ break;810810+ }811811+}812812+809813static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)810814{811815 DEFINE_IR_RAW_EVENT(rawir);···843791 if (ir->flags.microsoft_gen1)844792 i = 2;845793794794+ /* if there's no data, just return now */795795+ if (buf_len <= i)796796+ return;797797+846798 for (; i < buf_len; i++) {847799 switch (ir->parser_state) {848800 case SUBCMD:849801 ir->rem = mceusb_cmdsize(ir->cmd, ir->buf_in[i]);850802 mceusb_dev_printdata(ir, ir->buf_in, i - 1,851803 ir->rem + 2, false);804804+ mceusb_handle_command(ir, i);852805 ir->parser_state = CMD_DATA;853806 break;854807 case PARSE_IRDATA:855808 ir->rem--;856809 rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0);857810 rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK)858858- * MCE_TIME_UNIT * 1000;859859-860860- if ((ir->buf_in[i] & MCE_PULSE_MASK) == 0x7f) {861861- if (ir->rawir.pulse == rawir.pulse) {862862- ir->rawir.duration += rawir.duration;863863- } else {864864- ir->rawir.duration = rawir.duration;865865- ir->rawir.pulse = rawir.pulse;866866- }867867- if (ir->rem)868868- break;869869- }870870- rawir.duration += ir->rawir.duration;871871- ir->rawir.duration = 0;872872- ir->rawir.pulse = rawir.pulse;811811+ * MS_TO_NS(MCE_TIME_UNIT);873812874813 dev_dbg(ir->dev, "Storing %s with duration %d\n",875814 rawir.pulse ? "pulse" : "space",876815 rawir.duration);877816878878- ir_raw_event_store(ir->idev, &rawir);817817+ ir_raw_event_store_with_filter(ir->idev, &rawir);879818 break;880819 case CMD_DATA:881820 ir->rem--;···882839 continue;883840 }884841 ir->rem = (ir->cmd & MCE_PACKET_LENGTH_MASK);885885- mceusb_dev_printdata(ir, ir->buf_in, i, ir->rem + 1, false);886886- if (ir->rem) {842842+ mceusb_dev_printdata(ir, ir->buf_in,843843+ i, ir->rem + 1, false);844844+ if (ir->rem)887845 ir->parser_state = PARSE_IRDATA;888888- break;889889- }890890- /*891891- * a package with len=0 (e. g. 0x80) means end of892892- * data. We could use it to do the call to893893- * ir_raw_event_handle(). For now, we don't need to894894- * use it.895895- */896846 break;897847 }898848···1020984 mce_async_out(ir, GET_CARRIER_FREQ, sizeof(GET_CARRIER_FREQ));1021985 mce_sync_in(ir, NULL, maxp);102298610231023- /* get the transmitter bitmask */10241024- mce_async_out(ir, GET_TX_BITMASK, sizeof(GET_TX_BITMASK));10251025- mce_sync_in(ir, NULL, maxp);987987+ if (!ir->flags.no_tx) {988988+ /* get the transmitter bitmask */989989+ mce_async_out(ir, GET_TX_BITMASK, sizeof(GET_TX_BITMASK));990990+ mce_sync_in(ir, NULL, maxp);991991+ }10269921027993 /* get receiver timeout value */1028994 mce_async_out(ir, GET_RX_TIMEOUT, sizeof(GET_RX_TIMEOUT));···10731035 props->priv = ir;10741036 props->driver_type = RC_DRIVER_IR_RAW;10751037 props->allowed_protos = IR_TYPE_ALL;10761076- props->s_tx_mask = mceusb_set_tx_mask;10771077- props->s_tx_carrier = mceusb_set_tx_carrier;10781078- props->tx_ir = mceusb_tx_ir;10381038+ props->timeout = MS_TO_NS(1000);10391039+ if (!ir->flags.no_tx) {10401040+ props->s_tx_mask = mceusb_set_tx_mask;10411041+ props->s_tx_carrier = mceusb_set_tx_carrier;10421042+ props->tx_ir = mceusb_tx_ir;10431043+ }1079104410801045 ir->props = props;10461046+10471047+ usb_to_input_id(ir->usbdev, &idev->id);10481048+ idev->dev.parent = ir->dev;1081104910821050 if (mceusb_model[ir->model].rc_map)10831051 rc_map = mceusb_model[ir->model].rc_map;···11181074 enum mceusb_model_type model = id->driver_info;11191075 bool is_gen3;11201076 bool is_microsoft_gen1;11211121- bool tx_mask_inverted;10771077+ bool tx_mask_normal;11221078 bool is_polaris;1123107911241124- dev_dbg(&intf->dev, ": %s called\n", __func__);10801080+ dev_dbg(&intf->dev, "%s called\n", __func__);1125108111261082 idesc = intf->cur_altsetting;1127108311281084 is_gen3 = mceusb_model[model].mce_gen3;11291085 is_microsoft_gen1 = mceusb_model[model].mce_gen1;11301130- tx_mask_inverted = mceusb_model[model].tx_mask_inverted;10861086+ tx_mask_normal = mceusb_model[model].tx_mask_normal;11311087 is_polaris = mceusb_model[model].is_polaris;1132108811331089 if (is_polaris) {···11511107 ep_in = ep;11521108 ep_in->bmAttributes = USB_ENDPOINT_XFER_INT;11531109 ep_in->bInterval = 1;11541154- dev_dbg(&intf->dev, ": acceptable inbound endpoint "11101110+ dev_dbg(&intf->dev, "acceptable inbound endpoint "11551111 "found\n");11561112 }11571113···11661122 ep_out = ep;11671123 ep_out->bmAttributes = USB_ENDPOINT_XFER_INT;11681124 ep_out->bInterval = 1;11691169- dev_dbg(&intf->dev, ": acceptable outbound endpoint "11251125+ dev_dbg(&intf->dev, "acceptable outbound endpoint "11701126 "found\n");11711127 }11721128 }11731129 if (ep_in == NULL) {11741174- dev_dbg(&intf->dev, ": inbound and/or endpoint not found\n");11301130+ dev_dbg(&intf->dev, "inbound and/or endpoint not found\n");11751131 return -ENODEV;11761132 }11771133···11941150 ir->dev = &intf->dev;11951151 ir->len_in = maxp;11961152 ir->flags.microsoft_gen1 = is_microsoft_gen1;11971197- ir->flags.tx_mask_inverted = tx_mask_inverted;11531153+ ir->flags.tx_mask_normal = tx_mask_normal;11541154+ ir->flags.no_tx = mceusb_model[model].no_tx;11981155 ir->model = model;11991199-12001200- init_ir_raw_event(&ir->rawir);1201115612021157 /* Saving usb interface data for use by the transmitter routine */12031158 ir->usb_ep_in = ep_in;···1234119112351192 mceusb_get_parameters(ir);1236119312371237- mceusb_set_tx_mask(ir, MCE_DEFAULT_TX_MASK);11941194+ if (!ir->flags.no_tx)11951195+ mceusb_set_tx_mask(ir, MCE_DEFAULT_TX_MASK);1238119612391197 usb_set_intfdata(intf, ir);12401198
+8-2
drivers/media/IR/nuvoton-cir.c
···603603 count = nvt->pkts;604604 nvt_dbg_verbose("Processing buffer of len %d", count);605605606606+ init_ir_raw_event(&rawir);607607+606608 for (i = 0; i < count; i++) {607609 nvt->pkts--;608610 sample = nvt->buf[i];···645643 * indicates end of IR signal, but new data incoming. In both646644 * cases, it means we're ready to call ir_raw_event_handle647645 */648648- if (sample == BUF_PULSE_BIT || ((sample != BUF_LEN_MASK) &&649649- (sample & BUF_REPEAT_MASK) == BUF_REPEAT_BYTE))646646+ if ((sample == BUF_PULSE_BIT) && nvt->pkts) {647647+ nvt_dbg("Calling ir_raw_event_handle (signal end)\n");650648 ir_raw_event_handle(nvt->rdev);649649+ }651650 }651651+652652+ nvt_dbg("Calling ir_raw_event_handle (buffer empty)\n");653653+ ir_raw_event_handle(nvt->rdev);652654653655 if (nvt->pkts) {654656 nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts);
+12-9
drivers/media/IR/streamzap.c
···3434#include <linux/device.h>3535#include <linux/module.h>3636#include <linux/slab.h>3737-#include <linux/usb.h>3837#include <linux/input.h>3838+#include <linux/usb.h>3939+#include <linux/usb/input.h>3940#include <media/ir-core.h>40414142#define DRIVER_VERSION "1.61"···141140142141static void sz_push(struct streamzap_ir *sz, struct ir_raw_event rawir)143142{144144- ir_raw_event_store(sz->idev, &rawir);143143+ dev_dbg(sz->dev, "Storing %s with duration %u us\n",144144+ (rawir.pulse ? "pulse" : "space"), rawir.duration);145145+ ir_raw_event_store_with_filter(sz->idev, &rawir);145146}146147147148static void sz_push_full_pulse(struct streamzap_ir *sz,···170167 rawir.duration *= 1000;171168 rawir.duration &= IR_MAX_DURATION;172169 }173173- dev_dbg(sz->dev, "ls %u\n", rawir.duration);174170 sz_push(sz, rawir);175171176172 sz->idle = false;···182180 sz->sum += rawir.duration;183181 rawir.duration *= 1000;184182 rawir.duration &= IR_MAX_DURATION;185185- dev_dbg(sz->dev, "p %u\n", rawir.duration);186183 sz_push(sz, rawir);187184}188185···201200 rawir.duration += SZ_RESOLUTION / 2;202201 sz->sum += rawir.duration;203202 rawir.duration *= 1000;204204- dev_dbg(sz->dev, "s %u\n", rawir.duration);205203 sz_push(sz, rawir);206204}207205···221221 struct streamzap_ir *sz;222222 unsigned int i;223223 int len;224224- static int timeout = (((SZ_TIMEOUT * SZ_RESOLUTION * 1000) &225225- IR_MAX_DURATION) | 0x03000000);226224227225 if (!urb)228226 return;···244246245247 dev_dbg(sz->dev, "%s: received urb, len %d\n", __func__, len);246248 for (i = 0; i < len; i++) {247247- dev_dbg(sz->dev, "sz idx %d: %x\n",249249+ dev_dbg(sz->dev, "sz->buf_in[%d]: %x\n",248250 i, (unsigned char)sz->buf_in[i]);249251 switch (sz->decoder_state) {250252 case PulseSpace:···271273 DEFINE_IR_RAW_EVENT(rawir);272274273275 rawir.pulse = false;274274- rawir.duration = timeout;276276+ rawir.duration = sz->props->timeout;275277 sz->idle = true;276278 if (sz->timeout_enabled)277279 sz_push(sz, rawir);···332334 props->allowed_protos = IR_TYPE_ALL;333335334336 sz->props = props;337337+338338+ usb_to_input_id(sz->usbdev, &idev->id);339339+ idev->dev.parent = sz->dev;335340336341 ret = ir_input_register(idev, RC_MAP_STREAMZAP, props, DRIVER_NAME);337342 if (ret < 0) {···445444 sz->decoder_state = PulseSpace;446445 /* FIXME: don't yet have a way to set this */447446 sz->timeout_enabled = true;447447+ sz->props->timeout = (((SZ_TIMEOUT * SZ_RESOLUTION * 1000) &448448+ IR_MAX_DURATION) | 0x03000000);448449 #if 0449450 /* not yet supported, depends on patches from maxim */450451 /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */
+17-2
drivers/media/video/cx25840/cx25840-core.c
···19891989 v4l2_ctrl_new_std(&state->hdl, &cx25840_ctrl_ops,19901990 V4L2_CID_HUE, -128, 127, 1, 0);19911991 if (!is_cx2583x(state)) {19921992- default_volume = 228 - cx25840_read(client, 0x8d4);19931993- default_volume = ((default_volume / 2) + 23) << 9;19921992+ default_volume = cx25840_read(client, 0x8d4);19931993+ /*19941994+ * Enforce the legacy PVR-350/MSP3400 to PVR-150/CX25843 volume19951995+ * scale mapping limits to avoid -ERANGE errors when19961996+ * initializing the volume control19971997+ */19981998+ if (default_volume > 228) {19991999+ /* Bottom out at -96 dB, v4l2 vol range 0x2e00-0x2fff */20002000+ default_volume = 228;20012001+ cx25840_write(client, 0x8d4, 228);20022002+ }20032003+ else if (default_volume < 20) {20042004+ /* Top out at + 8 dB, v4l2 vol range 0xfe00-0xffff */20052005+ default_volume = 20;20062006+ cx25840_write(client, 0x8d4, 20);20072007+ }20082008+ default_volume = (((228 - default_volume) >> 1) + 23) << 9;1994200919952010 state->volume = v4l2_ctrl_new_std(&state->hdl,19962011 &cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME,
···13131414/*#define DEBUG*/15151616+#include <linux/sched.h>1617#include <linux/types.h>1818+#include <linux/videodev2.h>1719#include <media/videobuf-core.h>1820#include <media/v4l2-device.h>1921#include <media/v4l2-mem2mem.h>2022#include <media/v4l2-mediabus.h>2123#include <media/s3c_fimc.h>2222-#include <linux/videodev2.h>2424+2325#include "regs-fimc.h"24262527#define err(fmt, args...) \···371369 * @pix_hoff: indicate whether horizontal offset is in pixels or in bytes372370 * @has_inp_rot: set if has input rotator373371 * @has_out_rot: set if has output rotator372372+ * @has_cistatus2: 1 if CISTATUS2 register is present in this IP revision374373 * @pix_limit: pixel size constraints for the scaler375374 * @min_inp_pixsize: minimum input pixel size376375 * @min_out_pixsize: minimum output pixel size···382379 unsigned int pix_hoff:1;383380 unsigned int has_inp_rot:1;384381 unsigned int has_out_rot:1;382382+ unsigned int has_cistatus2:1;385383 struct fimc_pix_limit *pix_limit;386384 u16 min_inp_pixsize;387385 u16 min_out_pixsize;···558554 return frame;559555}560556557557+/* Return an index to the buffer actually being written. */561558static inline u32 fimc_hw_get_frame_index(struct fimc_dev *dev)562559{563563- u32 reg = readl(dev->regs + S5P_CISTATUS);564564- return (reg & S5P_CISTATUS_FRAMECNT_MASK) >>565565- S5P_CISTATUS_FRAMECNT_SHIFT;560560+ u32 reg;561561+562562+ if (dev->variant->has_cistatus2) {563563+ reg = readl(dev->regs + S5P_CISTATUS2) & 0x3F;564564+ return reg > 0 ? --reg : reg;565565+ } else {566566+ reg = readl(dev->regs + S5P_CISTATUS);567567+ return (reg & S5P_CISTATUS_FRAMECNT_MASK) >>568568+ S5P_CISTATUS_FRAMECNT_SHIFT;569569+ }566570}567571568572/* -----------------------------------------------------*/···606594 struct v4l2_format *f);607595int fimc_vidioc_try_fmt(struct file *file, void *priv,608596 struct v4l2_format *f);609609-int fimc_vidioc_g_crop(struct file *file, void *fh,610610- struct v4l2_crop *cr);611611-int fimc_vidioc_cropcap(struct file *file, void *fh,612612- struct v4l2_cropcap *cr);613597int fimc_vidioc_queryctrl(struct file *file, void *priv,614598 struct v4l2_queryctrl *qc);615599int fimc_vidioc_g_ctrl(struct file *file, void *priv,
+3
drivers/media/video/s5p-fimc/regs-fimc.h
···165165#define S5P_CISTATUS_VVALID_A (1 << 15)166166#define S5P_CISTATUS_VVALID_B (1 << 14)167167168168+/* Indexes to the last and the currently processed buffer. */169169+#define S5P_CISTATUS2 0x68170170+168171/* Image capture control */169172#define S5P_CIIMGCPT 0xc0170173#define S5P_CIIMGCPT_IMGCPTEN (1 << 31)
+1-1
drivers/media/video/sh_mobile_ceu_camera.c
···19801980 * we complete the completion.19811981 */1982198219831983- if (!csi2->driver || !csi2->driver->owner) {19831983+ if (!csi2->driver) {19841984 complete(&wait.completion);19851985 /* Either too late, or probing failed */19861986 bus_unregister_notifier(&platform_bus_type, &wait.notifier);
···3535#include <media/v4l2-device.h>3636#include <media/v4l2-chip-ident.h>3737#include <media/v4l2-ctrls.h>3838-#include <media/wm8775.h>39384039MODULE_DESCRIPTION("wm8775 driver");4140MODULE_AUTHOR("Ulf Eklund, Hans Verkuil");···5051 TOT_REGS5152};52535353-#define ALC_HOLD 0x85 /* R17: use zero cross detection, ALC hold time 42.6 ms */5454-#define ALC_EN 0x100 /* R17: ALC enable */5555-5654struct wm8775_state {5755 struct v4l2_subdev sd;5856 struct v4l2_ctrl_handler hdl;5957 struct v4l2_ctrl *mute;6060- struct v4l2_ctrl *vol;6161- struct v4l2_ctrl *bal;6262- struct v4l2_ctrl *loud;6358 u8 input; /* Last selected input (0-0xf) */6459};6560···8592 return -1;8693}87948888-static void wm8775_set_audio(struct v4l2_subdev *sd, int quietly)8989-{9090- struct wm8775_state *state = to_state(sd);9191- u8 vol_l, vol_r;9292- int muted = 0 != state->mute->val;9393- u16 volume = (u16)state->vol->val;9494- u16 balance = (u16)state->bal->val;9595-9696- /* normalize ( 65535 to 0 -> 255 to 0 (+24dB to -103dB) ) */9797- vol_l = (min(65536 - balance, 32768) * volume) >> 23;9898- vol_r = (min(balance, (u16)32768) * volume) >> 23;9999-100100- /* Mute */101101- if (muted || quietly)102102- wm8775_write(sd, R21, 0x0c0 | state->input);103103-104104- wm8775_write(sd, R14, vol_l | 0x100); /* 0x100= Left channel ADC zero cross enable */105105- wm8775_write(sd, R15, vol_r | 0x100); /* 0x100= Right channel ADC zero cross enable */106106-107107- /* Un-mute */108108- if (!muted)109109- wm8775_write(sd, R21, state->input);110110-}111111-11295static int wm8775_s_routing(struct v4l2_subdev *sd,11396 u32 input, u32 output, u32 config)11497{···102133 state->input = input;103134 if (!v4l2_ctrl_g_ctrl(state->mute))104135 return 0;105105- if (!v4l2_ctrl_g_ctrl(state->vol))106106- return 0;107107- if (!v4l2_ctrl_g_ctrl(state->bal))108108- return 0;109109- wm8775_set_audio(sd, 1);136136+ wm8775_write(sd, R21, 0x0c0);137137+ wm8775_write(sd, R14, 0x1d4);138138+ wm8775_write(sd, R15, 0x1d4);139139+ wm8775_write(sd, R21, 0x100 + state->input);110140 return 0;111141}112142113143static int wm8775_s_ctrl(struct v4l2_ctrl *ctrl)114144{115145 struct v4l2_subdev *sd = to_sd(ctrl);146146+ struct wm8775_state *state = to_state(sd);116147117148 switch (ctrl->id) {118149 case V4L2_CID_AUDIO_MUTE:119119- case V4L2_CID_AUDIO_VOLUME:120120- case V4L2_CID_AUDIO_BALANCE:121121- wm8775_set_audio(sd, 0);122122- return 0;123123- case V4L2_CID_AUDIO_LOUDNESS:124124- wm8775_write(sd, R17, (ctrl->val ? ALC_EN : 0) | ALC_HOLD);150150+ wm8775_write(sd, R21, 0x0c0);151151+ wm8775_write(sd, R14, 0x1d4);152152+ wm8775_write(sd, R15, 0x1d4);153153+ if (!ctrl->val)154154+ wm8775_write(sd, R21, 0x100 + state->input);125155 return 0;126156 }127157 return -EINVAL;···144176145177static int wm8775_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq)146178{147147- wm8775_set_audio(sd, 0);179179+ struct wm8775_state *state = to_state(sd);180180+181181+ /* If I remove this, then it can happen that I have no182182+ sound the first time I tune from static to a valid channel.183183+ It's difficult to reproduce and is almost certainly related184184+ to the zero cross detect circuit. */185185+ wm8775_write(sd, R21, 0x0c0);186186+ wm8775_write(sd, R14, 0x1d4);187187+ wm8775_write(sd, R15, 0x1d4);188188+ wm8775_write(sd, R21, 0x100 + state->input);148189 return 0;149190}150191···203226{204227 struct wm8775_state *state;205228 struct v4l2_subdev *sd;206206- int err;207229208230 /* Check if the adapter supports the needed features */209231 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))···216240 return -ENOMEM;217241 sd = &state->sd;218242 v4l2_i2c_subdev_init(sd, client, &wm8775_ops);219219- sd->grp_id = WM8775_GID; /* subdev group id */220243 state->input = 2;221244222222- v4l2_ctrl_handler_init(&state->hdl, 4);245245+ v4l2_ctrl_handler_init(&state->hdl, 1);223246 state->mute = v4l2_ctrl_new_std(&state->hdl, &wm8775_ctrl_ops,224247 V4L2_CID_AUDIO_MUTE, 0, 1, 1, 0);225225- state->vol = v4l2_ctrl_new_std(&state->hdl, &wm8775_ctrl_ops,226226- V4L2_CID_AUDIO_VOLUME, 0, 65535, (65535+99)/100, 0xCF00); /* 0dB*/227227- state->bal = v4l2_ctrl_new_std(&state->hdl, &wm8775_ctrl_ops,228228- V4L2_CID_AUDIO_BALANCE, 0, 65535, (65535+99)/100, 32768);229229- state->loud = v4l2_ctrl_new_std(&state->hdl, &wm8775_ctrl_ops,230230- V4L2_CID_AUDIO_LOUDNESS, 0, 1, 1, 1);231248 sd->ctrl_handler = &state->hdl;232232- err = state->hdl.error;233233- if (err) {249249+ if (state->hdl.error) {250250+ int err = state->hdl.error;251251+234252 v4l2_ctrl_handler_free(&state->hdl);235253 kfree(state);236254 return err;···236266 wm8775_write(sd, R23, 0x000);237267 /* Disable zero cross detect timeout */238268 wm8775_write(sd, R7, 0x000);239239- /* HPF enable, I2S mode, 24-bit */240240- wm8775_write(sd, R11, 0x022);269269+ /* Left justified, 24-bit mode */270270+ wm8775_write(sd, R11, 0x021);241271 /* Master mode, clock ratio 256fs */242272 wm8775_write(sd, R12, 0x102);243273 /* Powered up */244274 wm8775_write(sd, R13, 0x000);245245- /* ALC stereo, ALC target level -5dB FS, ALC max gain +8dB */246246- wm8775_write(sd, R16, 0x1bb);247247- /* Set ALC mode and hold time */248248- wm8775_write(sd, R17, (state->loud->val ? ALC_EN : 0) | ALC_HOLD);275275+ /* ADC gain +2.5dB, enable zero cross */276276+ wm8775_write(sd, R14, 0x1d4);277277+ /* ADC gain +2.5dB, enable zero cross */278278+ wm8775_write(sd, R15, 0x1d4);279279+ /* ALC Stereo, ALC target level -1dB FS max gain +8dB */280280+ wm8775_write(sd, R16, 0x1bf);281281+ /* Enable gain control, use zero cross detection,282282+ ALC hold time 42.6 ms */283283+ wm8775_write(sd, R17, 0x185);249284 /* ALC gain ramp up delay 34 s, ALC gain ramp down delay 33 ms */250285 wm8775_write(sd, R18, 0x0a2);251286 /* Enable noise gate, threshold -72dBfs */252287 wm8775_write(sd, R19, 0x005);253253- /* Transient window 4ms, ALC min gain -5dB */254254- wm8775_write(sd, R20, 0x0fb);255255-256256- wm8775_set_audio(sd, 1); /* set volume/mute/mux */257257-288288+ /* Transient window 4ms, lower PGA gain limit -1dB */289289+ wm8775_write(sd, R20, 0x07a);290290+ /* LRBOTH = 1, use input 2. */291291+ wm8775_write(sd, R21, 0x102);258292 return 0;259293}260294
+1-1
drivers/mfd/ab8500-core.c
···303303 continue;304304305305 do {306306- int bit = __ffs(status);306306+ int bit = __ffs(value);307307 int line = i * 8 + bit;308308309309 handle_nested_irq(ab8500->irq_base + line);
+6-2
drivers/mfd/wm831x-core.c
···14551455 dev_err(wm831x->dev, "Failed to read parent ID: %d\n", ret);14561456 goto err;14571457 }14581458- if (ret != 0x6204) {14581458+ switch (ret) {14591459+ case 0x6204:14601460+ case 0x6246:14611461+ break;14621462+ default:14591463 dev_err(wm831x->dev, "Device is not a WM831x: ID %x\n", ret);14601464 ret = -EINVAL;14611465 goto err;···16241620 case WM8325:16251621 ret = mfd_add_devices(wm831x->dev, -1,16261622 wm8320_devs, ARRAY_SIZE(wm8320_devs),16271627- NULL, 0);16231623+ NULL, wm831x->irq_base);16281624 break;1629162516301626 default:
···234234 u8 __iomem *db; /* Door Bell */235235 u8 __iomem *pcicfg; /* PCI config space */236236237237- spinlock_t mbox_lock; /* For serializing mbox cmds to BE card */237237+ struct mutex mbox_lock; /* For serializing mbox cmds to BE card */238238 struct be_dma_mem mbox_mem;239239 /* Mbox mem is adjusted to align to 16 bytes. The allocated addr240240 * is stored for freeing purpose */
+45-30
drivers/net/benet/be_cmds.c
···462462 u8 *wrb;463463 int status;464464465465- spin_lock(&adapter->mbox_lock);465465+ if (mutex_lock_interruptible(&adapter->mbox_lock))466466+ return -1;466467467468 wrb = (u8 *)wrb_from_mbox(adapter);468469 *wrb++ = 0xFF;···477476478477 status = be_mbox_notify_wait(adapter);479478480480- spin_unlock(&adapter->mbox_lock);479479+ mutex_unlock(&adapter->mbox_lock);481480 return status;482481}483482···492491 if (adapter->eeh_err)493492 return -EIO;494493495495- spin_lock(&adapter->mbox_lock);494494+ if (mutex_lock_interruptible(&adapter->mbox_lock))495495+ return -1;496496497497 wrb = (u8 *)wrb_from_mbox(adapter);498498 *wrb++ = 0xFF;···507505508506 status = be_mbox_notify_wait(adapter);509507510510- spin_unlock(&adapter->mbox_lock);508508+ mutex_unlock(&adapter->mbox_lock);511509 return status;512510}513511int be_cmd_eq_create(struct be_adapter *adapter,···518516 struct be_dma_mem *q_mem = &eq->dma_mem;519517 int status;520518521521- spin_lock(&adapter->mbox_lock);519519+ if (mutex_lock_interruptible(&adapter->mbox_lock))520520+ return -1;522521523522 wrb = wrb_from_mbox(adapter);524523 req = embedded_payload(wrb);···549546 eq->created = true;550547 }551548552552- spin_unlock(&adapter->mbox_lock);549549+ mutex_unlock(&adapter->mbox_lock);553550 return status;554551}555552···561558 struct be_cmd_req_mac_query *req;562559 int status;563560564564- spin_lock(&adapter->mbox_lock);561561+ if (mutex_lock_interruptible(&adapter->mbox_lock))562562+ return -1;565563566564 wrb = wrb_from_mbox(adapter);567565 req = embedded_payload(wrb);···587583 memcpy(mac_addr, resp->mac.addr, ETH_ALEN);588584 }589585590590- spin_unlock(&adapter->mbox_lock);586586+ mutex_unlock(&adapter->mbox_lock);591587 return status;592588}593589···671667 void *ctxt;672668 int status;673669674674- spin_lock(&adapter->mbox_lock);670670+ if (mutex_lock_interruptible(&adapter->mbox_lock))671671+ return -1;675672676673 wrb = wrb_from_mbox(adapter);677674 req = embedded_payload(wrb);···706701 cq->created = true;707702 }708703709709- spin_unlock(&adapter->mbox_lock);704704+ mutex_unlock(&adapter->mbox_lock);710705711706 return status;712707}···729724 void *ctxt;730725 int status;731726732732- spin_lock(&adapter->mbox_lock);727727+ if (mutex_lock_interruptible(&adapter->mbox_lock))728728+ return -1;733729734730 wrb = wrb_from_mbox(adapter);735731 req = embedded_payload(wrb);···760754 mccq->id = le16_to_cpu(resp->id);761755 mccq->created = true;762756 }763763- spin_unlock(&adapter->mbox_lock);757757+ mutex_unlock(&adapter->mbox_lock);764758765759 return status;766760}···775769 void *ctxt;776770 int status;777771778778- spin_lock(&adapter->mbox_lock);772772+ if (mutex_lock_interruptible(&adapter->mbox_lock))773773+ return -1;779774780775 wrb = wrb_from_mbox(adapter);781776 req = embedded_payload(wrb);···808801 txq->created = true;809802 }810803811811- spin_unlock(&adapter->mbox_lock);804804+ mutex_unlock(&adapter->mbox_lock);812805813806 return status;814807}···823816 struct be_dma_mem *q_mem = &rxq->dma_mem;824817 int status;825818826826- spin_lock(&adapter->mbox_lock);819819+ if (mutex_lock_interruptible(&adapter->mbox_lock))820820+ return -1;827821828822 wrb = wrb_from_mbox(adapter);829823 req = embedded_payload(wrb);···851843 *rss_id = resp->rss_id;852844 }853845854854- spin_unlock(&adapter->mbox_lock);846846+ mutex_unlock(&adapter->mbox_lock);855847856848 return status;857849}···870862 if (adapter->eeh_err)871863 return -EIO;872864873873- spin_lock(&adapter->mbox_lock);865865+ if (mutex_lock_interruptible(&adapter->mbox_lock))866866+ return -1;874867875868 wrb = wrb_from_mbox(adapter);876869 req = embedded_payload(wrb);···908899909900 status = be_mbox_notify_wait(adapter);910901911911- spin_unlock(&adapter->mbox_lock);902902+ mutex_unlock(&adapter->mbox_lock);912903913904 return status;914905}···924915 struct be_cmd_req_if_create *req;925916 int status;926917927927- spin_lock(&adapter->mbox_lock);918918+ if (mutex_lock_interruptible(&adapter->mbox_lock))919919+ return -1;928920929921 wrb = wrb_from_mbox(adapter);930922 req = embedded_payload(wrb);···951941 *pmac_id = le32_to_cpu(resp->pmac_id);952942 }953943954954- spin_unlock(&adapter->mbox_lock);944944+ mutex_unlock(&adapter->mbox_lock);955945 return status;956946}957947···965955 if (adapter->eeh_err)966956 return -EIO;967957968968- spin_lock(&adapter->mbox_lock);958958+ if (mutex_lock_interruptible(&adapter->mbox_lock))959959+ return -1;969960970961 wrb = wrb_from_mbox(adapter);971962 req = embedded_payload(wrb);···981970982971 status = be_mbox_notify_wait(adapter);983972984984- spin_unlock(&adapter->mbox_lock);973973+ mutex_unlock(&adapter->mbox_lock);985974986975 return status;987976}···10711060 struct be_cmd_req_get_fw_version *req;10721061 int status;1073106210741074- spin_lock(&adapter->mbox_lock);10631063+ if (mutex_lock_interruptible(&adapter->mbox_lock))10641064+ return -1;1075106510761066 wrb = wrb_from_mbox(adapter);10771067 req = embedded_payload(wrb);···10891077 strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN);10901078 }1091107910921092- spin_unlock(&adapter->mbox_lock);10801080+ mutex_unlock(&adapter->mbox_lock);10931081 return status;10941082}10951083···13341322 struct be_cmd_req_query_fw_cfg *req;13351323 int status;1336132413371337- spin_lock(&adapter->mbox_lock);13251325+ if (mutex_lock_interruptible(&adapter->mbox_lock))13261326+ return -1;1338132713391328 wrb = wrb_from_mbox(adapter);13401329 req = embedded_payload(wrb);···13541341 *caps = le32_to_cpu(resp->function_caps);13551342 }1356134313571357- spin_unlock(&adapter->mbox_lock);13441344+ mutex_unlock(&adapter->mbox_lock);13581345 return status;13591346}13601347···13651352 struct be_cmd_req_hdr *req;13661353 int status;1367135413681368- spin_lock(&adapter->mbox_lock);13551355+ if (mutex_lock_interruptible(&adapter->mbox_lock))13561356+ return -1;1369135713701358 wrb = wrb_from_mbox(adapter);13711359 req = embedded_payload(wrb);···1379136513801366 status = be_mbox_notify_wait(adapter);1381136713821382- spin_unlock(&adapter->mbox_lock);13681368+ mutex_unlock(&adapter->mbox_lock);13831369 return status;13841370}13851371···13901376 u32 myhash[10];13911377 int status;1392137813931393- spin_lock(&adapter->mbox_lock);13791379+ if (mutex_lock_interruptible(&adapter->mbox_lock))13801380+ return -1;1394138113951382 wrb = wrb_from_mbox(adapter);13961383 req = embedded_payload(wrb);···1411139614121397 status = be_mbox_notify_wait(adapter);1413139814141414- spin_unlock(&adapter->mbox_lock);13991399+ mutex_unlock(&adapter->mbox_lock);14151400 return status;14161401}14171402
···8888 }89899090 if (vlan_id) {9191- skb = vlan_put_tag(skb, vlan_id);9191+ /* The Ethernet header is not present yet, so it is9292+ * too early to insert a VLAN tag. Force use of an9393+ * out-of-line tag here and let dev_hard_start_xmit()9494+ * insert it if the slave hardware can't.9595+ */9696+ skb = __vlan_hwaccel_put_tag(skb, vlan_id);9297 if (!skb) {9398 pr_err("failed to insert VLAN tag\n");9499 return;
+10-32
drivers/net/bonding/bond_main.c
···418418 * @bond: bond device that got this skb for tx.419419 * @skb: hw accel VLAN tagged skb to transmit420420 * @slave_dev: slave that is supposed to xmit this skbuff421421- *422422- * When the bond gets an skb to transmit that is423423- * already hardware accelerated VLAN tagged, and it424424- * needs to relay this skb to a slave that is not425425- * hw accel capable, the skb needs to be "unaccelerated",426426- * i.e. strip the hwaccel tag and re-insert it as part427427- * of the payload.428421 */429422int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,430423 struct net_device *slave_dev)431424{432432- unsigned short uninitialized_var(vlan_id);433433-434434- /* Test vlan_list not vlgrp to catch and handle 802.1p tags */435435- if (!list_empty(&bond->vlan_list) &&436436- !(slave_dev->features & NETIF_F_HW_VLAN_TX) &&437437- vlan_get_tag(skb, &vlan_id) == 0) {438438- skb->dev = slave_dev;439439- skb = vlan_put_tag(skb, vlan_id);440440- if (!skb) {441441- /* vlan_put_tag() frees the skb in case of error,442442- * so return success here so the calling functions443443- * won't attempt to free is again.444444- */445445- return 0;446446- }447447- } else {448448- skb->dev = slave_dev;449449- }450450-425425+ skb->dev = slave_dev;451426 skb->priority = 1;452427#ifdef CONFIG_NET_POLL_CONTROLLER453428 if (unlikely(bond->dev->priv_flags & IFF_IN_NETPOLL)) {···11781203 bond_do_fail_over_mac(bond, new_active,11791204 old_active);1180120511811181- bond->send_grat_arp = bond->params.num_grat_arp;11821182- bond_send_gratuitous_arp(bond);12061206+ if (netif_running(bond->dev)) {12071207+ bond->send_grat_arp = bond->params.num_grat_arp;12081208+ bond_send_gratuitous_arp(bond);1183120911841184- bond->send_unsol_na = bond->params.num_unsol_na;11851185- bond_send_unsolicited_na(bond);12101210+ bond->send_unsol_na = bond->params.num_unsol_na;12111211+ bond_send_unsolicited_na(bond);12121212+ }1186121311871214 write_unlock_bh(&bond->curr_slave_lock);11881215 read_unlock(&bond->lock);···1198122111991222 /* resend IGMP joins since active slave has changed or12001223 * all were sent on curr_active_slave */12011201- if ((USES_PRIMARY(bond->params.mode) && new_active) ||12021202- bond->params.mode == BOND_MODE_ROUNDROBIN) {12241224+ if (((USES_PRIMARY(bond->params.mode) && new_active) ||12251225+ bond->params.mode == BOND_MODE_ROUNDROBIN) &&12261226+ netif_running(bond->dev)) {12031227 bond->igmp_retrans = bond->params.resend_igmp;12041228 queue_delayed_work(bond->wq, &bond->mcast_work, 0);12051229 }
···12851285}1286128612871287#ifdef CONFIG_PPP_MULTILINK12881288+static bool mp_protocol_compress __read_mostly = true;12891289+module_param(mp_protocol_compress, bool, S_IRUGO | S_IWUSR);12901290+MODULE_PARM_DESC(mp_protocol_compress,12911291+ "compress protocol id in multilink fragments");12921292+12881293/*12891294 * Divide a packet to be transmitted into fragments and12901295 * send them out the individual links.···13521347 if (nfree == 0 || nfree < navail / 2)13531348 return 0; /* can't take now, leave it in xmit_pending */1354134913551355- /* Do protocol field compression (XXX this should be optional) */13501350+ /* Do protocol field compression */13561351 p = skb->data;13571352 len = skb->len;13581358- if (*p == 0) {13531353+ if (*p == 0 && mp_protocol_compress) {13591354 ++p;13601355 --len;13611356 }
+1-1
drivers/net/skfp/skfddi.c
···412412 bp->SharedMemAddr = pci_alloc_consistent(&bp->pdev,413413 bp->SharedMemSize,414414 &bp->SharedMemDMA);415415- if (!bp->SharedMemSize) {415415+ if (!bp->SharedMemAddr) {416416 printk("could not allocate mem for ");417417 printk("hardware module: %ld byte\n",418418 bp->SharedMemSize);
+1-1
drivers/net/starfire.c
···148148 * This SUCKS.149149 * We need a much better method to determine if dma_addr_t is 64-bit.150150 */151151-#if (defined(__i386__) && defined(CONFIG_HIGHMEM64G)) || defined(__x86_64__) || defined (__ia64__) || defined(__alpha__) || defined(__mips64__) || (defined(__mips__) && defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) || (defined(__powerpc64__) || defined(CONFIG_PHYS_64BIT))151151+#if (defined(__i386__) && defined(CONFIG_HIGHMEM64G)) || defined(__x86_64__) || defined (__ia64__) || defined(__alpha__) || (defined(CONFIG_MIPS) && ((defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) || defined(CONFIG_64BIT))) || (defined(__powerpc64__) || defined(CONFIG_PHYS_64BIT))152152/* 64-bit dma_addr_t */153153#define ADDR_64BITS /* This chip uses 64 bit addresses. */154154#define netdrv_addr_t __le64
+2-2
drivers/net/sundance.c
···1016101610171017 /* Fill in the Rx buffers. Handle allocation failure gracefully. */10181018 for (i = 0; i < RX_RING_SIZE; i++) {10191019- struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);10191019+ struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + 2);10201020 np->rx_skbuff[i] = skb;10211021 if (skb == NULL)10221022 break;···14071407 struct sk_buff *skb;14081408 entry = np->dirty_rx % RX_RING_SIZE;14091409 if (np->rx_skbuff[entry] == NULL) {14101410- skb = dev_alloc_skb(np->rx_buf_sz);14101410+ skb = dev_alloc_skb(np->rx_buf_sz + 2);14111411 np->rx_skbuff[entry] = skb;14121412 if (skb == NULL)14131413 break; /* Better luck next round. */
···11/*22- * MOSCHIP MCS7830 based USB 2.0 Ethernet Devices22+ * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices33 *44 * based on usbnet.c, asix.c and the vendor provided mcs7830 driver55 *···1010 * Copyright (c) 2002-2003 TiVo Inc.1111 *1212 * Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!).1313+ *1414+ * 2010-12-19: add 7832 USB PID ("functionality same as MCS7830"),1515+ * per active notification by manufacturer1316 *1417 * TODO:1518 * - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?)···6360#define MCS7830_MAX_MCAST 6464616562#define MCS7830_VENDOR_ID 0x97106363+#define MCS7832_PRODUCT_ID 0x78326664#define MCS7830_PRODUCT_ID 0x78306765#define MCS7730_PRODUCT_ID 0x77306866···355351 if (!ret)356352 ret = mcs7830_write_phy(dev, MII_BMCR,357353 BMCR_ANENABLE | BMCR_ANRESTART );358358- return ret < 0 ? : 0;354354+ return ret;359355}360356361357···630626}631627632628static const struct driver_info moschip_info = {633633- .description = "MOSCHIP 7830/7730 usb-NET adapter",629629+ .description = "MOSCHIP 7830/7832/7730 usb-NET adapter",634630 .bind = mcs7830_bind,635631 .rx_fixup = mcs7830_rx_fixup,636632 .flags = FLAG_ETHER,···648644};649645650646static const struct usb_device_id products[] = {647647+ {648648+ USB_DEVICE(MCS7830_VENDOR_ID, MCS7832_PRODUCT_ID),649649+ .driver_info = (unsigned long) &moschip_info,650650+ },651651 {652652 USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID),653653 .driver_info = (unsigned long) &moschip_info,
+3-1
drivers/net/veth.c
···166166 if (!(rcv->flags & IFF_UP))167167 goto tx_drop;168168169169- if (dev->features & NETIF_F_NO_CSUM)169169+ /* don't change ip_summed == CHECKSUM_PARTIAL, as that170170+ will cause bad checksum on forwarded packets */171171+ if (skb->ip_summed == CHECKSUM_NONE)170172 skb->ip_summed = rcv_priv->ip_summed;171173172174 length = skb->len + ETH_HLEN;
-1
drivers/net/wireless/hostap/hostap_main.c
···891891892892 SET_ETHTOOL_OPS(dev, &prism2_ethtool_ops);893893894894- netif_stop_queue(dev);895894}896895897896static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked)
···561561 .ht_params = &iwl6000_ht_params,562562 .need_dc_calib = true,563563 .need_temp_offset_calib = true,564564+ .use_new_eeprom_reading = true,564565};565566566567struct iwl_cfg iwl6000g2a_2abg_cfg = {···579578 .base_params = &iwl6000_base_params,580579 .need_dc_calib = true,581580 .need_temp_offset_calib = true,581581+ .use_new_eeprom_reading = true,582582};583583584584struct iwl_cfg iwl6000g2a_2bg_cfg = {···597595 .base_params = &iwl6000_base_params,598596 .need_dc_calib = true,599597 .need_temp_offset_calib = true,598598+ .use_new_eeprom_reading = true,600599};601600602601struct iwl_cfg iwl6000g2b_2agn_cfg = {···619616 .need_temp_offset_calib = true,620617 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */621618 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,619619+ .use_new_eeprom_reading = true,622620};623621624622struct iwl_cfg iwl6000g2b_2abg_cfg = {···640636 .need_temp_offset_calib = true,641637 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */642638 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,639639+ .use_new_eeprom_reading = true,643640};644641645642struct iwl_cfg iwl6000g2b_2bgn_cfg = {···662657 .need_temp_offset_calib = true,663658 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */664659 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,660660+ .use_new_eeprom_reading = true,665661};666662667663struct iwl_cfg iwl6000g2b_2bg_cfg = {···683677 .need_temp_offset_calib = true,684678 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */685679 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,680680+ .use_new_eeprom_reading = true,686681};687682688683struct iwl_cfg iwl6000g2b_bgn_cfg = {···705698 .need_temp_offset_calib = true,706699 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */707700 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,701701+ .use_new_eeprom_reading = true,708702};709703710704struct iwl_cfg iwl6000g2b_bg_cfg = {···726718 .need_temp_offset_calib = true,727719 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */728720 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,721721+ .use_new_eeprom_reading = true,729722};730723731724/*···813804 .base_params = &iwl6050_base_params,814805 .ht_params = &iwl6000_ht_params,815806 .need_dc_calib = true,807807+ .use_new_eeprom_reading = true,816808};817809818810struct iwl_cfg iwl6050_2abg_cfg = {···867857 .need_dc_calib = true,868858 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */869859 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,860860+ .use_new_eeprom_reading = true,870861};871862872863struct iwl_cfg iwl130_bg_cfg = {···887876 .need_dc_calib = true,888877 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */889878 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,879879+ .use_new_eeprom_reading = true,890880};891881892882MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
+86-2
drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
···392392/**393393 * iwlcore_eeprom_enhanced_txpower: process enhanced tx power info394394 */395395-void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv)395395+static void iwlcore_eeprom_enhanced_txpower_old(struct iwl_priv *priv)396396{397397 int eeprom_section_count = 0;398398 int section, element;···419419 * always check for valid entry before process420420 * the information421421 */422422- if (!enhanced_txpower->common || enhanced_txpower->reserved)422422+ if (!(enhanced_txpower->flags || enhanced_txpower->channel) ||423423+ enhanced_txpower->delta_20_in_40)423424 continue;424425425426 for (element = 0; element < eeprom_section_count; element++) {···452451 max_txpower_in_half_dbm;453452 }454453 }454454+}455455+456456+static void457457+iwlcore_eeprom_enh_txp_read_element(struct iwl_priv *priv,458458+ struct iwl_eeprom_enhanced_txpwr *txp,459459+ s8 max_txpower_avg)460460+{461461+ int ch_idx;462462+ bool is_ht40 = txp->flags & IWL_EEPROM_ENH_TXP_FL_40MHZ;463463+ enum ieee80211_band band;464464+465465+ band = txp->flags & IWL_EEPROM_ENH_TXP_FL_BAND_52G ?466466+ IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ;467467+468468+ for (ch_idx = 0; ch_idx < priv->channel_count; ch_idx++) {469469+ struct iwl_channel_info *ch_info = &priv->channel_info[ch_idx];470470+471471+ /* update matching channel or from common data only */472472+ if (txp->channel != 0 && ch_info->channel != txp->channel)473473+ continue;474474+475475+ /* update matching band only */476476+ if (band != ch_info->band)477477+ continue;478478+479479+ if (ch_info->max_power_avg < max_txpower_avg && !is_ht40) {480480+ ch_info->max_power_avg = max_txpower_avg;481481+ ch_info->curr_txpow = max_txpower_avg;482482+ ch_info->scan_power = max_txpower_avg;483483+ }484484+485485+ if (is_ht40 && ch_info->ht40_max_power_avg < max_txpower_avg)486486+ ch_info->ht40_max_power_avg = max_txpower_avg;487487+ }488488+}489489+490490+#define EEPROM_TXP_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT)491491+#define EEPROM_TXP_ENTRY_LEN sizeof(struct iwl_eeprom_enhanced_txpwr)492492+#define EEPROM_TXP_SZ_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT_SIZE)493493+494494+static void iwlcore_eeprom_enhanced_txpower_new(struct iwl_priv *priv)495495+{496496+ struct iwl_eeprom_enhanced_txpwr *txp_array, *txp;497497+ int idx, entries;498498+ __le16 *txp_len;499499+ s8 max_txp_avg, max_txp_avg_halfdbm;500500+501501+ BUILD_BUG_ON(sizeof(struct iwl_eeprom_enhanced_txpwr) != 8);502502+503503+ /* the length is in 16-bit words, but we want entries */504504+ txp_len = (__le16 *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_SZ_OFFS);505505+ entries = le16_to_cpup(txp_len) * 2 / EEPROM_TXP_ENTRY_LEN;506506+507507+ txp_array = (void *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_OFFS);508508+ for (idx = 0; idx < entries; idx++) {509509+ txp = &txp_array[idx];510510+511511+ /* skip invalid entries */512512+ if (!(txp->flags & IWL_EEPROM_ENH_TXP_FL_VALID))513513+ continue;514514+515515+ max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx,516516+ &max_txp_avg_halfdbm);517517+518518+ /*519519+ * Update the user limit values values to the highest520520+ * power supported by any channel521521+ */522522+ if (max_txp_avg > priv->tx_power_user_lmt)523523+ priv->tx_power_user_lmt = max_txp_avg;524524+ if (max_txp_avg_halfdbm > priv->tx_power_lmt_in_half_dbm)525525+ priv->tx_power_lmt_in_half_dbm = max_txp_avg_halfdbm;526526+527527+ iwlcore_eeprom_enh_txp_read_element(priv, txp, max_txp_avg);528528+ }529529+}530530+531531+void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv)532532+{533533+ if (priv->cfg->use_new_eeprom_reading)534534+ iwlcore_eeprom_enhanced_txpower_new(priv);535535+ else536536+ iwlcore_eeprom_enhanced_txpower_old(priv);455537}
+6
drivers/net/wireless/iwlwifi/iwl-agn-lib.c
···569569 case INDIRECT_REGULATORY:570570 offset = iwl_eeprom_query16(priv, EEPROM_LINK_REGULATORY);571571 break;572572+ case INDIRECT_TXP_LIMIT:573573+ offset = iwl_eeprom_query16(priv, EEPROM_LINK_TXP_LIMIT);574574+ break;575575+ case INDIRECT_TXP_LIMIT_SIZE:576576+ offset = iwl_eeprom_query16(priv, EEPROM_LINK_TXP_LIMIT_SIZE);577577+ break;572578 case INDIRECT_CALIBRATION:573579 offset = iwl_eeprom_query16(priv, EEPROM_LINK_CALIBRATION);574580 break;
+1
drivers/net/wireless/iwlwifi/iwl-core.h
···390390 const bool need_temp_offset_calib; /* if used set to true */391391 u8 scan_rx_antennas[IEEE80211_NUM_BANDS];392392 u8 scan_tx_antennas[IEEE80211_NUM_BANDS];393393+ const bool use_new_eeprom_reading; /* temporary, remove later */393394};394395395396/***************************
+21-4
drivers/net/wireless/iwlwifi/iwl-eeprom.h
···120120 s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */121121} __packed;122122123123+enum iwl_eeprom_enhanced_txpwr_flags {124124+ IWL_EEPROM_ENH_TXP_FL_VALID = BIT(0),125125+ IWL_EEPROM_ENH_TXP_FL_BAND_52G = BIT(1),126126+ IWL_EEPROM_ENH_TXP_FL_OFDM = BIT(2),127127+ IWL_EEPROM_ENH_TXP_FL_40MHZ = BIT(3),128128+ IWL_EEPROM_ENH_TXP_FL_HT_AP = BIT(4),129129+ IWL_EEPROM_ENH_TXP_FL_RES1 = BIT(5),130130+ IWL_EEPROM_ENH_TXP_FL_RES2 = BIT(6),131131+ IWL_EEPROM_ENH_TXP_FL_COMMON_TYPE = BIT(7),132132+};133133+123134/**124135 * iwl_eeprom_enhanced_txpwr structure125136 * This structure presents the enhanced regulatory tx power limit layout···138127 * Enhanced regulatory tx power portion of eeprom image can be broken down139128 * into individual structures; each one is 8 bytes in size and contain the140129 * following information141141- * @common: (desc + channel) not used by driver, should _NOT_ be "zero"130130+ * @flags: entry flags131131+ * @channel: channel number142132 * @chain_a_max_pwr: chain a max power in 1/2 dBm143133 * @chain_b_max_pwr: chain b max power in 1/2 dBm144134 * @chain_c_max_pwr: chain c max power in 1/2 dBm145145- * @reserved: not used, should be "zero"135135+ * @delta_20_in_40: 20-in-40 deltas (hi/lo)146136 * @mimo2_max_pwr: mimo2 max power in 1/2 dBm147137 * @mimo3_max_pwr: mimo3 max power in 1/2 dBm148138 *149139 */150140struct iwl_eeprom_enhanced_txpwr {151151- __le16 common;141141+ u8 flags;142142+ u8 channel;152143 s8 chain_a_max;153144 s8 chain_b_max;154145 s8 chain_c_max;155155- s8 reserved;146146+ u8 delta_20_in_40;156147 s8 mimo2_max;157148 s8 mimo3_max;158149} __packed;···199186#define EEPROM_LINK_CALIBRATION (2*0x67)200187#define EEPROM_LINK_PROCESS_ADJST (2*0x68)201188#define EEPROM_LINK_OTHERS (2*0x69)189189+#define EEPROM_LINK_TXP_LIMIT (2*0x6a)190190+#define EEPROM_LINK_TXP_LIMIT_SIZE (2*0x6b)202191203192/* agn regulatory - indirect access */204193#define EEPROM_REG_BAND_1_CHANNELS ((0x08)\···404389#define INDIRECT_CALIBRATION 0x00040000405390#define INDIRECT_PROCESS_ADJST 0x00050000406391#define INDIRECT_OTHERS 0x00060000392392+#define INDIRECT_TXP_LIMIT 0x00070000393393+#define INDIRECT_TXP_LIMIT_SIZE 0x00080000407394#define INDIRECT_ADDRESS 0x00100000408395409396/* General */
+1-1
drivers/net/wireless/libertas/cfg.c
···619619 print_ssid(ssid_buf, ssid, ssid_len),620620 LBS_SCAN_RSSI_TO_MBM(rssi)/100);621621622622- if (channel ||622622+ if (channel &&623623 !(channel->flags & IEEE80211_CHAN_DISABLED))624624 cfg80211_inform_bss(wiphy, channel,625625 bssid, le64_to_cpu(*(__le64 *)tsfdesc),
···664664 DRIVER_REQUIRE_COPY_IV,665665 DRIVER_REQUIRE_L2PAD,666666 DRIVER_REQUIRE_TXSTATUS_FIFO,667667+ DRIVER_REQUIRE_TASKLET_CONTEXT,667668668669 /*669670 * Driver features
+6-3
drivers/net/wireless/rt2x00/rt2x00dev.c
···390390 * through a mac80211 library call (RTS/CTS) then we should not391391 * send the status report back.392392 */393393- if (!(skbdesc_flags & SKBDESC_NOT_MAC80211))394394- ieee80211_tx_status(rt2x00dev->hw, entry->skb);395395- else393393+ if (!(skbdesc_flags & SKBDESC_NOT_MAC80211)) {394394+ if (test_bit(DRIVER_REQUIRE_TASKLET_CONTEXT, &rt2x00dev->flags))395395+ ieee80211_tx_status(rt2x00dev->hw, entry->skb);396396+ else397397+ ieee80211_tx_status_ni(rt2x00dev->hw, entry->skb);398398+ } else396399 dev_kfree_skb_any(entry->skb);397400398401 /*
+2-2
drivers/net/yellowfin.c
···744744 }745745746746 for (i = 0; i < RX_RING_SIZE; i++) {747747- struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz);747747+ struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2);748748 yp->rx_skbuff[i] = skb;749749 if (skb == NULL)750750 break;···11571157 for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) {11581158 entry = yp->dirty_rx % RX_RING_SIZE;11591159 if (yp->rx_skbuff[entry] == NULL) {11601160- struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz);11601160+ struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2);11611161 if (skb == NULL)11621162 break; /* Better luck next round. */11631163 yp->rx_skbuff[entry] = skb;
···115115static int __init select_detection_mode(void)116116{117117 struct dummy_slot *slot, *tmp;118118- pcie_port_service_register(&dummy_driver);118118+ if (pcie_port_service_register(&dummy_driver))119119+ return PCIEHP_DETECT_ACPI;119120 pcie_port_service_unregister(&dummy_driver);120121 list_for_each_entry_safe(slot, tmp, &dummy_slots, list) {121122 list_del(&slot->list);
+33-3
drivers/platform/x86/intel_ips.c
···7575#include <drm/i915_drm.h>7676#include <asm/msr.h>7777#include <asm/processor.h>7878+#include "intel_ips.h"78797980#define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b328081···246245#define thm_writel(off, val) writel((val), ips->regmap + (off))247246248247static const int IPS_ADJUST_PERIOD = 5000; /* ms */248248+static bool late_i915_load = false;249249250250/* For initial average collection */251251static const int IPS_SAMPLE_PERIOD = 200; /* ms */···340338 u64 orig_turbo_limit;341339 u64 orig_turbo_ratios;342340};341341+342342+static bool343343+ips_gpu_turbo_enabled(struct ips_driver *ips);343344344345/**345346 * ips_cpu_busy - is CPU busy?···522517 */523518static bool ips_gpu_busy(struct ips_driver *ips)524519{525525- if (!ips->gpu_turbo_enabled)520520+ if (!ips_gpu_turbo_enabled(ips))526521 return false;527522528523 return ips->gpu_busy();···537532 */538533static void ips_gpu_raise(struct ips_driver *ips)539534{540540- if (!ips->gpu_turbo_enabled)535535+ if (!ips_gpu_turbo_enabled(ips))541536 return;542537543538 if (!ips->gpu_raise())···554549 */555550static void ips_gpu_lower(struct ips_driver *ips)556551{557557- if (!ips->gpu_turbo_enabled)552552+ if (!ips_gpu_turbo_enabled(ips))558553 return;559554560555 if (!ips->gpu_lower())···14581453out_err:14591454 return false;14601455}14561456+14571457+static bool14581458+ips_gpu_turbo_enabled(struct ips_driver *ips)14591459+{14601460+ if (!ips->gpu_busy && late_i915_load) {14611461+ if (ips_get_i915_syms(ips)) {14621462+ dev_info(&ips->dev->dev,14631463+ "i915 driver attached, reenabling gpu turbo\n");14641464+ ips->gpu_turbo_enabled = !(thm_readl(THM_HTS) & HTS_GTD_DIS);14651465+ }14661466+ }14671467+14681468+ return ips->gpu_turbo_enabled;14691469+}14701470+14711471+void14721472+ips_link_to_i915_driver()14731473+{14741474+ /* We can't cleanly get at the various ips_driver structs from14751475+ * this caller (the i915 driver), so just set a flag saying14761476+ * that it's time to try getting the symbols again.14771477+ */14781478+ late_i915_load = true;14791479+}14801480+EXPORT_SYMBOL_GPL(ips_link_to_i915_driver);1461148114621482static DEFINE_PCI_DEVICE_TABLE(ips_id_table) = {14631483 { PCI_DEVICE(PCI_VENDOR_ID_INTEL,
+21
drivers/platform/x86/intel_ips.h
···11+/*22+ * Copyright (c) 2010 Intel Corporation33+ *44+ * This program is free software; you can redistribute it and/or modify it55+ * under the terms and conditions of the GNU General Public License,66+ * version 2, as published by the Free Software Foundation.77+ *88+ * This program is distributed in the hope it will be useful, but WITHOUT99+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or1010+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for1111+ * more details.1212+ *1313+ * You should have received a copy of the GNU General Public License along with1414+ * this program; if not, write to the Free Software Foundation, Inc.,1515+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.1616+ *1717+ * The full GNU General Public License is included in this distribution in1818+ * the file called "COPYING".1919+ */2020+2121+void ips_link_to_i915_driver(void);
+1-1
drivers/rtc/rtc-rs5c372.c
···207207static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm)208208{209209 struct rs5c372 *rs5c = i2c_get_clientdata(client);210210- unsigned char buf[8];210210+ unsigned char buf[7];211211 int addr;212212213213 dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d "
+2-2
drivers/scsi/bfa/bfa_fcs.c
···677677 bfa_trc(fabric->fcs, event);678678 wwn2str(pwwn_ptr, fabric->bport.port_cfg.pwwn);679679680680- BFA_LOG(KERN_INFO, bfad, log_level,680680+ BFA_LOG(KERN_INFO, bfad, bfa_log_level,681681 "Port is isolated due to VF_ID mismatch. "682682 "PWWN: %s Port VF_ID: %04x switch port VF_ID: %04x.",683683 pwwn_ptr, fabric->fcs->port_vfid,···14111411 wwn2str(pwwn_ptr, bfa_fcs_lport_get_pwwn(&fabric->bport));14121412 wwn2str(fwwn_ptr,14131413 bfa_fcs_lport_get_fabric_name(&fabric->bport));14141414- BFA_LOG(KERN_WARNING, bfad, log_level,14141414+ BFA_LOG(KERN_WARNING, bfad, bfa_log_level,14151415 "Base port WWN = %s Fabric WWN = %s\n",14161416 pwwn_ptr, fwwn_ptr);14171417 }
···337337extern int rport_del_timeout;338338extern int bfa_lun_queue_depth;339339extern int bfa_io_max_sge;340340-extern int log_level;340340+extern int bfa_log_level;341341extern int ioc_auto_recover;342342extern int bfa_linkup_delay;343343extern int msix_disable_cb;
···13051305/* work with hotplug and coldplug */13061306MODULE_ALIAS("platform:omap2_mcspi");1307130713081308+#ifdef CONFIG_SUSPEND13091309+/*13101310+ * When SPI wake up from off-mode, CS is in activate state. If it was in13111311+ * unactive state when driver was suspend, then force it to unactive state at13121312+ * wake up.13131313+ */13141314+static int omap2_mcspi_resume(struct device *dev)13151315+{13161316+ struct spi_master *master = dev_get_drvdata(dev);13171317+ struct omap2_mcspi *mcspi = spi_master_get_devdata(master);13181318+ struct omap2_mcspi_cs *cs;13191319+13201320+ omap2_mcspi_enable_clocks(mcspi);13211321+ list_for_each_entry(cs, &omap2_mcspi_ctx[master->bus_num - 1].cs,13221322+ node) {13231323+ if ((cs->chconf0 & OMAP2_MCSPI_CHCONF_FORCE) == 0) {13241324+13251325+ /*13261326+ * We need to toggle CS state for OMAP take this13271327+ * change in account.13281328+ */13291329+ MOD_REG_BIT(cs->chconf0, OMAP2_MCSPI_CHCONF_FORCE, 1);13301330+ __raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);13311331+ MOD_REG_BIT(cs->chconf0, OMAP2_MCSPI_CHCONF_FORCE, 0);13321332+ __raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);13331333+ }13341334+ }13351335+ omap2_mcspi_disable_clocks(mcspi);13361336+ return 0;13371337+}13381338+#else13391339+#define omap2_mcspi_resume NULL13401340+#endif13411341+13421342+static const struct dev_pm_ops omap2_mcspi_pm_ops = {13431343+ .resume = omap2_mcspi_resume,13441344+};13451345+13081346static struct platform_driver omap2_mcspi_driver = {13091347 .driver = {13101348 .name = "omap2_mcspi",13111349 .owner = THIS_MODULE,13501350+ .pm = &omap2_mcspi_pm_ops13121351 },13131352 .remove = __exit_p(omap2_mcspi_remove),13141353};
···14581458 if (gen->base == hw->base)14591459 return true;14601460 /* is the generic aperture base inside the hw base->hw base+size */14611461- if (gen->base > hw->base && gen->base <= hw->base + hw->size)14611461+ if (gen->base > hw->base && gen->base < hw->base + hw->size)14621462 return true;14631463 return false;14641464}
+13-3
drivers/video/sh_mobile_hdmi.c
···845845 found_rate_error = rate_error;846846 }847847848848+ hdmi->var.width = hdmi->monspec.max_x * 10;849849+ hdmi->var.height = hdmi->monspec.max_y * 10;850850+848851 /*849852 * TODO 1: if no ->info is present, postpone running the config until850853 * after ->info first gets registered.···10341031 dev_dbg(info->dev, "Old %ux%u, new %ux%u\n",10351032 mode1.xres, mode1.yres, mode2.xres, mode2.yres);1036103310371037- if (fb_mode_is_equal(&mode1, &mode2))10341034+ if (fb_mode_is_equal(&mode1, &mode2)) {10351035+ /* It can be a different monitor with an equal video-mode */10361036+ old_var->width = new_var->width;10371037+ old_var->height = new_var->height;10381038 return false;10391039+ }1039104010401041 dev_dbg(info->dev, "Switching %u -> %u lines\n",10411042 mode1.yres, mode2.yres);···11361129 * on, if we run a resume here, the logo disappears11371130 */11381131 if (lock_fb_info(hdmi->info)) {11391139- sh_hdmi_display_on(hdmi, hdmi->info);11401140- unlock_fb_info(hdmi->info);11321132+ struct fb_info *info = hdmi->info;11331133+ info->var.width = hdmi->var.width;11341134+ info->var.height = hdmi->var.height;11351135+ sh_hdmi_display_on(hdmi, info);11361136+ unlock_fb_info(info);11411137 }11421138 } else {11431139 /* New monitor or have to wake up */
···1994199419951995 /* FIXME: transaction is part of logfs_block now. Is that enough? */19961996 err = logfs_write_buf(master_inode, page, 0);19971997+ if (err)19981998+ move_page_to_inode(inode, page);19991999+19972000 logfs_put_write_page(page);19982001 return err;19992002}
+5-2
fs/ocfs2/aops.c
···573573 /* this io's submitter should not have unlocked this before we could */574574 BUG_ON(!ocfs2_iocb_is_rw_locked(iocb));575575576576+ if (ocfs2_iocb_is_sem_locked(iocb)) {577577+ up_read(&inode->i_alloc_sem);578578+ ocfs2_iocb_clear_sem_locked(iocb);579579+ }580580+576581 ocfs2_iocb_clear_rw_locked(iocb);577582578583 level = ocfs2_iocb_rw_locked_level(iocb);579579- if (!level)580580- up_read(&inode->i_alloc_sem);581584 ocfs2_rw_unlock(inode, level);582585583586 if (is_async)
+21-2
fs/ocfs2/aops.h
···6868 else6969 clear_bit(1, (unsigned long *)&iocb->private);7070}7171+7272+/*7373+ * Using a named enum representing lock types in terms of #N bit stored in7474+ * iocb->private, which is going to be used for communication bewteen7575+ * ocfs2_dio_end_io() and ocfs2_file_aio_write/read().7676+ */7777+enum ocfs2_iocb_lock_bits {7878+ OCFS2_IOCB_RW_LOCK = 0,7979+ OCFS2_IOCB_RW_LOCK_LEVEL,8080+ OCFS2_IOCB_SEM,8181+ OCFS2_IOCB_NUM_LOCKS8282+};8383+7184#define ocfs2_iocb_clear_rw_locked(iocb) \7272- clear_bit(0, (unsigned long *)&iocb->private)8585+ clear_bit(OCFS2_IOCB_RW_LOCK, (unsigned long *)&iocb->private)7386#define ocfs2_iocb_rw_locked_level(iocb) \7474- test_bit(1, (unsigned long *)&iocb->private)8787+ test_bit(OCFS2_IOCB_RW_LOCK_LEVEL, (unsigned long *)&iocb->private)8888+#define ocfs2_iocb_set_sem_locked(iocb) \8989+ set_bit(OCFS2_IOCB_SEM, (unsigned long *)&iocb->private)9090+#define ocfs2_iocb_clear_sem_locked(iocb) \9191+ clear_bit(OCFS2_IOCB_SEM, (unsigned long *)&iocb->private)9292+#define ocfs2_iocb_is_sem_locked(iocb) \9393+ test_bit(OCFS2_IOCB_SEM, (unsigned long *)&iocb->private)7594#endif /* OCFS2_FILE_H */
···8181#include <linux/sched.h>82828383/* bits that are frequently given and infrequently matched in the low word */8484-/* NOTE: If you add a flag, you need to also update mlog.c! */8484+/* NOTE: If you add a flag, you need to also update masklog.c! */8585#define ML_ENTRY 0x0000000000000001ULL /* func call entry */8686#define ML_EXIT 0x0000000000000002ULL /* func call exit */8787#define ML_TCP 0x0000000000000004ULL /* net cluster/tcp.c */···114114#define ML_XATTR 0x0000000020000000ULL /* ocfs2 extended attributes */115115#define ML_QUOTA 0x0000000040000000ULL /* ocfs2 quota operations */116116#define ML_REFCOUNT 0x0000000080000000ULL /* refcount tree operations */117117-#define ML_BASTS 0x0000001000000000ULL /* dlmglue asts and basts */117117+#define ML_BASTS 0x0000000100000000ULL /* dlmglue asts and basts */118118+#define ML_RESERVATIONS 0x0000000200000000ULL /* ocfs2 alloc reservations */119119+#define ML_CLUSTER 0x0000000400000000ULL /* cluster stack */120120+118121/* bits that are infrequently given and frequently matched in the high word */119119-#define ML_ERROR 0x0000000100000000ULL /* sent to KERN_ERR */120120-#define ML_NOTICE 0x0000000200000000ULL /* setn to KERN_NOTICE */121121-#define ML_KTHREAD 0x0000000400000000ULL /* kernel thread activity */122122-#define ML_RESERVATIONS 0x0000000800000000ULL /* ocfs2 alloc reservations */123123-#define ML_CLUSTER 0x0000001000000000ULL /* cluster stack */122122+#define ML_ERROR 0x1000000000000000ULL /* sent to KERN_ERR */123123+#define ML_NOTICE 0x2000000000000000ULL /* setn to KERN_NOTICE */124124+#define ML_KTHREAD 0x4000000000000000ULL /* kernel thread activity */124125125126#define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE)126127#define MLOG_INITIAL_NOT_MASK (ML_ENTRY|ML_EXIT)
···23462346 */23472347static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm,23482348 struct dlm_lock_resource *res,23492349- int *numlocks)23492349+ int *numlocks,23502350+ int *hasrefs)23502351{23512352 int ret;23522353 int i;···23562355 struct dlm_lock *lock;2357235623582357 assert_spin_locked(&res->spinlock);23582358+23592359+ *numlocks = 0;23602360+ *hasrefs = 0;2359236123602362 ret = -EINVAL;23612363 if (res->owner == DLM_LOCK_RES_OWNER_UNKNOWN) {···23902386 }2391238723922388 *numlocks = count;23932393- mlog(0, "migrateable lockres having %d locks\n", *numlocks);23892389+23902390+ count = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);23912391+ if (count < O2NM_MAX_NODES)23922392+ *hasrefs = 1;23932393+23942394+ mlog(0, "%s: res %.*s, Migrateable, locks %d, refs %d\n", dlm->name,23952395+ res->lockname.len, res->lockname.name, *numlocks, *hasrefs);2394239623952397leave:23962398 return ret;···24182408 const char *name;24192409 unsigned int namelen;24202410 int mle_added = 0;24212421- int numlocks;24112411+ int numlocks, hasrefs;24222412 int wake = 0;2423241324242414 if (!dlm_grab(dlm))···24272417 name = res->lockname.name;24282418 namelen = res->lockname.len;2429241924302430- mlog(0, "migrating %.*s to %u\n", namelen, name, target);24202420+ mlog(0, "%s: Migrating %.*s to %u\n", dlm->name, namelen, name, target);2431242124322422 /*24332423 * ensure this lockres is a proper candidate for migration24342424 */24352425 spin_lock(&res->spinlock);24362436- ret = dlm_is_lockres_migrateable(dlm, res, &numlocks);24262426+ ret = dlm_is_lockres_migrateable(dlm, res, &numlocks, &hasrefs);24372427 if (ret < 0) {24382428 spin_unlock(&res->spinlock);24392429 goto leave;···24412431 spin_unlock(&res->spinlock);2442243224432433 /* no work to do */24442444- if (numlocks == 0) {24452445- mlog(0, "no locks were found on this lockres! done!\n");24342434+ if (numlocks == 0 && !hasrefs)24462435 goto leave;24472447- }2448243624492437 /*24502438 * preallocate up front···24672459 * find a node to migrate the lockres to24682460 */2469246124702470- mlog(0, "picking a migration node\n");24712462 spin_lock(&dlm->spinlock);24722463 /* pick a new node */24732464 if (!test_bit(target, dlm->domain_map) ||24742465 target >= O2NM_MAX_NODES) {24752466 target = dlm_pick_migration_target(dlm, res);24762467 }24772477- mlog(0, "node %u chosen for migration\n", target);24682468+ mlog(0, "%s: res %.*s, Node %u chosen for migration\n", dlm->name,24692469+ namelen, name, target);2478247024792471 if (target >= O2NM_MAX_NODES ||24802472 !test_bit(target, dlm->domain_map)) {···26752667{26762668 int ret;26772669 int lock_dropped = 0;26782678- int numlocks;26702670+ int numlocks, hasrefs;2679267126802672 spin_lock(&res->spinlock);26812673 if (res->owner != dlm->node_num) {···26892681 }2690268226912683 /* No need to migrate a lockres having no locks */26922692- ret = dlm_is_lockres_migrateable(dlm, res, &numlocks);26932693- if (ret >= 0 && numlocks == 0) {26842684+ ret = dlm_is_lockres_migrateable(dlm, res, &numlocks, &hasrefs);26852685+ if (ret >= 0 && numlocks == 0 && !hasrefs) {26942686 spin_unlock(&res->spinlock);26952687 goto leave;26962688 }···29222914 }29232915 }29242916 queue++;29172917+ }29182918+29192919+ nodenum = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);29202920+ if (nodenum < O2NM_MAX_NODES) {29212921+ spin_unlock(&res->spinlock);29222922+ return nodenum;29252923 }29262924 spin_unlock(&res->spinlock);29272925 mlog(0, "have not found a suitable target yet! checking domain map\n");
+13-2
fs/ocfs2/file.c
···2241224122422242 mutex_lock(&inode->i_mutex);2243224322442244+ ocfs2_iocb_clear_sem_locked(iocb);22452245+22442246relock:22452247 /* to match setattr's i_mutex -> i_alloc_sem -> rw_lock ordering */22462248 if (direct_io) {22472249 down_read(&inode->i_alloc_sem);22482250 have_alloc_sem = 1;22512251+ /* communicate with ocfs2_dio_end_io */22522252+ ocfs2_iocb_set_sem_locked(iocb);22492253 }2250225422512255 /*···23862382 ocfs2_rw_unlock(inode, rw_level);2387238323882384out_sems:23892389- if (have_alloc_sem)23852385+ if (have_alloc_sem) {23902386 up_read(&inode->i_alloc_sem);23872387+ ocfs2_iocb_clear_sem_locked(iocb);23882388+ }2391238923922390 mutex_unlock(&inode->i_mutex);23932391···25332527 goto bail;25342528 }2535252925302530+ ocfs2_iocb_clear_sem_locked(iocb);25312531+25362532 /*25372533 * buffered reads protect themselves in ->readpage(). O_DIRECT reads25382534 * need locks to protect pending reads from racing with truncate.···25422534 if (filp->f_flags & O_DIRECT) {25432535 down_read(&inode->i_alloc_sem);25442536 have_alloc_sem = 1;25372537+ ocfs2_iocb_set_sem_locked(iocb);2545253825462539 ret = ocfs2_rw_lock(inode, 0);25472540 if (ret < 0) {···25842575 }2585257625862577bail:25872587- if (have_alloc_sem)25782578+ if (have_alloc_sem) {25882579 up_read(&inode->i_alloc_sem);25802580+ ocfs2_iocb_clear_sem_locked(iocb);25812581+ }25892582 if (rw_level != -1)25902583 ocfs2_rw_unlock(inode, rw_level);25912584 mlog_exit(ret);
···20242024 *20252025 * This function may not be called in IRQ context. Calls to this function20262026 * for a single hardware must be synchronized against each other. Calls20272027- * to this function and ieee80211_tx_status_irqsafe() may not be mixed20282028- * for a single hardware.20272027+ * to this function, ieee80211_tx_status_ni() and ieee80211_tx_status_irqsafe()20282028+ * may not be mixed for a single hardware.20292029 *20302030 * @hw: the hardware the frame was transmitted by20312031 * @skb: the frame that was transmitted, owned by mac80211 after this call···20342034 struct sk_buff *skb);2035203520362036/**20372037+ * ieee80211_tx_status_ni - transmit status callback (in process context)20382038+ *20392039+ * Like ieee80211_tx_status() but can be called in process context.20402040+ *20412041+ * Calls to this function, ieee80211_tx_status() and20422042+ * ieee80211_tx_status_irqsafe() may not be mixed20432043+ * for a single hardware.20442044+ *20452045+ * @hw: the hardware the frame was transmitted by20462046+ * @skb: the frame that was transmitted, owned by mac80211 after this call20472047+ */20482048+static inline void ieee80211_tx_status_ni(struct ieee80211_hw *hw,20492049+ struct sk_buff *skb)20502050+{20512051+ local_bh_disable();20522052+ ieee80211_tx_status(hw, skb);20532053+ local_bh_enable();20542054+}20552055+20562056+/**20372057 * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback20382058 *20392059 * Like ieee80211_tx_status() but can be called in IRQ context20402060 * (internally defers to a tasklet.)20412061 *20422042- * Calls to this function and ieee80211_tx_status() may not be mixed for a20432043- * single hardware.20622062+ * Calls to this function, ieee80211_tx_status() and20632063+ * ieee80211_tx_status_ni() may not be mixed for a single hardware.20442064 *20452065 * @hw: the hardware the frame was transmitted by20462066 * @skb: the frame that was transmitted, owned by mac80211 after this call
···610610{611611 struct sk_buff *n;612612613613- if ((action == TC_ACT_STOLEN || action == TC_ACT_QUEUED) &&614614- !skb_shared(skb))615615- n = skb_get(skb);616616- else617617- n = skb_clone(skb, gfp_mask);613613+ n = skb_clone(skb, gfp_mask);618614619615 if (n) {620616 n->tc_verd = SET_TC_VERD(n->tc_verd, 0);
+3
include/net/sock.h
···754754 void (*unhash)(struct sock *sk);755755 void (*rehash)(struct sock *sk);756756 int (*get_port)(struct sock *sk, unsigned short snum);757757+ void (*clear_sk)(struct sock *sk, int size);757758758759 /* Keeping track of sockets in use */759760#ifdef CONFIG_PROC_FS···852851 sk->sk_prot->unhash(sk);853852 sk->sk_prot->hash(sk);854853}854854+855855+void sk_prot_clear_portaddr_nulls(struct sock *sk, int size);855856856857/* About 10 seconds */857858#define SOCK_DESTROY_TIME (10*HZ)
+1-1
init/do_mounts.c
···9393 *9494 * Returns the matching dev_t on success or 0 on failure.9595 */9696-static dev_t __init devt_from_partuuid(char *uuid_str)9696+static dev_t devt_from_partuuid(char *uuid_str)9797{9898 dev_t res = 0;9999 struct device *dev = NULL;
+11
kernel/kthread.c
···265265 return 0;266266}267267268268+void __init_kthread_worker(struct kthread_worker *worker,269269+ const char *name,270270+ struct lock_class_key *key)271271+{272272+ spin_lock_init(&worker->lock);273273+ lockdep_set_class_and_name(&worker->lock, key, name);274274+ INIT_LIST_HEAD(&worker->work_list);275275+ worker->task = NULL;276276+}277277+EXPORT_SYMBOL_GPL(__init_kthread_worker);278278+268279/**269280 * kthread_worker_fn - kthread function to process kthread_worker270281 * @worker_ptr: pointer to initialized kthread_worker
+44-13
kernel/taskstats.c
···349349 return ret;350350}351351352352+#ifdef CONFIG_IA64353353+#define TASKSTATS_NEEDS_PADDING 1354354+#endif355355+352356static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid)353357{354358 struct nlattr *na, *ret;355359 int aggr;356360357357- /* If we don't pad, we end up with alignment on a 4 byte boundary.358358- * This causes lots of runtime warnings on systems requiring 8 byte359359- * alignment */360360- u32 pids[2] = { pid, 0 };361361- int pid_size = ALIGN(sizeof(pid), sizeof(long));362362-363361 aggr = (type == TASKSTATS_TYPE_PID)364362 ? TASKSTATS_TYPE_AGGR_PID365363 : TASKSTATS_TYPE_AGGR_TGID;366364365365+ /*366366+ * The taskstats structure is internally aligned on 8 byte367367+ * boundaries but the layout of the aggregrate reply, with368368+ * two NLA headers and the pid (each 4 bytes), actually369369+ * force the entire structure to be unaligned. This causes370370+ * the kernel to issue unaligned access warnings on some371371+ * architectures like ia64. Unfortunately, some software out there372372+ * doesn't properly unroll the NLA packet and assumes that the start373373+ * of the taskstats structure will always be 20 bytes from the start374374+ * of the netlink payload. Aligning the start of the taskstats375375+ * structure breaks this software, which we don't want. So, for now376376+ * the alignment only happens on architectures that require it377377+ * and those users will have to update to fixed versions of those378378+ * packages. Space is reserved in the packet only when needed.379379+ * This ifdef should be removed in several years e.g. 2012 once380380+ * we can be confident that fixed versions are installed on most381381+ * systems. We add the padding before the aggregate since the382382+ * aggregate is already a defined type.383383+ */384384+#ifdef TASKSTATS_NEEDS_PADDING385385+ if (nla_put(skb, TASKSTATS_TYPE_NULL, 0, NULL) < 0)386386+ goto err;387387+#endif367388 na = nla_nest_start(skb, aggr);368389 if (!na)369390 goto err;370370- if (nla_put(skb, type, pid_size, pids) < 0)391391+392392+ if (nla_put(skb, type, sizeof(pid), &pid) < 0)371393 goto err;372394 ret = nla_reserve(skb, TASKSTATS_TYPE_STATS, sizeof(struct taskstats));373395 if (!ret)···478456 return rc;479457}480458459459+static size_t taskstats_packet_size(void)460460+{461461+ size_t size;462462+463463+ size = nla_total_size(sizeof(u32)) +464464+ nla_total_size(sizeof(struct taskstats)) + nla_total_size(0);465465+#ifdef TASKSTATS_NEEDS_PADDING466466+ size += nla_total_size(0); /* Padding for alignment */467467+#endif468468+ return size;469469+}470470+481471static int cmd_attr_pid(struct genl_info *info)482472{483473 struct taskstats *stats;···498464 u32 pid;499465 int rc;500466501501- size = nla_total_size(sizeof(u32)) +502502- nla_total_size(sizeof(struct taskstats)) + nla_total_size(0);467467+ size = taskstats_packet_size();503468504469 rc = prepare_reply(info, TASKSTATS_CMD_NEW, &rep_skb, size);505470 if (rc < 0)···527494 u32 tgid;528495 int rc;529496530530- size = nla_total_size(sizeof(u32)) +531531- nla_total_size(sizeof(struct taskstats)) + nla_total_size(0);497497+ size = taskstats_packet_size();532498533499 rc = prepare_reply(info, TASKSTATS_CMD_NEW, &rep_skb, size);534500 if (rc < 0)···602570 /*603571 * Size includes space for nested attributes604572 */605605- size = nla_total_size(sizeof(u32)) +606606- nla_total_size(sizeof(struct taskstats)) + nla_total_size(0);573573+ size = taskstats_packet_size();607574608575 is_thread_group = !!taskstats_tgid_alloc(tsk);609576 if (is_thread_group) {
+8-1
kernel/trace/ring_buffer.c
···3853385338543854 /* Need to copy one event at a time */38553855 do {38563856+ /* We need the size of one event, because38573857+ * rb_advance_reader only advances by one event,38583858+ * whereas rb_event_ts_length may include the size of38593859+ * one or two events.38603860+ * We have already ensured there's enough space if this38613861+ * is a time extend. */38623862+ size = rb_event_length(event);38563863 memcpy(bpage->data + pos, rpage->data + rpos, size);3857386438583865 len -= size;···38743867 event = rb_reader_event(cpu_buffer);38753868 /* Always keep the time extend and data together */38763869 size = rb_event_ts_length(event);38773877- } while (len > size);38703870+ } while (len >= size);3878387138793872 /* update bpage */38803873 local_set(&bpage->commit, pos);
+1
kernel/user.c
···158158 spin_lock_irq(&uidhash_lock);159159 up = uid_hash_find(uid, hashent);160160 if (up) {161161+ put_user_ns(ns);161162 key_put(new->uid_keyring);162163 key_put(new->session_keyring);163164 kmem_cache_free(uid_cachep, new);
+2-1
kernel/watchdog.c
···364364 goto out_save;365365 }366366367367- printk(KERN_ERR "NMI watchdog failed to create perf event on cpu%i: %p\n", cpu, event);367367+ printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ld\n",368368+ cpu, PTR_ERR(event));368369 return PTR_ERR(event);369370370371 /* success path */
-1
mm/compaction.c
···279279 /* Successfully isolated */280280 del_page_from_lru_list(zone, page, page_lru(page));281281 list_add(&page->lru, migratelist);282282- mem_cgroup_del_lru(page);283282 cc->nr_migratepages++;284283285284 /* Avoid isolating too much */
+9-10
mm/memcontrol.c
···1925192519261926 rcu_read_lock();19271927 p = rcu_dereference(mm->owner);19281928- VM_BUG_ON(!p);19291928 /*19301930- * because we don't have task_lock(), "p" can exit while19311931- * we're here. In that case, "mem" can point to root19321932- * cgroup but never be NULL. (and task_struct itself is freed19331933- * by RCU, cgroup itself is RCU safe.) Then, we have small19341934- * risk here to get wrong cgroup. But such kind of mis-account19351935- * by race always happens because we don't have cgroup_mutex().19361936- * It's overkill and we allow that small race, here.19291929+ * Because we don't have task_lock(), "p" can exit.19301930+ * In that case, "mem" can point to root or p can be NULL with19311931+ * race with swapoff. Then, we have small risk of mis-accouning.19321932+ * But such kind of mis-account by race always happens because19331933+ * we don't have cgroup_mutex(). It's overkill and we allo that19341934+ * small race, here.19351935+ * (*) swapoff at el will charge against mm-struct not against19361936+ * task-struct. So, mm->owner can be NULL.19371937 */19381938 mem = mem_cgroup_from_task(p);19391939- VM_BUG_ON(!mem);19401940- if (mem_cgroup_is_root(mem)) {19391939+ if (!mem || mem_cgroup_is_root(mem)) {19411940 rcu_read_unlock();19421941 goto done;19431942 }
···1010 * Copyright (c) 2000-2003 David McCullough <davidm@snapgear.com>1111 * Copyright (c) 2000-2001 D Jeff Dionne <jeff@uClinux.org>1212 * Copyright (c) 2002 Greg Ungerer <gerg@snapgear.com>1313- * Copyright (c) 2007-2009 Paul Mundt <lethal@linux-sh.org>1313+ * Copyright (c) 2007-2010 Paul Mundt <lethal@linux-sh.org>1414 */15151616#include <linux/module.h>···328328{329329 return vmalloc(size);330330}331331+EXPORT_SYMBOL(vmalloc_node);331332332333/**333334 * vzalloc_node - allocate memory on a specific node with zero fill···440439void __attribute__((weak)) vmalloc_sync_all(void)441440{442441}442442+443443+/**444444+ * alloc_vm_area - allocate a range of kernel address space445445+ * @size: size of the area446446+ *447447+ * Returns: NULL on failure, vm_struct on success448448+ *449449+ * This function reserves a range of kernel address space, and450450+ * allocates pagetables to map that range. No actual mappings451451+ * are created. If the kernel address space is not shared452452+ * between processes, it syncs the pagetable across all453453+ * processes.454454+ */455455+struct vm_struct *alloc_vm_area(size_t size)456456+{457457+ BUG();458458+ return NULL;459459+}460460+EXPORT_SYMBOL_GPL(alloc_vm_area);461461+462462+void free_vm_area(struct vm_struct *area)463463+{464464+ BUG();465465+}466466+EXPORT_SYMBOL_GPL(free_vm_area);443467444468int vm_insert_page(struct vm_area_struct *vma, unsigned long addr,445469 struct page *page)
···2669266926702670 ASSERT_RTNL();2671267126722672- rt6_ifdown(net, dev);26722672+ /* Flush routes if device is being removed or it is not loopback */26732673+ if (how || !(dev->flags & IFF_LOOPBACK))26742674+ rt6_ifdown(net, dev);26732675 neigh_ifdown(&nd_tbl, dev);2674267626752677 idev = __in6_dev_get(dev);
+2-10
net/ipv6/ip6_output.c
···5656#include <net/checksum.h>5757#include <linux/mroute6.h>58585959-static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));5959+int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));60606161int __ip6_local_out(struct sk_buff *skb)6262{···143143 ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES);144144 kfree_skb(skb);145145 return -EINVAL;146146-}147147-148148-static inline int ip6_skb_dst_mtu(struct sk_buff *skb)149149-{150150- struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL;151151-152152- return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ?153153- skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));154146}155147156148static int ip6_finish_output(struct sk_buff *skb)···593601 return offset;594602}595603596596-static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))604604+int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))597605{598606 struct sk_buff *frag;599607 struct rt6_info *rt = (struct rt6_info*)skb_dst(skb);
···10701070 struct snd_pcm_hw_rule *new;10711071 unsigned int new_rules = constrs->rules_all + 16;10721072 new = kcalloc(new_rules, sizeof(*c), GFP_KERNEL);10731073- if (!new)10731073+ if (!new) {10741074+ va_end(args);10741075 return -ENOMEM;10761076+ }10751077 if (constrs->rules) {10761078 memcpy(new, constrs->rules,10771079 constrs->rules_num * sizeof(*c));···10891087 c->private = private;10901088 k = 0;10911089 while (1) {10921092- if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps)))10901090+ if (snd_BUG_ON(k >= ARRAY_SIZE(c->deps))) {10911091+ va_end(args);10931092 return -EINVAL;10931093+ }10941094 c->deps[k++] = dep;10951095 if (dep < 0)10961096 break;···11011097 constrs->rules_num++;11021098 va_end(args);11031099 return 0;11041104-} 11001100+}1105110111061102EXPORT_SYMBOL(snd_pcm_hw_rule_add);11071103
+2-2
sound/oss/soundcard.c
···8787 int i, n;88888989 for (i = 0; i < num_mixer_volumes; i++) {9090- if (strcmp(name, mixer_vols[i].name) == 0) {9090+ if (strncmp(name, mixer_vols[i].name, 32) == 0) {9191 if (present)9292 mixer_vols[i].num = i;9393 return mixer_vols[i].levels;···9999 }100100 n = num_mixer_volumes++;101101102102- strcpy(mixer_vols[n].name, name);102102+ strncpy(mixer_vols[n].name, name, 32);103103104104 if (present)105105 mixer_vols[n].num = n;
+34-23
sound/pci/hda/hda_codec.c
···19191919}19201920EXPORT_SYMBOL_HDA(snd_hda_find_mixer_ctl);1921192119221922+static int find_empty_mixer_ctl_idx(struct hda_codec *codec, const char *name)19231923+{19241924+ int idx;19251925+ for (idx = 0; idx < 16; idx++) { /* 16 ctlrs should be large enough */19261926+ if (!_snd_hda_find_mixer_ctl(codec, name, idx))19271927+ return idx;19281928+ }19291929+ return -EBUSY;19301930+}19311931+19221932/**19231933 * snd_hda_ctl_add - Add a control element and assign to the codec19241934 * @codec: HD-audio codec···26642654 { } /* end */26652655};2666265626672667-#define SPDIF_MAX_IDX 4 /* 4 instances should be enough to probe */26682668-26692657/**26702658 * snd_hda_create_spdif_out_ctls - create Output SPDIF-related controls26712659 * @codec: the HDA codec···26812673 struct snd_kcontrol_new *dig_mix;26822674 int idx;2683267526842684- for (idx = 0; idx < SPDIF_MAX_IDX; idx++) {26852685- if (!_snd_hda_find_mixer_ctl(codec, "IEC958 Playback Switch",26862686- idx))26872687- break;26882688- }26892689- if (idx >= SPDIF_MAX_IDX) {26762676+ idx = find_empty_mixer_ctl_idx(codec, "IEC958 Playback Switch");26772677+ if (idx < 0) {26902678 printk(KERN_ERR "hda_codec: too many IEC958 outputs\n");26912679 return -EBUSY;26922680 }···28332829 struct snd_kcontrol_new *dig_mix;28342830 int idx;2835283128362836- for (idx = 0; idx < SPDIF_MAX_IDX; idx++) {28372837- if (!_snd_hda_find_mixer_ctl(codec, "IEC958 Capture Switch",28382838- idx))28392839- break;28402840- }28412841- if (idx >= SPDIF_MAX_IDX) {28322832+ idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch");28332833+ if (idx < 0) {28422834 printk(KERN_ERR "hda_codec: too many IEC958 inputs\n");28432835 return -EBUSY;28442836 }···3808380838093809 for (; knew->name; knew++) {38103810 struct snd_kcontrol *kctl;38113811+ int addr = 0, idx = 0;38113812 if (knew->iface == -1) /* skip this codec private value */38123813 continue;38133813- kctl = snd_ctl_new1(knew, codec);38143814- if (!kctl)38153815- return -ENOMEM;38163816- err = snd_hda_ctl_add(codec, 0, kctl);38173817- if (err < 0) {38183818- if (!codec->addr)38193819- return err;38143814+ for (;;) {38203815 kctl = snd_ctl_new1(knew, codec);38213816 if (!kctl)38223817 return -ENOMEM;38233823- kctl->id.device = codec->addr;38183818+ if (addr > 0)38193819+ kctl->id.device = addr;38203820+ if (idx > 0)38213821+ kctl->id.index = idx;38243822 err = snd_hda_ctl_add(codec, 0, kctl);38253825- if (err < 0)38233823+ if (!err)38243824+ break;38253825+ /* try first with another device index corresponding to38263826+ * the codec addr; if it still fails (or it's the38273827+ * primary codec), then try another control index38283828+ */38293829+ if (!addr && codec->addr)38303830+ addr = codec->addr;38313831+ else if (!idx && !knew->index) {38323832+ idx = find_empty_mixer_ctl_idx(codec,38333833+ knew->name);38343834+ if (idx <= 0)38353835+ return err;38363836+ } else38263837 return err;38273838 }38283839 }
···4040};41414242struct max98088_priv {4343- u8 reg_cache[M98088_REG_CNT];4443 enum max98088_type devtype;4544 void *control_data;4645 struct max98088_pdata *pdata;···1587158815881589static void max98088_sync_cache(struct snd_soc_codec *codec)15891590{15901590- struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);15911591+ u16 *reg_cache = codec->reg_cache;15911592 int i;1592159315931594 if (!codec->cache_sync)···15981599 /* write back cached values if they're writeable and15991600 * different from the hardware default.16001601 */16011601- for (i = 1; i < ARRAY_SIZE(max98088->reg_cache); i++) {16021602+ for (i = 1; i < codec->driver->reg_cache_size; i++) {16021603 if (!max98088_access[i].writable)16031604 continue;1604160516051605- if (max98088->reg_cache[i] == max98088_reg[i])16061606+ if (reg_cache[i] == max98088_reg[i])16061607 continue;1607160816081608- snd_soc_write(codec, i, max98088->reg_cache[i]);16091609+ snd_soc_write(codec, i, reg_cache[i]);16091610 }1610161116111612 codec->cache_sync = 0;···19501951 int ret = 0;1951195219521953 codec->cache_sync = 1;19531953- memcpy(codec->reg_cache, max98088_reg, sizeof(max98088_reg));1954195419551955 ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_I2C);19561956 if (ret != 0) {
+5-4
sound/soc/codecs/wm8523.c
···4141/* codec private data */4242struct wm8523_priv {4343 enum snd_soc_control_type control_type;4444- u16 reg_cache[WM8523_REGISTER_COUNT];4544 struct regulator_bulk_data supplies[WM8523_NUM_SUPPLIES];4645 unsigned int sysclk;4746 unsigned int rate_constraint_list[WM8523_NUM_RATES];···313314 enum snd_soc_bias_level level)314315{315316 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);317317+ u16 *reg_cache = codec->reg_cache;316318 int ret, i;317319318320 switch (level) {···344344 /* Sync back default/cached values */345345 for (i = WM8523_AIF_CTRL1;346346 i < WM8523_MAX_REGISTER; i++)347347- snd_soc_write(codec, i, wm8523->reg_cache[i]);347347+ snd_soc_write(codec, i, reg_cache[i]);348348349349350350 msleep(100);···414414static int wm8523_probe(struct snd_soc_codec *codec)415415{416416 struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);417417+ u16 *reg_cache = codec->reg_cache;417418 int ret, i;418419419420 codec->hw_write = (hw_write_t)i2c_master_send;···471470 }472471473472 /* Change some default settings - latch VU and enable ZC */474474- wm8523->reg_cache[WM8523_DAC_GAINR] |= WM8523_DACR_VU;475475- wm8523->reg_cache[WM8523_DAC_CTRL3] |= WM8523_ZC;473473+ reg_cache[WM8523_DAC_GAINR] |= WM8523_DACR_VU;474474+ reg_cache[WM8523_DAC_CTRL3] |= WM8523_ZC;476475477476 wm8523_set_bias_level(codec, SND_SOC_BIAS_STANDBY);478477
···249249 !params.show_lines))250250 usage_with_options(probe_usage, options);251251252252+ /*253253+ * Only consider the user's kernel image path if given.254254+ */255255+ symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);256256+252257 if (params.list_events) {253258 if (params.mod_events) {254259 pr_err(" Error: Don't use --list with --add/--del.\n");
···356356357357static size_t ipchain__fprintf_graph(FILE *fp, struct callchain_list *chain,358358 int depth, int depth_mask, int period,359359- u64 total_samples, int hits,359359+ u64 total_samples, u64 hits,360360 int left_margin)361361{362362 int i;
···117117}118118119119/* Dwarf FL wrappers */120120-121121-static int __linux_kernel_find_elf(Dwfl_Module *mod,122122- void **userdata,123123- const char *module_name,124124- Dwarf_Addr base,125125- char **file_name, Elf **elfp)126126-{127127- int fd;128128- const char *path = kernel_get_module_path(module_name);129129-130130- if (path) {131131- fd = open(path, O_RDONLY);132132- if (fd >= 0) {133133- *file_name = strdup(path);134134- return fd;135135- }136136- }137137- /* If failed, try to call standard method */138138- return dwfl_linux_kernel_find_elf(mod, userdata, module_name, base,139139- file_name, elfp);140140-}141141-142120static char *debuginfo_path; /* Currently dummy */143121144122static const Dwfl_Callbacks offline_callbacks = {···127149128150 /* We use this table for core files too. */129151 .find_elf = dwfl_build_id_find_elf,130130-};131131-132132-static const Dwfl_Callbacks kernel_callbacks = {133133- .find_debuginfo = dwfl_standard_find_debuginfo,134134- .debuginfo_path = &debuginfo_path,135135-136136- .find_elf = __linux_kernel_find_elf,137137- .section_address = dwfl_linux_kernel_module_section_address,138152};139153140154/* Get a Dwarf from offline image */···155185 return dbg;156186}157187188188+#if _ELFUTILS_PREREQ(0, 148)189189+/* This method is buggy if elfutils is older than 0.148 */190190+static int __linux_kernel_find_elf(Dwfl_Module *mod,191191+ void **userdata,192192+ const char *module_name,193193+ Dwarf_Addr base,194194+ char **file_name, Elf **elfp)195195+{196196+ int fd;197197+ const char *path = kernel_get_module_path(module_name);198198+199199+ pr_debug2("Use file %s for %s\n", path, module_name);200200+ if (path) {201201+ fd = open(path, O_RDONLY);202202+ if (fd >= 0) {203203+ *file_name = strdup(path);204204+ return fd;205205+ }206206+ }207207+ /* If failed, try to call standard method */208208+ return dwfl_linux_kernel_find_elf(mod, userdata, module_name, base,209209+ file_name, elfp);210210+}211211+212212+static const Dwfl_Callbacks kernel_callbacks = {213213+ .find_debuginfo = dwfl_standard_find_debuginfo,214214+ .debuginfo_path = &debuginfo_path,215215+216216+ .find_elf = __linux_kernel_find_elf,217217+ .section_address = dwfl_linux_kernel_module_section_address,218218+};219219+158220/* Get a Dwarf from live kernel image */159221static Dwarf *dwfl_init_live_kernel_dwarf(Dwarf_Addr addr, Dwfl **dwflp,160222 Dwarf_Addr *bias)···207205 dbg = dwfl_addrdwarf(*dwflp, addr, bias);208206 /* Here, check whether we could get a real dwarf */209207 if (!dbg) {208208+ pr_debug("Failed to find kernel dwarf at %lx\n",209209+ (unsigned long)addr);210210 dwfl_end(*dwflp);211211 *dwflp = NULL;212212 }213213 return dbg;214214}215215+#else216216+/* With older elfutils, this just support kernel module... */217217+static Dwarf *dwfl_init_live_kernel_dwarf(Dwarf_Addr addr __used, Dwfl **dwflp,218218+ Dwarf_Addr *bias)219219+{220220+ int fd;221221+ const char *path = kernel_get_module_path("kernel");222222+223223+ if (!path) {224224+ pr_err("Failed to find vmlinux path\n");225225+ return NULL;226226+ }227227+228228+ pr_debug2("Use file %s for debuginfo\n", path);229229+ fd = open(path, O_RDONLY);230230+ if (fd < 0)231231+ return NULL;232232+233233+ return dwfl_init_offline_dwarf(fd, dwflp, bias);234234+}235235+#endif215236216237/* Dwarf wrappers */217238
+1-1
tools/perf/util/string.c
···259259 if (!*pat) /* Tail wild card matches all */260260 return true;261261 while (*str)262262- if (strglobmatch(str++, pat))262262+ if (__match_glob(str++, pat, ignore_space))263263 return true;264264 }265265 return !*str && !*pat;