]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agoMerge remote-tracking branch 'sound-asoc/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:36:06 +0000 (14:36 +0200)]
Merge remote-tracking branch 'sound-asoc/for-next'

10 years agoMerge remote-tracking branch 'sound/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:36:04 +0000 (14:36 +0200)]
Merge remote-tracking branch 'sound/for-next'

10 years agoMerge remote-tracking branch 'drm-tegra/drm/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:36:01 +0000 (14:36 +0200)]
Merge remote-tracking branch 'drm-tegra/drm/for-next'

Conflicts:
drivers/gpu/drm/tegra/Kconfig

10 years agoMerge remote-tracking branch 'drm-intel/for-linux-next'
Thierry Reding [Thu, 24 Oct 2013 12:35:56 +0000 (14:35 +0200)]
Merge remote-tracking branch 'drm-intel/for-linux-next'

10 years agoMerge remote-tracking branch 'drm/drm-next'
Thierry Reding [Thu, 24 Oct 2013 12:35:53 +0000 (14:35 +0200)]
Merge remote-tracking branch 'drm/drm-next'

Conflicts:
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h

10 years agoMerge remote-tracking branch 'crypto/master'
Thierry Reding [Thu, 24 Oct 2013 12:35:49 +0000 (14:35 +0200)]
Merge remote-tracking branch 'crypto/master'

10 years agoMerge remote-tracking branch 'l2-mtd/master'
Thierry Reding [Thu, 24 Oct 2013 12:35:47 +0000 (14:35 +0200)]
Merge remote-tracking branch 'l2-mtd/master'

10 years agoMerge remote-tracking branch 'bluetooth/master'
Thierry Reding [Thu, 24 Oct 2013 12:35:44 +0000 (14:35 +0200)]
Merge remote-tracking branch 'bluetooth/master'

10 years agoMerge remote-tracking branch 'wireless-next/master'
Thierry Reding [Thu, 24 Oct 2013 12:35:39 +0000 (14:35 +0200)]
Merge remote-tracking branch 'wireless-next/master'

Conflicts:
drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
drivers/net/wireless/iwlwifi/pcie/drv.c

10 years agoMerge remote-tracking branch 'ipsec-next/master'
Thierry Reding [Thu, 24 Oct 2013 12:35:29 +0000 (14:35 +0200)]
Merge remote-tracking branch 'ipsec-next/master'

Conflicts:
net/xfrm/xfrm_policy.c

10 years agoMerge remote-tracking branch 'net-next/master'
Thierry Reding [Thu, 24 Oct 2013 12:35:23 +0000 (14:35 +0200)]
Merge remote-tracking branch 'net-next/master'

Conflicts:
arch/h8300/include/uapi/asm/socket.h
arch/parisc/include/uapi/asm/socket.h

10 years agoMerge remote-tracking branch 'slave-dma/next'
Thierry Reding [Thu, 24 Oct 2013 12:34:17 +0000 (14:34 +0200)]
Merge remote-tracking branch 'slave-dma/next'

10 years agoMerge remote-tracking branch 'dlm/next'
Thierry Reding [Thu, 24 Oct 2013 12:34:15 +0000 (14:34 +0200)]
Merge remote-tracking branch 'dlm/next'

10 years agoMerge remote-tracking branch 'ubi/linux-next'
Thierry Reding [Thu, 24 Oct 2013 12:34:13 +0000 (14:34 +0200)]
Merge remote-tracking branch 'ubi/linux-next'

10 years agoMerge remote-tracking branch 'thermal/next'
Thierry Reding [Thu, 24 Oct 2013 12:34:10 +0000 (14:34 +0200)]
Merge remote-tracking branch 'thermal/next'

10 years agoMerge remote-tracking branch 'idle/next'
Thierry Reding [Thu, 24 Oct 2013 12:34:06 +0000 (14:34 +0200)]
Merge remote-tracking branch 'idle/next'

10 years agoMerge remote-tracking branch 'pm/linux-next'
Thierry Reding [Thu, 24 Oct 2013 12:34:03 +0000 (14:34 +0200)]
Merge remote-tracking branch 'pm/linux-next'

Conflicts:
drivers/i2c/i2c-core.c

10 years agoMerge remote-tracking branch 'libata/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:49 +0000 (14:33 +0200)]
Merge remote-tracking branch 'libata/for-next'

10 years agoMerge remote-tracking branch 'kbuild/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:46 +0000 (14:33 +0200)]
Merge remote-tracking branch 'kbuild/for-next'

10 years agoMerge remote-tracking branch 'v4l-dvb/master'
Thierry Reding [Thu, 24 Oct 2013 12:33:44 +0000 (14:33 +0200)]
Merge remote-tracking branch 'v4l-dvb/master'

10 years agoMerge remote-tracking branch 'hwmon-staging/hwmon-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:42 +0000 (14:33 +0200)]
Merge remote-tracking branch 'hwmon-staging/hwmon-next'

10 years agoMerge remote-tracking branch 'i2c/i2c/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:41 +0000 (14:33 +0200)]
Merge remote-tracking branch 'i2c/i2c/for-next'

