id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
51ee049e771c14a29aaee8ecd6cbbe14db088f3a
Analyze and fix the following issue in the Linux kernel code: vfs: add lockdep annotation to s_vfs_rename_key for ecryptfs
Problem Details: > ============================================= > [ INFO: possible recursive locking detected ] > 2.6.31-2-generic #14~rbd3 > --------------------------------------------- > firefox-3.5/4162 is trying to acquire lock: > (&s->s_vfs_rename_mutex){+.+.+.}, at: [<ffffffff81139d31>] lock_rename+...
```diff diff --git a/fs/super.c b/fs/super.c index 89afca5055ab..69688b15f1fa 100644 --- a/fs/super.c +++ b/fs/super.c @@ -88,6 +88,7 @@ static struct super_block *alloc_super(struct file_system_type *type) s->s_count = 1; atomic_set(&s->s_active, 1); mutex_init(&s->s_vfs_rename_mutex); + lockdep_set_class(&s...
79893c17b45dec0d3c25bc22d28d9f319b14f573
Analyze and fix the following issue in the Linux kernel code: fix prune_dcache()/umount() race
Problem Details: ... and get rid of the last __put_super_and_need_restart() caller Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/fs/dcache.c b/fs/dcache.c index 5afc4994bb27..d96047b4a633 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -536,7 +536,7 @@ restart: */ static void prune_dcache(int count) { - struct super_block *sb; + struct super_block *sb, *n; int w_count; int unused = dentry_stat.nr_unused; int prune_ra...
1494583de59dfad2e3a6788ce9817e658d32df22
Analyze and fix the following issue in the Linux kernel code: fix get_active_super()/umount() race
Problem Details: This one needs restarts... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/fs/super.c b/fs/super.c index 4df8233dfb61..44971d7df1ce 100644 --- a/fs/super.c +++ b/fs/super.c @@ -471,17 +471,17 @@ struct super_block *get_active_super(struct block_device *bdev) if (!bdev) return NULL; +restart: spin_lock(&sb_lock); list_for_each_entry(sb, &super_blocks, s_list) { ...
e7fe0585ca8793e2d43c57e77d4ca79042806acf
Analyze and fix the following issue in the Linux kernel code: fix do_emergency_remount()/umount() races
Problem Details: need list_for_each_entry_safe() here. Original didn't even have restart logics, so if you race with umount() it blew up. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/fs/super.c b/fs/super.c index ccb2b5fa89bd..4df8233dfb61 100644 --- a/fs/super.c +++ b/fs/super.c @@ -602,10 +602,10 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force) static void do_emergency_remount(struct work_struct *work) { - struct super_block *sb; + struct sup...
decabd6650915a9534dad09e967115513be12b24
Analyze and fix the following issue in the Linux kernel code: fix a couple of ecryptfs leaks
Problem Details: First of all, get_sb_nodev() grabs anon dev minor and we never free it in ecryptfs ->kill_sb(). Moreover, on one of the failure exits in ecryptfs_get_sb() we leak things - it happens before we set ->s_root and ->put_super() won't be called in that case. Solution: kill ->put_super(), do all that stuff...
```diff diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 760983d0f25e..36268db29ea1 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c @@ -633,11 +633,16 @@ out: * @sb: The ecryptfs super block * * Used to bring the superblock down and free the private data. - * Private data is free'd in ecryptfs_...
13e3c5e5b9c67e59074d24e29f3ff794bb4dfef0
Analyze and fix the following issue in the Linux kernel code: clean DCACHE_CANT_MOUNT in d_delete()
Problem Details: We set the "it's dead, don't mount on it" flag _and_ do not remove it if we turn the damn thing negative and leave it around. And if it goes positive afterwards, well... Fortunately, there's only one place where that needs to be caught: only d_delete() can turn the sucker negative without immediately...
```diff diff --git a/fs/dcache.c b/fs/dcache.c index f1358e5c3a59..2b6f09af13ab 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1529,6 +1529,7 @@ void d_delete(struct dentry * dentry) spin_lock(&dentry->d_lock); isdir = S_ISDIR(dentry->d_inode->i_mode); if (atomic_read(&dentry->d_count) == 1) { + dentry->d_flags ...
0fc377bd648d1935ea34665239e3f0a274b71698
Analyze and fix the following issue in the Linux kernel code: sysctl: fix kernel-doc notation and typos
Problem Details: Fix kernel-doc warnings, kernel-doc special characters, and typos in recent kernel/sysctl.c additions. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Amerigo Wang <amwang@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/kernel/sysctl.c b/kernel/sysctl.c index b12583047757..30acc6c87b1b 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2083,20 +2083,20 @@ static void proc_skip_char(char **buf, size_t *size, const char v) #define TMPBUFLEN 22 /** - * proc_get_long - reads an ASCII formated integer from a us...
606c958e2857d29106b8d3b2fc30e22f376c80c5
Analyze and fix the following issue in the Linux kernel code: MIPS: Octeon: Serial port fixes for OCTEON simulator.
Problem Details: For the simulator, fake a slow clock to get fast output. In prom_putchar we have to mask the value so the simulator doesn't ASSERT when printing non-ASCII characters. Signed-off-by: David Daney <ddaney@caviumnetworks.com> To: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/...
```diff diff --git a/arch/mips/cavium-octeon/serial.c b/arch/mips/cavium-octeon/serial.c index 8240728d485a..83eac37a1ff9 100644 --- a/arch/mips/cavium-octeon/serial.c +++ b/arch/mips/cavium-octeon/serial.c @@ -65,7 +65,11 @@ static void __init octeon_uart_set_common(struct plat_serial8250_port *p) p->type = PORT_OCT...
142a2ceea793b4d134757c226daeb4101d649df0
Analyze and fix the following issue in the Linux kernel code: MIPS: AR7: prevent race between clock initialization and devices registration
Problem Details: ar7_regiser_devices needs ar7_clocks_init to have been called first, however clock.o is currently linked later due to its order in the Makefile, therefore ar7_clocks_init always gets called later than ar7_register_devices because both have the same initcall level. Fix this by moving ar7_register_device...
```diff diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c index 1d4a466ccb6f..566f2d7f2ea3 100644 --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c @@ -647,4 +647,4 @@ static int __init ar7_register_devices(void) return 0; } -arch_initcall(ar7_register_devices); +device_initcall(ar7_regi...
3e1bf29f73ccb31b99215476b0278f477db1a247
Analyze and fix the following issue in the Linux kernel code: MIPS: BCM63xx: Avoid namespace clash on GPIO_DIR_{IN,OUT}
Problem Details: This is too generic a name, so prefix it with BCM63XX_ to avoid potential namespace clashes when including <asm/gpio.h>. Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> To: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/1171/ Signed-off-by: Ralf Baechle <ralf@lin...
```diff diff --git a/arch/mips/bcm63xx/gpio.c b/arch/mips/bcm63xx/gpio.c index 315bc7f79ce1..f560fe7d38dd 100644 --- a/arch/mips/bcm63xx/gpio.c +++ b/arch/mips/bcm63xx/gpio.c @@ -91,7 +91,7 @@ static int bcm63xx_gpio_set_direction(struct gpio_chip *chip, spin_lock_irqsave(&bcm63xx_gpio_lock, flags); tmp = bcm_gpi...
3804a89bfb84fb8849c72e3bbafddaee539b3430
Analyze and fix the following issue in the Linux kernel code: RTC: rtc-cmos: Fix binary mode support
Problem Details: As a follow-up to the thread about RTC support for some Loongson 2E/2F boards, this patch tries to address the "REVISIT"/"FIXME" comments about rtc binary mode handling and allow rtc to work with rtc in binary mode. I've also raised the message about 24-h mode not supported to warning otherwise, one ma...
```diff diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index ece4dbddc0ea..96e8e70fbf1e 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -238,31 +238,32 @@ static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t) rtc_control = CMOS_READ(RTC_CONTROL); spin_unlock_irq(&rtc...
852151bdb992874b3d625444a8c7c551f3a738b5
Analyze and fix the following issue in the Linux kernel code: MIPS: Oprofile: Loongson: Cleanup of the macros
Problem Details: The _EXL, _KERNEL etc. bits are in the performance control register so use _PERFCTRL prefix instead of _PERFCNT. While at it make the macro more readable, use _ENABLE instead of _INT_EN suffix to describe the interrupt enable bit. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: linux-mips@linux...
```diff diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c index deefcee69a69..515f7790c048 100644 --- a/arch/mips/oprofile/op_model_loongson2.c +++ b/arch/mips/oprofile/op_model_loongson2.c @@ -24,16 +24,16 @@ */ #define LOONGSON2_CPU_TYPE "mips/loongson2" +#define LOON...
7b5fcd694dffd1db294dd4ef9f90911852e422f5
Analyze and fix the following issue in the Linux kernel code: MIPS: Alchemy: Fix up residual devboard poweroff/reboot code.
Problem Details: Clean out stray unused board_reset() calls in pb1x boards, the PB1000 is different from the rest and gets private methods. (Cleanup after 32fd6901a6d8d19f94e4de6be4e4b552ab078620) Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> To: Linux-MIPS <linux-mips@linux-mips.org> Patchwork: http://patchwo...
```diff diff --git a/arch/mips/alchemy/devboards/pb1000/board_setup.c b/arch/mips/alchemy/devboards/pb1000/board_setup.c index b5311d8a29ab..4ef50d86b181 100644 --- a/arch/mips/alchemy/devboards/pb1000/board_setup.c +++ b/arch/mips/alchemy/devboards/pb1000/board_setup.c @@ -27,8 +27,10 @@ #include <linux/gpio.h> #inc...
23ce422748def9652fdc019f740cd7900fa2fe3b
Analyze and fix the following issue in the Linux kernel code: drbd: Null pointer deref fix to the large "multi bio rewrite"
Problem Details: Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
```diff diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 461d9872d4d3..bc9ab7fb2cc7 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -98,6 +98,10 @@ static struct page *page_chain_del(struct page **head, int n) BUG_ON(!head); pag...
fc8ce1941d668c70e57a07f13f5a63e73e5dbff3
Analyze and fix the following issue in the Linux kernel code: drbd: Fix: Do not detach, if a bio with a barrier fails
Problem Details: Introduced a few days ago: commit 45bb912bd5ea4d2b3a270a93cbdf767a0e2df6f5 Author: Lars Ellenberg <lars.ellenberg@linbit.com> Date: Fri May 14 17:10:48 2010 +0200 Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by...
```diff diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 91085c1ab52f..15c96207e626 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c @@ -127,7 +127,7 @@ static void drbd_endio_write_sec_final(struct drbd_epoch_entry *e) __releases(lo drbd_bump...
9fbc630c89fd210e15ffe84fd6e968a2d39000b0
Analyze and fix the following issue in the Linux kernel code: cfg80211: fix crash in cfg80211_set_freq()
Problem Details: Since wdev can be NULL, check it before dereferencing it Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/net/wireless/chan.c b/net/wireless/chan.c index d92d088026bf..b01a6f6397d7 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -50,7 +50,7 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev, struct ieee80211_channel *chan; int result; - if (wdev->iftype == NL80211_IFTY...
b9f2e39d4c2bcd8e94f73ae14450d7764f930a41
Analyze and fix the following issue in the Linux kernel code: wl1271: Fix RX data path frame lengths
Problem Details: The current frame length used by the driver for RX frames is the SPI bus transfer length. This length has padding bytes, which do not belong to the WLAN frame. As there is no other length information in the WLAN frame except the skb length this problem caused for instance extra ESSID's to be listed at...
```diff diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c index 57f4bfd959c8..b98fb643fab0 100644 --- a/drivers/net/wireless/wl12xx/wl1271_rx.c +++ b/drivers/net/wireless/wl12xx/wl1271_rx.c @@ -113,6 +113,8 @@ static void wl1271_rx_handle_data(struct wl1271 *wl, u32 length) ...
073d5eab6fc85b6c278d507a5633b759a85dc878
Analyze and fix the following issue in the Linux kernel code: iwlwifi: fix internal scan race
Problem Details: It is possible for internal scan to race against itself if the device is not returning the scan results from first requests. What happens in this case is the cleanup done during the abort of the first internal scan also cleans up part of the new scan, causing it to access memory it shouldn't. Here are...
```diff diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 107e173112f6..5d3f51ff2f0d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c @@ -376,6 +376,11 @@ void iwl_bg_start_internal_scan(struct work_struct *work) mu...
22fe88d3d85850267ff4535b465794a5768f868a
Analyze and fix the following issue in the Linux kernel code: cfg80211: Fix signal_type comparison
Problem Details: signal_type is enum cfg80211_signal_type. This fixes the gcc warning: scan.c: In function `cfg80211_inform_bss': scan.c:518:6: warning: comparison between `enum cfg80211_signal_type' and `enum nl80211_bss' scan.c: In function `cfg80211_inform_bss_frame': scan.c:574:6: warning: comparison between `enu...
```diff diff --git a/net/wireless/scan.c b/net/wireless/scan.c index a026c6d56bd3..58401d246bda 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -515,7 +515,7 @@ cfg80211_inform_bss(struct wiphy *wiphy, privsz = wiphy->bss_priv_size; - if (WARN_ON(wiphy->signal_type == NL80211_BSS_SIGNAL_UNSPEC && + ...
df96e96f76571c30d903829a7b2ab2b421028790
Analyze and fix the following issue in the Linux kernel code: writeback: fix mixed up arguments to bdi_start_writeback()
Problem Details: The laptop mode timer had the nr_pages and sb_locked arguments mixed up. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
```diff diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 9886424e1864..b289310e2c89 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -707,7 +707,7 @@ void laptop_mode_timer_fn(unsigned long data) */ if (bdi_has_dirty_io(&q->backing_dev_info)) - bdi_start_writeback(&q->backing_dev_info, ...
c2c4986eddaa7dc3d036cb2bfa5c8c5f1f2492a0
Analyze and fix the following issue in the Linux kernel code: writeback: fix problem with !CONFIG_BLOCK compilation
Problem Details: When CONFIG_BLOCK isn't enabled: mm/page-writeback.c: In function 'laptop_mode_timer_fn': mm/page-writeback.c:708: error: dereferencing pointer to incomplete type mm/page-writeback.c:709: error: dereferencing pointer to incomplete type Fix this by essentially eliminating the laptop sync handlers when...
```diff diff --git a/fs/super.c b/fs/super.c index dc72491a19f9..1527e6a0ee35 100644 --- a/fs/super.c +++ b/fs/super.c @@ -37,6 +37,7 @@ #include <linux/kobject.h> #include <linux/mutex.h> #include <linux/file.h> +#include <linux/backing-dev.h> #include <asm/uaccess.h> #include "internal.h" diff --git a/include/...
fa4b9074cd8428958c2adf9dc0c831f46e27c193
Analyze and fix the following issue in the Linux kernel code: buffer: make invalidate_bdev() drain all percpu LRU add caches
Problem Details: invalidate_bdev() should release all page cache pages which are clean and not being used; however, if some pages are still in the percpu LRU add caches on other cpus, those pages are considered in used and don't get released. Fix it by calling lru_add_drain_all() before trying to invalidate pages. Th...
```diff diff --git a/fs/buffer.c b/fs/buffer.c index c9c266db0624..08e422d56996 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -275,6 +275,7 @@ void invalidate_bdev(struct block_device *bdev) return; invalidate_bh_lrus(); + lru_add_drain_all(); /* make sure all lru add caches are flushed */ invalidate_mapping_p...
6423104b6a1e6f0c18be60e8c33f02d263331d5e
Analyze and fix the following issue in the Linux kernel code: writeback: fixups for !dirty_writeback_centisecs
Problem Details: Commit 69b62d01 fixed up most of the places where we would enter busy schedule() spins when disabling the periodic background writeback. This fixes up the sb timer so that it doesn't get hammered on with the delay disabled, and ensures that it gets rearmed if needed when /proc/sys/vm/dirty_writeback_ce...
```diff diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index ff8bac63213f..e6e0cb5437e6 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h @@ -109,6 +109,7 @@ void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb, long nr_pages, int sb_locked)...
b4e6b09738fde057ce885703705f71cc953d0512
Analyze and fix the following issue in the Linux kernel code: interrupt.h: fix fatal kernel-doc error
Problem Details: Fix kernel-doc fatal error: /** beginning a non-kernel-doc comment block: (That alone does not kill kernel-doc, but the 'enum' was totally confusing to it.) Error(/lnx/src/TMP/linux-2.6.34-git6//include/linux/interrupt.h:88): cannot understand prototype: 'enum ' make[2]: *** [Documentation/DocBook/gen...
```diff diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 5137db3317f9..c2331138ca1b 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -78,7 +78,7 @@ enum { IRQTF_AFFINITY, }; -/** +/* * These values can be returned by request_any_context_irq() and * describe the ...
c06bcbfa1ed8daaeb2a262f372b411207891e229
Analyze and fix the following issue in the Linux kernel code: ocfs2: Fix lock inversion in quotas during umount
Problem Details: We cannot cancel delayed work from ocfs2_local_free_info because that is called with dqonoff_mutex held and the work it cancels requires dqonoff_mutex to finish. Cancel the work before acquiring dqonoff_mutex. Acked-by: Joel Becker <Joel.Becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
```diff diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index 551a6bff9f2c..8bd70d4d184d 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c @@ -816,10 +816,6 @@ static int ocfs2_local_free_info(struct super_block *sb, int type) int mark_clean = 1, len; int status; - /* At this point we ...
52a9ee281cfb26fffce1d6c409fb4b1f4aa8a766
Analyze and fix the following issue in the Linux kernel code: ocfs2: Use __dquot_transfer to avoid lock inversion
Problem Details: dquot_transfer() acquires own references to dquots via dqget(). Thus it waits for dq_lock which creates a lock inversion because dq_lock ranks above transaction start but transaction is already started in ocfs2_setattr(). Fix the problem by passing own references directly to __dquot_transfer. Acked-by...
```diff diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index e127c53ec2e7..97e54b9e654b 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -933,9 +933,8 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) struct ocfs2_super *osb = OCFS2_SB(sb); struct buffer_head *bh = NULL; handle_t *handle = NULL...
741e128933448e589a85286e535078b24f4cf568
Analyze and fix the following issue in the Linux kernel code: ocfs2: Fix NULL pointer deref when writing local dquot
Problem Details: commit_dqblk() can write quota info to global file. That is actually a bad thing to do because if we are just modifying local quota file, we are not prepared (do not hold proper locks, do not have transaction credits) to do a modification of the global quota file. So do not use commit_dqblk() and inste...
```diff diff --git a/fs/ocfs2/quota.h b/fs/ocfs2/quota.h index 903ffa933d53..196fcb52d95d 100644 --- a/fs/ocfs2/quota.h +++ b/fs/ocfs2/quota.h @@ -109,6 +109,7 @@ int ocfs2_read_quota_phys_block(struct inode *inode, u64 p_block, struct buffer_head **bh); int ocfs2_create_local_dquot(struct dquot *dquot); int ocf...
832d09cf1438bd172f69478bde74f20f05ec0115
Analyze and fix the following issue in the Linux kernel code: ocfs2: Fix estimate of credits needed for quota allocation
Problem Details: We were missing reservation of a journal credit for modification of quota file inode when creating new dquot structure in the global quota file. Acked-by: Joel Becker <Joel.Becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
```diff diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index 1e3e0d5b3ae7..734995823740 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c @@ -468,9 +468,10 @@ static int ocfs2_global_qinit_alloc(struct super_block *sb, int type) static int ocfs2_calc_global_qinit_credits(struct super...
fb8dd8d780140a3f0e9074831a59054fec6cc451
Analyze and fix the following issue in the Linux kernel code: ocfs2: Fix quota locking
Problem Details: OCFS2 had three issues with quota locking: a) When reading dquot from global quota file, we started a transaction while holding dqio_mutex which is prone to deadlocks because other paths do it the other way around b) During ocfs2_sync_dquot we were not protected against concurrent writers on t...
```diff diff --git a/fs/ocfs2/quota.h b/fs/ocfs2/quota.h index c7623430ca3c..903ffa933d53 100644 --- a/fs/ocfs2/quota.h +++ b/fs/ocfs2/quota.h @@ -104,10 +104,11 @@ static inline int ocfs2_global_release_dquot(struct dquot *dquot) int ocfs2_lock_global_qf(struct ocfs2_mem_dqinfo *oinfo, int ex); void ocfs2_unlock_g...
bc8e5f07392f05c47c8bdeff4f7098db440d065c
Analyze and fix the following issue in the Linux kernel code: quota: Refactor dquot_transfer code so that OCFS2 can pass in its references
Problem Details: Currently, __dquot_transfer() acquires its own references of dquot structures that will be put into inode. But for OCFS2, this creates a lock inversion between dq_lock (waited on in dqget) and transaction start (started in ocfs2_setattr). Currently, deadlock is impossible because dq_lock is acquired on...
```diff diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 1056a21f0300..655a4c52b8c3 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1703,16 +1703,19 @@ EXPORT_SYMBOL(dquot_free_inode); /* * Transfer the number of inode and blocks from one diskquota to an other. + * On success, dquot references in tr...
da8d1ba22fa1fd0c0e541a43d75ebb062589b14b
Analyze and fix the following issue in the Linux kernel code: suppress warning: "quotatypes" defined but not used
Problem Details: Suppress compilation warning: "quotatypes" defined but not used. quotatypes is used only when CONFIG_QUOTA_DEBUG or CONFIG_PRINT_QUOTA_WARNING is/are defined. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
```diff diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 05c590e10ac2..ae766056350d 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -132,7 +132,9 @@ static __cacheline_aligned_in_smp DEFINE_SPINLOCK(dq_state_lock); __cacheline_aligned_in_smp DEFINE_SPINLOCK(dq_data_lock); EXPORT_SYMBOL(dq_data_lock); ...
5277970878a32e437b27296e34c592e5d351f11d
Analyze and fix the following issue in the Linux kernel code: ext3: Fix waiting on transaction during fsync
Problem Details: log_start_commit() returns 1 only when it started a transaction commit. Thus in case transaction commit is already running, we fail to wait for the commit to finish. Fix the issue by always waiting for the commit regardless of the log_start_commit return value. Signed-off-by: Jan Kara <jack@suse.cz>
```diff diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c index 8209f266e9ad..26289e8f4163 100644 --- a/fs/ext3/fsync.c +++ b/fs/ext3/fsync.c @@ -48,7 +48,7 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync) struct inode *inode = dentry->d_inode; struct ext3_inode_info *ei = EXT3_I(inode); ...
41d1a636b813867339db52e12377ca132d54700f
Analyze and fix the following issue in the Linux kernel code: ext3: init statistics after journal recovery v2
Problem Details: Currently block/inode/dir counters are initialized before journal was recovered. In fact after journal recovery this info will probably change which results in incorrect numbers returned from statfs(2). BUG:#15768 Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jan Kara <jack@suse...
```diff diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 1bee604cc6cd..6b6e49de0916 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -1890,21 +1890,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s...
70ca0a42fe1702ac0784386c44b05d18ee5f1f9e
Analyze and fix the following issue in the Linux kernel code: Fix networking tree iscsi_tcp.c mis-merge
Problem Details: The removal of the 'waitqueue_active()' test in commit d7d05548a6 ("[SCSI] iscsi_tcp: fix relogin/shutdown hang") got incorrectly resolved by David when he back-merged the main git tree into the networking tree in commit 278554bd65 ("Merge branch 'master' of master.kernel.org:..."). There was a conten...
```diff diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 7608310e19ee..bf55d3057413 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c @@ -601,7 +601,7 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx)...
2086ca482f89950410527425913ca48d948e9622
Analyze and fix the following issue in the Linux kernel code: i2c-algo-pca: Fix coding style issues
Problem Details: Fix up some coding style issues. i2c-algo-pca.c has been built successfully after applying this patch and the binary object is still exactly the same. Other issues found by checkpatch.pl were voluntarily not fixed, either to keep readability, or because of false positive errors. Signed-off-by: Farid H...
```diff diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c index dcdaf8e675bf..2b9a8f54bb2c 100644 --- a/drivers/i2c/algos/i2c-algo-pca.c +++ b/drivers/i2c/algos/i2c-algo-pca.c @@ -109,13 +109,13 @@ static void pca_stop(struct i2c_algo_pca_data *adap) * returns after the address has been...
ae5624fc36f7b9113df56c2e9b3069fefbb7117e
Analyze and fix the following issue in the Linux kernel code: i2c-dev: Fix all coding style issues
Problem Details: Fix all coding style issues found by checkpatch.pl. Signed-off-by: Farid Hammane <farid.hammane@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index c507204a8c7d..e0694e4d86c7 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -35,7 +35,7 @@ #include <linux/i2c.h> #include <linux/i2c-dev.h> #include <linux/jiffies.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> st...
7225acf4aa2855787184af92febedd92284776ee
Analyze and fix the following issue in the Linux kernel code: i2c-core: Fix some coding style issues
Problem Details: Fix up coding style issues found by the checkpatch.pl tool. Signed-off-by: Farid Hammane <farid.hammane@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 7c469a62c3c1..db3c9f3a7647 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -1221,10 +1221,10 @@ EXPORT_SYMBOL(i2c_transfer); * * Returns negative errno, or else the number of bytes written. */ -int i2c_master_send(struc...
b8680784875b26a2876df5959673a496d56af673
Analyze and fix the following issue in the Linux kernel code: i2c-gpio: Move initialization code to subsys_initcall()
Problem Details: GPIO driven I2C bus can be used for controlling the PMIC chip. The example of such configuration is Samsung Aquila board. This patch moves initialization code to subsys_initcall() to ensure that the i2c bus is available early so the regulators can be quickly probed and available for other devices on t...
```diff diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index c21077d248af..d9aa9a649e35 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c @@ -211,7 +211,7 @@ static int __init i2c_gpio_init(void) return ret; } -module_init(i2c_gpio_init); +subsys_initcall(i2...
3fb21c64b63e2a98755aaad7b90ba9b711491b7e
Analyze and fix the following issue in the Linux kernel code: i2c-i801: Fix all checkpatch warnings
Problem Details: Fix all checkpatch warnings. No functional changes are made. Signed-off-by: Ivo Manca <pinkel@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
```diff diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 878299cd0ef8..f4b21f2bb8ed 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -352,9 +352,8 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data, do { msleep(1); sta...
a1b3f594dc5faab91d3a218c7019e9b5edd9fe1a
Analyze and fix the following issue in the Linux kernel code: net: Expose all network devices in a namespaces in sysfs
Problem Details: This reverts commit aaf8cdc34ddba08122f02217d9d684e2f9f5d575. Drivers like the ipw2100 call device_create_group when they are initialized and device_remove_group when they are shutdown. Moving them between namespaces deletes their sysfs groups early. In particular the following call chain results. ne...
```diff diff --git a/net/core/dev.c b/net/core/dev.c index 6c820650b80f..d273e4e3ecdc 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1002,15 +1002,10 @@ int dev_change_name(struct net_device *dev, const char *newname) return err; rollback: - /* For now only devices in the initial network namespace - * are ...
d6523ddf2376f39eaa89a4d68a33052d20c138b9
Analyze and fix the following issue in the Linux kernel code: net/sysfs: Fix the bitrot in network device kobject namespace support
Problem Details: I had a couple of stupid bugs in: netns: Teach network device kobjects which namespace they are in. - I duplicated the Kconfig for the NET_NS - The build was broken when sysfs was not compiled in The sysfs breakage is because after I moved the operations for the sysfs to the kobject layer, to make th...
```diff diff --git a/net/Kconfig b/net/Kconfig index f49532053a98..0d68b40fc0e6 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -45,14 +45,6 @@ config COMPAT_NETLINK_MESSAGES menu "Networking options" -config NET_NS - bool "Network namespace support" - default n - depends on EXPERIMENTAL && NAMESPACES - help - All...
1d9e882ba4971f31473dd812da64909f30a6c242
Analyze and fix the following issue in the Linux kernel code: driver-core: fix Typo in drivers/base/core.c for CONFIG_MODULE
Problem Details: In this code section the final S of CONFIG_MODULES was missed making the whole check useless Signed-off-by: Christoph Egger <siccegge@cs.fau.de> Cc: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/base/core.c b/drivers/base/core.c index 17e7d5048b83..9630fbdf4e6c 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1420,7 +1420,7 @@ struct device *__root_device_register(const char *name, struct module *owner) return ERR_PTR(err); } -#ifdef CONFIG_MODULE /* gotta find...
1704f47b50b5d9e1b825e43e1baaf2c5897baf03
Analyze and fix the following issue in the Linux kernel code: lockdep: Add novalidate class for dev->mutex conversion
Problem Details: The conversion of device->sem to device->mutex resulted in lockdep warnings. Create a novalidate class for now until the driver folks come up with separate classes. That way we have at least the basic mutex debugging coverage. Add a checkpatch error so the usage is reserved for device->mutex. [ tglx:...
```diff diff --git a/drivers/base/core.c b/drivers/base/core.c index cf507a7d200c..4c5be85016b6 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -559,6 +559,7 @@ void device_initialize(struct device *dev) kobject_init(&dev->kobj, &device_ktype); INIT_LIST_HEAD(&dev->dma_pools); mutex_init(&dev->mutex...
3142788b7967ccfd2f1813ee9e11aeb1e1cf7de2
Analyze and fix the following issue in the Linux kernel code: drivers/base: Convert dev->sem to mutex
Problem Details: The semaphore is semantically a mutex. Convert it to a real mutex and fix up a few places where code was relying on semaphore.h to be included by device.h, as well as the users of the trylock function, as that value is now reversed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Gr...
```diff diff --git a/drivers/base/core.c b/drivers/base/core.c index e11c8c3e7416..cf507a7d200c 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -20,7 +20,6 @@ #include <linux/notifier.h> #include <linux/genhd.h> #include <linux/kallsyms.h> -#include <linux/semaphore.h> #include <linux/mutex.h> #inclu...
fbb88fadf7dc2dd6d0d1aa88ff521b2f8552996a
Analyze and fix the following issue in the Linux kernel code: driver-core: fix potential race condition in drivers/base/dd.c
Problem Details: This patch fix a potential race condition in the driver_bound() function in the file driver/base/dd.c. The broadcast of the BUS_NOTIFY_BOUND_DRIVER notifier should be done after adding the new device to the driver list. Otherwise notifier listener will fail if they use functions like usb_find_interfac...
```diff diff --git a/drivers/base/dd.c b/drivers/base/dd.c index c89291f8a16b..503c2620bbcc 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -40,11 +40,11 @@ static void driver_bound(struct device *dev) pr_debug("driver: '%s': %s: bound to device '%s'\n", dev_name(dev), __func__, dev->driver->name); + ...
6f18ff91d926ab411749a199b06a49f6bc72e9af
Analyze and fix the following issue in the Linux kernel code: Driver core: Reduce the level of request_firmware() messages
Problem Details: The messages from _request_firmware() informing that firmware is being requested or built-in firmware is going to be used are printed at KERN_INFO, which produces lots of noise on systems with huge numbers of AMD CPUs. Reduce the level of these messages to KERN_DEBUG to get rid of that noise. Signed-...
```diff diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 4c70b9148b28..8e6c62b4f512 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -507,15 +507,14 @@ _request_firmware(const struct firmware **firmware_p, const char *name, builtin++) { if (strc...
db1afffab0b5d9f6d31f8f4bea44c9cb3bc59351
Analyze and fix the following issue in the Linux kernel code: kref: remove kref_set
Problem Details: Of the three uses of kref_set in the kernel: One really should be kref_put as the code is letting go of a reference, Two really should be kref_init because the kref is being initialised. This suggests that making kref_set available encourages bad code. So fix the three uses and remove kref_...
```diff diff --git a/include/linux/kref.h b/include/linux/kref.h index baf4b9e4b194..6cc38fc07ab7 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h @@ -21,7 +21,6 @@ struct kref { atomic_t refcount; }; -void kref_set(struct kref *kref, int num); void kref_init(struct kref *kref); void kref_get(struct ...
dd336c554d8926c3348a2d5f2a5ef5597f6d1a06
Analyze and fix the following issue in the Linux kernel code: firmware_class: fix memory leak - free allocated pages
Problem Details: fix memory leak introduced by the patch 6e03a201bbe: firmware: speed up request_firmware() 1. vfree won't release pages there were allocated explicitly and mapped using vmap. The memory has to be vunmap-ed and the pages needs to be freed explicitly 2. page array is moved into the 'struct firmware' so...
```diff diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 985da11174e7..4c70b9148b28 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -130,6 +130,17 @@ static ssize_t firmware_loading_show(struct device *dev, return sprintf(buf, "%d\n", loading); } +s...
cdc6e3d3968052cebb2f2ddcd742bff29fbd1a90
Analyze and fix the following issue in the Linux kernel code: drivers/base/cpu.c: fix the output from /sys/devices/system/cpu/offline
Problem Details: Without CONFIG_CPUMASK_OFFSTACK, simply inverting cpu_online_mask leads to CPUs beyond nr_cpu_ids to be displayed twice and CPUs not even possible to be displayed as offline. Signed-off-by: Jan Beulich <jbeulich@novell.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au...
```diff diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index f35719aab3c1..251acea3d359 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -186,7 +186,7 @@ static ssize_t print_cpus_offline(struct sysdev_class *class, /* display offline cpus < nr_cpu_ids */ if (!alloc_cpumask_var(&offline, GFP_KERNEL...
0dbb5671921b6dad2396090ef81a3efee1ae7da1
Analyze and fix the following issue in the Linux kernel code: serial: Tidy REMOTE_DEBUG
Problem Details: REMOTE_DEBUG does already appear in 2.2 kernel sources but didn't appear as a config Option in the initial git import 2.6.12-rc. It's currently just used in one single place of the linux kernel and should probably be dropped totally Signed-off-by: Christoph Egger <siccegge@cs.fau.de> Signed-off-by: Gr...
```diff diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index 78a62ebe75c7..ecbe479c7d68 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -176,23 +176,6 @@ static void config_setup(struct cyclades_port *); static void show_status(int); #endif -#ifdef CONFIG_REMOTE_DEBUG -stat...
e114474cf5c7fe7ab94dd4f5938ffa51c9af77c4
Analyze and fix the following issue in the Linux kernel code: serial: bfin_sport_uart: Use resource size to fix off-by-one error
Problem Details: Use the resource_size function instead of manually calculating the resource size. This actually fixes an off-by-one error. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c index 66cda2290de0..e57fb3d228e2 100644 --- a/drivers/serial/bfin_sport_uart.c +++ b/drivers/serial/bfin_sport_uart.c @@ -774,8 +774,7 @@ static int __devinit sport_uart_probe(struct platform_device *pdev) goto out_error_free_p...
ccc5ca8d4cadc141d6c97ec0213cdd676616a11d
Analyze and fix the following issue in the Linux kernel code: tty: fix obsolete comment on tty_insert_flip_string_fixed_flag
Problem Details: Comment was not updated when tty_insert_flip_string was generalised. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/char/tty_buffer.c b/drivers/char/tty_buffer.c index 7ee52164d474..cc1e9850d655 100644 --- a/drivers/char/tty_buffer.c +++ b/drivers/char/tty_buffer.c @@ -238,7 +238,7 @@ EXPORT_SYMBOL_GPL(tty_buffer_request_room); * @size: size * * Queue a series of bytes to the tty buffering. All the...
24cd73a3942f3df214d7953f0cfd65d5085fa583
Analyze and fix the following issue in the Linux kernel code: serial: timbuart: make sure last byte is sent when port is closed
Problem Details: Fix a problem in early versions of the FPGA IP. In certain situations the IP reports that the FIFO is empty, but a byte is still clocked out. If a flush is done at that point the currently clocked byte is canceled. This causes incompatibilities with the upper layers when a port is closed, it waits u...
```diff diff --git a/drivers/serial/timbuart.c b/drivers/serial/timbuart.c index 62f389fdc2a3..67ca642713b8 100644 --- a/drivers/serial/timbuart.c +++ b/drivers/serial/timbuart.c @@ -68,12 +68,22 @@ static void timbuart_start_tx(struct uart_port *port) tasklet_schedule(&uart->tasklet); } +static unsigned int timbu...
3f3a978b9f4a513610b32f16670914006a61067f
Analyze and fix the following issue in the Linux kernel code: serial: bfin_sport_uart: shorten the SPORT TX waiting loop
Problem Details: The waiting loop to stop SPORT TX from TX interrupt is too long. This may block the SPORT RX interrupts and cause the RX FIFO to overflow. So, do stop sport TX only after the last char in TX FIFO is moved into the shift register. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike...
```diff diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c index c88f8ad3ff82..6991c3605f9c 100644 --- a/drivers/serial/bfin_sport_uart.c +++ b/drivers/serial/bfin_sport_uart.c @@ -271,7 +271,13 @@ static void sport_uart_tx_chars(struct sport_uart_port *up) } if (uart_circ_empty(xmit...
ead4046b2fdfd69acc4272e693afd249ad3eb689
Analyze and fix the following issue in the Linux kernel code: ALSA: pcm: fix the fix of the runtime->boundary calculation
Problem Details: Commit 7910b4a1db63fefc3d291853d33c34c5b6352e8e in 2.6.34 changed the runtime->boundary calculation to make this value a multiple of both the buffer_size and the period_size, because the latter is assumed by the runtime->hw_ptr_interrupt calculation. However, due to the lack of a ioctl that could read...
```diff diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index a2ff86189d2a..22aff180dd1f 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -439,8 +439,13 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, snd_pcm_playback_silence(substream, new_hw_ptr); if (in_interr...
d60805ad470aef52465f3dc982212f559d9f661b
Analyze and fix the following issue in the Linux kernel code: Blackfin: print out the faulting insn in the trace output
Problem Details: Print out the faulting instruction so when people send traces as part of bug reports, we have a better idea of what is going on. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
```diff diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin/kernel/trace.c index 6e37a8765bc0..5aa0d5e4e704 100644 --- a/arch/blackfin/kernel/trace.c +++ b/arch/blackfin/kernel/trace.c @@ -19,6 +19,7 @@ #include <asm/trace.h> #include <asm/fixed_code.h> #include <asm/traps.h> +#include <asm/irq_handler.h> v...
598357eba6a55d27ddc7ead80ebb83fe1aad9b83
Analyze and fix the following issue in the Linux kernel code: perf: Fix getline undeclared
Problem Details: We need to have stdio.h included with _GNU_SOURCEfopr getline, which is broken with the inclusion of build-id.h. Keep util.h included first in hist.c Fixes: util/hist.c: Dans la fonction «hist_entry__parse_objdump_line» : util/hist.c:938: attention : déclaration implicite de la fonction « «getline»...
```diff diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 739c39fd0ade..009ad76b0879 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1,5 +1,5 @@ -#include "build-id.h" #include "util.h" +#include "build-id.h" #include "hist.h" #include "session.h" #include "sort.h" ```
73d5e8f77e88a4d3a154dfdbb4ed2cf461b7bf21
Analyze and fix the following issue in the Linux kernel code: HID: fix up 'EMBEDDED' mess in Kconfig
Problem Details: The whole point of making some of the drivers automatically selected unless 'EMBEDDED' was to handle quirks transparently after their separation from the generic core. Over time, some of the later-added quirks grew into more standalone drivers, implementing non-trivial features a being larger than a f...
```diff diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 339c1eaa55ac..76ba59b9fea1 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -129,9 +129,8 @@ config HID_CYPRESS Support for cypress mouse and barcode readers. config HID_DRAGONRISE - tristate "DragonRise Inc. support" if EMBEDDED + t...
44ebaa5de1f922965d8aa215a6da729341b3deb2
Analyze and fix the following issue in the Linux kernel code: ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK
Problem Details: When using MCLK is configured for 19.2 Mhz, clock slicer should be enabled and HPPLL should be bypassed in clock path. Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>...
```diff diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index af36346ff336..85dd4fb4c681 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -928,7 +928,7 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai, case 19200000: /* mclk input, pll disabled */...
adb8e118f288dc4c569ac9a89010b81a4745fbf0
Analyze and fix the following issue in the Linux kernel code: perf: Fix wakeup storm for RO mmap()s
Problem Details: RO mmap()s don't update the tail pointer, so comparing against it for determining the written data size doesn't really do any good. Keep track of when we last did a wakeup, and compare against that. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> ...
```diff diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 7cd7b356447d..7098ebbb3b3a 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -599,7 +599,7 @@ struct perf_mmap_data { local_t head; /* write position */ local_t nest; /* nested writers */ loc...
76cc8b13a6e41b537fd262b600da1571314add62
Analyze and fix the following issue in the Linux kernel code: net: fix problem in dequeuing from input_pkt_queue
Problem Details: Fix some issues introduced in batch skb dequeuing for input_pkt_queue. The primary issue it that the queue head must be incremented only after a packet has been processed, that is only after __netif_receive_skb has been called. This is needed for the mechanism to prevent OOO packet in RFS. Also when ...
```diff diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a1bff6518166..256419583d9d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1407,17 +1407,25 @@ struct softnet_data { struct softnet_data *rps_ipi_next; unsigned int cpu; unsigned int input_queue_head; + u...
60adec6226bbcf061d4c2d10944fced209d1847d
Analyze and fix the following issue in the Linux kernel code: powerpc/kdump: Fix race in kdump shutdown
Problem Details: When we are crashing, the crashing/primary CPU IPIs the secondaries to turn off IRQs, go into real mode and wait in kexec_wait. While this is happening, the primary tears down all the MMU maps. Unfortunately the primary doesn't check to make sure the secondaries have entered real mode before doing th...
```diff diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c index cca7c8fafc1c..8c066d6a8e4b 100644 --- a/arch/powerpc/kernel/crash.c +++ b/arch/powerpc/kernel/crash.c @@ -162,6 +162,32 @@ static void crash_kexec_prepare_cpus(int cpu) /* Leave the IPI callback set */ } +/* wait for all the CPUs ...
1fc711f7ffb01089efc58042cfdbac8573d1b59a
Analyze and fix the following issue in the Linux kernel code: powerpc/kexec: Fix race in kexec shutdown
Problem Details: In kexec_prepare_cpus, the primary CPU IPIs the secondary CPUs to kexec_smp_down(). kexec_smp_down() calls kexec_smp_wait() which sets the hw_cpu_id() to -1. The primary does this while leaving IRQs on which means the primary can take a timer interrupt which can lead to the IPIing one of the secondar...
```diff diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h index 7e06b43720d3..a6ca6da1430b 100644 --- a/arch/powerpc/include/asm/kexec.h +++ b/arch/powerpc/include/asm/kexec.h @@ -31,6 +31,10 @@ #define KEXEC_ARCH KEXEC_ARCH_PPC #endif +#define KEXEC_STATE_NONE 0 +#define KEXEC_STATE_...
095c7965f4dc870ed2b65143b1e2610de653416c
Analyze and fix the following issue in the Linux kernel code: powerpc: Use more accurate limit for first segment memory allocations
Problem Details: Author: Milton Miller <miltonm@bga.com> On large machines we are running out of room below 256MB. In some cases we only need to ensure the allocation is in the first segment, which may be 256MB or 1TB. Add slb0_limit and use it to specify the upper limit for the irqstack and emergency stacks. On a l...
```diff diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index cea66987a6ea..f3fb5a79de52 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -424,9 +424,18 @@ void __init setup_system(void) DBG(" <- setup_system()\n"); } +static u64 slb0_limit(void) +{ +...
0644079410065567e3bb31fcb8e6441f2b7685a9
Analyze and fix the following issue in the Linux kernel code: powerpc/kdump: CPUs assume the context of the oopsing CPU
Problem Details: We wrap the crash_shutdown_handles[] calls with longjmp/setjmp, so if any of them fault we can recover. The problem is we add a hook to the debugger fault handler hook which calls longjmp unconditionally. This first part of kdump is run before we marshall the other CPUs, so there is a very good chance...
```diff diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c index 341d8af6f33e..7ced58dacb12 100644 --- a/arch/powerpc/kernel/crash.c +++ b/arch/powerpc/kernel/crash.c @@ -347,10 +347,12 @@ int crash_shutdown_unregister(crash_shutdown_t handler) EXPORT_SYMBOL(crash_shutdown_unregister); static un...
426b6cb478e60352a463a0d1ec75c1c9fab30b13
Analyze and fix the following issue in the Linux kernel code: powerpc/crashdump: Do not fail on NULL pointer dereferencing
Problem Details: Signed-off-by: Maxim Uvarov <muvarov@gmail.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
```diff diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c index 6f4613dd05ef..341d8af6f33e 100644 --- a/arch/powerpc/kernel/crash.c +++ b/arch/powerpc/kernel/crash.c @@ -375,6 +375,9 @@ void default_machine_crash_shutdown(struct pt_regs *regs) for_each_irq(i) { struct irq_desc *desc = irq_to_d...
ce47c1c45b2b17ad07af82c775f27cc5196080f8
Analyze and fix the following issue in the Linux kernel code: powerpc/eeh: Fix oops when probing in early boot
Problem Details: If we take an EEH error early enough, we oops: Call Trace: [c000000010483770] [c000000000013ee4] .show_stack+0xd8/0x218 (unreliable) [c000000010483850] [c000000000658940] .dump_stack+0x28/0x3c [c0000000104838d0] [c000000000057a68] .eeh_dn_check_failure+0x2b8/0x304 [c000000010483990] [c0000000000259c8]...
```diff diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 7df7fbb7cacb..34b7dc12e731 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c @@ -749,7 +749,7 @@ static void __rtas_set_slot_reset(struct pci_dn *pdn) /* Determine type of ...
abb17f9c3a92c5acf30e749efdf0419b7f50a5b8
Analyze and fix the following issue in the Linux kernel code: powerpc: Use common cpu_die (fixes SMP+SUSPEND build)
Problem Details: Configuring a powerpc 32 bit kernel for both SMP and SUSPEND turns on CPU_HOTPLUG to enable disable_nonboot_cpus to be called by the common suspend code. Previously the definition of cpu_die for ppc32 was in the powermac platform code, causing it to be undefined if that platform as not selected. arch...
```diff diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 914389158a9b..cea66987a6ea 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -573,12 +573,6 @@ void ppc64_boot_msg(unsigned int src, const char *msg) printk("[boot]%04x %s\n", src, msg); } -...
ca5d0674c37840366f04a7bbfbf78e7b5f3ce0a4
Analyze and fix the following issue in the Linux kernel code: powerpc: Fix string library functions
Problem Details: The powerpc strncmp implementation does not correctly handle a zero length, despite the claim in 0119536cd314ef95553604208c25bc35581f7f0a (Add hand-coded assembly strcmp). Additionally, all the length arguments are size_t, not int, so use PPC_LCMPI and eq instead of cmpwi and le throughout. Signed-of...
```diff diff --git a/arch/powerpc/lib/string.S b/arch/powerpc/lib/string.S index 3ac0cd3a5373..455881a5563f 100644 --- a/arch/powerpc/lib/string.S +++ b/arch/powerpc/lib/string.S @@ -28,7 +28,7 @@ _GLOBAL(strcpy) /* This clears out any unused part of the destination buffer, just as the libc version does. -- paulu...
7358650e9e9a81c854dc4582b4193eb5ea500bf6
Analyze and fix the following issue in the Linux kernel code: powerpc/rtasd: Don't start event scan if scan rate is zero
Problem Details: There appear to be Pegasos systems which have the rtas-event-scan RTAS tokens, but on which the event scan always fails. They also have an event-scan-rate property containing 0, which means call event scan 0 times per minute. So interpret a scan rate of 0 to mean don't scan at all. This fixes the prob...
```diff diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c index e907ca66f75a..638883e23e3a 100644 --- a/arch/powerpc/kernel/rtasd.c +++ b/arch/powerpc/kernel/rtasd.c @@ -490,6 +490,12 @@ static int __init rtas_init(void) return -ENODEV; } + if (!rtas_event_scan_rate) { + /* Broken firmware:...
1f01bfd202bc539bccd282befa2bbdb8d6ad80ee
Analyze and fix the following issue in the Linux kernel code: can: SJA1000 add missing spin_lock_init()
Problem Details: As remarked by Sam Ravnborg the spin_lock variable, that has been introduced in commit 57c8a456640fa3ca777652f11f2db4179a3e66b6 ("can: Fix SJA1000 command register writes on SMP systems") has not been initialized properly. This patch adds the initialization to allow spinlock debugging. Signed-off-by:...
```diff diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index 85f7cbfe8e5f..0a8de01d52f7 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c @@ -599,6 +599,8 @@ struct net_device *alloc_sja1000dev(int sizeof_priv) priv->can.ctrlmode_supported = CAN...
0f0b405cd16f7aaff84a935984cae421897d725d
Analyze and fix the following issue in the Linux kernel code: sh_eth: Fix memleak in sh_mdio_release
Problem Details: Allocated memory for IRQs should be freed when releasing the mii_bus Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 586ed0915a29..501a55ffce57 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -1294,6 +1294,9 @@ static int sh_mdio_release(struct net_device *ndev) /* remove mdio bus info from net_device */ dev_set_drvdata(&ndev->dev, NULL); + /...
622e0ca1cd4d459f5af4f2c65f4dc0dd823cb4c3
Analyze and fix the following issue in the Linux kernel code: gro: Fix bogus gso_size on the first fraglist entry
Problem Details: When GRO produces fraglist entries, and the resulting skb hits an interface that is incapable of TSO but capable of FRAGLIST, we end up producing a bogus packet with gso_size non-zero. This was reported in the field with older versions of KVM that did not set the TSO bits on tuntap. This patch fixes ...
```diff diff --git a/net/core/skbuff.c b/net/core/skbuff.c index c543dd252433..4c11000a96aa 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -2718,6 +2718,7 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) *NAPI_GRO_CB(nskb) = *NAPI_GRO_CB(p); skb_shinfo(nskb)->frag_list = p; skb_shinfo...
5d9b7e2d2db95549aeab129c95d588236137a4c8
Analyze and fix the following issue in the Linux kernel code: drm/radeon: fix power supply kconfig interaction.
Problem Details: radeon needs power supply to get correct PM info so select it at the radeon level not at the kms option. Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 2583ddfcc33e..88910e5a2c77 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -60,6 +60,7 @@ config DRM_RADEON select FW_LOADER select DRM_KMS_HELPER select DRM_TTM + select POWER_SUPPLY help Choose...
365048ff7f977c5983d67b63c47502c5964840e9
Analyze and fix the following issue in the Linux kernel code: drm/radeon: AGP memory is only I/O if the aperture can be mapped by the CPU.
Problem Details: Fixes AGP initialization failure with Apple UniNorth bridges due to trying to ioremap() normal RAM. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 3aa3a65800ab..e9918d88f5b0 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -451,7 +451,7 @@ static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_ ...
45737447ed160faaba036c0709226bf9057f7b72
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms: don't default display priority to high on rs4xx
Problem Details: Seems to cause issues with the sound hardware. Fixes kernel bug 15982: https://bugzilla.kernel.org/show_bug.cgi?id=15982 Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index da85cad1152b..1006549d1570 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -983,8 +983,11 @@ void radeon_update_display_priority(struct radeon_device *rdev) ...
c43ae476a5fef6719f8227a04cab70645f891349
Analyze and fix the following issue in the Linux kernel code: drm/edid: fix typo in 1600x1200@75 mode
Problem Details: Spotted by Scott Bertilson. Fixes fdo bug 28146. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Reviewed-by: Mark Marshall <mark.marshall@csr.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index dfd4f3677f3b..f569ae88ab38 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -587,7 +587,7 @@ static struct drm_display_mode drm_dmt_modes[] = { 1856, 2160, 0, 1200, 1201, 1204, 1250, 0, DRM_MODE_FLA...
4fe1da4ebc18c4c42fa56c228447f68033fce5f0
Analyze and fix the following issue in the Linux kernel code: echi-dbgp: Add kernel debugger support for the usb debug port
Problem Details: This patch adds the capability to use the usb debug port with the kernel debugger. It is also still possible to use this functionality with or without the earlyprintk=dbgpX. It is possible to use the kgdbwait boot argument to debug very early in the kernel start up code. There are two ways to use th...
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 4c44d01c67f4..f5fce483930c 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1127,6 +1127,17 @@ and is between 256 and 4096 characters. It is defined in the file use the ...
61eaf539b9fb4926ed57e38f6545100c3432cf1b
Analyze and fix the following issue in the Linux kernel code: earlyprintk,vga,kdb: Fix \b and \r for earlyprintk=vga with kdb
Problem Details: Allow kdb to work properly with with earlyprintk=vga by interpreting the backspace and carriage return output characters. These interpretation of these characters is used for simple line editing provided in the kdb shell. CC: Thomas Gleixner <tglx@linutronix.de> CC: Ingo Molnar <mingo@redhat.com> CC:...
```diff diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c index b9c830c12b4a..fa99bae75ace 100644 --- a/arch/x86/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c @@ -41,6 +41,14 @@ static void early_vga_write(struct console *con, const char *str, unsigned n) writew(0x720, VGABA...
0b4b3827db386ec6034a5aba1261025b039440c2
Analyze and fix the following issue in the Linux kernel code: x86, kgdb, init: Add early and late debug states
Problem Details: The kernel debugger can operate well before mm_init(), but the x86 hardware breakpoint code which uses the perf api requires that the kernel allocators are initialized. This means the kernel debug core needs to provide an optional arch specific call back to allow the initialization functions to run af...
```diff diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index 95b89d4cb8f1..2b71ec41869f 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c @@ -595,15 +595,16 @@ static struct notifier_block kgdb_notifier = { * specific callbacks. */ int kgdb_arch_init(void) +{ + return register_die_noti...
29c843912a0baa7fa63033fe28e1ca7e796686a5
Analyze and fix the following issue in the Linux kernel code: x86, kgdb: early trap init for early debug
Problem Details: Allow the x86 arch to have early exception processing for the purpose of debugging via the kgdb. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
```diff diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 5a51379dcbe4..7e5c6a60b8ee 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -789,6 +789,8 @@ static inline void wbinvd_halt(void) extern void enable_sep_cpu(void); extern int sysenter_...
4402c153cb9c549cd21d6007ef0dfac50c8d148d
Analyze and fix the following issue in the Linux kernel code: kdb,debug_core: Allow the debug core to receive a panic notification
Problem Details: It is highly desirable to trap into kdb on panic. The debug core will attempt to register as the first in line for the panic notifier. CC: Ingo Molnar <mingo@elte.hu> CC: Andrew Morton <akpm@linux-foundation.org> CC: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Jason Wessel <jason.wessel@...
```diff diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index b38bb25dbbb3..64b5588c9638 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -762,11 +762,28 @@ static struct sysrq_key_op sysrq_dbg_op = { }; #endif +static int kgdb_panic_event(struct notifier_block *self, + ...
6d90634076200af035f1d9dcc8fc11acefd603e9
Analyze and fix the following issue in the Linux kernel code: debug_core,kdb: Allow the debug core to process a recursive debug entry
Problem Details: This allows kdb to debug a crash with in the kms code with a single level recursive re-entry. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
```diff diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index fff59019cca0..b38bb25dbbb3 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -445,6 +445,10 @@ static int kgdb_reenter_check(struct kgdb_state *ks) } printk(KERN_CRIT "KGDB: re-enter exception: ALL breakpoints...
f503b5ae53cb557ac351a668fcac1baab1cef0db
Analyze and fix the following issue in the Linux kernel code: x86,kgdb: Add low level debug hook
Problem Details: The only way the debugger can handle a trap in inside rcu_lock, notify_die, or atomic_notifier_call_chain without a triple fault is to have a low level "first opportunity handler" in the int3 exception handler. Generally this will be something the vast majority of folks will not need, but for those wh...
```diff diff --git a/arch/x86/include/asm/kgdb.h b/arch/x86/include/asm/kgdb.h index e6c6c808489f..006da3687cdc 100644 --- a/arch/x86/include/asm/kgdb.h +++ b/arch/x86/include/asm/kgdb.h @@ -76,4 +76,7 @@ static inline void arch_kgdb_breakpoint(void) #define BREAK_INSTR_SIZE 1 #define CACHE_FLUSH_IS_SAFE 1 +extern ...
ada64e4c98eb5f04a9ca223c5ff9e7ac22ce6404
Analyze and fix the following issue in the Linux kernel code: kgdboc,keyboard: Keyboard driver for kdb with kgdb
Problem Details: This patch adds in the kdb PS/2 keyboard driver. This was mostly a direct port from the original kdb where I cleaned up the code against checkpatch.pl and added the glue to stitch it into kgdb. This patch also enables early kdb debug via kgdbwait and the keyboard. All the access to configure kdb usi...
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index b12bacd252fc..3845e3a84a52 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1121,9 +1121,11 @@ and is between 256 and 4096 characters. It is defined in the file zone if ...
a0de055cf61338549b13079a5677ef2e1b6472ef
Analyze and fix the following issue in the Linux kernel code: kgdb: gdb "monitor" -> kdb passthrough
Problem Details: One of the driving forces behind integrating another front end (kdb) to the debug core is to allow front end commands to be accessible via gdb's monitor command. It is true that you could write gdb macros to get certain data, but you may want to just use gdb to access the commands that are available i...
```diff diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 1d71df66f3fa..1aed37b4c564 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -82,7 +82,7 @@ static int kgdb_use_con; int dbg_switch_cpu; /* Use kdb or gdbserver mode */ -static int dbg_kdb_mode = 1; +int dbg_kdb...
dcc7871128e99458ca86186b7bc8bf27ff0c47b5
Analyze and fix the following issue in the Linux kernel code: kgdb: core changes to support kdb
Problem Details: These are the minimum changes to the kgdb core in order to enable an API to connect a new front end (kdb) to the debug core. This patch introduces the dbg_kdb_mode variable controls where the user level I/O is routed. It will be routed to the gdbstub (kgdb) or to the kdb front end which is a simple s...
```diff diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c index a5b846b9895d..c868a8864117 100644 --- a/arch/arm/kernel/kgdb.c +++ b/arch/arm/kernel/kgdb.c @@ -98,6 +98,11 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task) gdb_regs[_CPSR] = thread_regs->ARM_cpsr; } +void ...
67fc4e0cb931d6b4ccf21248e4199b154478ecea
Analyze and fix the following issue in the Linux kernel code: kdb: core for kgdb back end (2 of 2)
Problem Details: This patch contains the hooks and instrumentation into kernel which live outside the kernel/debug directory, which the kdb core will call to run commands like lsmod, dmesg, bt etc... CC: linux-arch@vger.kernel.org Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Martin Hicks <mo...
```diff diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h index c4b2ea3fbe42..e51b1e81df05 100644 --- a/arch/arm/include/asm/kmap_types.h +++ b/arch/arm/include/asm/kmap_types.h @@ -20,6 +20,7 @@ enum km_type { KM_SOFTIRQ1, KM_L1_CACHE, KM_L2_CACHE, + KM_KDB, KM_TYPE_NR }; di...
e8861129d3c1a64e3c62f459aeb1cd54a55ab045
Analyze and fix the following issue in the Linux kernel code: kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin
Problem Details: The new debug core api requires all architectures that use to debug core to implement a function to set the program counter. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
```diff diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index 2c501ceb1e55..7367aea4ae59 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c @@ -439,6 +439,11 @@ int kgdb_validate_break_address(unsigned long addr) return -EFAULT; } +void kgdb_arch_set_pc(struct pt_regs...
489022cc86ec8817a30226d00d35c67d74dd24a0
Analyze and fix the following issue in the Linux kernel code: kgdb,sh: update superh kgdb exception handling
Problem Details: Implement kgdb_arch_pc() which adjusts the pc if it needs to be adjusted after a software breakpoint trap. Implement kgdb_arch_set_pc() which is a new required function in the kgdb debug core. When processing a single step return zero in the error exception field so that the debug core can distinguis...
```diff diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c index 70c69659b846..efb6d398dec3 100644 --- a/arch/sh/kernel/kgdb.c +++ b/arch/sh/kernel/kgdb.c @@ -237,6 +237,18 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code, return -1; } +unsigned long kgdb_arch_pc(int exception, struc...
c75fbb05b523571c0fdc48d4b968b73f0e20acbb
Analyze and fix the following issue in the Linux kernel code: kgdb,sparc: Add in kgdb_arch_set_pc for sparc
Problem Details: The new debug core api requires all architectures that use to debug core to implement a function to set the program counter. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/arch/sparc/kernel/kgdb_32.c b/arch/sparc/kernel/kgdb_32.c index 04df4edc0073..539243b236fa 100644 --- a/arch/sparc/kernel/kgdb_32.c +++ b/arch/sparc/kernel/kgdb_32.c @@ -158,6 +158,12 @@ void kgdb_arch_exit(void) { } +void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) +{ + regs->pc =...
c433820971ffa854feda6adc17f5f24201354f11
Analyze and fix the following issue in the Linux kernel code: Move kernel/kgdb.c to kernel/debug/debug_core.c
Problem Details: Move kgdb.c in preparation to separate the gdbstub from the debug core and exception handling. CC: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
```diff diff --git a/kernel/Makefile b/kernel/Makefile index 149e18ef1ab1..057472fbc272 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -75,7 +75,7 @@ obj-$(CONFIG_AUDITSYSCALL) += auditsc.o obj-$(CONFIG_GCOV_KERNEL) += gcov/ obj-$(CONFIG_AUDIT_TREE) += audit_tree.o obj-$(CONFIG_KPROBES) += kprobes.o -obj-$(CO...
c0dc72bad9cf21071f5e4005de46f7c8b67a138a
Analyze and fix the following issue in the Linux kernel code: mlx4_core: Fix possible chunk sg list overflow in mlx4_alloc_icm()
Problem Details: If the number of sg entries in the ICM chunk reaches MLX4_ICM_CHUNK_LEN, we must set chunk to NULL even for coherent mappings so that the next time through the loop will allocate another chunk. Otherwise we'll overflow the sg list the next time through the loop. This will lead to memory corruption if...
```diff diff --git a/drivers/net/mlx4/icm.c b/drivers/net/mlx4/icm.c index 57288ca1395f..ef62f1749b8a 100644 --- a/drivers/net/mlx4/icm.c +++ b/drivers/net/mlx4/icm.c @@ -175,9 +175,10 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, if (chunk->nsg <= 0) goto fail; + } + if (chunk...
a901ff715d53c109821cbbd9d7ea1f2a311646a9
Analyze and fix the following issue in the Linux kernel code: ARM: 6139/1: ARMv7: Use the Inner Shareable I-cache on MP
Problem Details: This patch fixes the flush_cache_all for ARMv7 SMP.It was missing from commit b8349b569aae661dea9d59d7d2ee587ccea3336c Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Cc: <stable@kernel.org> Signed-off-by: Russell King <rmk+kernel@arm.lin...
```diff diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index 06a90dcfc60a..37c8157e116e 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -91,7 +91,11 @@ ENTRY(v7_flush_kern_cache_all) THUMB( stmfd sp!, {r4-r7, r9-r11, lr} ) bl v7_flush_dcache_all mov r0, #0 +#ifdef CONFIG_SMP + mc...
e1695307e6b85477afd2421d3b4891ca5bea8300
Analyze and fix the following issue in the Linux kernel code: ARM: 6135/1: mx21/devices: fix USBOTG resource
Problem Details: It got a typo from 988addf82e4c03739375279de73929580a2d4a6a. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Cc: <stable@kernel.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
```diff diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c index b91e412f7b3e..04f36d820ca5 100644 --- a/arch/arm/mach-mx2/devices.c +++ b/arch/arm/mach-mx2/devices.c @@ -483,8 +483,8 @@ int __init mxc_register_gpios(void) #ifdef CONFIG_MACH_MX21 static struct resource mx21_usbhc_resources[] = { ...
c1aa075acb696c374613fded0380c7ad8a96ebf5
Analyze and fix the following issue in the Linux kernel code: USB: ftdi_sio: fix legacy SIO-device header
Problem Details: Length field of header was incorrectly set to available payload space rather than the actual payload size. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 97f2d9c1edd6..050211afc07e 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -1752,10 +1752,10 @@ static int ftdi_prepare_write_buffer(struct usb_serial_port *port, spin_lock_irqsave(&port->lock, ...
313b0d80c1717ffe8f64b455a4d323996748b91a
Analyze and fix the following issue in the Linux kernel code: USB: kl5usb105: fix memory leak
Problem Details: Private data was not freed on error path in startup. Cc: stable <stable@kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index 8eef91ba4b1c..cc0ba38d4748 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c @@ -321,6 +321,7 @@ err_cleanup: usb_free_urb(priv->write_urb_pool[j]); } } + kfree(priv); usb_set_se...
e421fe97adf96a2b1f9d89140ec3e184f0cb7d7c
Analyze and fix the following issue in the Linux kernel code: USB: ir-usb: fix incorrect write-buffer length
Problem Details: Returned length should include header length. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index e7087f9fe479..ccbce4066d04 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c @@ -307,6 +307,7 @@ static int ir_prepare_write_buffer(struct usb_serial_port *port, void *dest, size_t size) { unsigned ch...
f26c2889a4d937371e2ec9b5690ac407f0496634
Analyze and fix the following issue in the Linux kernel code: USB: aircable: fix incorrect write-buffer length
Problem Details: Returned length should include header length. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c index 8a990a763c21..0db6ace16f7b 100644 --- a/drivers/usb/serial/aircable.c +++ b/drivers/usb/serial/aircable.c @@ -95,7 +95,7 @@ static int aircable_prepare_write_buffer(struct usb_serial_port *port, buf[1] = TX_HEADER_1; put_unalig...
cbd3af54642ec1146bac0479538d495fc474318e
Analyze and fix the following issue in the Linux kernel code: USB: usb-storage: trivial debug improvements
Problem Details: Use pr_foo and dev_foo instead of printk. Maybe US_DEBUG* should be replaced too. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index e2798ef2dd19..55c526b81c7c 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -510,6 +510,7 @@ static int get_device_info(struct us_data *us, const struct usb_device_id *id, struct usb_device *dev = us->pusb_dev; ...