id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
17d33e14f7ffc05f8c81e4a3bdb9a8003a05dcce
Analyze and fix the following issue in the Linux kernel code: mmc: core SDIO suspend/resume support
Problem Details: Currently, all SDIO cards are virtually removed upon a suspend, and completely reprobed upon a resume. This adds the suspend and resume methods to the SDIO bus driver so to be able to dispatch those events to the actual SDIO function drivers for real suspend/resume instead. All active functions on a ...
```diff diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 2d24a123f0b0..f4c8637fd072 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -217,6 +217,134 @@ static int sdio_enable_hs(struct mmc_card *card) return 0; } +/* + * Handle the detection and initialisation of a card. + ...
864f38ebdcb1f7dc4138b7ccb801f16f1696eb8e
Analyze and fix the following issue in the Linux kernel code: AT91: atmel-mci: Platform configuration to the the atmel-mci driver
Problem Details: Created a modified version of the at91sam9g20 evaluation kit platform (board-sam9g20ek-2slot-mmc.c) and device support to make use of the updated atmel-mci driver. As the use of two slots modify GPIO pin allocation, we create another board file. This requires getting the most updated arch/arm/tools/m...
```diff diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index a24d824c428b..e35d54d43e70 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig @@ -289,6 +289,13 @@ config MACH_NEOCORE926 help Select this if you are using the Adeneo Neocore 926 board. +config MACH_AT91SAM9...
81b39802468fe4bf5c6b038837319b608acfdd3e
Analyze and fix the following issue in the Linux kernel code: sdhci-of: fix high-speed cards recognition
Problem Details: eSDHC fails to recognize some SDHS cards, throwing timeout errors: mmc0: error -110 whilst initialising SD card That's because we calculate timeout value in a wrong way: on eSDHC hosts the timeout clock is derivied from the SD clock, which is set dynamically. As David Vrabel suggested, deriving ti...
```diff diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c index 3439fc118904..56041dc74ce1 100644 --- a/drivers/mmc/host/sdhci-of.c +++ b/drivers/mmc/host/sdhci-of.c @@ -172,19 +172,13 @@ static unsigned int esdhc_get_min_clock(struct sdhci_host *host) return of_host->clock / 256 / 16; } -stat...
1e5df7525d0705dfbfded0c10a7b87b0a754a35d
Analyze and fix the following issue in the Linux kernel code: sdhci-of: fix SD clock calculation
Problem Details: Linear divisor's values in a register start at 0 (zero means "divide by 1"). Before this patch the code didn't account that fact, so SD cards were running underclocked. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Kumar Gala <galak@kernel.crashing...
```diff diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c index 1e8aa590bb39..2b0756934f49 100644 --- a/drivers/mmc/host/sdhci-of.c +++ b/drivers/mmc/host/sdhci-of.c @@ -136,6 +136,7 @@ static void esdhc_set_clock(struct sdhci_host *host, unsigned int clock) } pre_div >>= 1; + div--; setb...
4245c0256da0784b1f96d01ff263a71a4ca3894e
Analyze and fix the following issue in the Linux kernel code: sdio: fix read buffer overflow
Problem Details: Avoid buffer underrun when parsing an invalid CISTPL_VERS_1. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: David Vrabel <david.vrabel@csr.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c index 963f2937c5e3..6636354b48ce 100644 --- a/drivers/mmc/core/sdio_cis.c +++ b/drivers/mmc/core/sdio_cis.c @@ -40,7 +40,7 @@ static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func, nr_strings++; } - if (buf[i-1] != '...
2bec08937e3cdf6828d29421c7f870dca84f3b02
Analyze and fix the following issue in the Linux kernel code: omap_hsmmc: ensure all clock enables and disables are paired
Problem Details: [madhu.cr@ti.com: fix for the db clock failure message] Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: D...
```diff diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index a20fafecfc60..14c58caac990 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -162,7 +162,7 @@ struct omap_hsmmc_host { int use_dma, dma_ch; int dma_line_tx, dma_line_rx; int slot_id; - in...
0a40e64786933fb04be37af0a19aa320bc3414a8
Analyze and fix the following issue in the Linux kernel code: omap_hsmmc: fix NULL pointer dereference
Problem Details: Do not call 'mmc_omap_xfer_done()' if the request is already done. Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.fog...
```diff diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index b83f7a4d8e28..9519964ecb2a 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -677,7 +677,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id) if (end_cmd || ((status & CC) && host->cmd)) ...
a3f406f861456987c9fce8cfa0a00d07b16cdec0
Analyze and fix the following issue in the Linux kernel code: omap_hsmmc: fix scatter-gather list sanity checking
Problem Details: Do not use host->dma_len when it is uninitialzed. Finish the request with an error if the mmc_omap_prepare_data() fails. Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@...
```diff diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 9599dd126ac8..f588deff8b2c 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -878,7 +878,7 @@ mmc_omap_start_dma_transfer(struct mmc_omap_host *host, struct mmc_request *req) struct mmc_data *data ...
d900f7128cf73d77467209672db2dcf0ff02dde6
Analyze and fix the following issue in the Linux kernel code: omap_hsmmc: add debugfs entry (host registers)
Problem Details: Adds <debugfs_root>/kernel/debug/mmc<N>/regs entry, contents show registers' state and some driver internal state variables. Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton ...
```diff diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 4b3af9e11b7b..259c07d61a81 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -17,6 +17,8 @@ #include <linux/module.h> #include <linux/init.h> +#include <linux/debugfs.h> +#include <linux/seq_file...
53509f0fe28e049e772897aa8fa1f5183b6823a2
Analyze and fix the following issue in the Linux kernel code: mmc: power off once at removal
Problem Details: Fix MMC host stop sequence: power off once. Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Acked-by: Matt Fleming <matt@console-pimps.org> Cc: Ian Molton <ian@mnementh.co.uk> Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com> Cc:...
```diff diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 828e60ea528c..0842f6829250 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1143,6 +1143,8 @@ void mmc_stop_host(struct mmc_host *host) mmc_claim_host(host); mmc_detach_bus(host); mmc_release_host(host); + mmc_b...
a9ece53c4089ef23d4002d34c4c7148d94622a40
Analyze and fix the following issue in the Linux kernel code: kallsyms: fix segfault in prefix_underscores_count()
Problem Details: Commit b478b782e110fdb4135caa3062b6d687e989d994 "kallsyms, tracing: output more proper symbol name" introduces a "bugfix" that introduces a segfault in kallsyms in my configurations. The cause is the introduction of prefix_underscores_count() which attempts to count underscores, even in symbols that d...
```diff diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 64343cc084b4..86c3896a1e01 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -585,7 +585,7 @@ static int prefix_underscores_count(const char *str) { const char *tail = str; - while (*tail != '_') + while (*tail == '_') tail++; retu...
1f10206cf8e945220f7220a809d8bfc15c21f9a5
Analyze and fix the following issue in the Linux kernel code: getrusage: fill ru_maxrss value
Problem Details: Make ->ru_maxrss value in struct rusage filled accordingly to rss hiwater mark. This struct is filled as a parameter to getrusage syscall. ->ru_maxrss value is set to KBs which is the way it is done in BSD systems. /usr/bin/time (gnu time) application converts ->ru_maxrss to KBs which seems to be inc...
```diff diff --git a/fs/exec.c b/fs/exec.c index 434dba778ccc..69bb9d899791 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -845,6 +845,9 @@ static int de_thread(struct task_struct *tsk) sig->notify_count = 0; no_thread_group: + if (current->mm) + setmax_mm_hiwater_rss(&sig->maxrss, current->mm); + exit_itimers(sig);...
a49c59c042c63b432307c1bbf7dac5a104c786e6
Analyze and fix the following issue in the Linux kernel code: Make sure the value in abs() does not get truncated if it is greater than 2^32
Problem Details: abs() will truncate the input if is it outside the 2^32 range. Fix that by assuming `long' input. This might generate worse code in the common case. Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@...
```diff diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 63dcaece1ac5..d3cd23f30039 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -146,7 +146,7 @@ extern int _cond_resched(void); #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) #define abs(x) ({ \ - ...
d7d7561c908afa001ab0fc8212eee94731a213a6
Analyze and fix the following issue in the Linux kernel code: fix compat_sys_utimensat()
Problem Details: Compat utimensat() returns EINVAL when the tv_nsec is one of UTIME_OMIT or UTIME_NOW and the tv_sec is set to non-zero. As per man pages, the tv_sec field should be ignored. sys_utimensat() works fine in this case. Test case: #define _GNU_SOURCE #define _ATFILE_SOURCE #include <stdio.h> #include <f...
```diff diff --git a/fs/compat.c b/fs/compat.c index 6d6f98fe64a0..3aa48834a222 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -100,13 +100,6 @@ asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, st get_compat_timespec(&tv[1], &t[1])) return -EFAULT; - if ((tv[0].tv_nsec == UTIME...
54447c3e8f63524fcdd40395bb2d405cab5555a7
Analyze and fix the following issue in the Linux kernel code: vlynq: includecheck fix: drivers/vlynq/vlynq.c
Problem Details: Fix the following 'make includecheck' warning: drivers/vlynq/vlynq.c: linux/device.h is included more than once. Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-...
```diff diff --git a/drivers/vlynq/vlynq.c b/drivers/vlynq/vlynq.c index f05d2a368367..ba3d71f5c7d0 100644 --- a/drivers/vlynq/vlynq.c +++ b/drivers/vlynq/vlynq.c @@ -28,7 +28,6 @@ #include <linux/errno.h> #include <linux/platform_device.h> #include <linux/interrupt.h> -#include <linux/device.h> #include <linux/del...
8c87df457cb58fe75b9b893007917cf8095660a0
Analyze and fix the following issue in the Linux kernel code: BUILD_BUG_ON(): fix it and a couple of bogus uses of it
Problem Details: gcc permitting variable length arrays makes the current construct used for BUILD_BUG_ON() useless, as that doesn't produce any diagnostic if the controlling expression isn't really constant. Instead, this patch makes it so that a bit field gets used here. Consequently, those uses where the condition ...
```diff diff --git a/arch/sparc/include/asm/vio.h b/arch/sparc/include/asm/vio.h index d4de32f0f8af..6cdbf7e7351d 100644 --- a/arch/sparc/include/asm/vio.h +++ b/arch/sparc/include/asm/vio.h @@ -258,7 +258,7 @@ static inline void *vio_dring_entry(struct vio_dring_state *dr, static inline u32 vio_dring_avail(struct vio...
02b51df1b07b4e9ca823c89284e704cadb323cd1
Analyze and fix the following issue in the Linux kernel code: proc connector: add event for process becoming session leader
Problem Details: The act of a process becoming a session leader is a useful signal to a supervising init daemon such as Upstart. While a daemon will normally do this as part of the process of becoming a daemon, it is rare for its children to do so. When the children do, it is nearly always a sign that the child shoul...
```diff diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index 85e5dc0431fe..abf4a2529f80 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c @@ -139,6 +139,31 @@ void proc_id_connector(struct task_struct *task, int which_id) cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); ...
b7ed698cc9d556306a4088c238e2ea9311ea2cb3
Analyze and fix the following issue in the Linux kernel code: Documentation/: fix warnings from -Wmissing-prototypes in HOSTCFLAGS
Problem Details: Fix up -Wmissing-prototypes in compileable userspace code, mainly under Documentation/. Signed-off-by: Ladinu Chandrasinghe <ladinu.pub@gmail.com> Signed-off-by: Trevor Keith <tsrk@tsrk.net> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Lin...
```diff diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index aa73e72fd793..6e25c2659e0a 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c @@ -116,7 +116,7 @@ error: } -int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, +stati...
5c725138437837291db5c25f4a076ee852e806e3
Analyze and fix the following issue in the Linux kernel code: Fix all -Wmissing-prototypes warnings in x86 defconfig
Problem Details: Signed-off-by: Trevor Keith <tsrk@tsrk.net> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/scripts/conmakehash.c b/scripts/conmakehash.c index e0c6891a9ad4..263a44d57fa9 100644 --- a/scripts/conmakehash.c +++ b/scripts/conmakehash.c @@ -24,14 +24,14 @@ typedef unsigned short unicode; -void usage(char *argv0) +static void usage(char *argv0) { fprintf(stderr, "Usage: \n" ...
e898893399335514b10dfbd75598f8308976abe4
Analyze and fix the following issue in the Linux kernel code: dac960: fix undefined behavior on empty string
Problem Details: Fix undefined behavior due to a buffer underrun if an empty string is written to the proc file. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index c77b6f3c28ea..6fa7b0fdbdfd 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -6562,7 +6562,7 @@ static int DAC960_ProcWriteUserCommand(struct file *file, if (copy_from_user(CommandBuffer, Buffer, Count)) return -EFAULT; C...
c02e3f361c75da04ca3025b4d19e947e9cc62ed3
Analyze and fix the following issue in the Linux kernel code: kmod: fix race in usermodehelper code
Problem Details: The user mode helper code has a race in it. call_usermodehelper_exec() takes an allocated subprocess_info structure, which it passes to a workqueue, and then passes it to a kernel thread which it creates, after which it calls complete to signal to the caller of call_usermodehelper_exec() that it can f...
```diff diff --git a/kernel/kmod.c b/kernel/kmod.c index 9fcb53a11f87..689d20f39305 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -143,6 +143,7 @@ struct subprocess_info { static int ____call_usermodehelper(void *data) { struct subprocess_info *sub_info = data; + enum umh_wait wait = sub_info->wait; int retva...
af91322ef3f29ae4114e736e2a72e28b4d619cf9
Analyze and fix the following issue in the Linux kernel code: printk: add printk_delay to make messages readable for some scenarios
Problem Details: When syslog is not possible, at the same time there's no serial/net console available, it will be hard to read the printk messages. For example oops/panic/warning messages in shutdown phase. Add a printk delay feature, we can make each printk message delay some milliseconds. Setting the delay by pro...
```diff diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 3e5b63ebb821..b3d8b4922740 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt @@ -313,6 +313,14 @@ send before ratelimiting kicks in. ==========================================================...
5ae87e79ecb5baa65e9cf48be874098fafad0668
Analyze and fix the following issue in the Linux kernel code: poll/select: avoid arithmetic overflow in __estimate_accuracy()
Problem Details: __estimate_accuracy() was prone to integer overflow, for example if *tv == {2147, 483648000} on a 32 bit computer (or even for delays as small as {429, 500000000} if the task is niced). Because the result was already forced between 0 and 100ms, the effect of the overflow was not too problematic, but t...
```diff diff --git a/fs/select.c b/fs/select.c index 8084834e123e..a201fc370223 100644 --- a/fs/select.c +++ b/fs/select.c @@ -41,22 +41,28 @@ * better solutions.. */ +#define MAX_SLACK (100 * NSEC_PER_MSEC) + static long __estimate_accuracy(struct timespec *tv) { long slack; int divfactor = 1000; + if (t...
ca976c53de0c33160083d36f70bd18d7970f6969
Analyze and fix the following issue in the Linux kernel code: smbfs: read buffer overflow
Problem Details: This function uses signed integers for the unix_date and local variables - if a negative number is supplied and the leap-year condition is not met, month will be 0, leading to a read of day_n[-1] Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> ...
```diff diff --git a/fs/smbfs/proc.c b/fs/smbfs/proc.c index 9468168b9af5..71c29b6670b4 100644 --- a/fs/smbfs/proc.c +++ b/fs/smbfs/proc.c @@ -509,7 +509,7 @@ date_unix2dos(struct smb_sb_info *server, month = 2; } else { nl_day = (year & 3) || day <= 59 ? day : day - 1; - for (month = 0; month < 12; month++) +...
fa081b00a80ef3f4575c99af6e97d29e1628cf51
Analyze and fix the following issue in the Linux kernel code: include/linux/kmemcheck.h: fix a trillion warnings
Problem Details: of the form include/net/inet_sock.h:208: warning: ISO C90 forbids mixed declarations and code Cc: Johannes Berg <johannes@sipsolutions.net> Acked-by: Vegard Nossum <vegard.nossum@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundati...
```diff diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index c8006607f947..136cdcdf92ef 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h @@ -145,10 +145,12 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) #define kmemcheck_annotate_bitfield...
9c2d2056647790c5034d722bd24e9d913ebca73c
Analyze and fix the following issue in the Linux kernel code: eCryptfs: Prevent lower dentry from going negative during unlink
Problem Details: When calling vfs_unlink() on the lower dentry, d_delete() turns the dentry into a negative dentry when the d_count is 1. This eventually caused a NULL pointer deref when a read() or write() was done and the negative dentry's d_inode was dereferenced in ecryptfs_read_update_atime() or ecryptfs_getxattr...
```diff diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 2f0945d63297..056fed62d0de 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -476,6 +476,7 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) struct inode *lower_dir_inode = ecryptfs_inode_to_lower(dir); struct den...
ac22ba23b659e34a5961aec8c945608e471b0d5b
Analyze and fix the following issue in the Linux kernel code: eCryptfs: Check for O_RDONLY lower inodes when opening lower files
Problem Details: If the lower inode is read-only, don't attempt to open the lower file read/write and don't hand off the open request to the privileged eCryptfs kthread for opening it read/write. Instead, only try an unprivileged, read-only open of the file and give up if that fails. This patch fixes an oops when eCry...
```diff diff --git a/fs/ecryptfs/kthread.c b/fs/ecryptfs/kthread.c index c6d7a4d748a0..e14cf7e588db 100644 --- a/fs/ecryptfs/kthread.c +++ b/fs/ecryptfs/kthread.c @@ -136,6 +136,7 @@ int ecryptfs_privileged_open(struct file **lower_file, const struct cred *cred) { struct ecryptfs_open_req *req; + int flags ...
382684984e93039a3bbd83b04d341b0ceb831519
Analyze and fix the following issue in the Linux kernel code: ecryptfs: improved dependency checking and reporting
Problem Details: So, I compiled a 2.6.31-rc5 kernel with ecryptfs and loaded its module. When it came time to mount my filesystem, I got this in dmesg, and it refused to mount: [93577.776637] Unable to allocate crypto cipher with name [aes]; rc = [-2] [93577.783280] Error attempting to initialize key TFM cipher with n...
```diff diff --git a/fs/ecryptfs/Kconfig b/fs/ecryptfs/Kconfig index 0c754e64232b..8aadb99b7634 100644 --- a/fs/ecryptfs/Kconfig +++ b/fs/ecryptfs/Kconfig @@ -1,6 +1,8 @@ config ECRYPT_FS tristate "eCrypt filesystem layer support (EXPERIMENTAL)" - depends on EXPERIMENTAL && KEYS && CRYPTO && NET + depends on EXPERIM...
aa06117f19944573cda0c4bee026c916b5256090
Analyze and fix the following issue in the Linux kernel code: eCryptfs: Fix lockdep-reported AB-BA mutex issue
Problem Details: Lockdep reports the following valid-looking possible AB-BA deadlock with global_auth_tok_list_mutex and keysig_list_mutex: ecryptfs_new_file_context() -> ecryptfs_copy_mount_wide_sigs_to_inode_sigs() -> mutex_lock(&mount_crypt_stat->global_auth_tok_list_mutex); -> ecryptfs_...
```diff diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 4610fd6afcef..520783b205a1 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -923,7 +923,9 @@ static int ecryptfs_copy_mount_wide_sigs_to_inode_sigs( struct ecryptfs_global_auth_tok *global_auth_tok; int rc = 0; + mutex_lock(&cry...
05dafedb906425fe935199f4c92700d87285e3e9
Analyze and fix the following issue in the Linux kernel code: ecryptfs: Remove unneeded locking that triggers lockdep false positives
Problem Details: In ecryptfs_destroy_inode(), inode_info->lower_file_mutex is locked, and just after the mutex is unlocked, the code does: kmem_cache_free(ecryptfs_inode_info_cache, inode_info); This means that if another context could possibly try to take the same mutex as ecryptfs_destroy_inode(), then it could e...
```diff diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index b91851f1cda3..4610fd6afcef 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -245,13 +245,11 @@ void ecryptfs_destroy_crypt_stat(struct ecryptfs_crypt_stat *crypt_stat) crypto_free_blkcipher(crypt_stat->tfm); if (crypt_stat->hash_...
a87371b477774b290c27bc5cb7f4ccc5379574a9
Analyze and fix the following issue in the Linux kernel code: USB: Fix sysfs paths in documentation
Problem Details: Neither /sys/usb/devices nor /sys/bus/devices exist. The correct path is /sys/bus/usb/devices. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/Documentation/usb/authorization.txt b/Documentation/usb/authorization.txt index 381b22ee7834..c069b6884c77 100644 --- a/Documentation/usb/authorization.txt +++ b/Documentation/usb/authorization.txt @@ -16,20 +16,20 @@ Usage: Authorize a device to connect: -$ echo 1 > /sys/usb/devices/DEVICE/au...
3ae9da1c99eda248b469fc10d8d9fcebebc949cf
Analyze and fix the following issue in the Linux kernel code: USB: skeleton: fix coding style issues.
Problem Details: This fixes up the majority of the coding style issues in the usb-skeleton driver. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index ef8c877cdd41..b62f2bc064f6 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -18,7 +18,7 @@ #include <linux/slab.h> #include <linux/module.h> #include <linux/kref.h> -#include <asm/uaccess.h> +#include <linux...
e7389cc9a7ff7c6e760e741c81a751c834f7d145
Analyze and fix the following issue in the Linux kernel code: USB: skel_read really sucks royally
Problem Details: The read code path of the skeleton driver really sucks - skel_read works only for devices which always send data - the timeout comes out of thin air - it blocks signals for the duration of the timeout - it disallows nonblocking IO by design This patch fixes it by using a real urb, a completion an...
```diff diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 60ba631e99c2..5ffa3e246856 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -52,15 +52,21 @@ struct usb_skel { struct usb_interface *interface; /* the interface for this device */ struct semaphore limit_se...
a50c8aa953c65fd690eca03a2618ac445a3da05d
Analyze and fix the following issue in the Linux kernel code: USB: xhci: Fix command wait list handling.
Problem Details: In the xHCI driver, configure endpoint commands that are submitted to the hardware may involve one of two data structures. If the configure endpoint command is setting up a new configuration or modifying max packet sizes, the data structures and completions are statically allocated in the xhci_virt_de...
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index a9379b3bebaf..2274604e863e 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -685,6 +685,34 @@ static void handle_reset_ep_completion(struct xhci_hcd *xhci, } } +/* Check to see if a command in the ...
9e221be815cd263480928248bfd4541497017a1b
Analyze and fix the following issue in the Linux kernel code: USB: gadget: ether needs to select CRC32
Problem Details: Fix build error, ether uses/needs to select CRC32 config symbol: ether.c:(.text+0x271480): undefined reference to `crc32_le' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 4d8ab470f087..33351312327f 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -627,6 +627,7 @@ config USB_AUDIO config USB_ETH tristate "Ethernet Gadget (with CDC Ethernet support)" depends on NET + select C...
d0a38365d9585bf3fb71f7c57fd532441a14f3e8
Analyze and fix the following issue in the Linux kernel code: USB: fix USBTMC get_capabilities success handling
Problem Details: In order: Add reference to relevant section of USBTMC usb488 subclass specs. Print debug output of capabilities only when it was retrieved successfully. Clear return value on success, otherwise driver always reports failure. Signed-off-by: Gergely Imreh <imrehg@gmail.com> Signed-off-by: Greg Kroah-Har...
```diff diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 6395f22a58e1..333ee02e7b2b 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -57,7 +57,9 @@ MODULE_DEVICE_TABLE(usb, usbtmc_devices); /* * This structure is the capabilities for the device - * See section 4...
1e5ea5e32043094d96ca1e501110c1fbb631f693
Analyze and fix the following issue in the Linux kernel code: USB: fix missing error check in probing
Problem Details: usb: check for IO errors usb_set_interface can return if they happen while unbinding a flag is set to retry upon probe if they happen during probe they are handled as probe errors Signed-off-by: Oliver Neukum <oliver@neukum.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kro...
```diff diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 1c976c141f33..4f864472c5c4 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -239,24 +239,31 @@ static int usb_probe_interface(struct device *dev) /* Carry out a deferred switch to altsetting 0 */ if (intf->...
ad45f1dc836cb175e9aeea927837dd48039d652c
Analyze and fix the following issue in the Linux kernel code: USB: ehci-dbgp,ehci: Allow dbpg to work with suspend/resume
Problem Details: In order for the dbgp driver to survive suspend/resume, on every ehci resume operation the debug controller must get re-initialized. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: dbrownell@users.sourceforge.net Cc: Ingo Molnar <mingo@elte.hu> C...
```diff diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 6b5e4d18d4bf..1b6f1c0e5cee 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -235,6 +235,13 @@ static int ehci_bus_resume (struct usb_hcd *hcd) return -ESHUTDOWN; } + if (unlikely(ehci->debug)) { + i...
9780bc41dca728f9b082a42d9e1f1716d5057081
Analyze and fix the following issue in the Linux kernel code: USB: ehci-dbgp,documentation: Documentation updates for ehci-dbgp
Problem Details: Add missing information about requirements of using the EHCI usb debug controller as well as to mention you can use a debug controller other than the first one in the system. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Andrew Morton <akpm@linux-foundati...
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index c363840cdcea..6fa7292947e5 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -671,7 +671,7 @@ and is between 256 and 4096 characters. It is defined in the file earlyprintk= ...
68d2956a810b5c1b8213a1a9f59eacc54d7ce087
Analyze and fix the following issue in the Linux kernel code: USB: ehci-dbgp: errata for EHCI debug/host controller synchronization
Problem Details: On some EHCI debug controllers after the host controller driver is activated, the debug controller will occasionally fail to submit a bulk write URB. On controllers that exhibit this behavior a dummy bulk write must get submitted to resynchronize the device. The "dummy bulk write" does not get receiv...
```diff diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c index f0a41c647bef..1206a26ef893 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c @@ -245,16 +245,9 @@ static inline void dbgp_get_data(void *buf, int size) bytes[i] = (hi >> (8*(i - 4))) & 0xff; } -st...
aab2d4086a1876fcff282aa36e2d4a92aa9935c9
Analyze and fix the following issue in the Linux kernel code: USB: ehci-dbgp: errata for EHCI debug controller initialization
Problem Details: On some EHCI usb debug controllers, the EHCI debug device will fail to be seen after a port reset, after a warm reset. Two options exist to get the device to initialize correctly. Option 1 is to unplug and plug in the device. Option 2 is to use the EHCI port test to get the usb debug device to start...
```diff diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c index b88cb65b64e0..f0a41c647bef 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c @@ -478,10 +478,13 @@ int dbgp_external_startup(void) int devnum; struct usb_debug_descriptor dbgp_desc; int ret; - u32...
8d053c79f22462f55c02c8083580730b922cf7b4
Analyze and fix the following issue in the Linux kernel code: USB: ehci-dbgp,ehci: Allow early or late use of the dbgp device
Problem Details: If the EHCI debug port is initialized and in use, the EHCI host controller driver must follow two rules. 1) If the EHCI host driver issues a controller reset, the debug controller driver re-initialization must get called after the reset is completed. 2) The EHCI host driver should ignore any re...
```diff diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c index 06e05ea17871..b88cb65b64e0 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c @@ -933,3 +933,26 @@ struct console early_dbgp_console = { .flags = CON_PRINTBUFFER, .index = -1, }; + +int dbgp_reset_p...
917778267fbe67703ab7d5c6f0b7a05d4c3df485
Analyze and fix the following issue in the Linux kernel code: USB: ehci-dbgp: stability improvements and external re-init
Problem Details: This patch implements several changes: 1) Improve the capability to debug the dbgp driver The dbgp_ehci_status() was added in a number of places to report the critical ehci registers to diagnose the cause of a failure of the ehci-dbgp driver. 2) Capability to survive the host controller ini...
```diff diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c index 6198ebded3a4..06e05ea17871 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c @@ -1,5 +1,19 @@ +/* + * Standalone EHCI usb debug driver + * + * Originally written by: + * Eric W. Biederman" <ebiederm@xm...
c9530948bc626c8b638015c0b32abb9615659ec6
Analyze and fix the following issue in the Linux kernel code: early_printk: Allow more than one early console
Problem Details: It is desirable to be able to use one early boot device to debug another or to have multiple places you can see the early boot diagnostics, such as the vga screen or serial device. This patch changes the early_printk console device registration to allow more than one early printk device to get registe...
```diff diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c index 519a5e10be53..2acfd3fdc0cc 100644 --- a/arch/x86/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c @@ -176,10 +176,19 @@ asmlinkage void early_printk(const char *fmt, ...) va_end(ap); } +static inline void early_con...
56faf0f98fd53e4a27cec331a3ff6d4aa55b1213
Analyze and fix the following issue in the Linux kernel code: USB: dbgp: EHCI debug controller initialization delays
Problem Details: When using the EHCI host controller as a polled device, a bit more tolerance is required in terms of delays. On some 3+ghz systems the cpu loops were faster than the EHCI device mmio and resulted in the controller failing to initialize. On at least one first generation EHCI controller when it was not...
```diff diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c index 7deae97fe50f..6198ebded3a4 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c @@ -9,6 +9,12 @@ #include <asm/pci-direct.h> #include <asm/fixmap.h> +#ifdef DBGP_DEBUG +# define dbgp_printk printk +#el...
87a5d15154ae2389251e6ad99216a846b905375c
Analyze and fix the following issue in the Linux kernel code: USB: dbgp: insert cr prior to nl as needed
Problem Details: The rs232 drivers send a carriage return prior to a new line in the early printk code. The usb debug driver should do the same because you want to be able to use the same terminal programs and tools for analysis of early printk data. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Cc: Ingo M...
```diff diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c index 821b7b21c29c..8de709ac0f55 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c @@ -700,17 +700,27 @@ int __init early_dbgp_init(char *s) static void early_dbgp_write(struct console *con, const char *str,...
f0cc82a831d4d839eb6b67c7c046ebd2d1d7c4c2
Analyze and fix the following issue in the Linux kernel code: USB: fix paths in usbmon documentation
Problem Details: Hi there. On Aug 21 2009, Alan Stern wrote: > On Thu, 20 Aug 2009, Rogério Brito wrote: > > Again, just reiterating, what I said before, even though I am not sure > > if I can reproduce it, I will try to. > > A usbmon trace showing what happens when you plug in the drive and > when you run smartctl ...
```diff diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt index 4efd8470921c..66f92d1194c1 100644 --- a/Documentation/usb/usbmon.txt +++ b/Documentation/usb/usbmon.txt @@ -33,7 +33,7 @@ if usbmon is built into the kernel. Verify that bus sockets are present. -# ls /sys/kernel/debug/usbmon +#...
d77282c836d6c2601da6a188812b20cff8e9bbe2
Analyze and fix the following issue in the Linux kernel code: USB: OMAP: ISP1301: Compile fix
Problem Details: OMAP: ISP1301: Compile fix Fix this build error on non- OMAP-H2/H3/H4 systems: (factored out two empty functions as part of the fix) CC drivers/usb/otg/isp1301_omap.o drivers/usb/otg/isp1301_omap.c: In function 'otg_update_isp': drivers/usb/otg/isp1301_omap.c:635: error: implicit declaration o...
```diff diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c index e0d56ef2bcb0..77a5f4188999 100644 --- a/drivers/usb/otg/isp1301_omap.c +++ b/drivers/usb/otg/isp1301_omap.c @@ -117,24 +117,7 @@ static void enable_vbus_draw(struct isp1301 *isp, unsigned mA) pr_debug(" VBUS %d mA error %d\n"...
392ca68b401e0797115a08836642faad5778fdb2
Analyze and fix the following issue in the Linux kernel code: USB: Clean up root hub string descriptors
Problem Details: The previous code had a bug that would add a trailing null byte to the returned descriptor. Signed-off-by: George Spelvin <linux@horizon.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 95ccfa0b9fc5..34de475f016e 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -337,72 +337,89 @@ static const u8 ss_rh_config_descriptor[] = { /*-------------------------------------------------------------------------*/ -/...
2912282c06f219cf1634a624653c445329b37acf
Analyze and fix the following issue in the Linux kernel code: USB: make usb_buffer_map_sg consistent with doc
Problem Details: usb_buffer_map_sg should return negative on error according to its documentation. But dma_map_sg returns 0 on error. Take this into account and return -ENOMEM in such situation. While at it, return -EINVAL instead of -1 when wrong input is passed in. If this wasn't done, usb_sg_* operations used afte...
```diff diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 43ee943d757a..30dd2636f262 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -914,11 +914,11 @@ int usb_buffer_map_sg(const struct usb_device *dev, int is_in, || !(bus = dev->bus) || !(controller = bus->controller) ...
3a44494e233c0fdd818d485cfea8998500543589
Analyze and fix the following issue in the Linux kernel code: USB: EHCI: rescan the queue after an unlink
Problem Details: This patch (as1280) fixes an obscure bug in ehci-hcd's dequeuing logic for async URBs. If a later URB is unlinked and the completion routine unlinks an earlier URB, then the earlier URB won't be given back in a timely manner because the endpoint queue isn't rescanned as it should be. Similar bugs occ...
```diff diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 6887aac5e73d..d7e85b6231b3 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -863,12 +863,18 @@ static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) if (!HC_IS_RUNNING(ehci_to_hcd(ehci)->st...
25b8286805e856c8c7fda127018e31032c918015
Analyze and fix the following issue in the Linux kernel code: USB-serial: pl2303: fix baud rate handling in case of unsupported values
Problem Details: According to the datasheets, the PL2303 supports a set of 25 baudrates. The baudrate is set as a 4 byte value directly. During my experiments with device 067b:2303 (PL2303X), I noticed that - the bridge-controller always uses 9600 baud if invalid/unsupported baud rate values are set - the baud ra...
```diff diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 4cbe59c4ae7f..82055b07e02c 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -528,6 +528,12 @@ static void pl2303_set_termios(struct tty_struct *tty, int baud; int i; u8 control; + const int baud_sup[]...
c2cd26e15b84b964c489f2aff278cdaf03840c93
Analyze and fix the following issue in the Linux kernel code: USB: usbtmc: Fix short reads in usbtmc_read()
Problem Details: The header size should not be included in the number of bytes requested of the instrument Signed-off-by: Steve Holland <sdh4@iastate.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 40ef4da786d8..f2fde7cd6109 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -407,10 +407,10 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, buffer[1] = data->bTag; buffer[2] = ~(data->b...
823c3fd9cc71714fe22ea415a68da746800d5a9a
Analyze and fix the following issue in the Linux kernel code: USB: s3c2410: unregister should call unbind, not disconnect
Problem Details: This patch (as1275) fixes the s3c2410 device controller driver. Its usb_gadget_unregister_driver() routine is supposed to call the gadget driver's unbind method, not the disconnect method. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index a9b452fe6221..d5f4c1d45c97 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c @@ -1703,8 +1703,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) dprintk(DEBUG_NORMAL,"...
63ead6a00d54a645667c141d8aaf0f6ffe1212be
Analyze and fix the following issue in the Linux kernel code: USB: otg: fix twl4030-usb build
Problem Details: subsys_initcall_sync() is only defined for built-in code, not for loadable modules, so this driver build fails when built as a module. However, the _sync() forms of the initcalls are not implemented, so this should not be used -- just use the non-sync form of it. drivers/usb/otg/twl4030-usb.c:777: war...
```diff diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index d1852d475893..9e3e7a5c258b 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c @@ -774,7 +774,7 @@ static int __init twl4030_usb_init(void) { return platform_driver_register(&twl4030_usb_driver); } -s...
9ca33a0f1abdefea3811666d9e87af11fd0af6c6
Analyze and fix the following issue in the Linux kernel code: USB: Fix CDC EEM host driver 'sentinel' CRC validation
Problem Details: This is an alternate solution to the EEM 'sentinel' CRC valiation issue. CDC EEM allows using a 'sentinel' ethernet frame CRC of 0xdeadbeef in place of a real CRC. The 'sentinel' value is transmitted in big-endian order whereas the normal CRC is little-endian. This patch handles both cases appropria...
```diff diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c index 45cebfb302cf..23300656c266 100644 --- a/drivers/net/usb/cdc_eem.c +++ b/drivers/net/usb/cdc_eem.c @@ -300,20 +300,23 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb) return 0; } - crc = get_unaligned_le32(s...
0ffd3b2902e28b13d8379df0f09a55668f330f77
Analyze and fix the following issue in the Linux kernel code: USB: otg: twl4030-usb.c: mark .init as subsys_initcall_sync
Problem Details: This patch fixes the .probe failure of twl4030_usb driver if it is compiled into kernel. Since twl4030_usb USB transceiver .probe depends on twl4030-regulator, marking twl4030_usb_init as subsys_initcall_sync can make it called after twl4030-regulator initialization is finished, then twl4030_usb USB t...
```diff diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index 9e3e7a5c258b..d1852d475893 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c @@ -774,7 +774,7 @@ static int __init twl4030_usb_init(void) { return platform_driver_register(&twl4030_usb_driver); } -s...
c740d0d80d385b178c319f3d6e627ade8f732488
Analyze and fix the following issue in the Linux kernel code: USB: musb: fix put_device() call sequence
Problem Details: Invoke put_device(musb->xceiv->dev) before musb_platform_exit()as xceiv is getting unregistered in musb_platform_exit(). Fixes put_device() panic when module insert/removal is performed multiple times. Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Acked-by: David Brownell <dbrownell@users.sourc...
```diff diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 1d26beddf2ca..3a61ddb62bd2 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1850,6 +1850,10 @@ static void musb_free(struct musb *musb) dma_controller_destroy(c); } +#ifdef CONFIG_USB_MUSB_OTG +...
db8be50c4307dac2b37305fc59c8dc0f978d09ea
Analyze and fix the following issue in the Linux kernel code: USB: Work around BIOS bugs by quiescing USB controllers earlier
Problem Details: We are seeing a number of crashes in SMM, when VT-d is enabled while 'Legacy USB support' is enabled in various BIOSes. The BIOS is supposed to indicate which addresses it uses for DMA in a special ACPI table ("RMRR"), so that we can punch a hole for it when we set up the IOMMU. The problem is, as us...
```diff diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 83b5f9cea85a..23cf3bde4762 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -475,4 +475,4 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev) else if (pdev->class == PCI_CLASS_S...
7949f4e16456183bae0bc19ffe92072a27d0553e
Analyze and fix the following issue in the Linux kernel code: USB: isp1362: fix pulldown register defines and conf logic
Problem Details: HCHWCFG_PULLDOWN_DS2 and HCHWCFG_PULLDOWN_DS1 were swapped. Incorrect operator precedence in isp1362_hc_start() hid part of the problem. This fixes a problem where Port 1 in Host mode fails to see disconnects. Signed-Off-By: Ken MacLeod <ken@bitsko.slc.ut.us> Signed-off-by: Greg Kroah-Hartman <gregkh...
```diff diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c index 5819e10a146c..16ba1eadf971 100644 --- a/drivers/usb/host/isp1362-hcd.c +++ b/drivers/usb/host/isp1362-hcd.c @@ -2563,7 +2563,7 @@ static int isp1362_hc_start(struct usb_hcd *hcd) hwcfg = HCHWCFG_INT_ENABLE | HCHWCFG_DBWIDTH(1);...
e792b1b0b83c276ca786b01cad662dc2e5d18843
Analyze and fix the following issue in the Linux kernel code: USB: gadget: audio driver seg-fault fix
Problem Details: The included patch can be applied to the new usb gadget audio driver. It addresses a seg-fault in uncovered in g_audio.ko. The fault occurs in the function u_audio.c::gaudio_open_end_dev() when device /dev/snd/pcmC0D0c (FILE_PCM_CAPTURE) is not present. I suspect there may be similar problems with de...
```diff diff --git a/drivers/usb/gadget/u_audio.c b/drivers/usb/gadget/u_audio.c index 0f3d22fc030e..b5200d551458 100644 --- a/drivers/usb/gadget/u_audio.c +++ b/drivers/usb/gadget/u_audio.c @@ -253,11 +253,13 @@ static int gaudio_open_snd_dev(struct gaudio *card) snd->filp = filp_open(fn_cap, O_RDONLY, 0); if (IS_...
417b57b3e4e34df07a2aceaf75baffeacdd9385f
Analyze and fix the following issue in the Linux kernel code: USB: gadget: Read buffer overflow
Problem Details: Check whether index is within bounds before testing the element. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 59e85234fa0a..d05397ec8a18 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -602,7 +602,7 @@ static int get_string(struct usb_composite_dev *cdev, } } - for (len = 0; s->wData[len] && ...
a2fbf10eba3a38407e3984bc9503342de2b5e399
Analyze and fix the following issue in the Linux kernel code: USB: usbtmc: fix printk format warnings
Problem Details: Fix printk format warnings: drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 4 has type 'u32' drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 5 has type 'int' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed...
```diff diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 5bab8e596c88..40ef4da786d8 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -463,7 +463,7 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, /* Ensure the instrument doesn't lie about it */...
665d7662d15441b4b3e54131a9418a1a198d0d31
Analyze and fix the following issue in the Linux kernel code: USB: usbtmc: sanity checks for DEV_DEP_MSG_IN urbs
Problem Details: According to the specifications, an instrument should not return more data in a DEV_DEP_MSG_IN urb than requested. However, some instruments can send more than requested. This could cause the kernel to write the extra data past the end of the buffer provided by read(). Fix this by checking that the v...
```diff diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 4f0858fbf980..5bab8e596c88 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -369,13 +369,13 @@ static ssize_t usbtmc_read(struct file *filp, char __user *buf, { struct usbtmc_device_data *data; struct devi...
e9238221d3fef990e2fd01702ebe5af90dda52a2
Analyze and fix the following issue in the Linux kernel code: USB: dummy-hcd: accept mismatch between wLength and transfer length
Problem Details: This patch (as1269) fixes a bug in the way dummy_hcd handles control URBs. Currently it returns a -EOVERFLOW error if the wLength value in the setup packet is different from the URB's transfer_buffer_length. Other host controller drivers don't do this. There's no reason the two length values have to...
```diff diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index a56b24d305f8..5e0966485188 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -1306,11 +1306,6 @@ restart: setup = *(struct usb_ctrlrequest*) urb->setup_packet; w_index = le16_to_cpu(setup...
81e5b23cd206d46d4872d25f3d7ff67a0f355c71
Analyze and fix the following issue in the Linux kernel code: USB: fix wrong order of events in usb serial suspension
Problem Details: if a subdriver has an additional suspend method, it must be called first to allow the subdriver to return -EBUSY, because the second half cannot be easily undone. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 54bb37d41916..45975b4984ea 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -1157,15 +1157,19 @@ int usb_serial_suspend(struct usb_interface *intf, pm_message_t message) serial->suspendi...
86286883fc8218c81cc1deb04cd1b4a8464bba6f
Analyze and fix the following issue in the Linux kernel code: USB: usbtmc can do IO to device after disconnect
Problem Details: usbtmc will happily complete read/write requests even after disconnect has returned. The fix is to introduce a flag. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index b09a527f7341..0c9df97f6775 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c @@ -86,6 +86,8 @@ struct usbtmc_device_data { bool TermCharEnabled; bool auto_abort; + bool zombie; /* fd of disconnected device */...
4c6e8971cbe0148085fcf6fd30eaa3c39f8a8cce
Analyze and fix the following issue in the Linux kernel code: USB: make the "usbfs_snoop" log more pertinent
Problem Details: This patch (as1261) reduces the amount of detailed URB information logged by usbfs when the usbfs_snoop parameter is enabled. Currently we don't display the final status value for a completed URB. But we do display the entire data buffer twice: both before submission and after completion. The after-c...
```diff diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 165de5d59005..a1add776e89a 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -100,11 +100,15 @@ MODULE_PARM_DESC(usbfs_snoop, "true to log all usbfs traffic"); dev_info(dev , format , ## arg); \ } while (0) -#de...
512ad27d8667158747de2e8da8a23e8f50e91856
Analyze and fix the following issue in the Linux kernel code: USB audio gadget: Prefix all macro definitions with UAC_ in linux/usb/audio.h
Problem Details: linux/usb/audio.h is a public header file that includes definitions exported to userspace. To avoid namespace clashes, prefix all macro definitions with UAC_. Existing macros and structures prefixed with USB_AC_ and USB_AS_ are renamed for consistency. Signed-off-by: Laurent Pinchart <laurent.pinchart...
```diff diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c index 9f80f4e970bd..a3a0f4a27ef0 100644 --- a/drivers/usb/gadget/audio.c +++ b/drivers/usb/gadget/audio.c @@ -106,20 +106,20 @@ static int audio_set_endpoint_req(struct usb_configuration *c, ctrl->bRequest, w_value, len, ep); switch (c...
81bf46f3034046c572714bdee1dc51beb3475082
Analyze and fix the following issue in the Linux kernel code: USB: Let usb_sg_init to set transfer_buffer more often
Problem Details: This fix permits the "new" usbmon to access usb-storage's data buffer without DMA remapping tricks. It should be compatible with PIO controllers and not add any new crashes. Note that from now on PIO controllers and usbmon are uniform in their access pattern and if one crashes then the other will too. ...
```diff diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 9720e699f472..da718e84d58d 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -459,35 +459,23 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, io->urbs[i]->context = io; /* - * S...
4e9e92003529e5c7bb11281f7c2c9b3fe8858403
Analyze and fix the following issue in the Linux kernel code: USB: usbmon: end ugly tricks with DMA peeking
Problem Details: This patch fixes crashes when usbmon attempts to access GART aperture. The old code attempted to take a bus address and convert it into a virtual address, which clearly was impossible on systems with actual IOMMUs. Let us not persist in this foolishness, and use transfer_buffer in all cases instead. I...
```diff diff --git a/drivers/usb/mon/Makefile b/drivers/usb/mon/Makefile index c6516b566731..384b198faa7c 100644 --- a/drivers/usb/mon/Makefile +++ b/drivers/usb/mon/Makefile @@ -2,6 +2,6 @@ # Makefile for USB monitor # -usbmon-objs := mon_main.o mon_stat.o mon_text.o mon_bin.o mon_dma.o +usbmon-objs := mon_main.o ...
d2fb1bb32b9b379a029aeca969b45d28bd91ae89
Analyze and fix the following issue in the Linux kernel code: USB: sisusbvga: drop usb_buffer_alloc
Problem Details: This patch falls out of my work to fix usbmon so it uses virtual addresses. It is not necessary, the "new" usbmon should work just fine with sisusbvga. However, it seems ridiculous that anyone would use uncached memory to transfer bulk data. Dropping the unnecessary use of usb_buffer_alloc should be be...
```diff diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index b4ec716de7da..0025847743f3 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c @@ -79,14 +79,12 @@ sisusb_free_buffers(struct sisusb_usb_data *sisusb) for (i = 0; i < NUMOBUFS;...
6682bb39e111b34290e25c4d275c5bcf8bbccbe1
Analyze and fix the following issue in the Linux kernel code: USB: Fix SS endpoint companion descriptor parsing.
Problem Details: When there's a descriptor after the SuperSpeed endpoint companion descriptor, the previous code would have skipped over twice the length it was supposed to. This code fixes crashes seen with UASP devices (which have a UASP descriptor after the SS endpoint companion descriptor). Signed-off-by: Sarah S...
```diff diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index a16c538d0132..0d3af6a6ee49 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -105,7 +105,7 @@ static int usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, ep->ss_ep_comp->extralen = i; buffer += i;...
9191eee7b8a0e18c07c06d6da502706805cab6d2
Analyze and fix the following issue in the Linux kernel code: USB: xhci: Don't touch xhci_td after it's freed.
Problem Details: On a successful transfer, urb->td is freed before the URB is ready to be given back to the driver. Don't touch urb->td after it's freed. This bug would have only shown up when xHCI debugging was turned on, and the freed memory was quickly reused for something else. Signed-off-by: Sarah Sharp <sarah....
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 2eadf0693862..4142c04b5adf 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1193,7 +1193,7 @@ cleanup: if (urb) { usb_hcd_unlink_urb_from_ep(xhci_to_hcd(xhci), urb); xhci_dbg(xhci, "Giveback UR...
ac9d8fe7c6a8041cca5a0738915d2c4e21381421
Analyze and fix the following issue in the Linux kernel code: USB: xhci: Add quirk for Fresco Logic xHCI hardware.
Problem Details: This Fresco Logic xHCI host controller chip revision puts bad data into the output endpoint context after a Reset Endpoint command. It needs a Configure Endpoint command (instead of a Set TR Dequeue Pointer command) after the reset endpoint command. Set up the input context before issuing the Reset E...
```diff diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c index 4353c1c78935..1d4a1e3f9533 100644 --- a/drivers/usb/host/xhci-hcd.c +++ b/drivers/usb/host/xhci-hcd.c @@ -224,7 +224,7 @@ int xhci_init(struct usb_hcd *hcd) xhci_dbg(xhci, "QUIRK: Not clearing Link TRB chain bits.\n"); xhci->quir...
2d3f1fac7ee8bb4c6fad40f838488edbeabb0c50
Analyze and fix the following issue in the Linux kernel code: USB: xhci: Support full speed devices.
Problem Details: Full speed devices have varying max packet sizes (8, 16, 32, or 64) for endpoint 0. The xHCI hardware needs to know the real max packet size that the USB core discovers after it fetches the first 8 bytes of the device descriptor. In order to fix this without adding a new hook to host controller drive...
```diff diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c index ddb1a6a118eb..4e18f4edf5aa 100644 --- a/drivers/usb/host/xhci-hcd.c +++ b/drivers/usb/host/xhci-hcd.c @@ -601,6 +601,70 @@ int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, return 1; } +static int xhci_configure_en...
018218d1d9eb06116d24a02dd5e7a390f0353d0f
Analyze and fix the following issue in the Linux kernel code: USB: xhci: Fix slot and endpoint context debugging.
Problem Details: Use the virtual address of the memory hardware uses, not the address for the container of that memory. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c index 705e34324156..33128d52f212 100644 --- a/drivers/usb/host/xhci-dbg.c +++ b/drivers/usb/host/xhci-dbg.c @@ -413,7 +413,8 @@ void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx) int i; struct xhci_slot_ctx *...
eb661bc88252e5c6dc69df732e77e42981dd4d8b
Analyze and fix the following issue in the Linux kernel code: USB: sl811-hcd: Fix device disconnect:
Problem Details: SL811 Device detected after removal used to be working in linux-2.6.22 but then broke somewhere between 2.6.22 and 2.6.28. Current hub_port_connect_change() in drivers/usb/core/hub.c won't call usb_disconnect() in case the SL811 driver sets portstatus USB_PORT_FEAT_CONNECTION upon removal. AFAIK the SL...
```diff diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index a949259f18b9..5b22a4d1c9e4 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -719,8 +719,12 @@ retry: /* port status seems weird until after reset, so * force the reset and make khubd clean up lat...
7af25b4b34a2439020d78da765a3bed0ff73f25c
Analyze and fix the following issue in the Linux kernel code: USB: fix cdc-acm regression in open
Problem Details: cdc-acm needs to set a flag during open to tell the tty layer that the device is initialized Signed-off-by: Oliver Neukum <oliver@neukum.org> Cc: Marcel Holtmann <marcel@holtmann.org> Cc: Paul Martin <pm@debian.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 85a1a55815cf..e3861b21e776 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -59,6 +59,7 @@ #include <linux/init.h> #include <linux/slab.h> #include <linux/tty.h> +#include <linux/serial.h> #include <lin...
e5dc8ae121592239c2a2521d383bcb789849b2a3
Analyze and fix the following issue in the Linux kernel code: USB: storage: fix a resume path GFP_NOIO must be used
Problem Details: In the resume path of a block driver GFP_NOIO must be used to avoid a possible deadlock. The onetouch subdriver of storage violates the requirement. Signed-off-by: Oliver Neukum <oliver@neukum.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c index 380233bd6a39..80e65f29921c 100644 --- a/drivers/usb/storage/onetouch.c +++ b/drivers/usb/storage/onetouch.c @@ -163,7 +163,7 @@ static void usb_onetouch_pm_hook(struct us_data *us, int action) usb_kill_urb(onetouch->irq); ...
4c1ea3dd718a1d93a726cb3e66665ac4170dcccd
Analyze and fix the following issue in the Linux kernel code: lguest: use set_pte/set_pmd uniformly for real page table entries
Problem Details: If we're building a pte, we can use simple assigment; only use set_pte etc. when we're actually going to use that destination as a PTE. I don't know that we'll ever run under Xen, but it's neater. And use set_pte/set_pmd rather than assuming native_ versions, even though that's probably true for most...
```diff diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c index a8d0aee3bc0e..232fba6a4882 100644 --- a/drivers/lguest/page_tables.c +++ b/drivers/lguest/page_tables.c @@ -380,7 +380,7 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode) * And we copy the flags to the sha...
f68d24082e22ccee3077d11aeb6dc5354f0ca7f1
Analyze and fix the following issue in the Linux kernel code: virtio_pci: minor MSI-X cleanups
Problem Details: 1) Rename vp_request_vectors to vp_request_msix_vectors, and take non-MSI-X case out to caller. 2) Comment weird pci_enable_msix API 3) Rename vp_find_vq to setup_vq. 4) Fix spaces to tabs 5) Make nvectors calc internal to vp_try_to_find_vqs() 6) Rename vector to msix_vector for more clarity. Signe...
```diff diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 248e00ec4dc1..4a1f1ebff7bf 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -84,7 +84,7 @@ struct virtio_pci_vq_info struct list_head node; /* MSI-X vector (or none) */ - unsigned vector; + unsigned m...
508c4d0874acf8584787bbab7e4a3798e2834c1a
Analyze and fix the following issue in the Linux kernel code: perf tools: Fix module symbol loading bug
Problem Details: Avi Kivity reported 'perf annotate' failures with modules, the requested function was not annotated. If there are no modules currently loaded, or the last module scanned is not loaded, dso__load_modules() steps on the value from dso__load_vmlinux(), so we happily load the kallsyms symbols on top of wh...
```diff diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index fd3d9c8e90fc..559fb06210f5 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -833,7 +833,7 @@ int dso__load_modules(struct dso *self, symbol_filter_t filter, int v) struct mod_dso *mods = mod_dso__new_dso("modules"); ...
7d42896628202a551ad1107697cd215dc5fca099
Analyze and fix the following issue in the Linux kernel code: perf_event, x86: Fix 'perf sched record' crashing the machine
Problem Details: Chris Malley reported that 'perf sched record' sometimes crashes his box with: [ 389.272175] BUG: unable to handle kernel paging request at ffffb300 [ 389.272294] IP: [<c011b0bd>] default_send_IPI_self+0x1d/0x50 [ 389.272366] *pde = 0073f067 *pte = 00000000 [ 389.274708] Call Trace: [ 389.274752]...
```diff diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index a3c7adb06b78..b5801c311846 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -1790,6 +1790,9 @@ void smp_perf_pending_interrupt(struct pt_regs *regs) void set_perf_event_pending(void) {...
b80474b432913f73cce8db001e9fa3104f9b79ee
Analyze and fix the following issue in the Linux kernel code: ocfs2: Use buffer IO if we are appending a file.
Problem Details: In ocfs2_file_aio_write, we will prevent direct io if we find that we are appending(changing i_size) and call generic_file_aio_write_nolock. But actually O_DIRECT flag is there and this function will call generic_file_direct_write eventually which will update i_size and leave di->i_size alone. The bug ...
```diff diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 33e03c551127..72e76062a900 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -690,6 +690,10 @@ static ssize_t ocfs2_direct_IO(int rw, if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) return 0; + /* Fallback to buffered I/O if we are appe...
83e32d9044a4510fffdf65c2691a25c0ba84e259
Analyze and fix the following issue in the Linux kernel code: ocfs2: add spinlock protection when dealing with lockres->purge.
Problem Details: when we check/modify lockres->purge, we should with the protection of lockres->spinlock. in dlm_purge_lockres(), the checking/modifying is not with the protectin. this patch fixes it. Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
```diff diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c index d490b66ad9d7..98569e86c613 100644 --- a/fs/ocfs2/dlm/dlmthread.c +++ b/fs/ocfs2/dlm/dlmthread.c @@ -212,14 +212,18 @@ static int dlm_purge_lockres(struct dlm_ctxt *dlm, spin_lock(&dlm->spinlock); } + spin_lock(&res->spinlock); if (!...
1ef04fefe2241087d9db7e9615c3f11b516e36cf
Analyze and fix the following issue in the Linux kernel code: md: raid-1/10: fix RW bits manipulation
Problem Details: Recently Jens has changed bio_rw_flagged() logic by following commit 1f98a13f623e0ef666690a18c1250335fc6d7ef1. Now it returns bool instead of int. This broke raid1/raid10 RW bits manipulation logic. One of visible result is BUG_ON triggering due to empty barrier here scsi_lib.c:1108 scsi_setup_fs_cmnd(...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a1eb4e13a112..d1b9bd5fd4f6 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -854,7 +854,7 @@ static int make_request(struct request_queue *q, struct bio * bio) read_bio->bi_sector = r1_bio->sector + mirror->rdev->data_offset; read_bio->...
8cb3ed13935b9b523c2de7afc8f68473fe1d4531
Analyze and fix the following issue in the Linux kernel code: x86: ptrace: set TS_COMPAT when 32-bit ptrace sets orig_eax>=0
Problem Details: The 32-bit ptrace syscall on a 64-bit kernel (32-bit debugger on 32-bit task) behaves differently than a native 32-bit kernel. When setting a register state of orig_eax>=0 and eax=-ERESTART* when the debugged task is NOT on its way out of a 32-bit syscall, the task will fail to do the syscall restart ...
```diff diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 52222fab99f4..7b058a2dc66a 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -1111,10 +1111,22 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 value) R32(esi, si); R32(ebp, bp); R32(eax, ax);...
5b31aee9d72f529ee6b60e8d66967f817a0e39fc
Analyze and fix the following issue in the Linux kernel code: drm/radeon/r600: set correct pitch for 4 byte copy
Problem Details: [agd5f: also fix the non-kms path] Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
```diff diff --git a/drivers/gpu/drm/radeon/r600_blit.c b/drivers/gpu/drm/radeon/r600_blit.c index dde2ccbf1d15..d988eece0187 100644 --- a/drivers/gpu/drm/radeon/r600_blit.c +++ b/drivers/gpu/drm/radeon/r600_blit.c @@ -737,7 +737,7 @@ r600_blit_copy(struct drm_device *dev, /* dst */ set_render_target(dev_priv...
c214271563c00f2721c5111e27b53bf06dabc6e4
Analyze and fix the following issue in the Linux kernel code: drm/radeon: consolidate family flags used in pciids.
Problem Details: having these separate was pointless and introduced a bug when one got updated without the other. Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 817af8ecff10..d5de53e06cec 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -49,6 +49,7 @@ #include <linux/list.h> #include <linux/kref.h> +#include "radeon_family.h" #include "radeon_m...
9731129c5e3077d0c2da13479f91c3a07e341f70
Analyze and fix the following issue in the Linux kernel code: drm/i915: Remove eviction debug spam
Problem Details: Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
```diff diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 62ba9c121a14..8beec97fa348 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2078,27 +2078,14 @@ i915_gem_evict_everything(struct drm_device *dev) int ret; bool lists_empty; - DRM_INFO...
ab5ee57650165dc342a20d1213d48d585f2a72bd
Analyze and fix the following issue in the Linux kernel code: drm/i915: Clean up evict from list.
Problem Details: First the routine attempted to unlock a mutex it did not own along the error path. Secondly the routine should never be called on any list but the inactive one, since we attempt to unbind those objects, so fix the calling semantics. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
```diff diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 67e2cd5636ec..d49ac1c2e396 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -50,8 +50,7 @@ static int i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment); s...
1c5d22f76dc721f3acb7a3dadc657a221e487fb7
Analyze and fix the following issue in the Linux kernel code: drm/i915: Add tracepoints
Problem Details: By adding tracepoint equivalents for WATCH_BUF/EXEC we are able to monitor the lifetimes of objects, requests and significant events. These events can then be probed using the tracing frameworks, such as systemtap and, in particular, perf. For example to record the stack trace for every GPU stall duri...
```diff diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 5269dfa5f620..fa7b9be096bc 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -9,6 +9,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o i915_mem.o \ i915_gem.o \ i915_gem_debug.o \ i915_gem_...
7c329288d72e025db4feac65f0fed95fb3e3ef1c
Analyze and fix the following issue in the Linux kernel code: vgaarb: make client interface config invariant.
Problem Details: Fixes build when VGA_ARB is off. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index e81c64af80c1..923f9040ea20 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h @@ -41,7 +41,7 @@ * interrupts at any time. */ extern void vga_set_legacy_decoding(struct pci_dev *pdev, - unsigned int decodes); + ...
b1912a85b54c27738afe1c4fa069df02d3316f0c
Analyze and fix the following issue in the Linux kernel code: media: video: Fix build in saa7164
Problem Details: -tip testing found that the x86 build (64-bit allyesconfig) fails due to: LD vmlinux.o drivers/built-in.o:(.bss+0x4b648): multiple definition of `debug' arch/x86/built-in.o:(.kprobes.text+0x88): first defined here ld: Warning: size of symbol `debug' changed from 90 in arch/x86/built-in.o ...
```diff diff --git a/drivers/media/video/saa7164/saa7164-api.c b/drivers/media/video/saa7164/saa7164-api.c index bb6df1b276be..6f094a96ac81 100644 --- a/drivers/media/video/saa7164/saa7164-api.c +++ b/drivers/media/video/saa7164/saa7164-api.c @@ -415,7 +415,7 @@ int saa7164_api_enum_subdevs(struct saa7164_dev *dev) ...
6ef57a0ea77e7bf4123a06da895a0e26312b5737
Analyze and fix the following issue in the Linux kernel code: cnic: Shutdown iSCSI ring during uio_close.
Problem Details: The iSCSI ring should be shutdown during uio_close instead of uio_open for proper operations. This fixes the problem of the ring getting stuck intermittently. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemlo...
```diff diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index d45eacb76702..211c8e9182fc 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c @@ -85,8 +85,6 @@ static int cnic_uio_open(struct uio_info *uinfo, struct inode *inode) cp->uio_dev = iminor(inode); - cnic_shutdown_bnx2_rx_ring(dev); - cnic_in...
ec4756238239f1a331d9fb95bad8b281dad56855
Analyze and fix the following issue in the Linux kernel code: smsc95xx: fix transmission where ZLP is expected
Problem Details: Usbnet framework assumes USB hardware doesn't handle zero length packets, but SMSC LAN95xx requires these to be sent for correct operation. This patch fixes an easily reproducible tx lockup when sending a frame that results in exactly 512 bytes in a USB transmission (e.g. a UDP frame with 458 data byt...
```diff diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 3aafebdbe7b5..c6c922247d05 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -1227,7 +1227,7 @@ static const struct driver_info smsc95xx_info = { .rx_fixup = smsc95xx_rx_fixup, .tx_fixup = smsc95xx_tx_fixup,...
8cd09a5984c08dafade74c9c1ab4311af2bf2d24
Analyze and fix the following issue in the Linux kernel code: tracing: Fix a comment and a trivial format issue in tracepoint.h
Problem Details: Fix the tracepoint documentation path in tracepoints headers and a misaligned tabulation. Signed-off-by: Li Hong <lihong.hi@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Ingo Molnar <mingo@redhat.com> LKML-Reference: <3a3680030909220300h7cf18849q4d4702b9d4feaa67@mail.gmail.com> Signed-off-by...
```diff diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 63a3f7a80580..2aac8a83e89b 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -4,7 +4,7 @@ /* * Kernel Tracepoint API. * - * See Documentation/tracepoint.txt. + * See Documentation/trace/tracepoints.txt. *...
9cc4085585a011179caf86a6408225626f6c2263
Analyze and fix the following issue in the Linux kernel code: 8139cp: fix duplicate loglevel in module load message
Problem Details: This was introduced by b93d58 "8139*: convert printk() to pr_<foo>()": [ 2256252443 ] <6>8139cp: 10/100 PCI Ethernet driver v1.3 (Mar 22, 2004) The "version" string is printed using pr_info(), so it doesn't need to include a loglevel. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> CC: Ale...
```diff diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 462d9f59c53a..83a1922e68e0 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c @@ -87,7 +87,7 @@ /* These identify the driver base version and may not be removed. */ static char version[] = -KERN_INFO DRV_NAME ": 10/100 PCI Ethernet dri...
407fc5cf019fc5cb990458a2e38d2c0a27b3cb30
Analyze and fix the following issue in the Linux kernel code: ax25: Fix SIOCAX25GETINFO ioctl
Problem Details: rcv_q & snd_q initializations were reversed in commit 31e6d363abcd0d05766c82f1a9c905a4c974a199 (net: correct off-by-one write allocations reports) Signed-off-by: Jan Rafaj <jr+netfilter-devel@cedric.unob.cz> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@dav...
```diff diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index da0f64f82b57..d6b1b054e294 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -1781,8 +1781,8 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ax25_info.idletimer = ax25_display_timer(&ax25->idletimer) / (60...