10 years agoMerge remote-tracking branch 'hid/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:39 +0000 (14:33 +0200)]
Merge remote-tracking branch 'hid/for-next'

10 years agoMerge remote-tracking branch 'pci/next'
Thierry Reding [Thu, 24 Oct 2013 12:33:38 +0000 (14:33 +0200)]
Merge remote-tracking branch 'pci/next'

10 years agoMerge remote-tracking branch 'vfs/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:34 +0000 (14:33 +0200)]
Merge remote-tracking branch 'vfs/for-next'

Conflicts:
fs/nfs/direct.c
fs/nfs/file.c

10 years agoMerge remote-tracking branch 'xfs/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:30 +0000 (14:33 +0200)]
Merge remote-tracking branch 'xfs/for-next'

10 years agoMerge remote-tracking branch 'ubifs/linux-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:28 +0000 (14:33 +0200)]
Merge remote-tracking branch 'ubifs/linux-next'

10 years agoMerge remote-tracking branch 'v9fs/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:26 +0000 (14:33 +0200)]
Merge remote-tracking branch 'v9fs/for-next'

10 years agoMerge remote-tracking branch 'nfsd/nfsd-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:22 +0000 (14:33 +0200)]
Merge remote-tracking branch 'nfsd/nfsd-next'

10 years agoMerge remote-tracking branch 'nfs/linux-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:19 +0000 (14:33 +0200)]
Merge remote-tracking branch 'nfs/linux-next'

10 years agoMerge remote-tracking branch 'logfs/master'
Thierry Reding [Thu, 24 Oct 2013 12:33:16 +0000 (14:33 +0200)]
Merge remote-tracking branch 'logfs/master'

10 years agoMerge remote-tracking branch 'gfs2/master'
Thierry Reding [Thu, 24 Oct 2013 12:33:14 +0000 (14:33 +0200)]
Merge remote-tracking branch 'gfs2/master'

10 years agoMerge remote-tracking branch 'fuse/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:12 +0000 (14:33 +0200)]
Merge remote-tracking branch 'fuse/for-next'

10 years agoMerge remote-tracking branch 'fscache/fscache'
Thierry Reding [Thu, 24 Oct 2013 12:33:11 +0000 (14:33 +0200)]
Merge remote-tracking branch 'fscache/fscache'

10 years agoMerge remote-tracking branch 'f2fs/dev'
Thierry Reding [Thu, 24 Oct 2013 12:33:10 +0000 (14:33 +0200)]
Merge remote-tracking branch 'f2fs/dev'

10 years agoMerge remote-tracking branch 'ext4/dev'
Thierry Reding [Thu, 24 Oct 2013 12:33:09 +0000 (14:33 +0200)]
Merge remote-tracking branch 'ext4/dev'

10 years agoMerge remote-tracking branch 'ecryptfs/next'
Thierry Reding [Thu, 24 Oct 2013 12:33:08 +0000 (14:33 +0200)]
Merge remote-tracking branch 'ecryptfs/next'

10 years agoMerge remote-tracking branch 'cifs/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:05 +0000 (14:33 +0200)]
Merge remote-tracking branch 'cifs/for-next'

10 years agoMerge remote-tracking branch 'ceph/master'
Thierry Reding [Thu, 24 Oct 2013 12:33:04 +0000 (14:33 +0200)]
Merge remote-tracking branch 'ceph/master'

10 years agoMerge remote-tracking branch 'aio-direct/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:33:02 +0000 (14:33 +0200)]
Merge remote-tracking branch 'aio-direct/for-next'

10 years agoMerge remote-tracking branch 'sh/sh-latest'
Thierry Reding [Thu, 24 Oct 2013 12:32:58 +0000 (14:32 +0200)]
Merge remote-tracking branch 'sh/sh-latest'

Conflicts:
arch/sh/kernel/cpu/sh2a/Makefile
drivers/tty/serial/sh-sci.c
include/linux/serial_sci.h

10 years agoMerge remote-tracking branch 's390/features'
Thierry Reding [Thu, 24 Oct 2013 12:32:52 +0000 (14:32 +0200)]
Merge remote-tracking branch 's390/features'

10 years agoMerge remote-tracking branch 'mpc5xxx/next'
Thierry Reding [Thu, 24 Oct 2013 12:32:50 +0000 (14:32 +0200)]
Merge remote-tracking branch 'mpc5xxx/next'

10 years agoMerge remote-tracking branch 'powerpc/next'
Thierry Reding [Thu, 24 Oct 2013 12:32:50 +0000 (14:32 +0200)]
Merge remote-tracking branch 'powerpc/next'

10 years agoMerge remote-tracking branch 'parisc-hd/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:32:49 +0000 (14:32 +0200)]
Merge remote-tracking branch 'parisc-hd/for-next'

10 years agoMerge remote-tracking branch 'mips/mips-for-linux-next'
Thierry Reding [Thu, 24 Oct 2013 12:32:47 +0000 (14:32 +0200)]
Merge remote-tracking branch 'mips/mips-for-linux-next'

