···11+* EETI eGalax Multiple Touch Controller22+33+Required properties:44+- compatible: must be "eeti,egalax_ts"55+- reg: i2c slave address66+- interrupt-parent: the phandle for the interrupt controller77+- interrupts: touch controller interrupt88+- wakeup-gpios: the gpio pin to be used for waking up the controller99+ as well as uased as irq pin1010+1111+Example:1212+1313+ egalax_ts@04 {1414+ compatible = "eeti,egalax_ts";1515+ reg = <0x04>;1616+ interrupt-parent = <&gpio1>;1717+ interrupts = <9 2>;1818+ wakeup-gpios = <&gpio1 9 0>;1919+ };
+1-1
Documentation/hwmon/fam15h_power
···1010 BIOS and Kernel Developer's Guide (BKDG) For AMD Family 15h Processors1111 (not yet published)12121313-Author: Andreas Herrmann <andreas.herrmann3@amd.com>1313+Author: Andreas Herrmann <herrmann.der.user@googlemail.com>14141515Description1616-----------
+3-2
MAINTAINERS
···503503F: include/linux/altera_jtaguart.h504504505505AMD FAM15H PROCESSOR POWER MONITORING DRIVER506506-M: Andreas Herrmann <andreas.herrmann3@amd.com>506506+M: Andreas Herrmann <herrmann.der.user@googlemail.com>507507L: lm-sensors@lm-sensors.org508508S: Maintained509509F: Documentation/hwmon/fam15h_power···25072507M: Seung-Woo Kim <sw0312.kim@samsung.com>25082508M: Kyungmin Park <kyungmin.park@samsung.com>25092509L: dri-devel@lists.freedesktop.org25102510+T: git git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git25102511S: Supported25112512F: drivers/gpu/drm/exynos25122513F: include/drm/exynos*···56485647F: drivers/pinctrl/spear/5649564856505649PKTCDVD DRIVER56515651-M: Peter Osterlund <petero2@telia.com>56505650+M: Jiri Kosina <jkosina@suse.cz>56525651S: Maintained56535652F: drivers/block/pktcdvd.c56545653F: include/linux/pktcdvd.h
···869869 call schedule_tail870870 calll.p @(gr21,gr0)871871 or gr20,gr20,gr8872872- bra sys_exit873873-874874- .globl ret_from_kernel_execve875875-ret_from_kernel_execve:876876- ori gr28,0,sp877872 bra __syscall_exit878873879874###################################################################################################···10751080 subicc gr5,#0,gr0,icc010761081 beq icc0,#0,__entry_return_direct1077108210781078-__entry_preempt_need_resched:10791079- ldi @(gr15,#TI_FLAGS),gr410801080- andicc gr4,#_TIF_NEED_RESCHED,gr0,icc010811081- beq icc0,#1,__entry_return_direct10821082-10831083- setlos #PREEMPT_ACTIVE,gr510841084- sti gr5,@(gr15,#TI_FLAGS)10851085-10861086- andi gr23,#~PSR_PIL,gr2310871087- movgs gr23,psr10881088-10891089- call schedule10901090- sti gr0,@(gr15,#TI_PRE_COUNT)10911091-10921092- movsg psr,gr2310931093- ori gr23,#PSR_PIL_14,gr2310941094- movgs gr23,psr10951095- bra __entry_preempt_need_resched10961096-#else10971097- bra __entry_return_direct10831083+ subcc gr0,gr0,gr0,icc2 /* set Z and clear C */10841084+ call preempt_schedule_irq10981085#endif10861086+ bra __entry_return_direct109910871100108811011089###############################################################################
+3-2
arch/frv/kernel/process.c
···181181 childregs = (struct pt_regs *)182182 (task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE);183183184184+ /* set up the userspace frame (the only place that the USP is stored) */185185+ *childregs = *__kernel_frame0_ptr;186186+184187 p->set_child_tid = p->clear_child_tid = NULL;185188186189 p->thread.frame = childregs;···194191 p->thread.frame0 = childregs;195192196193 if (unlikely(!regs)) {197197- memset(childregs, 0, sizeof(struct pt_regs));198194 childregs->gr9 = usp; /* function */199195 childregs->gr8 = arg;200200- childregs->psr = PSR_S;201196 p->thread.pc = (unsigned long) ret_from_kernel_thread;202197 save_user_regs(p->thread.user);203198 return 0;
···152152153153/* Clearing a0 terminates the backtrace. */154154#define start_thread(regs, new_pc, new_sp) \155155+ memset(regs, 0, sizeof(*regs)); \155156 regs->pc = new_pc; \156157 regs->ps = USER_PS_VALUE; \157158 regs->areg[1] = new_sp; \···168167169168/* Free all resources held by a thread. */170169#define release_thread(thread) do { } while(0)171171-172172-/* Create a kernel thread without removing it from tasklists */173173-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);174170175171/* Copy and release all segment info associated with a VM */176172#define copy_segments(p, mm) do { } while(0)
+1-1
arch/xtensa/include/asm/syscall.h
···10101111struct pt_regs;1212struct sigaction;1313-asmlinkage long xtensa_execve(char*, char**, char**, struct pt_regs*);1313+asmlinkage long sys_execve(char*, char**, char**, struct pt_regs*);1414asmlinkage long xtensa_clone(unsigned long, unsigned long, struct pt_regs*);1515asmlinkage long xtensa_ptrace(long, long, long, long);1616asmlinkage long xtensa_sigreturn(struct pt_regs*);
+5-10
arch/xtensa/include/asm/unistd.h
···11-/*22- * include/asm-xtensa/unistd.h33- *44- * This file is subject to the terms and conditions of the GNU General Public55- * License. See the file "COPYING" in the main directory of this archive66- * for more details.77- *88- * Copyright (C) 2001 - 2005 Tensilica Inc.99- */11+#ifndef _XTENSA_UNISTD_H22+#define _XTENSA_UNISTD_H10344+#define __ARCH_WANT_SYS_EXECVE115#include <uapi/asm/unistd.h>1212-136147/*158 * "Conditional" syscalls···3037#define __IGNORE_mmap /* use mmap2 */3138#define __IGNORE_vfork /* use clone */3239#define __IGNORE_fadvise64 /* use fadvise64_64 */4040+4141+#endif /* _XTENSA_UNISTD_H */
+4-12
arch/xtensa/include/uapi/asm/unistd.h
···11-/*22- * include/asm-xtensa/unistd.h33- *44- * This file is subject to the terms and conditions of the GNU General Public55- * License. See the file "COPYING" in the main directory of this archive66- * for more details.77- *88- * Copyright (C) 2001 - 2012 Tensilica Inc.99- */1010-1111-#ifndef _UAPI_XTENSA_UNISTD_H11+#if !defined(_UAPI_XTENSA_UNISTD_H) || defined(__SYSCALL)122#define _UAPI_XTENSA_UNISTD_H133144#ifndef __SYSCALL···262272#define __NR_clone 116263273__SYSCALL(116, xtensa_clone, 5)264274#define __NR_execve 117265265-__SYSCALL(117, xtensa_execve, 3)275275+__SYSCALL(117, sys_execve, 3)266276#define __NR_exit 118267277__SYSCALL(118, sys_exit, 1)268278#define __NR_exit_group 119···748758#define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */749759750760#define SYS_XTENSA_COUNT 5 /* count */761761+762762+#undef __SYSCALL751763752764#endif /* _UAPI_XTENSA_UNISTD_H */
+13-44
arch/xtensa/kernel/entry.S
···183318331834183418351835/*18361836- * Create a kernel thread18371837- *18381838- * int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)18391839- * a2 a2 a3 a418401840- */18411841-18421842-ENTRY(kernel_thread)18431843- entry a1, 1618441844-18451845- mov a5, a2 # preserve fn over syscall18461846- mov a7, a3 # preserve args over syscall18471847-18481848- movi a3, _CLONE_VM | _CLONE_UNTRACED18491849- movi a2, __NR_clone18501850- or a6, a4, a3 # arg0: flags18511851- mov a3, a1 # arg1: sp18521852- syscall18531853-18541854- beq a3, a1, 1f # branch if parent18551855- mov a6, a7 # args18561856- callx4 a5 # fn(args)18571857-18581858- movi a2, __NR_exit18591859- syscall # return value of fn(args) still in a618601860-18611861-1: retw18621862-18631863-/*18641864- * Do a system call from kernel instead of calling sys_execve, so we end up18651865- * with proper pt_regs.18661866- *18671867- * int kernel_execve(const char *fname, char *const argv[], charg *const envp[])18681868- * a2 a2 a3 a418691869- */18701870-18711871-ENTRY(kernel_execve)18721872- entry a1, 1618731873- mov a6, a2 # arg0 is in a618741874- movi a2, __NR_execve18751875- syscall18761876-18771877- retw18781878-18791879-/*18801836 * Task switch.18811837 *18821838 * struct task* _switch_to (struct task* prev, struct task* next)···1914195819151959 j common_exception_return1916196019611961+/*19621962+ * Kernel thread creation helper19631963+ * On entry, set up by copy_thread: a2 = thread_fn, a3 = thread_fn arg19641964+ * left from _switch_to: a6 = prev19651965+ */19661966+ENTRY(ret_from_kernel_thread)19671967+19681968+ call4 schedule_tail19691969+ mov a6, a319701970+ callx4 a219711971+ j common_exception_return19721972+19731973+ENDPROC(ret_from_kernel_thread)
+71-57
arch/xtensa/kernel/process.c
···4545#include <asm/regs.h>46464747extern void ret_from_fork(void);4848+extern void ret_from_kernel_thread(void);48494950struct task_struct *current_set[NR_CPUS] = {&init_task, };5051···159158/*160159 * Copy thread.161160 *161161+ * There are two modes in which this function is called:162162+ * 1) Userspace thread creation,163163+ * regs != NULL, usp_thread_fn is userspace stack pointer.164164+ * It is expected to copy parent regs (in case CLONE_VM is not set165165+ * in the clone_flags) and set up passed usp in the childregs.166166+ * 2) Kernel thread creation,167167+ * regs == NULL, usp_thread_fn is the function to run in the new thread168168+ * and thread_fn_arg is its parameter.169169+ * childregs are not used for the kernel threads.170170+ *162171 * The stack layout for the new thread looks like this:163172 *164164- * +------------------------+ <- sp in childregs (= tos)173173+ * +------------------------+165174 * | childregs |166175 * +------------------------+ <- thread.sp = sp in dummy-frame167176 * | dummy-frame | (saved in dummy-frame spill-area)168177 * +------------------------+169178 *170170- * We create a dummy frame to return to ret_from_fork:171171- * a0 points to ret_from_fork (simulating a call4)179179+ * We create a dummy frame to return to either ret_from_fork or180180+ * ret_from_kernel_thread:181181+ * a0 points to ret_from_fork/ret_from_kernel_thread (simulating a call4)172182 * sp points to itself (thread.sp)173173- * a2, a3 are unused.183183+ * a2, a3 are unused for userspace threads,184184+ * a2 points to thread_fn, a3 holds thread_fn arg for kernel threads.174185 *175186 * Note: This is a pristine frame, so we don't need any spill region on top of176187 * childregs.···198185 * involved. Much simpler to just not copy those live frames across.199186 */200187201201-int copy_thread(unsigned long clone_flags, unsigned long usp,202202- unsigned long unused,203203- struct task_struct * p, struct pt_regs * regs)188188+int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,189189+ unsigned long thread_fn_arg,190190+ struct task_struct *p, struct pt_regs *unused)204191{205205- struct pt_regs *childregs;206206- unsigned long tos;207207- int user_mode = user_mode(regs);192192+ struct pt_regs *childregs = task_pt_regs(p);208193209194#if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS)210195 struct thread_info *ti;211196#endif212197213213- /* Set up new TSS. */214214- tos = (unsigned long)task_stack_page(p) + THREAD_SIZE;215215- if (user_mode)216216- childregs = (struct pt_regs*)(tos - PT_USER_SIZE);217217- else218218- childregs = (struct pt_regs*)tos - 1;219219-220220- /* This does not copy all the regs. In a bout of brilliance or madness,221221- ARs beyond a0-a15 exist past the end of the struct. */222222- *childregs = *regs;223223-224198 /* Create a call4 dummy-frame: a0 = 0, a1 = childregs. */225199 *((int*)childregs - 3) = (unsigned long)childregs;226200 *((int*)childregs - 4) = 0;227201228228- childregs->areg[2] = 0;229229- p->set_child_tid = p->clear_child_tid = NULL;230230- p->thread.ra = MAKE_RA_FOR_CALL((unsigned long)ret_from_fork, 0x1);231202 p->thread.sp = (unsigned long)childregs;232203233233- if (user_mode(regs)) {204204+ if (!(p->flags & PF_KTHREAD)) {205205+ struct pt_regs *regs = current_pt_regs();206206+ unsigned long usp = usp_thread_fn ?207207+ usp_thread_fn : regs->areg[1];234208209209+ p->thread.ra = MAKE_RA_FOR_CALL(210210+ (unsigned long)ret_from_fork, 0x1);211211+212212+ /* This does not copy all the regs.213213+ * In a bout of brilliance or madness,214214+ * ARs beyond a0-a15 exist past the end of the struct.215215+ */216216+ *childregs = *regs;235217 childregs->areg[1] = usp;218218+ childregs->areg[2] = 0;219219+220220+ /* When sharing memory with the parent thread, the child221221+ usually starts on a pristine stack, so we have to reset222222+ windowbase, windowstart and wmask.223223+ (Note that such a new thread is required to always create224224+ an initial call4 frame)225225+ The exception is vfork, where the new thread continues to226226+ run on the parent's stack until it calls execve. This could227227+ be a call8 or call12, which requires a legal stack frame228228+ of the previous caller for the overflow handlers to work.229229+ (Note that it's always legal to overflow live registers).230230+ In this case, ensure to spill at least the stack pointer231231+ of that frame. */232232+236233 if (clone_flags & CLONE_VM) {237237- childregs->wmask = 1; /* can't share live windows */234234+ /* check that caller window is live and same stack */235235+ int len = childregs->wmask & ~0xf;236236+ if (regs->areg[1] == usp && len != 0) {237237+ int callinc = (regs->areg[0] >> 30) & 3;238238+ int caller_ars = XCHAL_NUM_AREGS - callinc * 4;239239+ put_user(regs->areg[caller_ars+1],240240+ (unsigned __user*)(usp - 12));241241+ }242242+ childregs->wmask = 1;243243+ childregs->windowstart = 1;244244+ childregs->windowbase = 0;238245 } else {239246 int len = childregs->wmask & ~0xf;240247 memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4],···263230// FIXME: we need to set THREADPTR in thread_info...264231 if (clone_flags & CLONE_SETTLS)265232 childregs->areg[2] = childregs->areg[6];266266-267233 } else {268268- /* In kernel space, we start a new thread with a new stack. */269269- childregs->wmask = 1;270270- childregs->areg[1] = tos;234234+ p->thread.ra = MAKE_RA_FOR_CALL(235235+ (unsigned long)ret_from_kernel_thread, 1);236236+237237+ /* pass parameters to ret_from_kernel_thread:238238+ * a2 = thread_fn, a3 = thread_fn arg239239+ */240240+ *((int *)childregs - 1) = thread_fn_arg;241241+ *((int *)childregs - 2) = usp_thread_fn;242242+243243+ /* Childregs are only used when we're going to userspace244244+ * in which case start_thread will set them up.245245+ */271246 }272247273248#if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS)···371330 void __user *child_tid, long a5,372331 struct pt_regs *regs)373332{374374- if (!newsp)375375- newsp = regs->areg[1];376333 return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);377334}378378-379379-/*380380- * xtensa_execve() executes a new program.381381- */382382-383383-asmlinkage384384-long xtensa_execve(const char __user *name,385385- const char __user *const __user *argv,386386- const char __user *const __user *envp,387387- long a3, long a4, long a5,388388- struct pt_regs *regs)389389-{390390- long error;391391- struct filename *filename;392392-393393- filename = getname(name);394394- error = PTR_ERR(filename);395395- if (IS_ERR(filename))396396- goto out;397397- error = do_execve(filename->name, argv, envp, regs);398398- putname(filename);399399-out:400400- return error;401401-}402402-
+3-4
arch/xtensa/kernel/syscall.c
···3232syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= {3333 [0 ... __NR_syscall_count - 1] = (syscall_t)&sys_ni_syscall,34343535-#undef __SYSCALL3635#define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol,3737-#undef __KERNEL_SYSCALLS__3838-#include <asm/unistd.h>3636+#include <uapi/asm/unistd.h>3937};40384139asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg)···4749 return (long)ret;4850}49515050-asmlinkage long xtensa_fadvise64_64(int fd, int advice, unsigned long long offset, unsigned long long len)5252+asmlinkage long xtensa_fadvise64_64(int fd, int advice,5353+ unsigned long long offset, unsigned long long len)5154{5255 return sys_fadvise64_64(fd, offset, len, advice);5356}
···89899090config BLK_DEV_THROTTLING9191 bool "Block layer bio throttling support"9292- depends on BLK_CGROUP=y && EXPERIMENTAL9292+ depends on BLK_CGROUP=y9393 default n9494 ---help---9595 Block layer bio throttling support. It can be used to limit
+10
block/blk-cgroup.c
···285285 blkg_destroy(blkg);286286 spin_unlock(&blkcg->lock);287287 }288288+289289+ /*290290+ * root blkg is destroyed. Just clear the pointer since291291+ * root_rl does not take reference on root blkg.292292+ */293293+ q->root_blkg = NULL;294294+ q->root_rl.blkg = NULL;288295}289296290297static void blkg_rcu_free(struct rcu_head *rcu_head)···333326 */334327 if (rl == &q->root_rl) {335328 ent = &q->blkg_list;329329+ /* There are no more block groups, hence no request lists */330330+ if (list_empty(ent))331331+ return NULL;336332 } else {337333 blkg = container_of(rl, struct blkcg_gq, rl);338334 ent = &blkg->q_node;
···13451345acpi_video_bus_get_devices(struct acpi_video_bus *video,13461346 struct acpi_device *device)13471347{13481348- int status;13481348+ int status = 0;13491349 struct acpi_device *dev;1350135013511351- status = acpi_video_device_enumerate(video);13521352- if (status)13531353- return status;13511351+ /*13521352+ * There are systems where video module known to work fine regardless13531353+ * of broken _DOD and ignoring returned value here doesn't cause13541354+ * any issues later.13551355+ */13561356+ acpi_video_device_enumerate(video);1354135713551358 list_for_each_entry(dev, &device->children, node) {13561359
+8-7
drivers/block/Kconfig
···131131config BLK_CPQ_CISS_DA132132 tristate "Compaq Smart Array 5xxx support"133133 depends on PCI134134+ select CHECK_SIGNATURE134135 help135136 This is the driver for Compaq Smart Array 5xxx controllers.136137 Everyone using these boards should say Y here.···167166 module will be called DAC960.168167169168config BLK_DEV_UMEM170170- tristate "Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL)"171171- depends on PCI && EXPERIMENTAL169169+ tristate "Micro Memory MM5415 Battery Backed RAM support"170170+ depends on PCI172171 ---help---173172 Saying Y here will include support for the MM5415 family of174173 battery backed (Non-volatile) RAM cards.···431430 a disc is opened for writing.432431433432config CDROM_PKTCDVD_WCACHE434434- bool "Enable write caching (EXPERIMENTAL)"435435- depends on CDROM_PKTCDVD && EXPERIMENTAL433433+ bool "Enable write caching"434434+ depends on CDROM_PKTCDVD436435 help437436 If enabled, write caching will be set for the CD-R/W device. For now438437 this option is dangerous unless the CD-RW media is known good, as we···509508510509511510config VIRTIO_BLK512512- tristate "Virtio block driver (EXPERIMENTAL)"513513- depends on EXPERIMENTAL && VIRTIO511511+ tristate "Virtio block driver"512512+ depends on VIRTIO514513 ---help---515514 This is the virtual block driver for virtio. It can be used with516515 lguest or QEMU based VMMs (like KVM or Xen). Say Y or M.···529528530529config BLK_DEV_RBD531530 tristate "Rados block device (RBD)"532532- depends on INET && EXPERIMENTAL && BLOCK531531+ depends on INET && BLOCK533532 select CEPH_LIB534533 select LIBCRC32C535534 select CRYPTO_AES
-1
drivers/block/cciss.c
···52055205 return;52065206 }52075207 /* write all data in the battery backed cache to disk */52085208- memset(flush_buf, 0, 4);52095208 return_code = sendcmd_withirq(h, CCISS_CACHE_FLUSH, flush_buf,52105209 4, 0, CTLR_LUNID, TYPE_CMD);52115210 kfree(flush_buf);
+48-42
drivers/block/floppy.c
···4109410941104110static struct platform_device floppy_device[N_DRIVE];4111411141124112+static bool floppy_available(int drive)41134113+{41144114+ if (!(allowed_drive_mask & (1 << drive)))41154115+ return false;41164116+ if (fdc_state[FDC(drive)].version == FDC_NONE)41174117+ return false;41184118+ return true;41194119+}41204120+41124121static struct kobject *floppy_find(dev_t dev, int *part, void *data)41134122{41144123 int drive = (*part & 3) | ((*part & 0x80) >> 5);41154115- if (drive >= N_DRIVE ||41164116- !(allowed_drive_mask & (1 << drive)) ||41174117- fdc_state[FDC(drive)].version == FDC_NONE)41244124+ if (drive >= N_DRIVE || !floppy_available(drive))41184125 return NULL;41194126 if (((*part >> 2) & 0x1f) >= ARRAY_SIZE(floppy_type))41204127 return NULL;···4131412441324125static int __init do_floppy_init(void)41334126{41344134- int i, unit, drive;41354135- int err, dr;41274127+ int i, unit, drive, err;4136412841374129 set_debugt();41384130 interruptjiffies = resultjiffies = jiffies;···4143413741444138 raw_cmd = NULL;4145413941464146- for (dr = 0; dr < N_DRIVE; dr++) {41474147- disks[dr] = alloc_disk(1);41484148- if (!disks[dr]) {41404140+ floppy_wq = alloc_ordered_workqueue("floppy", 0);41414141+ if (!floppy_wq)41424142+ return -ENOMEM;41434143+41444144+ for (drive = 0; drive < N_DRIVE; drive++) {41454145+ disks[drive] = alloc_disk(1);41464146+ if (!disks[drive]) {41494147 err = -ENOMEM;41504148 goto out_put_disk;41514149 }4152415041534153- floppy_wq = alloc_ordered_workqueue("floppy", 0);41544154- if (!floppy_wq) {41514151+ disks[drive]->queue = blk_init_queue(do_fd_request, &floppy_lock);41524152+ if (!disks[drive]->queue) {41554153 err = -ENOMEM;41564154 goto out_put_disk;41574155 }4158415641594159- disks[dr]->queue = blk_init_queue(do_fd_request, &floppy_lock);41604160- if (!disks[dr]->queue) {41614161- err = -ENOMEM;41624162- goto out_destroy_workq;41634163- }41574157+ blk_queue_max_hw_sectors(disks[drive]->queue, 64);41584158+ disks[drive]->major = FLOPPY_MAJOR;41594159+ disks[drive]->first_minor = TOMINOR(drive);41604160+ disks[drive]->fops = &floppy_fops;41614161+ sprintf(disks[drive]->disk_name, "fd%d", drive);4164416241654165- blk_queue_max_hw_sectors(disks[dr]->queue, 64);41664166- disks[dr]->major = FLOPPY_MAJOR;41674167- disks[dr]->first_minor = TOMINOR(dr);41684168- disks[dr]->fops = &floppy_fops;41694169- sprintf(disks[dr]->disk_name, "fd%d", dr);41704170-41714171- init_timer(&motor_off_timer[dr]);41724172- motor_off_timer[dr].data = dr;41734173- motor_off_timer[dr].function = motor_off_callback;41634163+ init_timer(&motor_off_timer[drive]);41644164+ motor_off_timer[drive].data = drive;41654165+ motor_off_timer[drive].function = motor_off_callback;41744166 }4175416741764168 err = register_blkdev(FLOPPY_MAJOR, "fd");···42864282 }4287428342884284 for (drive = 0; drive < N_DRIVE; drive++) {42894289- if (!(allowed_drive_mask & (1 << drive)))42904290- continue;42914291- if (fdc_state[FDC(drive)].version == FDC_NONE)42854285+ if (!floppy_available(drive))42924286 continue;4293428742944288 floppy_device[drive].name = floppy_device_name;···4295429342964294 err = platform_device_register(&floppy_device[drive]);42974295 if (err)42984298- goto out_release_dma;42964296+ goto out_remove_drives;4299429743004298 err = device_create_file(&floppy_device[drive].dev,43014299 &dev_attr_cmos);···4313431143144312out_unreg_platform_dev:43154313 platform_device_unregister(&floppy_device[drive]);43144314+out_remove_drives:43154315+ while (drive--) {43164316+ if (floppy_available(drive)) {43174317+ del_gendisk(disks[drive]);43184318+ device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);43194319+ platform_device_unregister(&floppy_device[drive]);43204320+ }43214321+ }43164322out_release_dma:43174323 if (atomic_read(&usage_count))43184324 floppy_release_irq_and_dma();43194325out_unreg_region:43204326 blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);43214327 platform_driver_unregister(&floppy_driver);43224322-out_destroy_workq:43234323- destroy_workqueue(floppy_wq);43244328out_unreg_blkdev:43254329 unregister_blkdev(FLOPPY_MAJOR, "fd");43264330out_put_disk:43274327- while (dr--) {43284328- del_timer_sync(&motor_off_timer[dr]);43294329- if (disks[dr]->queue) {43304330- blk_cleanup_queue(disks[dr]->queue);43314331- /*43324332- * put_disk() is not paired with add_disk() and43334333- * will put queue reference one extra time. fix it.43344334- */43354335- disks[dr]->queue = NULL;43314331+ for (drive = 0; drive < N_DRIVE; drive++) {43324332+ if (!disks[drive])43334333+ break;43344334+ if (disks[drive]->queue) {43354335+ del_timer_sync(&motor_off_timer[drive]);43364336+ blk_cleanup_queue(disks[drive]->queue);43374337+ disks[drive]->queue = NULL;43364338 }43374337- put_disk(disks[dr]);43394339+ put_disk(disks[drive]);43384340 }43414341+ destroy_workqueue(floppy_wq);43394342 return err;43404343}43414344···45584551 for (drive = 0; drive < N_DRIVE; drive++) {45594552 del_timer_sync(&motor_off_timer[drive]);4560455345614561- if ((allowed_drive_mask & (1 << drive)) &&45624562- fdc_state[FDC(drive)].version != FDC_NONE) {45544554+ if (floppy_available(drive)) {45634555 del_gendisk(disks[drive]);45644556 device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);45654557 platform_device_unregister(&floppy_device[drive]);
+15-2
drivers/block/loop.c
···976976 if (lo->lo_state != Lo_bound)977977 return -ENXIO;978978979979- if (lo->lo_refcnt > 1) /* we needed one fd for the ioctl */980980- return -EBUSY;979979+ /*980980+ * If we've explicitly asked to tear down the loop device,981981+ * and it has an elevated reference count, set it for auto-teardown when982982+ * the last reference goes away. This stops $!~#$@ udev from983983+ * preventing teardown because it decided that it needs to run blkid on984984+ * the loopback device whenever they appear. xfstests is notorious for985985+ * failing tests because blkid via udev races with a losetup986986+ * <dev>/do something like mkfs/losetup -d <dev> causing the losetup -d987987+ * command to fail with EBUSY.988988+ */989989+ if (lo->lo_refcnt > 1) {990990+ lo->lo_flags |= LO_FLAGS_AUTOCLEAR;991991+ mutex_unlock(&lo->lo_ctl_mutex);992992+ return 0;993993+ }981994982995 if (filp == NULL)983996 return -EINVAL;
+15-4
drivers/block/mtip32xx/mtip32xx.c
···20352035 }20362036 return rv;20372037}20382038-20392039-static void mtip_set_timeout(struct host_to_dev_fis *fis, unsigned int *timeout)20382038+static void mtip_set_timeout(struct driver_data *dd,20392039+ struct host_to_dev_fis *fis,20402040+ unsigned int *timeout, u8 erasemode)20402041{20412042 switch (fis->command) {20422043 case ATA_CMD_DOWNLOAD_MICRO:···20452044 break;20462045 case ATA_CMD_SEC_ERASE_UNIT:20472046 case 0xFC:20482048- *timeout = 240000; /* 4 minutes */20472047+ if (erasemode)20482048+ *timeout = ((*(dd->port->identify + 90) * 2) * 60000);20492049+ else20502050+ *timeout = ((*(dd->port->identify + 89) * 2) * 60000);20492051 break;20502052 case ATA_CMD_STANDBYNOW1:20512053 *timeout = 120000; /* 2 minutes */···20912087 unsigned int transfer_size;20922088 unsigned long task_file_data;20932089 int intotal = outtotal + req_task->out_size;20902090+ int erasemode = 0;2094209120952092 taskout = req_task->out_size;20962093 taskin = req_task->in_size;···22172212 fis.lba_hi,22182213 fis.device);2219221422202220- mtip_set_timeout(&fis, &timeout);22152215+ /* check for erase mode support during secure erase.*/22162216+ if ((fis.command == ATA_CMD_SEC_ERASE_UNIT)22172217+ && (outbuf[0] & MTIP_SEC_ERASE_MODE)) {22182218+ erasemode = 1;22192219+ }22202220+22212221+ mtip_set_timeout(dd, &fis, &timeout, erasemode);2221222222222223 /* Determine the correct transfer size.*/22232224 if (force_single_sector)
+3
drivers/block/mtip32xx/mtip32xx.h
···3333/* offset of Device Control register in PCIe extended capabilites space */3434#define PCIE_CONFIG_EXT_DEVICE_CONTROL_OFFSET 0x4835353636+/* check for erase mode support during secure erase */3737+#define MTIP_SEC_ERASE_MODE 0x33838+3639/* # of times to retry timed out/failed IOs */3740#define MTIP_MAX_RETRIES 23841
···55 * http://www.gnu.org/licenses/gpl.html66 *77 * Maintainer:88- * Andreas Herrmann <andreas.herrmann3@amd.com>88+ * Andreas Herrmann <herrmann.der.user@googlemail.com>99 *1010 * Based on the powernow-k7.c module written by Dave Jones.1111 * (C) 2003 Dave Jones on behalf of SuSE Labs
···244244 if (ret)245245 return ret;246246247247+ mvebu_gpio_set(chip, pin, value);248248+247249 spin_lock_irqsave(&mvchip->lock, flags);248250 u = readl_relaxed(mvebu_gpioreg_io_conf(mvchip));249251 u &= ~(1 << pin);···646644 ct->handler = handle_edge_irq;647645 ct->chip.name = mvchip->chip.label;648646649649- irq_setup_generic_chip(gc, IRQ_MSK(ngpios), IRQ_GC_INIT_MASK_CACHE,647647+ irq_setup_generic_chip(gc, IRQ_MSK(ngpios), 0,650648 IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);651649652650 /* Setup irq domain on top of the generic chip. */
+35
drivers/gpio/gpio-omap.c
···251251 }252252}253253254254+/**255255+ * _clear_gpio_debounce - clear debounce settings for a gpio256256+ * @bank: the gpio bank we're acting upon257257+ * @gpio: the gpio number on this @gpio258258+ *259259+ * If a gpio is using debounce, then clear the debounce enable bit and if260260+ * this is the only gpio in this bank using debounce, then clear the debounce261261+ * time too. The debounce clock will also be disabled when calling this function262262+ * if this is the only gpio in the bank using debounce.263263+ */264264+static void _clear_gpio_debounce(struct gpio_bank *bank, unsigned gpio)265265+{266266+ u32 gpio_bit = GPIO_BIT(bank, gpio);267267+268268+ if (!bank->dbck_flag)269269+ return;270270+271271+ if (!(bank->dbck_enable_mask & gpio_bit))272272+ return;273273+274274+ bank->dbck_enable_mask &= ~gpio_bit;275275+ bank->context.debounce_en &= ~gpio_bit;276276+ __raw_writel(bank->context.debounce_en,277277+ bank->base + bank->regs->debounce_en);278278+279279+ if (!bank->dbck_enable_mask) {280280+ bank->context.debounce = 0;281281+ __raw_writel(bank->context.debounce, bank->base +282282+ bank->regs->debounce);283283+ clk_disable(bank->dbck);284284+ bank->dbck_enabled = false;285285+ }286286+}287287+254288static inline void set_gpio_trigger(struct gpio_bank *bank, int gpio,255289 unsigned trigger)256290{···573539 _set_gpio_irqenable(bank, gpio, 0);574540 _clear_gpio_irqstatus(bank, gpio);575541 _set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), IRQ_TYPE_NONE);542542+ _clear_gpio_debounce(bank, gpio);576543}577544578545/* Use disable_irq_wake() and enable_irq_wake() functions from drivers */
···4343 * @manager: specific encoder has its own manager to control a hardware4444 * appropriately and we can access a hardware drawing on this manager.4545 * @dpms: store the encoder dpms value.4646+ * @updated: indicate whether overlay data updating is needed or not.4647 */4748struct exynos_drm_encoder {4849 struct drm_crtc *old_crtc;4950 struct drm_encoder drm_encoder;5051 struct exynos_drm_manager *manager;5151- int dpms;5252+ int dpms;5353+ bool updated;5254};53555456static void exynos_drm_connector_power(struct drm_encoder *encoder, int mode)···8785 switch (mode) {8886 case DRM_MODE_DPMS_ON:8987 if (manager_ops && manager_ops->apply)9090- manager_ops->apply(manager->dev);8888+ if (!exynos_encoder->updated)8989+ manager_ops->apply(manager->dev);9090+9191 exynos_drm_connector_power(encoder, mode);9292 exynos_encoder->dpms = mode;9393 break;···9894 case DRM_MODE_DPMS_OFF:9995 exynos_drm_connector_power(encoder, mode);10096 exynos_encoder->dpms = mode;9797+ exynos_encoder->updated = false;10198 break;10299 default:103100 DRM_ERROR("unspecified mode %d\n", mode);···210205211206static void exynos_drm_encoder_commit(struct drm_encoder *encoder)212207{213213- struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);208208+ struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);209209+ struct exynos_drm_manager *manager = exynos_encoder->manager;214210 struct exynos_drm_manager_ops *manager_ops = manager->ops;215211216212 DRM_DEBUG_KMS("%s\n", __FILE__);217213218214 if (manager_ops && manager_ops->commit)219215 manager_ops->commit(manager->dev);216216+217217+ /*218218+ * this will avoid one issue that overlay data is updated to219219+ * real hardware two times.220220+ * And this variable will be used to check if the data was221221+ * already updated or not by exynos_drm_encoder_dpms function.222222+ */223223+ exynos_encoder->updated = true;220224}221225222226static void exynos_drm_encoder_disable(struct drm_encoder *encoder)···413399414400 if (manager_ops && manager_ops->dpms)415401 manager_ops->dpms(manager->dev, mode);416416-417417- /*418418- * set current mode to new one so that data aren't updated into419419- * registers by drm_helper_connector_dpms two times.420420- *421421- * in case that drm_crtc_helper_set_mode() is called,422422- * overlay_ops->commit() and manager_ops->commit() callbacks423423- * can be called two times, first at drm_crtc_helper_set_mode()424424- * and second at drm_helper_connector_dpms().425425- * so with this setting, when drm_helper_connector_dpms() is called426426- * encoder->funcs->dpms() will be ignored.427427- */428428- exynos_encoder->dpms = mode;429402430403 /*431404 * if this condition is ok then it means that the crtc is already
···341341 intel_ring_emit(ring, flip_addr);342342 intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);343343 /* turn overlay off */344344- intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_OFF);345345- intel_ring_emit(ring, flip_addr);346346- intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);344344+ if (IS_I830(dev)) {345345+ /* Workaround: Don't disable the overlay fully, since otherwise346346+ * it dies on the next OVERLAY_ON cmd. */347347+ intel_ring_emit(ring, MI_NOOP);348348+ intel_ring_emit(ring, MI_NOOP);349349+ intel_ring_emit(ring, MI_NOOP);350350+ } else {351351+ intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_OFF);352352+ intel_ring_emit(ring, flip_addr);353353+ intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);354354+ }347355 intel_ring_advance(ring);348356349357 return intel_overlay_do_wait_request(overlay, intel_overlay_off_tail);
+1-1
drivers/gpu/drm/i915/intel_panel.c
···435435 props.type = BACKLIGHT_RAW;436436 props.max_brightness = _intel_panel_get_max_backlight(dev);437437 if (props.max_brightness == 0) {438438- DRM_ERROR("Failed to get maximum backlight value\n");438438+ DRM_DEBUG_DRIVER("Failed to get maximum backlight value\n");439439 return -ENODEV;440440 }441441 dev_priv->backlight =
+42-20
drivers/gpu/drm/i915/intel_sdvo.c
···894894}895895#endif896896897897+static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,898898+ unsigned if_index, uint8_t tx_rate,899899+ uint8_t *data, unsigned length)900900+{901901+ uint8_t set_buf_index[2] = { if_index, 0 };902902+ uint8_t hbuf_size, tmp[8];903903+ int i;904904+905905+ if (!intel_sdvo_set_value(intel_sdvo,906906+ SDVO_CMD_SET_HBUF_INDEX,907907+ set_buf_index, 2))908908+ return false;909909+910910+ if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HBUF_INFO,911911+ &hbuf_size, 1))912912+ return false;913913+914914+ /* Buffer size is 0 based, hooray! */915915+ hbuf_size++;916916+917917+ DRM_DEBUG_KMS("writing sdvo hbuf: %i, hbuf_size %i, hbuf_size: %i\n",918918+ if_index, length, hbuf_size);919919+920920+ for (i = 0; i < hbuf_size; i += 8) {921921+ memset(tmp, 0, 8);922922+ if (i < length)923923+ memcpy(tmp, data + i, min_t(unsigned, 8, length - i));924924+925925+ if (!intel_sdvo_set_value(intel_sdvo,926926+ SDVO_CMD_SET_HBUF_DATA,927927+ tmp, 8))928928+ return false;929929+ }930930+931931+ return intel_sdvo_set_value(intel_sdvo,932932+ SDVO_CMD_SET_HBUF_TXRATE,933933+ &tx_rate, 1);934934+}935935+897936static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo)898937{899938 struct dip_infoframe avi_if = {···940901 .ver = DIP_VERSION_AVI,941902 .len = DIP_LEN_AVI,942903 };943943- uint8_t tx_rate = SDVO_HBUF_TX_VSYNC;944944- uint8_t set_buf_index[2] = { 1, 0 };945904 uint8_t sdvo_data[4 + sizeof(avi_if.body.avi)];946946- uint64_t *data = (uint64_t *)sdvo_data;947947- unsigned i;948905949906 intel_dip_infoframe_csum(&avi_if);950907···950915 sdvo_data[3] = avi_if.checksum;951916 memcpy(&sdvo_data[4], &avi_if.body, sizeof(avi_if.body.avi));952917953953- if (!intel_sdvo_set_value(intel_sdvo,954954- SDVO_CMD_SET_HBUF_INDEX,955955- set_buf_index, 2))956956- return false;957957-958958- for (i = 0; i < sizeof(sdvo_data); i += 8) {959959- if (!intel_sdvo_set_value(intel_sdvo,960960- SDVO_CMD_SET_HBUF_DATA,961961- data, 8))962962- return false;963963- data++;964964- }965965-966966- return intel_sdvo_set_value(intel_sdvo,967967- SDVO_CMD_SET_HBUF_TXRATE,968968- &tx_rate, 1);918918+ return intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF,919919+ SDVO_HBUF_TX_VSYNC,920920+ sdvo_data, sizeof(sdvo_data));969921}970922971923static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo)
···352352}353353354354/**355355- * radeon_atpx_switchto - switch to the requested GPU355355+ * radeon_atpx_power_state - power down/up the requested GPU356356 *357357- * @id: GPU to switch to357357+ * @id: GPU to power down/up358358 * @state: requested power state (0 = off, 1 = on)359359 *360360 * Execute the necessary ATPX function to power down/up the discrete GPU
+21-7
drivers/gpu/drm/radeon/radeon_connectors.c
···941941 struct drm_mode_object *obj;942942 int i;943943 enum drm_connector_status ret = connector_status_disconnected;944944- bool dret = false;944944+ bool dret = false, broken_edid = false;945945946946 if (!force && radeon_check_hpd_status_unchanged(connector))947947 return connector->status;···965965 ret = connector_status_disconnected;966966 DRM_ERROR("%s: detected RS690 floating bus bug, stopping ddc detect\n", drm_get_connector_name(connector));967967 radeon_connector->ddc_bus = NULL;968968+ } else {969969+ ret = connector_status_connected;970970+ broken_edid = true; /* defer use_digital to later */968971 }969972 } else {970973 radeon_connector->use_digital = !!(radeon_connector->edid->input & DRM_EDID_INPUT_DIGITAL);···1050104710511048 encoder_funcs = encoder->helper_private;10521049 if (encoder_funcs->detect) {10531053- if (ret != connector_status_connected) {10541054- ret = encoder_funcs->detect(encoder, connector);10551055- if (ret == connector_status_connected) {10561056- radeon_connector->use_digital = false;10501050+ if (!broken_edid) {10511051+ if (ret != connector_status_connected) {10521052+ /* deal with analog monitors without DDC */10531053+ ret = encoder_funcs->detect(encoder, connector);10541054+ if (ret == connector_status_connected) {10551055+ radeon_connector->use_digital = false;10561056+ }10571057+ if (ret != connector_status_disconnected)10581058+ radeon_connector->detected_by_load = true;10571059 }10581058- if (ret != connector_status_disconnected)10591059- radeon_connector->detected_by_load = true;10601060+ } else {10611061+ enum drm_connector_status lret;10621062+ /* assume digital unless load detected otherwise */10631063+ radeon_connector->use_digital = true;10641064+ lret = encoder_funcs->detect(encoder, connector);10651065+ DRM_DEBUG_KMS("load_detect %x returned: %x\n",encoder->encoder_type,lret);10661066+ if (lret == connector_status_connected)10671067+ radeon_connector->use_digital = false;10601068 }10611069 break;10621070 }
+13-2
drivers/gpu/drm/radeon/radeon_legacy_crtc.c
···295295 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);296296 struct drm_device *dev = crtc->dev;297297 struct radeon_device *rdev = dev->dev_private;298298+ uint32_t crtc_ext_cntl = 0;298299 uint32_t mask;299300300301 if (radeon_crtc->crtc_id)···308307 RADEON_CRTC_VSYNC_DIS |309308 RADEON_CRTC_HSYNC_DIS);310309310310+ /*311311+ * On all dual CRTC GPUs this bit controls the CRTC of the primary DAC.312312+ * Therefore it is set in the DAC DMPS function.313313+ * This is different for GPU's with a single CRTC but a primary and a314314+ * TV DAC: here it controls the single CRTC no matter where it is315315+ * routed. Therefore we set it here.316316+ */317317+ if (rdev->flags & RADEON_SINGLE_CRTC)318318+ crtc_ext_cntl = RADEON_CRTC_CRT_ON;319319+311320 switch (mode) {312321 case DRM_MODE_DPMS_ON:313322 radeon_crtc->enabled = true;···328317 else {329318 WREG32_P(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_EN, ~(RADEON_CRTC_EN |330319 RADEON_CRTC_DISP_REQ_EN_B));331331- WREG32_P(RADEON_CRTC_EXT_CNTL, 0, ~mask);320320+ WREG32_P(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl, ~(mask | crtc_ext_cntl));332321 }333322 drm_vblank_post_modeset(dev, radeon_crtc->crtc_id);334323 radeon_crtc_load_lut(crtc);···342331 else {343332 WREG32_P(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_DISP_REQ_EN_B, ~(RADEON_CRTC_EN |344333 RADEON_CRTC_DISP_REQ_EN_B));345345- WREG32_P(RADEON_CRTC_EXT_CNTL, mask, ~mask);334334+ WREG32_P(RADEON_CRTC_EXT_CNTL, mask, ~(mask | crtc_ext_cntl));346335 }347336 radeon_crtc->enabled = false;348337 /* adjust pm to dpms changes AFTER disabling crtcs */
···2828#define MS_RDESC 0x082929#define MS_NOGET 0x103030#define MS_DUPLICATE_USAGES 0x203131+#define MS_RDESC_3K 0x4031323232-/*3333- * Microsoft Wireless Desktop Receiver (Model 1028) has3434- * 'Usage Min/Max' where it ought to have 'Physical Min/Max'3535- */3633static __u8 *ms_report_fixup(struct hid_device *hdev, __u8 *rdesc,3734 unsigned int *rsize)3835{3936 unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);40373838+ /*3939+ * Microsoft Wireless Desktop Receiver (Model 1028) has4040+ * 'Usage Min/Max' where it ought to have 'Physical Min/Max'4141+ */4142 if ((quirks & MS_RDESC) && *rsize == 571 && rdesc[557] == 0x19 &&4243 rdesc[559] == 0x29) {4344 hid_info(hdev, "fixing up Microsoft Wireless Receiver Model 1028 report descriptor\n");4445 rdesc[557] = 0x35;4546 rdesc[559] = 0x45;4747+ }4848+ /* the same as above (s/usage/physical/) */4949+ if ((quirks & MS_RDESC_3K) && *rsize == 106 &&5050+ !memcmp((char []){ 0x19, 0x00, 0x29, 0xff },5151+ &rdesc[94], 4)) {5252+ rdesc[94] = 0x35;5353+ rdesc[96] = 0x45;4654 }4755 return rdesc;4856}···200192 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB),201193 .driver_data = MS_PRESENTER },202194 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K),203203- .driver_data = MS_ERGONOMY },195195+ .driver_data = MS_ERGONOMY | MS_RDESC_3K },204196 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0),205197 .driver_data = MS_NOGET },206198 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500),
+2-3
drivers/hid/hid-multitouch.c
···210210 },211211 { .name = MT_CLS_GENERALTOUCH_PWT_TENFINGERS,212212 .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |213213- MT_QUIRK_SLOT_IS_CONTACTNUMBER,214214- .maxcontacts = 10213213+ MT_QUIRK_SLOT_IS_CONTACTNUMBER215214 },216215217216 { .name = MT_CLS_FLATFROG,···420421 * contact max are global to the report */421422 td->last_field_index = field->index;422423 return -1;423423- }424424 case HID_DG_TOUCH:425425 /* Legacy devices use TIPSWITCH and not TOUCH.426426 * Let's just ignore this field. */427427 return -1;428428+ }428429 /* let hid-input decide for the others */429430 return 0;430431
+2-2
drivers/hwmon/fam15h_power.c
···22 * fam15h_power.c - AMD Family 15h processor power monitoring33 *44 * Copyright (c) 2011 Advanced Micro Devices, Inc.55- * Author: Andreas Herrmann <andreas.herrmann3@amd.com>55+ * Author: Andreas Herrmann <herrmann.der.user@googlemail.com>66 *77 *88 * This driver is free software; you can redistribute it and/or···2828#include <asm/processor.h>29293030MODULE_DESCRIPTION("AMD Family 15h CPU processor power monitor");3131-MODULE_AUTHOR("Andreas Herrmann <andreas.herrmann3@amd.com>");3131+MODULE_AUTHOR("Andreas Herrmann <herrmann.der.user@googlemail.com>");3232MODULE_LICENSE("GPL");33333434/* D18F3 */
···8181 tristate "Intel 82801 (ICH/PCH)"8282 depends on PCI8383 select CHECK_SIGNATURE if X86 && DMI8484- select GPIOLIB if I2C_MUX8584 help8685 If you say yes to this option, support will be included for the Intel8786 801 family of mainboard I2C interfaces. Specifically, the following
···22 i2c-stub.c - I2C/SMBus chip emulator3344 Copyright (c) 2004 Mark M. Hoffman <mhoffman@lightlink.com>55- Copyright (C) 2007 Jean Delvare <khali@linux-fr.org>55+ Copyright (C) 2007, 2012 Jean Delvare <khali@linux-fr.org>6677 This program is free software; you can redistribute it and/or modify88 it under the terms of the GNU General Public License as published by···5151static struct stub_chip *stub_chips;52525353/* Return negative errno on error. */5454-static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, unsigned short flags,5555- char read_write, u8 command, int size, union i2c_smbus_data * data)5454+static s32 stub_xfer(struct i2c_adapter *adap, u16 addr, unsigned short flags,5555+ char read_write, u8 command, int size, union i2c_smbus_data *data)5656{5757 s32 ret;5858 int i, len;···7878 case I2C_SMBUS_BYTE:7979 if (read_write == I2C_SMBUS_WRITE) {8080 chip->pointer = command;8181- dev_dbg(&adap->dev, "smbus byte - addr 0x%02x, "8282- "wrote 0x%02x.\n",8383- addr, command);8181+ dev_dbg(&adap->dev,8282+ "smbus byte - addr 0x%02x, wrote 0x%02x.\n",8383+ addr, command);8484 } else {8585 data->byte = chip->words[chip->pointer++] & 0xff;8686- dev_dbg(&adap->dev, "smbus byte - addr 0x%02x, "8787- "read 0x%02x.\n",8888- addr, data->byte);8686+ dev_dbg(&adap->dev,8787+ "smbus byte - addr 0x%02x, read 0x%02x.\n",8888+ addr, data->byte);8989 }90909191 ret = 0;···9595 if (read_write == I2C_SMBUS_WRITE) {9696 chip->words[command] &= 0xff00;9797 chip->words[command] |= data->byte;9898- dev_dbg(&adap->dev, "smbus byte data - addr 0x%02x, "9999- "wrote 0x%02x at 0x%02x.\n",100100- addr, data->byte, command);9898+ dev_dbg(&adap->dev,9999+ "smbus byte data - addr 0x%02x, wrote 0x%02x at 0x%02x.\n",100100+ addr, data->byte, command);101101 } else {102102 data->byte = chip->words[command] & 0xff;103103- dev_dbg(&adap->dev, "smbus byte data - addr 0x%02x, "104104- "read 0x%02x at 0x%02x.\n",105105- addr, data->byte, command);103103+ dev_dbg(&adap->dev,104104+ "smbus byte data - addr 0x%02x, read 0x%02x at 0x%02x.\n",105105+ addr, data->byte, command);106106 }107107 chip->pointer = command + 1;108108···112112 case I2C_SMBUS_WORD_DATA:113113 if (read_write == I2C_SMBUS_WRITE) {114114 chip->words[command] = data->word;115115- dev_dbg(&adap->dev, "smbus word data - addr 0x%02x, "116116- "wrote 0x%04x at 0x%02x.\n",117117- addr, data->word, command);115115+ dev_dbg(&adap->dev,116116+ "smbus word data - addr 0x%02x, wrote 0x%04x at 0x%02x.\n",117117+ addr, data->word, command);118118 } else {119119 data->word = chip->words[command];120120- dev_dbg(&adap->dev, "smbus word data - addr 0x%02x, "121121- "read 0x%04x at 0x%02x.\n",122122- addr, data->word, command);120120+ dev_dbg(&adap->dev,121121+ "smbus word data - addr 0x%02x, read 0x%04x at 0x%02x.\n",122122+ addr, data->word, command);123123 }124124125125 ret = 0;···132132 chip->words[command + i] &= 0xff00;133133 chip->words[command + i] |= data->block[1 + i];134134 }135135- dev_dbg(&adap->dev, "i2c block data - addr 0x%02x, "136136- "wrote %d bytes at 0x%02x.\n",137137- addr, len, command);135135+ dev_dbg(&adap->dev,136136+ "i2c block data - addr 0x%02x, wrote %d bytes at 0x%02x.\n",137137+ addr, len, command);138138 } else {139139 for (i = 0; i < len; i++) {140140 data->block[1 + i] =141141 chip->words[command + i] & 0xff;142142 }143143- dev_dbg(&adap->dev, "i2c block data - addr 0x%02x, "144144- "read %d bytes at 0x%02x.\n",145145- addr, len, command);143143+ dev_dbg(&adap->dev,144144+ "i2c block data - addr 0x%02x, read %d bytes at 0x%02x.\n",145145+ addr, len, command);146146 }147147148148 ret = 0;···179179 int i, ret;180180181181 if (!chip_addr[0]) {182182- printk(KERN_ERR "i2c-stub: Please specify a chip address\n");182182+ pr_err("i2c-stub: Please specify a chip address\n");183183 return -ENODEV;184184 }185185186186 for (i = 0; i < MAX_CHIPS && chip_addr[i]; i++) {187187 if (chip_addr[i] < 0x03 || chip_addr[i] > 0x77) {188188- printk(KERN_ERR "i2c-stub: Invalid chip address "189189- "0x%02x\n", chip_addr[i]);188188+ pr_err("i2c-stub: Invalid chip address 0x%02x\n",189189+ chip_addr[i]);190190 return -EINVAL;191191 }192192193193- printk(KERN_INFO "i2c-stub: Virtual chip at 0x%02x\n",194194- chip_addr[i]);193193+ pr_info("i2c-stub: Virtual chip at 0x%02x\n", chip_addr[i]);195194 }196195197196 /* Allocate memory for all chips at once */198197 stub_chips = kzalloc(i * sizeof(struct stub_chip), GFP_KERNEL);199198 if (!stub_chips) {200200- printk(KERN_ERR "i2c-stub: Out of memory\n");199199+ pr_err("i2c-stub: Out of memory\n");201200 return -ENOMEM;202201 }203202···218219219220module_init(i2c_stub_init);220221module_exit(i2c_stub_exit);221221-
+1-1
drivers/i2c/busses/i2c-tegra.c
···742742 }743743744744 ret = devm_request_irq(&pdev->dev, i2c_dev->irq,745745- tegra_i2c_isr, 0, pdev->name, i2c_dev);745745+ tegra_i2c_isr, 0, dev_name(&pdev->dev), i2c_dev);746746 if (ret) {747747 dev_err(&pdev->dev, "Failed to request irq %i\n", i2c_dev->irq);748748 return ret;
+1
drivers/input/keyboard/Kconfig
···335335config KEYBOARD_LPC32XX336336 tristate "LPC32XX matrix key scanner support"337337 depends on ARCH_LPC32XX && OF338338+ select INPUT_MATRIXKMAP338339 help339340 Say Y here if you want to use NXP LPC32XX SoC key scanner interface,340341 connected to a key matrix.
+3
drivers/input/keyboard/pxa27x_keypad.c
···368368 unsigned int mask = 0, direct_key_num = 0;369369 unsigned long kpc = 0;370370371371+ /* clear pending interrupt bit */372372+ keypad_readl(KPC);373373+371374 /* enable matrix keys with automatic scan */372375 if (pdata->matrix_key_rows && pdata->matrix_key_cols) {373376 kpc |= KPC_ASACT | KPC_MIE | KPC_ME | KPC_MS_ALL;
+4-1
drivers/input/misc/xen-kbdfront.c
···311311 case XenbusStateReconfiguring:312312 case XenbusStateReconfigured:313313 case XenbusStateUnknown:314314- case XenbusStateClosed:315314 break;316315317316 case XenbusStateInitWait:···349350350351 break;351352353353+ case XenbusStateClosed:354354+ if (dev->state == XenbusStateClosed)355355+ break;356356+ /* Missed the backend's CLOSING state -- fallthrough */352357 case XenbusStateClosing:353358 xenbus_frontend_closed(dev);354359 break;
···239239240240config TOUCHSCREEN_EGALAX241241 tristate "EETI eGalax multi-touch panel support"242242- depends on I2C242242+ depends on I2C && OF243243 help244244 Say Y here to enable support for I2C connected EETI245245 eGalax multi-touch panels.
+21-2
drivers/input/touchscreen/egalax_ts.c
···2828#include <linux/slab.h>2929#include <linux/bitops.h>3030#include <linux/input/mt.h>3131+#include <linux/of_gpio.h>31323233/*3334 * Mouse Mode: some panel may configure the controller to mouse mode,···123122/* wake up controller by an falling edge of interrupt gpio. */124123static int egalax_wake_up_device(struct i2c_client *client)125124{126126- int gpio = irq_to_gpio(client->irq);125125+ struct device_node *np = client->dev.of_node;126126+ int gpio;127127 int ret;128128+129129+ if (!np)130130+ return -ENODEV;131131+132132+ gpio = of_get_named_gpio(np, "wakeup-gpios", 0);133133+ if (!gpio_is_valid(gpio))134134+ return -ENODEV;128135129136 ret = gpio_request(gpio, "egalax_irq");130137 if (ret < 0) {···190181 ts->input_dev = input_dev;191182192183 /* controller may be in sleep, wake it up. */193193- egalax_wake_up_device(client);184184+ error = egalax_wake_up_device(client);185185+ if (error) {186186+ dev_err(&client->dev, "Failed to wake up the controller\n");187187+ goto err_free_dev;188188+ }194189195190 ret = egalax_firmware_version(client);196191 if (ret < 0) {···287274288275static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume);289276277277+static struct of_device_id egalax_ts_dt_ids[] = {278278+ { .compatible = "eeti,egalax_ts" },279279+ { /* sentinel */ }280280+};281281+290282static struct i2c_driver egalax_ts_driver = {291283 .driver = {292284 .name = "egalax_ts",293285 .owner = THIS_MODULE,294286 .pm = &egalax_ts_pm_ops,287287+ .of_match_table = of_match_ptr(egalax_ts_dt_ids),295288 },296289 .id_table = egalax_ts_id,297290 .probe = egalax_ts_probe,
···27102710 || disk_idx < 0)27112711 continue;27122712 if (test_bit(Replacement, &rdev->flags))27132713- disk = conf->mirrors + conf->raid_disks + disk_idx;27132713+ disk = conf->mirrors + mddev->raid_disks + disk_idx;27142714 else27152715 disk = conf->mirrors + disk_idx;27162716
+9-6
drivers/md/raid10.c
···17831783 clear_bit(Unmerged, &rdev->flags);17841784 }17851785 md_integrity_add_rdev(rdev, mddev);17861786- if (blk_queue_discard(bdev_get_queue(rdev->bdev)))17861786+ if (mddev->queue && blk_queue_discard(bdev_get_queue(rdev->bdev)))17871787 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);1788178817891789 print_conf(conf);···36133613 discard_supported = true;36143614 }3615361536163616- if (discard_supported)36173617- queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);36183618- else36193619- queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);36203620-36163616+ if (mddev->queue) {36173617+ if (discard_supported)36183618+ queue_flag_set_unlocked(QUEUE_FLAG_DISCARD,36193619+ mddev->queue);36203620+ else36213621+ queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD,36223622+ mddev->queue);36233623+ }36213624 /* need to check that every block has at least one working mirror */36223625 if (!enough(conf, -1)) {36233626 printk(KERN_ERR "md/raid10:%s: not enough operational mirrors.\n",
+2-2
drivers/net/bonding/bond_sysfs.c
···10601060 goto out;10611061 }1062106210631063- sscanf(buf, "%16s", ifname); /* IFNAMSIZ */10631063+ sscanf(buf, "%15s", ifname); /* IFNAMSIZ */1064106410651065 /* check to see if we are clearing primary */10661066 if (!strlen(ifname) || buf[0] == '\n') {···12371237 goto out;12381238 }1239123912401240- sscanf(buf, "%16s", ifname); /* IFNAMSIZ */12401240+ sscanf(buf, "%15s", ifname); /* IFNAMSIZ */1241124112421242 /* check to see if we are clearing active */12431243 if (!strlen(ifname) || buf[0] == '\n') {
···6794679467956795 bnx2x_init_block(bp, BLOCK_DORQ, init_phase);6796679667976797+ bnx2x_init_block(bp, BLOCK_BRB1, init_phase);67986798+67976799 if (CHIP_IS_E1(bp) || CHIP_IS_E1H(bp)) {67986798- bnx2x_init_block(bp, BLOCK_BRB1, init_phase);6799680068006801 if (IS_MF(bp))68016802 low = ((bp->flags & ONE_PORT_FLAG) ? 160 : 246);···1190311902 /* disable FCOE L2 queue for E1x */1190411903 if (CHIP_IS_E1x(bp))1190511904 bp->flags |= NO_FCOE_FLAG;1190611906-1190511905+ /* disable FCOE for 57840 device, until FW supports it */1190611906+ switch (ent->driver_data) {1190711907+ case BCM57840_O:1190811908+ case BCM57840_4_10:1190911909+ case BCM57840_2_20:1191011910+ case BCM57840_MFO:1191111911+ case BCM57840_MF:1191211912+ bp->flags |= NO_FCOE_FLAG;1191311913+ }1190711914#endif11908119151190911916
-10
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
···34163416 finicsum, cfcsum);3417341734183418 /*34193419- * If we're a pure NIC driver then disable all offloading facilities.34203420- * This will allow the firmware to optimize aspects of the hardware34213421- * configuration which will result in improved performance.34223422- */34233423- caps_cmd.ofldcaps = 0;34243424- caps_cmd.iscsicaps = 0;34253425- caps_cmd.rdmacaps = 0;34263426- caps_cmd.fcoecaps = 0;34273427-34283428- /*34293419 * And now tell the firmware to use the configuration we just loaded.34303420 */34313421 caps_cmd.op_to_write =
+3
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
···26732673 case ixgbe_mac_X540:26742674 case ixgbe_mac_82599EB:26752675 info->so_timestamping =26762676+ SOF_TIMESTAMPING_TX_SOFTWARE |26772677+ SOF_TIMESTAMPING_RX_SOFTWARE |26782678+ SOF_TIMESTAMPING_SOFTWARE |26762679 SOF_TIMESTAMPING_TX_HARDWARE |26772680 SOF_TIMESTAMPING_RX_HARDWARE |26782681 SOF_TIMESTAMPING_RAW_HARDWARE;
···237237 struct tcm_qla2xxx_tpg, se_tpg);238238 struct tcm_qla2xxx_lport *lport = tpg->lport;239239240240- return &lport->lport_name[0];240240+ return lport->lport_naa_name;241241}242242243243static char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *se_tpg)···14571457 return 0;14581458}1459145914601460+static void tcm_qla2xxx_update_sess(struct qla_tgt_sess *sess, port_id_t s_id,14611461+ uint16_t loop_id, bool conf_compl_supported)14621462+{14631463+ struct qla_tgt *tgt = sess->tgt;14641464+ struct qla_hw_data *ha = tgt->ha;14651465+ struct tcm_qla2xxx_lport *lport = ha->tgt.target_lport_ptr;14661466+ struct se_node_acl *se_nacl = sess->se_sess->se_node_acl;14671467+ struct tcm_qla2xxx_nacl *nacl = container_of(se_nacl,14681468+ struct tcm_qla2xxx_nacl, se_node_acl);14691469+ u32 key;14701470+14711471+14721472+ if (sess->loop_id != loop_id || sess->s_id.b24 != s_id.b24)14731473+ pr_info("Updating session %p from port %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x loop_id %d -> %d s_id %x:%x:%x -> %x:%x:%x\n",14741474+ sess,14751475+ sess->port_name[0], sess->port_name[1],14761476+ sess->port_name[2], sess->port_name[3],14771477+ sess->port_name[4], sess->port_name[5],14781478+ sess->port_name[6], sess->port_name[7],14791479+ sess->loop_id, loop_id,14801480+ sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa,14811481+ s_id.b.domain, s_id.b.area, s_id.b.al_pa);14821482+14831483+ if (sess->loop_id != loop_id) {14841484+ /*14851485+ * Because we can shuffle loop IDs around and we14861486+ * update different sessions non-atomically, we might14871487+ * have overwritten this session's old loop ID14881488+ * already, and we might end up overwriting some other14891489+ * session that will be updated later. So we have to14901490+ * be extra careful and we can't warn about those things...14911491+ */14921492+ if (lport->lport_loopid_map[sess->loop_id].se_nacl == se_nacl)14931493+ lport->lport_loopid_map[sess->loop_id].se_nacl = NULL;14941494+14951495+ lport->lport_loopid_map[loop_id].se_nacl = se_nacl;14961496+14971497+ sess->loop_id = loop_id;14981498+ }14991499+15001500+ if (sess->s_id.b24 != s_id.b24) {15011501+ key = (((u32) sess->s_id.b.domain << 16) |15021502+ ((u32) sess->s_id.b.area << 8) |15031503+ ((u32) sess->s_id.b.al_pa));15041504+15051505+ if (btree_lookup32(&lport->lport_fcport_map, key))15061506+ WARN(btree_remove32(&lport->lport_fcport_map, key) != se_nacl,15071507+ "Found wrong se_nacl when updating s_id %x:%x:%x\n",15081508+ sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);15091509+ else15101510+ WARN(1, "No lport_fcport_map entry for s_id %x:%x:%x\n",15111511+ sess->s_id.b.domain, sess->s_id.b.area, sess->s_id.b.al_pa);15121512+15131513+ key = (((u32) s_id.b.domain << 16) |15141514+ ((u32) s_id.b.area << 8) |15151515+ ((u32) s_id.b.al_pa));15161516+15171517+ if (btree_lookup32(&lport->lport_fcport_map, key)) {15181518+ WARN(1, "Already have lport_fcport_map entry for s_id %x:%x:%x\n",15191519+ s_id.b.domain, s_id.b.area, s_id.b.al_pa);15201520+ btree_update32(&lport->lport_fcport_map, key, se_nacl);15211521+ } else {15221522+ btree_insert32(&lport->lport_fcport_map, key, se_nacl, GFP_ATOMIC);15231523+ }15241524+15251525+ sess->s_id = s_id;15261526+ nacl->nport_id = key;15271527+ }15281528+15291529+ sess->conf_compl_supported = conf_compl_supported;15301530+}15311531+14601532/*14611533 * Calls into tcm_qla2xxx used by qla2xxx LLD I/O path.14621534 */···15391467 .free_cmd = tcm_qla2xxx_free_cmd,15401468 .free_mcmd = tcm_qla2xxx_free_mcmd,15411469 .free_session = tcm_qla2xxx_free_session,14701470+ .update_sess = tcm_qla2xxx_update_sess,15421471 .check_initiator_node_acl = tcm_qla2xxx_check_initiator_node_acl,15431472 .find_sess_by_s_id = tcm_qla2xxx_find_sess_by_s_id,15441473 .find_sess_by_loop_id = tcm_qla2xxx_find_sess_by_loop_id,···16071534 lport->lport_wwpn = wwpn;16081535 tcm_qla2xxx_format_wwn(&lport->lport_name[0], TCM_QLA2XXX_NAMELEN,16091536 wwpn);15371537+ sprintf(lport->lport_naa_name, "naa.%016llx", (unsigned long long) wwpn);1610153816111539 ret = tcm_qla2xxx_init_lport(lport);16121540 if (ret != 0)···16751601 lport->lport_npiv_wwnn = npiv_wwnn;16761602 tcm_qla2xxx_npiv_format_wwn(&lport->lport_npiv_name[0],16771603 TCM_QLA2XXX_NAMELEN, npiv_wwpn, npiv_wwnn);16041604+ sprintf(lport->lport_naa_name, "naa.%016llx", (unsigned long long) npiv_wwpn);1678160516791606/* FIXME: tcm_qla2xxx_npiv_make_lport */16801607 ret = -ENOSYS;
+2
drivers/scsi/qla2xxx/tcm_qla2xxx.h
···6161 u64 lport_npiv_wwnn;6262 /* ASCII formatted WWPN for FC Target Lport */6363 char lport_name[TCM_QLA2XXX_NAMELEN];6464+ /* ASCII formatted naa WWPN for VPD page 83 etc */6565+ char lport_naa_name[TCM_QLA2XXX_NAMELEN];6466 /* ASCII formatted WWPN+WWNN for NPIV FC Target Lport */6567 char lport_npiv_name[TCM_QLA2XXX_NPIV_NAMELEN];6668 /* map for fc_port pointers in 24-bit FC Port ID space */
···486486};487487488488struct iscsi_conn {489489+ wait_queue_head_t queues_wq;489490 /* Authentication Successful for this connection */490491 u8 auth_complete;491492 /* State connection is currently in */
+1
drivers/target/iscsi/iscsi_target_login.c
···41414242static int iscsi_login_init_conn(struct iscsi_conn *conn)4343{4444+ init_waitqueue_head(&conn->queues_wq);4445 INIT_LIST_HEAD(&conn->conn_list);4546 INIT_LIST_HEAD(&conn->conn_cmd_list);4647 INIT_LIST_HEAD(&conn->immed_queue_list);
···850850851851static u32 se_dev_align_max_sectors(u32 max_sectors, u32 block_size)852852{853853- u32 tmp, aligned_max_sectors;853853+ u32 aligned_max_sectors;854854+ u32 alignment;854855 /*855856 * Limit max_sectors to a PAGE_SIZE aligned value for modern856857 * transport_allocate_data_tasks() operation.857858 */858858- tmp = rounddown((max_sectors * block_size), PAGE_SIZE);859859- aligned_max_sectors = (tmp / block_size);860860- if (max_sectors != aligned_max_sectors) {861861- printk(KERN_INFO "Rounding down aligned max_sectors from %u"862862- " to %u\n", max_sectors, aligned_max_sectors);863863- return aligned_max_sectors;864864- }859859+ alignment = max(1ul, PAGE_SIZE / block_size);860860+ aligned_max_sectors = rounddown(max_sectors, alignment);865861866866- return max_sectors;862862+ if (max_sectors != aligned_max_sectors)863863+ pr_info("Rounding down aligned max_sectors from %u to %u\n",864864+ max_sectors, aligned_max_sectors);865865+866866+ return aligned_max_sectors;867867}868868869869void se_dev_set_default_attribs(
+18
drivers/target/target_core_sbc.c
···135135 return 0;136136}137137138138+static int sbc_emulate_noop(struct se_cmd *cmd)139139+{140140+ target_complete_cmd(cmd, GOOD);141141+ return 0;142142+}143143+138144static inline u32 sbc_get_size(struct se_cmd *cmd, u32 sectors)139145{140146 return cmd->se_dev->se_sub_dev->se_dev_attrib.block_size * sectors;···536530 case VERIFY:537531 size = 0;538532 cmd->execute_cmd = sbc_emulate_verify;533533+ break;534534+ case REZERO_UNIT:535535+ case SEEK_6:536536+ case SEEK_10:537537+ /*538538+ * There are still clients out there which use these old SCSI-2539539+ * commands. This mainly happens when running VMs with legacy540540+ * guest systems, connected via SCSI command pass-through to541541+ * iSCSI targets. Make them happy and return status GOOD.542542+ */543543+ size = 0;544544+ cmd->execute_cmd = sbc_emulate_noop;539545 break;540546 default:541547 ret = spc_parse_cdb(cmd, &size);
+2
drivers/target/target_core_spc.c
···605605 unsigned char buf[SE_INQUIRY_BUF];606606 int p, ret;607607608608+ memset(buf, 0, SE_INQUIRY_BUF);609609+608610 if (dev == tpg->tpg_virt_lun0.lun_se_dev)609611 buf[0] = 0x3f; /* Not connected */610612 else
···210210 goto error_free_priv;211211 }212212213213- zone = thermal_zone_device_register("rcar_thermal", 0, priv,213213+ zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,214214 &rcar_thermal_zone_ops, 0, 0);215215 if (IS_ERR(zone)) {216216 dev_err(&pdev->dev, "thermal zone device is NULL\n");
+4-1
drivers/video/xen-fbfront.c
···641641 case XenbusStateReconfiguring:642642 case XenbusStateReconfigured:643643 case XenbusStateUnknown:644644- case XenbusStateClosed:645644 break;646645647646 case XenbusStateInitWait:···669670 info->feature_resize = val;670671 break;671672673673+ case XenbusStateClosed:674674+ if (dev->state == XenbusStateClosed)675675+ break;676676+ /* Missed the backend's CLOSING state -- fallthrough */672677 case XenbusStateClosing:673678 xenbus_frontend_closed(dev);674679 break;
···181181 else182182 msg.rpc_proc = &mnt_clnt->cl_procinfo[MOUNTPROC_MNT];183183184184- status = rpc_call_sync(mnt_clnt, &msg, 0);184184+ status = rpc_call_sync(mnt_clnt, &msg, RPC_TASK_SOFT|RPC_TASK_TIMEOUT);185185 rpc_shutdown_client(mnt_clnt);186186187187 if (status < 0)
+14-5
fs/nfs/namespace.c
···3333 * @dentry - pointer to dentry3434 * @buffer - result buffer3535 * @buflen - length of buffer3636+ * @flags - options (see below)3637 *3738 * Helper function for constructing the server pathname3839 * by arbitrary hashed dentry.···4140 * This is mainly for use in figuring out the path on the4241 * server side when automounting on top of an existing partition4342 * and in generating /proc/mounts and friends.4343+ *4444+ * Supported flags:4545+ * NFS_PATH_CANONICAL: ensure there is exactly one slash after4646+ * the original device (export) name4747+ * (if unset, the original name is returned verbatim)4448 */4545-char *nfs_path(char **p, struct dentry *dentry, char *buffer, ssize_t buflen)4949+char *nfs_path(char **p, struct dentry *dentry, char *buffer, ssize_t buflen,5050+ unsigned flags)4651{4752 char *end;4853 int namelen;···8174 rcu_read_unlock();8275 goto rename_retry;8376 }8484- if (*end != '/') {7777+ if ((flags & NFS_PATH_CANONICAL) && *end != '/') {8578 if (--buflen < 0) {8679 spin_unlock(&dentry->d_lock);8780 rcu_read_unlock();···9891 return end;9992 }10093 namelen = strlen(base);101101- /* Strip off excess slashes in base string */102102- while (namelen > 0 && base[namelen - 1] == '/')103103- namelen--;9494+ if (flags & NFS_PATH_CANONICAL) {9595+ /* Strip off excess slashes in base string */9696+ while (namelen > 0 && base[namelen - 1] == '/')9797+ namelen--;9898+ }10499 buflen -= namelen;105100 if (buflen < 0) {106101 spin_unlock(&dentry->d_lock);
···11+/*22+ * Statically sized hash table implementation33+ * (C) 2012 Sasha Levin <levinsasha928@gmail.com>44+ */55+66+#ifndef _LINUX_HASHTABLE_H77+#define _LINUX_HASHTABLE_H88+99+#include <linux/list.h>1010+#include <linux/types.h>1111+#include <linux/kernel.h>1212+#include <linux/hash.h>1313+#include <linux/rculist.h>1414+1515+#define DEFINE_HASHTABLE(name, bits) \1616+ struct hlist_head name[1 << (bits)] = \1717+ { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT }1818+1919+#define DECLARE_HASHTABLE(name, bits) \2020+ struct hlist_head name[1 << (bits)]2121+2222+#define HASH_SIZE(name) (ARRAY_SIZE(name))2323+#define HASH_BITS(name) ilog2(HASH_SIZE(name))2424+2525+/* Use hash_32 when possible to allow for fast 32bit hashing in 64bit kernels. */2626+#define hash_min(val, bits) \2727+ (sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits))2828+2929+static inline void __hash_init(struct hlist_head *ht, unsigned int sz)3030+{3131+ unsigned int i;3232+3333+ for (i = 0; i < sz; i++)3434+ INIT_HLIST_HEAD(&ht[i]);3535+}3636+3737+/**3838+ * hash_init - initialize a hash table3939+ * @hashtable: hashtable to be initialized4040+ *4141+ * Calculates the size of the hashtable from the given parameter, otherwise4242+ * same as hash_init_size.4343+ *4444+ * This has to be a macro since HASH_BITS() will not work on pointers since4545+ * it calculates the size during preprocessing.4646+ */4747+#define hash_init(hashtable) __hash_init(hashtable, HASH_SIZE(hashtable))4848+4949+/**5050+ * hash_add - add an object to a hashtable5151+ * @hashtable: hashtable to add to5252+ * @node: the &struct hlist_node of the object to be added5353+ * @key: the key of the object to be added5454+ */5555+#define hash_add(hashtable, node, key) \5656+ hlist_add_head(node, &hashtable[hash_min(key, HASH_BITS(hashtable))])5757+5858+/**5959+ * hash_add_rcu - add an object to a rcu enabled hashtable6060+ * @hashtable: hashtable to add to6161+ * @node: the &struct hlist_node of the object to be added6262+ * @key: the key of the object to be added6363+ */6464+#define hash_add_rcu(hashtable, node, key) \6565+ hlist_add_head_rcu(node, &hashtable[hash_min(key, HASH_BITS(hashtable))])6666+6767+/**6868+ * hash_hashed - check whether an object is in any hashtable6969+ * @node: the &struct hlist_node of the object to be checked7070+ */7171+static inline bool hash_hashed(struct hlist_node *node)7272+{7373+ return !hlist_unhashed(node);7474+}7575+7676+static inline bool __hash_empty(struct hlist_head *ht, unsigned int sz)7777+{7878+ unsigned int i;7979+8080+ for (i = 0; i < sz; i++)8181+ if (!hlist_empty(&ht[i]))8282+ return false;8383+8484+ return true;8585+}8686+8787+/**8888+ * hash_empty - check whether a hashtable is empty8989+ * @hashtable: hashtable to check9090+ *9191+ * This has to be a macro since HASH_BITS() will not work on pointers since9292+ * it calculates the size during preprocessing.9393+ */9494+#define hash_empty(hashtable) __hash_empty(hashtable, HASH_SIZE(hashtable))9595+9696+/**9797+ * hash_del - remove an object from a hashtable9898+ * @node: &struct hlist_node of the object to remove9999+ */100100+static inline void hash_del(struct hlist_node *node)101101+{102102+ hlist_del_init(node);103103+}104104+105105+/**106106+ * hash_del_rcu - remove an object from a rcu enabled hashtable107107+ * @node: &struct hlist_node of the object to remove108108+ */109109+static inline void hash_del_rcu(struct hlist_node *node)110110+{111111+ hlist_del_init_rcu(node);112112+}113113+114114+/**115115+ * hash_for_each - iterate over a hashtable116116+ * @name: hashtable to iterate117117+ * @bkt: integer to use as bucket loop cursor118118+ * @node: the &struct list_head to use as a loop cursor for each entry119119+ * @obj: the type * to use as a loop cursor for each entry120120+ * @member: the name of the hlist_node within the struct121121+ */122122+#define hash_for_each(name, bkt, node, obj, member) \123123+ for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\124124+ hlist_for_each_entry(obj, node, &name[bkt], member)125125+126126+/**127127+ * hash_for_each_rcu - iterate over a rcu enabled hashtable128128+ * @name: hashtable to iterate129129+ * @bkt: integer to use as bucket loop cursor130130+ * @node: the &struct list_head to use as a loop cursor for each entry131131+ * @obj: the type * to use as a loop cursor for each entry132132+ * @member: the name of the hlist_node within the struct133133+ */134134+#define hash_for_each_rcu(name, bkt, node, obj, member) \135135+ for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\136136+ hlist_for_each_entry_rcu(obj, node, &name[bkt], member)137137+138138+/**139139+ * hash_for_each_safe - iterate over a hashtable safe against removal of140140+ * hash entry141141+ * @name: hashtable to iterate142142+ * @bkt: integer to use as bucket loop cursor143143+ * @node: the &struct list_head to use as a loop cursor for each entry144144+ * @tmp: a &struct used for temporary storage145145+ * @obj: the type * to use as a loop cursor for each entry146146+ * @member: the name of the hlist_node within the struct147147+ */148148+#define hash_for_each_safe(name, bkt, node, tmp, obj, member) \149149+ for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\150150+ hlist_for_each_entry_safe(obj, node, tmp, &name[bkt], member)151151+152152+/**153153+ * hash_for_each_possible - iterate over all possible objects hashing to the154154+ * same bucket155155+ * @name: hashtable to iterate156156+ * @obj: the type * to use as a loop cursor for each entry157157+ * @node: the &struct list_head to use as a loop cursor for each entry158158+ * @member: the name of the hlist_node within the struct159159+ * @key: the key of the objects to iterate over160160+ */161161+#define hash_for_each_possible(name, obj, node, member, key) \162162+ hlist_for_each_entry(obj, node, &name[hash_min(key, HASH_BITS(name))], member)163163+164164+/**165165+ * hash_for_each_possible_rcu - iterate over all possible objects hashing to the166166+ * same bucket in an rcu enabled hashtable167167+ * in a rcu enabled hashtable168168+ * @name: hashtable to iterate169169+ * @obj: the type * to use as a loop cursor for each entry170170+ * @node: the &struct list_head to use as a loop cursor for each entry171171+ * @member: the name of the hlist_node within the struct172172+ * @key: the key of the objects to iterate over173173+ */174174+#define hash_for_each_possible_rcu(name, obj, node, member, key) \175175+ hlist_for_each_entry_rcu(obj, node, &name[hash_min(key, HASH_BITS(name))], member)176176+177177+/**178178+ * hash_for_each_possible_safe - iterate over all possible objects hashing to the179179+ * same bucket safe against removals180180+ * @name: hashtable to iterate181181+ * @obj: the type * to use as a loop cursor for each entry182182+ * @node: the &struct list_head to use as a loop cursor for each entry183183+ * @tmp: a &struct used for temporary storage184184+ * @member: the name of the hlist_node within the struct185185+ * @key: the key of the objects to iterate over186186+ */187187+#define hash_for_each_possible_safe(name, obj, node, tmp, member, key) \188188+ hlist_for_each_entry_safe(obj, node, tmp, \189189+ &name[hash_min(key, HASH_BITS(name))], member)190190+191191+192192+#endif
+2-13
include/linux/kvm_host.h
···4242 */4343#define KVM_MEMSLOT_INVALID (1UL << 16)44444545-/*4646- * If we support unaligned MMIO, at most one fragment will be split into two:4747- */4848-#ifdef KVM_UNALIGNED_MMIO4949-# define KVM_EXTRA_MMIO_FRAGMENTS 15050-#else5151-# define KVM_EXTRA_MMIO_FRAGMENTS 05252-#endif5353-5454-#define KVM_USER_MMIO_SIZE 85555-5656-#define KVM_MAX_MMIO_FRAGMENTS \5757- (KVM_MMIO_SIZE / KVM_USER_MMIO_SIZE + KVM_EXTRA_MMIO_FRAGMENTS)4545+/* Two fragments for cross MMIO pages. */4646+#define KVM_MAX_MMIO_FRAGMENTS 258475948/*6049 * For the normal pfn, the highest 12 bits should be zero,
···1111 (for example /usr/src/linux/COPYING); if not, write to the Free1212 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 1313*/1414-1514#ifndef _MD_U_H1615#define _MD_U_H17161818-/*1919- * Different major versions are not compatible.2020- * Different minor versions are only downward compatible.2121- * Different patchlevel versions are downward and upward compatible.2222- */2323-#define MD_MAJOR_VERSION 02424-#define MD_MINOR_VERSION 902525-/*2626- * MD_PATCHLEVEL_VERSION indicates kernel functionality.2727- * >=1 means different superblock formats are selectable using SET_ARRAY_INFO2828- * and major_version/minor_version accordingly2929- * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT3030- * in the super status byte3131- * >=3 means that bitmap superblock version 4 is supported, which uses3232- * little-ending representation rather than host-endian3333- */3434-#define MD_PATCHLEVEL_VERSION 31717+#include <uapi/linux/raid/md_u.h>35183636-/* ioctls */3737-3838-/* status */3939-#define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)4040-#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)4141-#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)4242-#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13)4343-#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)4444-#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)4545-4646-/* configuration */4747-#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)4848-#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)4949-#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)5050-#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)5151-#define SET_DISK_INFO _IO (MD_MAJOR, 0x24)5252-#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)5353-#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)5454-#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)5555-#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)5656-#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)5757-#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)5858-#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)5959-6060-/* usage */6161-#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)6262-/* 0x31 was START_ARRAY */6363-#define STOP_ARRAY _IO (MD_MAJOR, 0x32)6464-#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)6565-#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)6666-6767-/* 63 partitions with the alternate major number (mdp) */6868-#define MdpMinorShift 66969-#ifdef __KERNEL__7019extern int mdp_major;7171-#endif7272-7373-typedef struct mdu_version_s {7474- int major;7575- int minor;7676- int patchlevel;7777-} mdu_version_t;7878-7979-typedef struct mdu_array_info_s {8080- /*8181- * Generic constant information8282- */8383- int major_version;8484- int minor_version;8585- int patch_version;8686- int ctime;8787- int level;8888- int size;8989- int nr_disks;9090- int raid_disks;9191- int md_minor;9292- int not_persistent;9393-9494- /*9595- * Generic state information9696- */9797- int utime; /* 0 Superblock update time */9898- int state; /* 1 State bits (clean, ...) */9999- int active_disks; /* 2 Number of currently active disks */100100- int working_disks; /* 3 Number of working disks */101101- int failed_disks; /* 4 Number of failed disks */102102- int spare_disks; /* 5 Number of spare disks */103103-104104- /*105105- * Personality information106106- */107107- int layout; /* 0 the array's physical layout */108108- int chunk_size; /* 1 chunk size in bytes */109109-110110-} mdu_array_info_t;111111-112112-/* non-obvious values for 'level' */113113-#define LEVEL_MULTIPATH (-4)114114-#define LEVEL_LINEAR (-1)115115-#define LEVEL_FAULTY (-5)116116-117117-/* we need a value for 'no level specified' and 0118118- * means 'raid0', so we need something else. This is119119- * for internal use only120120- */121121-#define LEVEL_NONE (-1000000)122122-123123-typedef struct mdu_disk_info_s {124124- /*125125- * configuration/status of one particular disk126126- */127127- int number;128128- int major;129129- int minor;130130- int raid_disk;131131- int state;132132-133133-} mdu_disk_info_t;134134-135135-typedef struct mdu_start_info_s {136136- /*137137- * configuration/status of one particular disk138138- */139139- int major;140140- int minor;141141- int raid_disk;142142- int state;143143-144144-} mdu_start_info_t;145145-146146-typedef struct mdu_bitmap_file_s147147-{148148- char pathname[4096];149149-} mdu_bitmap_file_t;150150-151151-typedef struct mdu_param_s152152-{153153- int personality; /* 1,2,3,4 */154154- int chunk_size; /* in bytes */155155- int max_fault; /* unused for now */156156-} mdu_param_t;157157-15820#endif 159159-
+9
include/net/cfg80211.h
···26522652unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc);2653265326542654/**26552655+ * ieee80211_get_mesh_hdrlen - get mesh extension header length26562656+ * @meshhdr: the mesh extension header, only the flags field26572657+ * (first byte) will be accessed26582658+ * Returns the length of the extension header, which is always at26592659+ * least 6 bytes and at most 18 if address 5 and 6 are present.26602660+ */26612661+unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr);26622662+26632663+/**26552664 * DOC: Data path helpers26562665 *26572666 * In addition to generic utilities, cfg80211 also offers
+3
include/sound/core.h
···132132 int shutdown; /* this card is going down */133133 int free_on_last_close; /* free in context of file_release */134134 wait_queue_head_t shutdown_sleep;135135+ atomic_t refcount; /* refcount for disconnection */135136 struct device *dev; /* device assigned to this card */136137 struct device *card_dev; /* cardX object for sysfs */137138···190189 const struct file_operations *f_ops; /* file operations */191190 void *private_data; /* private data for f_ops->open */192191 struct device *dev; /* device for sysfs */192192+ struct snd_card *card_ptr; /* assigned card instance */193193};194194195195/* return a device pointer linked to each sound device as a parent */···297295int snd_component_add(struct snd_card *card, const char *component);298296int snd_card_file_add(struct snd_card *card, struct file *file);299297int snd_card_file_remove(struct snd_card *card, struct file *file);298298+void snd_card_unref(struct snd_card *card);300299301300#define snd_card_set_dev(card, devptr) ((card)->dev = (devptr))302301
···11+/*22+ md_u.h : user <=> kernel API between Linux raidtools and RAID drivers33+ Copyright (C) 1998 Ingo Molnar44+55+ This program is free software; you can redistribute it and/or modify66+ it under the terms of the GNU General Public License as published by77+ the Free Software Foundation; either version 2, or (at your option)88+ any later version.99+1010+ You should have received a copy of the GNU General Public License1111+ (for example /usr/src/linux/COPYING); if not, write to the Free1212+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 1313+*/1414+1515+#ifndef _UAPI_MD_U_H1616+#define _UAPI_MD_U_H1717+1818+/*1919+ * Different major versions are not compatible.2020+ * Different minor versions are only downward compatible.2121+ * Different patchlevel versions are downward and upward compatible.2222+ */2323+#define MD_MAJOR_VERSION 02424+#define MD_MINOR_VERSION 902525+/*2626+ * MD_PATCHLEVEL_VERSION indicates kernel functionality.2727+ * >=1 means different superblock formats are selectable using SET_ARRAY_INFO2828+ * and major_version/minor_version accordingly2929+ * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT3030+ * in the super status byte3131+ * >=3 means that bitmap superblock version 4 is supported, which uses3232+ * little-ending representation rather than host-endian3333+ */3434+#define MD_PATCHLEVEL_VERSION 33535+3636+/* ioctls */3737+3838+/* status */3939+#define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)4040+#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)4141+#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)4242+#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13)4343+#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)4444+#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)4545+4646+/* configuration */4747+#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)4848+#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)4949+#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)5050+#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)5151+#define SET_DISK_INFO _IO (MD_MAJOR, 0x24)5252+#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)5353+#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)5454+#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)5555+#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)5656+#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)5757+#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)5858+#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)5959+6060+/* usage */6161+#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)6262+/* 0x31 was START_ARRAY */6363+#define STOP_ARRAY _IO (MD_MAJOR, 0x32)6464+#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)6565+#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)6666+6767+/* 63 partitions with the alternate major number (mdp) */6868+#define MdpMinorShift 66969+7070+typedef struct mdu_version_s {7171+ int major;7272+ int minor;7373+ int patchlevel;7474+} mdu_version_t;7575+7676+typedef struct mdu_array_info_s {7777+ /*7878+ * Generic constant information7979+ */8080+ int major_version;8181+ int minor_version;8282+ int patch_version;8383+ int ctime;8484+ int level;8585+ int size;8686+ int nr_disks;8787+ int raid_disks;8888+ int md_minor;8989+ int not_persistent;9090+9191+ /*9292+ * Generic state information9393+ */9494+ int utime; /* 0 Superblock update time */9595+ int state; /* 1 State bits (clean, ...) */9696+ int active_disks; /* 2 Number of currently active disks */9797+ int working_disks; /* 3 Number of working disks */9898+ int failed_disks; /* 4 Number of failed disks */9999+ int spare_disks; /* 5 Number of spare disks */100100+101101+ /*102102+ * Personality information103103+ */104104+ int layout; /* 0 the array's physical layout */105105+ int chunk_size; /* 1 chunk size in bytes */106106+107107+} mdu_array_info_t;108108+109109+/* non-obvious values for 'level' */110110+#define LEVEL_MULTIPATH (-4)111111+#define LEVEL_LINEAR (-1)112112+#define LEVEL_FAULTY (-5)113113+114114+/* we need a value for 'no level specified' and 0115115+ * means 'raid0', so we need something else. This is116116+ * for internal use only117117+ */118118+#define LEVEL_NONE (-1000000)119119+120120+typedef struct mdu_disk_info_s {121121+ /*122122+ * configuration/status of one particular disk123123+ */124124+ int number;125125+ int major;126126+ int minor;127127+ int raid_disk;128128+ int state;129129+130130+} mdu_disk_info_t;131131+132132+typedef struct mdu_start_info_s {133133+ /*134134+ * configuration/status of one particular disk135135+ */136136+ int major;137137+ int minor;138138+ int raid_disk;139139+ int state;140140+141141+} mdu_start_info_t;142142+143143+typedef struct mdu_bitmap_file_s144144+{145145+ char pathname[4096];146146+} mdu_bitmap_file_t;147147+148148+typedef struct mdu_param_s149149+{150150+ int personality; /* 1,2,3,4 */151151+ int chunk_size; /* in bytes */152152+ int max_fault; /* unused for now */153153+} mdu_param_t;154154+155155+#endif /* _UAPI_MD_U_H */
···864864 }865865 a = info->attrs[TCP_METRICS_ATTR_ADDR_IPV6];866866 if (a) {867867- if (nla_len(a) != sizeof(sizeof(struct in6_addr)))867867+ if (nla_len(a) != sizeof(struct in6_addr))868868 return -EINVAL;869869 addr->family = AF_INET6;870870 memcpy(addr->addr.a6, nla_data(a), sizeof(addr->addr.a6));
+3-1
net/ipv6/netfilter/ip6table_nat.c
···186186187187 if (!nf_inet_addr_cmp(&ct->tuplehash[dir].tuple.src.u3,188188 &ct->tuplehash[!dir].tuple.dst.u3) ||189189- (ct->tuplehash[dir].tuple.src.u.all !=189189+ (ct->tuplehash[dir].tuple.dst.protonum != IPPROTO_ICMPV6 &&190190+ ct->tuplehash[dir].tuple.src.u.all !=190191 ct->tuplehash[!dir].tuple.dst.u.all))191192 if (nf_xfrm_me_harder(skb, AF_INET6) < 0)192193 ret = NF_DROP;···223222 }224223#ifdef CONFIG_XFRM225224 else if (!(IP6CB(skb)->flags & IP6SKB_XFRM_TRANSFORMED) &&225225+ ct->tuplehash[dir].tuple.dst.protonum != IPPROTO_ICMPV6 &&226226 ct->tuplehash[dir].tuple.dst.u.all !=227227 ct->tuplehash[!dir].tuple.src.u.all)228228 if (nf_xfrm_me_harder(skb, AF_INET6))
+2-2
net/ipv6/netfilter/nf_conntrack_reasm.c
···8585 { }8686};87878888-static int __net_init nf_ct_frag6_sysctl_register(struct net *net)8888+static int nf_ct_frag6_sysctl_register(struct net *net)8989{9090 struct ctl_table *table;9191 struct ctl_table_header *hdr;···127127}128128129129#else130130-static int __net_init nf_ct_frag6_sysctl_register(struct net *net)130130+static int nf_ct_frag6_sysctl_register(struct net *net)131131{132132 return 0;133133}
···531531532532 if (ieee80211_is_action(hdr->frame_control)) {533533 u8 category;534534+535535+ /* make sure category field is present */536536+ if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE)537537+ return RX_DROP_MONITOR;538538+534539 mgmt = (struct ieee80211_mgmt *)hdr;535540 category = mgmt->u.action.category;536541 if (category != WLAN_CATEGORY_MESH_ACTION &&···888883 */889884 if (rx->sta && rx->sdata->vif.type == NL80211_IFTYPE_STATION &&890885 ieee80211_is_data_present(hdr->frame_control)) {891891- u16 ethertype;892892- u8 *payload;886886+ unsigned int hdrlen;887887+ __be16 ethertype;893888894894- payload = rx->skb->data +895895- ieee80211_hdrlen(hdr->frame_control);896896- ethertype = (payload[6] << 8) | payload[7];897897- if (cpu_to_be16(ethertype) ==898898- rx->sdata->control_port_protocol)889889+ hdrlen = ieee80211_hdrlen(hdr->frame_control);890890+891891+ if (rx->skb->len < hdrlen + 8)892892+ return RX_DROP_MONITOR;893893+894894+ skb_copy_bits(rx->skb, hdrlen + 6, ðertype, 2);895895+ if (ethertype == rx->sdata->control_port_protocol)899896 return RX_CONTINUE;900897 }901898···1469146214701463 hdr = (struct ieee80211_hdr *)rx->skb->data;14711464 fc = hdr->frame_control;14651465+14661466+ if (ieee80211_is_ctl(fc))14671467+ return RX_CONTINUE;14681468+14721469 sc = le16_to_cpu(hdr->seq_ctrl);14731470 frag = sc & IEEE80211_SCTL_FRAG;1474147114751472 if (likely((!ieee80211_has_morefrags(fc) && frag == 0) ||14761476- (rx->skb)->len < 24 ||14771473 is_multicast_ether_addr(hdr->addr1))) {14781474 /* not fragmented */14791475 goto out;···1899188919001890 hdr = (struct ieee80211_hdr *) skb->data;19011891 hdrlen = ieee80211_hdrlen(hdr->frame_control);18921892+18931893+ /* make sure fixed part of mesh header is there, also checks skb len */18941894+ if (!pskb_may_pull(rx->skb, hdrlen + 6))18951895+ return RX_DROP_MONITOR;18961896+18971897+ mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);18981898+18991899+ /* make sure full mesh header is there, also checks skb len */19001900+ if (!pskb_may_pull(rx->skb,19011901+ hdrlen + ieee80211_get_mesh_hdrlen(mesh_hdr)))19021902+ return RX_DROP_MONITOR;19031903+19041904+ /* reload pointers */19051905+ hdr = (struct ieee80211_hdr *) skb->data;19021906 mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);1903190719041908 /* frame is in RMC, don't forward */···19211897 mesh_rmc_check(hdr->addr3, mesh_hdr, rx->sdata))19221898 return RX_DROP_MONITOR;1923189919241924- if (!ieee80211_is_data(hdr->frame_control))19001900+ if (!ieee80211_is_data(hdr->frame_control) ||19011901+ !(status->rx_flags & IEEE80211_RX_RA_MATCH))19251902 return RX_CONTINUE;1926190319271904 if (!mesh_hdr->ttl)···19361911 if (is_multicast_ether_addr(hdr->addr1)) {19371912 mpp_addr = hdr->addr3;19381913 proxied_addr = mesh_hdr->eaddr1;19391939- } else {19141914+ } else if (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6) {19151915+ /* has_a4 already checked in ieee80211_rx_mesh_check */19401916 mpp_addr = hdr->addr4;19411917 proxied_addr = mesh_hdr->eaddr2;19181918+ } else {19191919+ return RX_DROP_MONITOR;19421920 }1943192119441922 rcu_read_lock();···19691941 }19701942 skb_set_queue_mapping(skb, q);1971194319721972- if (!(status->rx_flags & IEEE80211_RX_RA_MATCH))19731973- goto out;19741974-19751944 if (!--mesh_hdr->ttl) {19761945 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);19771977- return RX_DROP_MONITOR;19461946+ goto out;19781947 }1979194819801949 if (!ifmsh->mshcfg.dot11MeshForwarding)···23782353 }23792354 break;23802355 case WLAN_CATEGORY_SELF_PROTECTED:23562356+ if (len < (IEEE80211_MIN_ACTION_SIZE +23572357+ sizeof(mgmt->u.action.u.self_prot.action_code)))23582358+ break;23592359+23812360 switch (mgmt->u.action.u.self_prot.action_code) {23822361 case WLAN_SP_MESH_PEERING_OPEN:23832362 case WLAN_SP_MESH_PEERING_CLOSE:···24002371 }24012372 break;24022373 case WLAN_CATEGORY_MESH_ACTION:23742374+ if (len < (IEEE80211_MIN_ACTION_SIZE +23752375+ sizeof(mgmt->u.action.u.mesh_action.action_code)))23762376+ break;23772377+24032378 if (!ieee80211_vif_is_mesh(&sdata->vif))24042379 break;24052380 if (mesh_action_is_path_sel(mgmt) &&···29462913 if (ieee80211_is_data(fc) || ieee80211_is_mgmt(fc))29472914 local->dot11ReceivedFragmentCount++;2948291529492949- if (ieee80211_is_mgmt(fc))29502950- err = skb_linearize(skb);29512951- else29162916+ if (ieee80211_is_mgmt(fc)) {29172917+ /* drop frame if too short for header */29182918+ if (skb->len < ieee80211_hdrlen(fc))29192919+ err = -ENOBUFS;29202920+ else29212921+ err = skb_linearize(skb);29222922+ } else {29522923 err = !pskb_may_pull(skb, ieee80211_hdrlen(fc));29242924+ }2953292529542926 if (err) {29552927 dev_kfree_skb(skb);
+35-7
net/mac80211/util.c
···643643 break;644644 }645645646646- if (id != WLAN_EID_VENDOR_SPECIFIC &&647647- id != WLAN_EID_QUIET &&648648- test_bit(id, seen_elems)) {649649- elems->parse_error = true;650650- left -= elen;651651- pos += elen;652652- continue;646646+ switch (id) {647647+ case WLAN_EID_SSID:648648+ case WLAN_EID_SUPP_RATES:649649+ case WLAN_EID_FH_PARAMS:650650+ case WLAN_EID_DS_PARAMS:651651+ case WLAN_EID_CF_PARAMS:652652+ case WLAN_EID_TIM:653653+ case WLAN_EID_IBSS_PARAMS:654654+ case WLAN_EID_CHALLENGE:655655+ case WLAN_EID_RSN:656656+ case WLAN_EID_ERP_INFO:657657+ case WLAN_EID_EXT_SUPP_RATES:658658+ case WLAN_EID_HT_CAPABILITY:659659+ case WLAN_EID_HT_OPERATION:660660+ case WLAN_EID_VHT_CAPABILITY:661661+ case WLAN_EID_VHT_OPERATION:662662+ case WLAN_EID_MESH_ID:663663+ case WLAN_EID_MESH_CONFIG:664664+ case WLAN_EID_PEER_MGMT:665665+ case WLAN_EID_PREQ:666666+ case WLAN_EID_PREP:667667+ case WLAN_EID_PERR:668668+ case WLAN_EID_RANN:669669+ case WLAN_EID_CHANNEL_SWITCH:670670+ case WLAN_EID_EXT_CHANSWITCH_ANN:671671+ case WLAN_EID_COUNTRY:672672+ case WLAN_EID_PWR_CONSTRAINT:673673+ case WLAN_EID_TIMEOUT_INTERVAL:674674+ if (test_bit(id, seen_elems)) {675675+ elems->parse_error = true;676676+ left -= elen;677677+ pos += elen;678678+ continue;679679+ }680680+ break;653681 }654682655683 if (calc_crc && id < 64 && (filter & (1ULL << id)))
+2-1
net/netfilter/nf_conntrack_h323_main.c
···753753 flowi4_to_flowi(&fl1), false)) {754754 if (!afinfo->route(&init_net, (struct dst_entry **)&rt2,755755 flowi4_to_flowi(&fl2), false)) {756756- if (rt1->rt_gateway == rt2->rt_gateway &&756756+ if (rt_nexthop(rt1, fl1.daddr) ==757757+ rt_nexthop(rt2, fl2.daddr) &&757758 rt1->dst.dev == rt2->dst.dev)758759 ret = 1;759760 dst_release(&rt2->dst);
+1-1
net/sctp/socket.c
···974974 void *addr_buf;975975 struct sctp_af *af;976976977977- SCTP_DEBUG_PRINTK("sctp_setsocktopt_bindx: sk %p addrs %p"977977+ SCTP_DEBUG_PRINTK("sctp_setsockopt_bindx: sk %p addrs %p"978978 " addrs_size %d opt %d\n", sk, addrs, addrs_size, op);979979980980 if (unlikely(addrs_size <= 0))
···369369 return usecs;370370}371371372372+static void snd_pcm_set_state(struct snd_pcm_substream *substream, int state)373373+{374374+ snd_pcm_stream_lock_irq(substream);375375+ if (substream->runtime->status->state != SNDRV_PCM_STATE_DISCONNECTED)376376+ substream->runtime->status->state = state;377377+ snd_pcm_stream_unlock_irq(substream);378378+}379379+372380static int snd_pcm_hw_params(struct snd_pcm_substream *substream,373381 struct snd_pcm_hw_params *params)374382{···460452 runtime->boundary *= 2;461453462454 snd_pcm_timer_resolution_change(substream);463463- runtime->status->state = SNDRV_PCM_STATE_SETUP;455455+ snd_pcm_set_state(substream, SNDRV_PCM_STATE_SETUP);464456465457 if (pm_qos_request_active(&substream->latency_pm_qos_req))466458 pm_qos_remove_request(&substream->latency_pm_qos_req);···472464 /* hardware might be unusable from this time,473465 so we force application to retry to set474466 the correct hardware parameter settings */475475- runtime->status->state = SNDRV_PCM_STATE_OPEN;467467+ snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN);476468 if (substream->ops->hw_free != NULL)477469 substream->ops->hw_free(substream);478470 return err;···520512 return -EBADFD;521513 if (substream->ops->hw_free)522514 result = substream->ops->hw_free(substream);523523- runtime->status->state = SNDRV_PCM_STATE_OPEN;515515+ snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN);524516 pm_qos_remove_request(&substream->latency_pm_qos_req);525517 return result;526518}···13281320{13291321 struct snd_pcm_runtime *runtime = substream->runtime;13301322 runtime->control->appl_ptr = runtime->status->hw_ptr;13311331- runtime->status->state = SNDRV_PCM_STATE_PREPARED;13231323+ snd_pcm_set_state(substream, SNDRV_PCM_STATE_PREPARED);13321324}1333132513341326static struct action_ops snd_pcm_action_prepare = {···15181510 down_read(&snd_pcm_link_rwsem);15191511 snd_pcm_stream_lock_irq(substream);15201512 remove_wait_queue(&to_check->sleep, &wait);15131513+ if (card->shutdown) {15141514+ result = -ENODEV;15151515+ break;15161516+ }15211517 if (tout == 0) {15221518 if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED)15231519 result = -ESTRPIPE;···16461634 write_unlock_irq(&snd_pcm_link_rwlock);16471635 up_write(&snd_pcm_link_rwsem);16481636 _nolock:16371637+ snd_card_unref(substream1->pcm->card);16491638 fput_light(file, fput_needed);16501639 if (res < 0)16511640 kfree(group);···21212108 return err;21222109 pcm = snd_lookup_minor_data(iminor(inode),21232110 SNDRV_DEVICE_TYPE_PCM_PLAYBACK);21242124- return snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK);21112111+ err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK);21122112+ snd_card_unref(pcm->card);21132113+ return err;21252114}2126211521272116static int snd_pcm_capture_open(struct inode *inode, struct file *file)···21342119 return err;21352120 pcm = snd_lookup_minor_data(iminor(inode),21362121 SNDRV_DEVICE_TYPE_PCM_CAPTURE);21372137- return snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE);21222122+ err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE);21232123+ snd_card_unref(pcm->card);21242124+ return err;21382125}2139212621402127static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream)···21732156 mutex_unlock(&pcm->open_mutex);21742157 schedule();21752158 mutex_lock(&pcm->open_mutex);21592159+ if (pcm->card->shutdown) {21602160+ err = -ENODEV;21612161+ break;21622162+ }21762163 if (signal_pending(current)) {21772164 err = -ERESTARTSYS;21782165 break;
+25-1
sound/core/rawmidi.c
···379379 if (rmidi == NULL)380380 return -ENODEV;381381382382- if (!try_module_get(rmidi->card->module))382382+ if (!try_module_get(rmidi->card->module)) {383383+ snd_card_unref(rmidi->card);383384 return -ENXIO;385385+ }384386385387 mutex_lock(&rmidi->open_mutex);386388 card = rmidi->card;···424422 mutex_unlock(&rmidi->open_mutex);425423 schedule();426424 mutex_lock(&rmidi->open_mutex);425425+ if (rmidi->card->shutdown) {426426+ err = -ENODEV;427427+ break;428428+ }427429 if (signal_pending(current)) {428430 err = -ERESTARTSYS;429431 break;···446440#endif447441 file->private_data = rawmidi_file;448442 mutex_unlock(&rmidi->open_mutex);443443+ snd_card_unref(rmidi->card);449444 return 0;450445451446 __error:···454447 __error_card:455448 mutex_unlock(&rmidi->open_mutex);456449 module_put(rmidi->card->module);450450+ snd_card_unref(rmidi->card);457451 return err;458452}459453···999991 spin_unlock_irq(&runtime->lock);1000992 schedule();1001993 remove_wait_queue(&runtime->sleep, &wait);994994+ if (rfile->rmidi->card->shutdown)995995+ return -ENODEV;1002996 if (signal_pending(current))1003997 return result > 0 ? result : -ERESTARTSYS;1004998 if (!runtime->avail)···12441234 spin_unlock_irq(&runtime->lock);12451235 timeout = schedule_timeout(30 * HZ);12461236 remove_wait_queue(&runtime->sleep, &wait);12371237+ if (rfile->rmidi->card->shutdown)12381238+ return -ENODEV;12471239 if (signal_pending(current))12481240 return result > 0 ? result : -ERESTARTSYS;12491241 if (!runtime->avail && !timeout)···16211609static int snd_rawmidi_dev_disconnect(struct snd_device *device)16221610{16231611 struct snd_rawmidi *rmidi = device->device_data;16121612+ int dir;1624161316251614 mutex_lock(®ister_mutex);16151615+ mutex_lock(&rmidi->open_mutex);16161616+ wake_up(&rmidi->open_wait);16261617 list_del_init(&rmidi->list);16181618+ for (dir = 0; dir < 2; dir++) {16191619+ struct snd_rawmidi_substream *s;16201620+ list_for_each_entry(s, &rmidi->streams[dir].substreams, list) {16211621+ if (s->runtime)16221622+ wake_up(&s->runtime->sleep);16231623+ }16241624+ }16251625+16271626#ifdef CONFIG_SND_OSSEMUL16281627 if (rmidi->ossreg) {16291628 if ((int)rmidi->device == midi_map[rmidi->card->number]) {···16491626 }16501627#endif /* CONFIG_SND_OSSEMUL */16511628 snd_unregister_device(SNDRV_DEVICE_TYPE_RAWMIDI, rmidi->card, rmidi->device);16291629+ mutex_unlock(&rmidi->open_mutex);16521630 mutex_unlock(®ister_mutex);16531631 return 0;16541632}
+9-2
sound/core/sound.c
···9898 *9999 * Checks that a minor device with the specified type is registered, and returns100100 * its user data pointer.101101+ *102102+ * This function increments the reference counter of the card instance103103+ * if an associated instance with the given minor number and type is found.104104+ * The caller must call snd_card_unref() appropriately later.101105 */102106void *snd_lookup_minor_data(unsigned int minor, int type)103107{···112108 return NULL;113109 mutex_lock(&sound_mutex);114110 mreg = snd_minors[minor];115115- if (mreg && mreg->type == type)111111+ if (mreg && mreg->type == type) {116112 private_data = mreg->private_data;117117- else113113+ if (mreg->card_ptr)114114+ atomic_inc(&mreg->card_ptr->refcount);115115+ } else118116 private_data = NULL;119117 mutex_unlock(&sound_mutex);120118 return private_data;···281275 preg->device = dev;282276 preg->f_ops = f_ops;283277 preg->private_data = private_data;278278+ preg->card_ptr = card;284279 mutex_lock(&sound_mutex);285280#ifdef CONFIG_SND_DYNAMIC_MINORS286281 minor = snd_find_free_minor(type);
+8-2
sound/core/sound_oss.c
···4040static struct snd_minor *snd_oss_minors[SNDRV_OSS_MINORS];4141static DEFINE_MUTEX(sound_oss_mutex);42424343+/* NOTE: This function increments the refcount of the associated card like4444+ * snd_lookup_minor_data(); the caller must call snd_card_unref() appropriately4545+ */4346void *snd_lookup_oss_minor_data(unsigned int minor, int type)4447{4548 struct snd_minor *mreg;···5249 return NULL;5350 mutex_lock(&sound_oss_mutex);5451 mreg = snd_oss_minors[minor];5555- if (mreg && mreg->type == type)5252+ if (mreg && mreg->type == type) {5653 private_data = mreg->private_data;5757- else5454+ if (mreg->card_ptr)5555+ atomic_inc(&mreg->card_ptr->refcount);5656+ } else5857 private_data = NULL;5958 mutex_unlock(&sound_oss_mutex);6059 return private_data;···128123 preg->device = dev;129124 preg->f_ops = f_ops;130125 preg->private_data = private_data;126126+ preg->card_ptr = card;131127 mutex_lock(&sound_oss_mutex);132128 snd_oss_minors[minor] = preg;133129 minor_unit = SNDRV_MINOR_OSS_DEVICE(minor);
···126126 struct snd_usb_endpoint *sync_endpoint;127127 unsigned long flags;128128 bool need_setup_ep; /* (re)configure EP at prepare? */129129+ unsigned int speed; /* USB_SPEED_XXX */129130130131 u64 formats; /* format bitmasks (all or'ed) */131132 unsigned int num_formats; /* number of supported audio formats (list) */
+43-22
sound/usb/mixer.c
···287287 unsigned char buf[2];288288 int val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1;289289 int timeout = 10;290290- int err;290290+ int idx = 0, err;291291292292 err = snd_usb_autoresume(cval->mixer->chip);293293 if (err < 0)294294 return -EIO;295295+ down_read(&chip->shutdown_rwsem);295296 while (timeout-- > 0) {297297+ if (chip->shutdown)298298+ break;299299+ idx = snd_usb_ctrl_intf(chip) | (cval->id << 8);296300 if (snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), request,297301 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,298298- validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),299299- buf, val_len) >= val_len) {302302+ validx, idx, buf, val_len) >= val_len) {300303 *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(buf, val_len));301301- snd_usb_autosuspend(cval->mixer->chip);302302- return 0;304304+ err = 0;305305+ goto out;303306 }304307 }305305- snd_usb_autosuspend(cval->mixer->chip);306308 snd_printdd(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n",307307- request, validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), cval->val_type);308308- return -EINVAL;309309+ request, validx, idx, cval->val_type);310310+ err = -EINVAL;311311+312312+ out:313313+ up_read(&chip->shutdown_rwsem);314314+ snd_usb_autosuspend(cval->mixer->chip);315315+ return err;309316}310317311318static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, int validx, int *value_ret)···320313 struct snd_usb_audio *chip = cval->mixer->chip;321314 unsigned char buf[2 + 3*sizeof(__u16)]; /* enough space for one range */322315 unsigned char *val;323323- int ret, size;316316+ int idx = 0, ret, size;324317 __u8 bRequest;325318326319 if (request == UAC_GET_CUR) {···337330 if (ret)338331 goto error;339332340340- ret = snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), bRequest,333333+ down_read(&chip->shutdown_rwsem);334334+ if (chip->shutdown)335335+ ret = -ENODEV;336336+ else {337337+ idx = snd_usb_ctrl_intf(chip) | (cval->id << 8);338338+ ret = snd_usb_ctl_msg(chip->dev, usb_rcvctrlpipe(chip->dev, 0), bRequest,341339 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,342342- validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),343343- buf, size);340340+ validx, idx, buf, size);341341+ }342342+ up_read(&chip->shutdown_rwsem);344343 snd_usb_autosuspend(chip);345344346345 if (ret < 0) {347346error:348347 snd_printk(KERN_ERR "cannot get ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d\n",349349- request, validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), cval->val_type);348348+ request, validx, idx, cval->val_type);350349 return ret;351350 }352351···430417{431418 struct snd_usb_audio *chip = cval->mixer->chip;432419 unsigned char buf[2];433433- int val_len, err, timeout = 10;420420+ int idx = 0, val_len, err, timeout = 10;434421435422 if (cval->mixer->protocol == UAC_VERSION_1) {436423 val_len = cval->val_type >= USB_MIXER_S16 ? 2 : 1;···453440 err = snd_usb_autoresume(chip);454441 if (err < 0)455442 return -EIO;456456- while (timeout-- > 0)443443+ down_read(&chip->shutdown_rwsem);444444+ while (timeout-- > 0) {445445+ if (chip->shutdown)446446+ break;447447+ idx = snd_usb_ctrl_intf(chip) | (cval->id << 8);457448 if (snd_usb_ctl_msg(chip->dev,458449 usb_sndctrlpipe(chip->dev, 0), request,459450 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,460460- validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),461461- buf, val_len) >= 0) {462462- snd_usb_autosuspend(chip);463463- return 0;451451+ validx, idx, buf, val_len) >= 0) {452452+ err = 0;453453+ goto out;464454 }465465- snd_usb_autosuspend(chip);455455+ }466456 snd_printdd(KERN_ERR "cannot set ctl value: req = %#x, wValue = %#x, wIndex = %#x, type = %d, data = %#x/%#x\n",467467- request, validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), cval->val_type, buf[0], buf[1]);468468- return -EINVAL;457457+ request, validx, idx, cval->val_type, buf[0], buf[1]);458458+ err = -EINVAL;459459+460460+ out:461461+ up_read(&chip->shutdown_rwsem);462462+ snd_usb_autosuspend(chip);463463+ return err;469464}470465471466static int set_cur_ctl_value(struct usb_mixer_elem_info *cval, int validx, int value)