10 years agoMerge remote-tracking branch 'm68k/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:32:44 +0000 (14:32 +0200)]
Merge remote-tracking branch 'm68k/for-next'

10 years agoMerge remote-tracking branch 'ia64/next'
Thierry Reding [Thu, 24 Oct 2013 12:32:40 +0000 (14:32 +0200)]
Merge remote-tracking branch 'ia64/next'

10 years agoMerge remote-tracking branch 'h8300-remove/h8300-remove'
Thierry Reding [Thu, 24 Oct 2013 12:32:38 +0000 (14:32 +0200)]
Merge remote-tracking branch 'h8300-remove/h8300-remove'

Conflicts:
drivers/parport/Kconfig

10 years agoMerge remote-tracking branch 'c6x/for-linux-next'
Thierry Reding [Thu, 24 Oct 2013 12:32:34 +0000 (14:32 +0200)]
Merge remote-tracking branch 'c6x/for-linux-next'

Conflicts:
arch/arm/Kconfig

10 years agoMerge remote-tracking branch 'arm-perf/for-next/perf'
Thierry Reding [Thu, 24 Oct 2013 12:32:31 +0000 (14:32 +0200)]
Merge remote-tracking branch 'arm-perf/for-next/perf'

10 years agoMerge remote-tracking branch 'arm/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:32:29 +0000 (14:32 +0200)]
Merge remote-tracking branch 'arm/for-next'

Conflicts:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

10 years agoMerge remote-tracking branch 'arc/for-next'
Thierry Reding [Thu, 24 Oct 2013 12:32:22 +0000 (14:32 +0200)]
Merge remote-tracking branch 'arc/for-next'

10 years agoMerge remote-tracking branch 'drm-intel-fixes/for-linux-next-fixes'
Thierry Reding [Thu, 24 Oct 2013 12:32:21 +0000 (14:32 +0200)]
Merge remote-tracking branch 'drm-intel-fixes/for-linux-next-fixes'

10 years agoMerge remote-tracking branch 'input-current/for-linus'
Thierry Reding [Thu, 24 Oct 2013 12:32:14 +0000 (14:32 +0200)]
Merge remote-tracking branch 'input-current/for-linus'

10 years agoMerge remote-tracking branch 'tty.current/tty-linus'
Thierry Reding [Thu, 24 Oct 2013 12:32:13 +0000 (14:32 +0200)]
Merge remote-tracking branch 'tty.current/tty-linus'

10 years agoMerge remote-tracking branch 'wireless/master'
Thierry Reding [Thu, 24 Oct 2013 12:32:12 +0000 (14:32 +0200)]
Merge remote-tracking branch 'wireless/master'

10 years agoMerge remote-tracking branch 'ipsec/master'
Thierry Reding [Thu, 24 Oct 2013 12:32:11 +0000 (14:32 +0200)]
Merge remote-tracking branch 'ipsec/master'

10 years agoMerge remote-tracking branch 'net/master'
Thierry Reding [Thu, 24 Oct 2013 12:32:11 +0000 (14:32 +0200)]
Merge remote-tracking branch 'net/master'

10 years agoMerge remote-tracking branch 'arm-current/fixes'
Thierry Reding [Thu, 24 Oct 2013 12:32:07 +0000 (14:32 +0200)]
Merge remote-tracking branch 'arm-current/fixes'

10 years agoDocumentation/pwm: Fix trivial typos
Sachin Kamat [Thu, 24 Oct 2013 08:43:47 +0000 (14:13 +0530)]
Documentation/pwm: Fix trivial typos

Fixes some trivial typos to improve readability.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
10 years agoMerge tag 'md/3.12-fixes' of git://neil.brown.name/md
Linus Torvalds [Thu, 24 Oct 2013 06:45:34 +0000 (07:45 +0100)]
Merge tag 'md/3.12-fixes' of git://neil.brown.name/md

Pull md bugfixes from Neil Brown:
 "Assorted md bug-fixes for 3.12.

  All tagged for -stable releases too"

* tag 'md/3.12-fixes' of git://neil.brown.name/md:
  raid5: avoid finding "discard" stripe
  raid5: set bio bi_vcnt 0 for discard request
  md: avoid deadlock when md_set_badblocks.
  md: Fix skipping recovery for read-only arrays.

10 years agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Thu, 24 Oct 2013 06:44:47 +0000 (07:44 +0100)]
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "This is a set of two fixes which cause oopses (Buslogic, qla2xxx) and
 one fix which may cause a hang because of request miscounting (sd)"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] sd: call blk_pm_runtime_init before add_disk
  [SCSI] qla2xxx: Fix request queue null dereference.
  [SCSI] BusLogic: Fix an oops when intializing multimaster adapter

10 years agoiscsi-target: Implement demo_mode_discovery logic
Thomas Glanzmann [Mon, 7 Oct 2013 21:13:46 +0000 (23:13 +0200)]
iscsi-target: Implement demo_mode_discovery logic

If demo_mode_discovery=0 and generate_node_acls=0 (demo mode dislabed) do
not return TargetName+TargetAddress unless a NodeACL exists.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
10 years agotarget: Export symbol core_tpg_check_initiator_node_acl
Thomas Glanzmann [Mon, 7 Oct 2013 21:13:02 +0000 (23:13 +0200)]
target: Export symbol core_tpg_check_initiator_node_acl

Export symbol core_tpg_check_initiator_node_acl and move prototype from the
private drivers/target/target_core_internal.h to the public
include/target/target_core_fabric.h

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
10 years agoiscsi-target: Add new TPG attribute
Thomas Glanzmann [Mon, 7 Oct 2013 21:12:11 +0000 (23:12 +0200)]
iscsi-target: Add new TPG attribute

Add a new TPG attribute demo_mode_discovery which is enabled by default.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
10 years agoraid1: Add some macros to make code clearly.
majianpeng [Wed, 28 Aug 2013 11:40:46 +0000 (19:40 +0800)]
raid1: Add some macros to make code clearly.

In next patch, we'll use some const parameter.
Using macros will make the code clearly.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agoraid1: Relace raise_barrier/lower_barrrier with freeze_array/unfreeze_array for recon...
majianpeng [Wed, 28 Aug 2013 11:40:33 +0000 (19:40 +0800)]
raid1: Relace raise_barrier/lower_barrrier with freeze_array/unfreeze_array for reconfigure the array.

We used raise_barrier to suspend nornal IO while we reconfigure the
array. Now we replace it with freeze_array.
Raise_barrier only suspends normal IO.  But freeze_array not only susend
nornal io,but it can suspend resync io. For the place where call
raise_barrier for reconfigure, it don't has a problem.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agoraid1: Add a field array_frozen to indicate whether raid in freeze state.
majianpeng [Wed, 28 Aug 2013 11:40:14 +0000 (19:40 +0800)]
raid1: Add a field array_frozen to indicate whether raid in freeze state.

Because the following patch will rewrite the content between normal IO
and resync IO. So we used a parameter to indicate whether raid is in freeze
array.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agomd: Convert use of typedef ctl_table to struct ctl_table
Joe Perches [Tue, 22 Oct 2013 22:29:51 +0000 (15:29 -0700)]
md: Convert use of typedef ctl_table to struct ctl_table

This typedef is unnecessary and should just be removed.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agomd/raid5: avoid deadlock when raid5 array has unack badblocks during md_stop_writes.
NeilBrown [Tue, 22 Oct 2013 00:50:35 +0000 (11:50 +1100)]
md/raid5: avoid deadlock when raid5 array has unack badblocks during md_stop_writes.

When raid5 recovery hits a fresh badblock, this badblock will flagged as unack
badblock until md_update_sb() is called.
But md_stop will take reconfig lock which means raid5d can't call
md_update_sb() in md_check_recovery(), the badblock will always
be unack, so raid5d thread enters an infinite loop and md_stop_write()
can never stop sync_thread. This causes deadlock.

To solve this, when STOP_ARRAY ioctl is issued and sync_thread is
running, we need set md->recovery FROZEN and INTR flags and wait for
sync_thread to stop before we (re)take reconfig lock.

Reported-by: Jianpeng Ma <majianpeng@gmail.com>
Reported-by: Bian Yu <bianyu@kedacom.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agoraid5: relieve lock contention in get_active_stripe()
Shaohua Li [Thu, 12 Sep 2013 01:55:07 +0000 (09:55 +0800)]
raid5: relieve lock contention in get_active_stripe()

track empty inactive list count, so md_raid5_congested() can use it to make
decision.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agoraid5: Retry R5_ReadNoMerge flag when hit a read error.
Bian Yu [Mon, 2 Sep 2013 00:13:02 +0000 (20:13 -0400)]
raid5: Retry R5_ReadNoMerge flag when hit a read error.

Because of block layer merge, one bio fails will cause other bios
which belongs to the same request fails, so raid5_end_read_request
will record all these bios as badblocks.
If retry request with R5_ReadNoMerge flag to avoid bios merge,
badblocks can only record sector which is bad exactly.

test:
hdparm --yes-i-know-what-i-am-doing --make-bad-sector 300000 /dev/sdb
mdadm -C /dev/md0 -l5 -n3 /dev/sd[bcd] --assume-clean
mdadm /dev/md0 -f /dev/sdd
mdadm /dev/md0 -r /dev/sdd
mdadm --zero-superblock /dev/sdd
mdadm /dev/md0 -a /dev/sdd

1. Without this patch:
cat /sys/block/md0/md/rd*/bad_blocks
299776 256
299776 256

2. With this patch:
cat /sys/block/md0/md/rd*/bad_blocks
300000 8
300000 8

Signed-off-by: Bian Yu <bianyu@kedacom.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agoraid5: relieve lock contention in get_active_stripe()
Shaohua Li [Tue, 10 Sep 2013 07:37:56 +0000 (15:37 +0800)]
raid5: relieve lock contention in get_active_stripe()

get_active_stripe() is the last place we have lock contention. It has two
paths. One is stripe isn't found and new stripe is allocated, the other is
stripe is found.

The first path basically calls __find_stripe and init_stripe. It accesses
conf->generation, conf->previous_raid_disks, conf->raid_disks,
conf->prev_chunk_sectors, conf->chunk_sectors, conf->max_degraded,
conf->prev_algo, conf->algorithm, the stripe_hashtbl and inactive_list. Except
stripe_hashtbl and inactive_list, other fields are changed very rarely.

With this patch, we split inactive_list and add new hash locks. Each free
stripe belongs to a specific inactive list. Which inactive list is determined
by stripe's lock_hash. Note, even a stripe hasn't a sector assigned, it has a
lock_hash assigned. Stripe's inactive list is protected by a hash lock, which
is determined by it's lock_hash too. The lock_hash is derivied from current
stripe_hashtbl hash, which guarantees any stripe_hashtbl list will be assigned
to a specific lock_hash, so we can use new hash lock to protect stripe_hashtbl
list too. The goal of the new hash locks introduced is we can only use the new
locks in the first path of get_active_stripe(). Since we have several hash
locks, lock contention is relieved significantly.

The first path of get_active_stripe() accesses other fields, since they are
changed rarely, changing them now need take conf->device_lock and all hash
locks. For a slow path, this isn't a problem.

If we need lock device_lock and hash lock, we always lock hash lock first. The
tricky part is release_stripe and friends. We need take device_lock first.
Neil's suggestion is we put inactive stripes to a temporary list and readd it
to inactive_list after device_lock is released. In this way, we add stripes to
temporary list with device_lock hold and remove stripes from the list with hash
lock hold. So we don't allow concurrent access to the temporary list, which
means we need allocate temporary list for all participants of release_stripe.

One downside is free stripes are maintained in their inactive list, they can't
across between the lists. By default, we have total 256 stripes and 8 lists, so
each list will have 32 stripes. It's possible one list has free stripe but
other list hasn't. The chance should be rare because stripes allocation are
even distributed. And we can always allocate more stripes for cache, several
mega bytes memory isn't a big deal.

This completely removes the lock contention of the first path of
get_active_stripe(). It slows down the second code path a little bit though
because we now need takes two locks, but since the hash lock isn't contended,
the overhead should be quite small (several atomic instructions). The second
path of get_active_stripe() (basically sequential write or big request size
randwrite) still has lock contentions.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agowait: add wait_event_cmd()
Shaohua Li [Mon, 12 Aug 2013 02:24:36 +0000 (10:24 +0800)]
wait: add wait_event_cmd()

Add a new API wait_event_cmd(). It's a variant of wait_even() with two commands
executed. One is executed before sleep, another after sleep.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agomd/raid5.c: add proper locking to error path of raid5_start_reshape.
NeilBrown [Wed, 11 Sep 2013 00:53:45 +0000 (10:53 +1000)]
md/raid5.c: add proper locking to error path of raid5_start_reshape.

If raid5_start_reshape errors out, we need to reset all the fields
that were updated (not just some), and need to use the seq_counter
to ensure make_request() doesn't use an inconsitent state.

Signed-off-by: NeilBrown <neilb@suse.de>
10 years agoraid5: avoid finding "discard" stripe
Shaohua Li [Sat, 19 Oct 2013 06:51:42 +0000 (14:51 +0800)]
raid5: avoid finding "discard" stripe

SCSI discard will damage discard stripe bio setting, eg, some fields are
changed. If the stripe is reused very soon, we have wrong bios setting. We
remove discard stripe from hash list, so next time the strip will be fully
initialized.

Suitable for backport to 3.7+.

Cc: <stable@vger.kernel.org> (3.7+)
Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agoraid5: set bio bi_vcnt 0 for discard request
Shaohua Li [Sat, 19 Oct 2013 06:50:28 +0000 (14:50 +0800)]
raid5: set bio bi_vcnt 0 for discard request

SCSI layer will add new payload for discard request. If two bios are merged
to one, the second bio has bi_vcnt 1 which is set in raid5. This will confuse
SCSI and cause oops.

Suitable for backport to 3.7+

Cc: stable@vger.kernel.org (v3.7+)
Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
10 years agomd: avoid deadlock when md_set_badblocks.
Bian Yu [Sat, 12 Oct 2013 05:10:03 +0000 (01:10 -0400)]
md: avoid deadlock when md_set_badblocks.

When operate harddisk and hit errors, md_set_badblocks is called after
scsi_restart_operations which already disabled the irq. but md_set_badblocks
will call write_sequnlock_irq and enable irq. so softirq can preempt the
current thread and that may cause a deadlock. I think this situation should
use write_sequnlock_irqsave/irqrestore instead.

I met the situation and the call trace is below:
[  638.919974] BUG: spinlock recursion on CPU#0, scsi_eh_13/1010
[  638.921923]  lock: 0xffff8800d4d51fc8, .magic: dead4ead, .owner: scsi_eh_13/1010, .owner_cpu: 0
[  638.923890] CPU: 0 PID: 1010 Comm: scsi_eh_13 Not tainted 3.12.0-rc5+ #37
[  638.925844] Hardware name: To be filled by O.E.M. To be filled by O.E.M./MAHOBAY, BIOS 4.6.5 03/05/2013
[  638.927816]  ffff880037ad4640 ffff880118c03d50 ffffffff8172ff85 0000000000000007
[  638.929829]  ffff8800d4d51fc8 ffff880118c03d70 ffffffff81730030 ffff8800d4d51fc8
[  638.931848]  ffffffff81a72eb0 ffff880118c03d90 ffffffff81730056 ffff8800d4d51fc8
[  638.933884] Call Trace:
[  638.935867]  <IRQ>  [<ffffffff8172ff85>] dump_stack+0x55/0x76
[  638.937878]  [<ffffffff81730030>] spin_dump+0x8a/0x8f
[  638.939861]  [<ffffffff81730056>] spin_bug+0x21/0x26
[  638.941836]  [<ffffffff81336de4>] do_raw_spin_lock+0xa4/0xc0
[  638.943801]  [<ffffffff8173f036>] _raw_spin_lock+0x66/0x80
[  638.945747]  [<ffffffff814a73ed>] ? scsi_device_unbusy+0x9d/0xd0
[  638.947672]  [<ffffffff8173fb1b>] ? _raw_spin_unlock+0x2b/0x50
[  638.949595]  [<ffffffff814a73ed>] scsi_device_unbusy+0x9d/0xd0
[  638.951504]  [<ffffffff8149ec47>] scsi_finish_command+0x37/0xe0
[  638.953388]  [<ffffffff814a75e8>] scsi_softirq_done+0xa8/0x140
[  638.955248]  [<ffffffff8130e32b>] blk_done_softirq+0x7b/0x90
[  638.957116]  [<ffffffff8104fddd>] __do_softirq+0xfd/0x330
[  638.958987]  [<ffffffff810b964f>] ? __lock_release+0x6f/0x100
[  638.960861]  [<ffffffff8174a5cc>] call_softirq+0x1c/0x30
[  638.962724]  [<ffffffff81004c7d>] do_softirq+0x8d/0xc0
[  638.964565]  [<ffffffff8105024e>] irq_exit+0x10e/0x150
[  638.966390]  [<ffffffff8174ad4a>] smp_apic_timer_interrupt+0x4a/0x60
[  638.968223]  [<ffffffff817499af>] apic_timer_interrupt+0x6f/0x80
[  638.970079]  <EOI>  [<ffffffff810b964f>] ? __lock_release+0x6f/0x100
[  638.971899]  [<ffffffff8173fa6a>] ? _raw_spin_unlock_irq+0x3a/0x50
[  638.973691]  [<ffffffff8173fa60>] ? _raw_spin_unlock_irq+0x30/0x50
[  638.975475]  [<ffffffff81562393>] md_set_badblocks+0x1f3/0x4a0
[  638.977243]  [<ffffffff81566e07>] rdev_set_badblocks+0x27/0x80
[  638.978988]  [<ffffffffa00d97bb>] raid5_end_read_request+0x36b/0x4e0 [raid456]
[  638.980723]  [<ffffffff811b5a1d>] bio_endio+0x1d/0x40
[  638.982463]  [<ffffffff81304ff3>] req_bio_endio.isra.65+0x83/0xa0
[  638.984214]  [<ffffffff81306b9f>] blk_update_request+0x7f/0x350
[  638.985967]  [<ffffffff81306ea1>] blk_update_bidi_request+0x31/0x90
[  638.987710]  [<ffffffff813085e0>] __blk_end_bidi_request+0x20/0x50
[  638.989439]  [<ffffffff8130862f>] __blk_end_request_all+0x1f/0x30
[  638.991149]  [<ffffffff81308746>] blk_peek_request+0x106/0x250
[  638.992861]  [<ffffffff814a62a9>] ? scsi_kill_request.isra.32+0xe9/0x130
[  638.994561]  [<ffffffff814a633a>] scsi_request_fn+0x4a/0x3d0
[  638.996251]  [<ffffffff813040a7>] __blk_run_queue+0x37/0x50
[  638.997900]  [<ffffffff813045af>] blk_run_queue+0x2f/0x50
[  638.999553]  [<ffffffff814a5750>] scsi_run_queue+0xe0/0x1c0
[  639.001185]  [<ffffffff814a7721>] scsi_run_host_queues+0x21/0x40
[  639.002798]  [<ffffffff814a2e87>] scsi_restart_operations+0x177/0x200
[  639.004391]  [<ffffffff814a4fe9>] scsi_error_handler+0xc9/0xe0
[  639.005996]  [<ffffffff814a4f20>] ? scsi_unjam_host+0xd0/0xd0
[  639.007600]  [<ffffffff81072f6b>] kthread+0xdb/0xe0
[  639.009205]  [<ffffffff81072e90>] ? flush_kthread_worker+0x170/0x170
[  639.010821]  [<ffffffff81748cac>] ret_from_fork+0x7c/0xb0
[  639.012437]  [<ffffffff81072e90>] ? flush_kthread_worker+0x170/0x170

This bug was introduce in commit  2e8ac30312973dd20e68073653
(the first time rdev_set_badblock was call from interrupt context),
so this patch is appropriate for 3.5 and subsequent kernels.

Cc: <stable@vger.kernel.org> (3.5+)
Signed-off-by: Bian Yu <bianyu@kedacom.com>
Reviewed-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agomd: Fix skipping recovery for read-only arrays.
Lukasz Dorau [Thu, 24 Oct 2013 01:55:17 +0000 (12:55 +1100)]
md: Fix skipping recovery for read-only arrays.

Since:
        commit 7ceb17e87bde79d285a8b988cfed9eaeebe60b86
        md: Allow devices to be re-added to a read-only array.

spares are activated on a read-only array. In case of raid1 and raid10
personalities it causes that not-in-sync devices are marked in-sync
without checking if recovery has been finished.

If a read-only array is degraded and one of its devices is not in-sync
(because the array has been only partially recovered) recovery will be skipped.

This patch adds checking if recovery has been finished before marking a device
in-sync for raid1 and raid10 personalities. In case of raid5 personality
such condition is already present (at raid5.c:6029).

Bug was introduced in 3.10 and causes data corruption.

Cc: stable@vger.kernel.org
Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
10 years agomtd: gpmi: imx6: fix the wrong method for checking ready/busy
Huang Shijie [Tue, 27 Aug 2013 09:29:07 +0000 (17:29 +0800)]
mtd: gpmi: imx6: fix the wrong method for checking ready/busy

In the imx6, all the ready/busy pins are binding togeter.
So we should always check the ready/busy pin of the chip 0.

In the other word, when the CS1 is enabled, we should also check the
ready/busy of chip 0; if we check the ready/busy of chip 1,
we will get the wrong result.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: scan two nand chips
Huang Shijie [Tue, 27 Aug 2013 09:29:06 +0000 (17:29 +0800)]
mtd: gpmi: scan two nand chips

Some nand chip has two DIEs in a single chip, such as Micron MT29F32G08QAA.
Each die has its own chip select pin, so this chip acts as two nand
chips.

If we only scan one chip, we may find that we only get 2G for this chip,
but in actually, this chip's size is 4G.

So scan two chips by default.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: use DMA channel 0 for all the nand chips
Huang Shijie [Tue, 27 Aug 2013 09:29:05 +0000 (17:29 +0800)]
mtd: gpmi: use DMA channel 0 for all the nand chips

We only have one DMA channel : the channel 0.
Use DMA channel 0 to access all the nand chips.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: decouple the chip select from the DMA channel
Huang Shijie [Tue, 27 Aug 2013 09:29:04 +0000 (17:29 +0800)]
mtd: gpmi: decouple the chip select from the DMA channel

Decouple the chip select from the DMA channel, we use the DMA channel 0
to accecc all the nand devices.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agoMerge branches 'fixes', 'misc', 'mmci', 'unstable/dma-for-next' and 'sa11x0' into...
Russell King [Wed, 23 Oct 2013 22:38:54 +0000 (23:38 +0100)]
Merge branches 'fixes', 'misc', 'mmci', 'unstable/dma-for-next' and 'sa11x0' into for-next

10 years agoMerge branch 'unstable/devel-testing' into for-next
Russell King [Wed, 23 Oct 2013 22:38:51 +0000 (23:38 +0100)]
Merge branch 'unstable/devel-testing' into for-next

10 years agoxfs: split xfs_rtalloc.c for userspace sanity
Dave Chinner [Mon, 14 Oct 2013 22:17:56 +0000 (09:17 +1100)]
xfs: split xfs_rtalloc.c for userspace sanity

xfs_rtalloc.c is partially shared with userspace. Split the file up
into two parts - one that is kernel private and the other which is
wholly shared with userspace.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfs: decouple inode and bmap btree header files
Dave Chinner [Tue, 22 Oct 2013 23:51:50 +0000 (10:51 +1100)]
xfs: decouple inode and bmap btree header files

Currently the xfs_inode.h header has a dependency on the definition
of the BMAP btree records as the inode fork includes an array of
xfs_bmbt_rec_host_t objects in it's definition.

Move all the btree format definitions from xfs_btree.h,
xfs_bmap_btree.h, xfs_alloc_btree.h and xfs_ialloc_btree.h to
xfs_format.h to continue the process of centralising the on-disk
format definitions. With this done, the xfs inode definitions are no
longer dependent on btree header files.

The enables a massive culling of unnecessary includes, with close to
200 #include directives removed from the XFS kernel code base.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoxfs: decouple log and transaction headers
Dave Chinner [Tue, 22 Oct 2013 23:50:10 +0000 (10:50 +1100)]
xfs: decouple log and transaction headers

xfs_trans.h has a dependency on xfs_log.h for a couple of
structures. Most code that does transactions doesn't need to know
anything about the log, but this dependency means that they have to
include xfs_log.h. Decouple the xfs_trans.h and xfs_log.h header
files and clean up the includes to be in dependency order.

In doing this, remove the direct include of xfs_trans_reserve.h from
xfs_trans.h so that we remove the dependency between xfs_trans.h and
xfs_mount.h. Hence the xfs_trans.h include can be moved to the
indicate the actual dependencies other header files have on it.

Note that these are kernel only header files, so this does not
translate to any userspace changes at all.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agoMerge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
David S. Miller [Wed, 23 Oct 2013 21:12:33 +0000 (17:12 -0400)]
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge

Antonio Quartulli says:

====================
this is another set of changes intended for net-next/linux-3.13.
(probably our last pull request for this cycle)

Patches 1 and 2 reshape two of our main data structures in a way that they can
easily be extended in the future to accommodate new routing protocols.

Patches from 3 to 9 improve our routing protocol API and its users so that all
the protocol-related code is not mixed up with the other components anymore.

Patch 10 limits the local Translation Table maximum size to a value such that it
can be fully transfered over the air if needed. This value depends on
fragmentation being enabled or not and on the mtu values.

Patch 11 makes batman-adv send a uevent in case of soft-interface destruction
while a "bat-Gateway" was configured (this informs userspace about the GW not
being available anymore).

Patches 13 and 14 enable the TT component to detect non-mesh client flag
changes at runtime (till now those flags where set upon client detection and
were not changed anymore).

Patch 16 is a generalisation of our user-to-kernel space communication (and
viceversa) used to exchange ICMP packets to send/received to/from the mesh
network. Now it can easily accommodate new ICMP packet types without breaking
the existing userspace API anymore.

Remaining patches are minor changes and cleanups.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'frag_hash_secret'
David S. Miller [Wed, 23 Oct 2013 21:01:51 +0000 (17:01 -0400)]
Merge branch 'frag_hash_secret'

Hannes Frederic Sowa says:

====================
initialize fragment hash secrets with net_get_random_once

This series switches the inet_frag.rnd hash initialization to
net_get_random_once.

Included patches:
 ipv4: initialize ip4_frags hash secret as late
 ipv6: split inet6_hash_frag for netfilter and
 inet: remove old fragmentation hash initializing
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoinet: remove old fragmentation hash initializing
Hannes Frederic Sowa [Wed, 23 Oct 2013 09:06:57 +0000 (11:06 +0200)]
inet: remove old fragmentation hash initializing

All fragmentation hash secrets now get initialized by their
corresponding hash function with net_get_random_once. Thus we can
eliminate the initial seeding.

Also provide a comment that hash secret seeding happens at the first
call to the corresponding hashing function.

Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoipv6: split inet6_hash_frag for netfilter and initialize secrets with net_get_random_once
Hannes Frederic Sowa [Wed, 23 Oct 2013 09:06:56 +0000 (11:06 +0200)]
ipv6: split inet6_hash_frag for netfilter and initialize secrets with net_get_random_once

Defer the fragmentation hash secret initialization for IPv6 like the
previous patch did for IPv4.

Because the netfilter logic reuses the hash secret we have to split it
first. Thus introduce a new nf_hash_frag function which takes care to
seed the hash secret.

Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoipv4: initialize ip4_frags hash secret as late as possible
Hannes Frederic Sowa [Wed, 23 Oct 2013 09:06:55 +0000 (11:06 +0200)]
ipv4: initialize ip4_frags hash secret as late as possible

Defer the generation of the first hash secret for the ipv4 fragmentation
cache as late as possible.

ip4_frags.rnd gets initial seeded by inet_frags_init and regulary
reseeded by inet_frag_secret_rebuild. Either we call ipqhashfn directly
from ip_fragment.c in which case we initialize the secret directly.

If we first get called by inet_frag_secret_rebuild we install a new secret
by a manual call to get_random_bytes. This secret will be overwritten
as soon as the first call to ipqhashfn happens. This is safe because we
won't race while publishing the new secrets with anyone else.

Cc: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'pci_set_drvdata'
David S. Miller [Wed, 23 Oct 2013 20:58:52 +0000 (16:58 -0400)]
Merge branch 'pci_set_drvdata'

Jingoo Han syas:

====================
ethernet: remove unnecessary pci_set_drvdata() part 4

Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound),
the driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: via-rhine: remove unnecessary pci_set_drvdata()
Jingoo Han [Wed, 23 Oct 2013 07:09:56 +0000 (16:09 +0900)]
net: via-rhine: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: tc35815: remove unnecessary pci_set_drvdata()
Jingoo Han [Wed, 23 Oct 2013 07:09:32 +0000 (16:09 +0900)]
net: tc35815: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: spider_net: remove unnecessary pci_set_drvdata()
Jingoo Han [Wed, 23 Oct 2013 07:09:03 +0000 (16:09 +0900)]
net: spider_net: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: tlan: remove unnecessary pci_set_drvdata()
Jingoo Han [Wed, 23 Oct 2013 07:08:32 +0000 (16:08 +0900)]
net: tlan: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: tehuti: remove unnecessary pci_set_drvdata()
Jingoo Han [Wed, 23 Oct 2013 07:07:51 +0000 (16:07 +0900)]
net: tehuti: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>