]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
Linus Torvalds [Tue, 2 Aug 2011 00:05:46 +0000 (14:05 -1000)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (23 commits)
  regulator: Improve WM831x DVS VSEL selection algorithm
  regulator: Bootstrap wm831x DVS VSEL value from ON VSEL if not already set
  regulator: Set up GPIO for WM831x VSEL before enabling VSEL mode
  regulator: Add EPEs to the MODULE_ALIAS() for wm831x-dcdc
  regulator: Fix WM831x DCDC DVS VSEL bootstrapping
  regulator: Fix WM831x regulator ID lookups for multiple WM831xs
  regulator: Fix argument format type errors in error prints
  regulator: Fix memory leak in set_machine_constraints() error paths
  regulator: Make core more chatty about some errors
  regulator: tps65910: Fix array access out of bounds bug
  regulator: tps65910: Add missing breaks in switch/case
  regulator: tps65910: Fix a memory leak in tps65910_probe error path
  regulator: TWL: Remove entry of RES_ID for 6030 macros
  ASoC: tlv320aic3x: Add correct hw registers to Line1 cross connect muxes
  regulator: Add basic per consumer debugfs
  regulator: Add rdev_crit() macro
  regulator: Refactor supply implementation to work as regular consumers
  regulator: Include the device name in the microamps_requested_ file
  regulator: Increase the limit on sysfs file names
  regulator: Properly register dummy regulator driver
  ...

12 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Linus Torvalds [Mon, 1 Aug 2011 23:56:03 +0000 (13:56 -1000)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (60 commits)
  ext4: prevent memory leaks from ext4_mb_init_backend() on error path
  ext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode #
  ext4: use ext4_msg() instead of printk in mballoc
  ext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info
  ext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and ext4_kvfree()
  ext4: use the correct error exit path in ext4_init_inode_table()
  ext4: add missing kfree() on error return path in add_new_gdb()
  ext4: change umode_t in tracepoint headers to be an explicit __u16
  ext4: fix races in ext4_sync_parent()
  ext4: Fix overflow caused by missing cast in ext4_fallocate()
  ext4: add action of moving index in ext4_ext_rm_idx for Punch Hole
  ext4: simplify parameters of reserve_backup_gdb()
  ext4: simplify parameters of add_new_gdb()
  ext4: remove lock_buffer in bclean() and setup_new_group_blocks()
  ext4: simplify journal handling in setup_new_group_blocks()
  ext4: let setup_new_group_blocks() set multiple bits at a time
  ext4: fix a typo in ext4_group_extend()
  ext4: let ext4_group_add_blocks() handle 0 blocks quickly
  ext4: let ext4_group_add_blocks() return an error code
  ext4: rename ext4_add_groupblocks() to ext4_group_add_blocks()
  ...

Fix up conflict in fs/ext4/inode.c: commit aacfc19c626e ("fs: simplify
the blockdev_direct_IO prototype") had changed the ext4_ind_direct_IO()
function for the new simplified calling convention, while commit
dae1e52cb126 ("ext4: move ext4_ind_* functions from inode.c to
indirect.c") moved the function to another file.

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
Linus Torvalds [Mon, 1 Aug 2011 23:48:31 +0000 (13:48 -1000)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  xfs: Fix build breakage in xfs_iops.c when CONFIG_FS_POSIX_ACL is not set
  VFS: Reorganise shrink_dcache_for_umount_subtree() after demise of dcache_lock
  VFS: Remove dentry->d_lock locking from shrink_dcache_for_umount_subtree()
  VFS: Remove detached-dentry counter from shrink_dcache_for_umount_subtree()
  switch posix_acl_chmod() to umode_t
  switch posix_acl_from_mode() to umode_t
  switch posix_acl_equiv_mode() to umode_t *
  switch posix_acl_create() to umode_t *
  block: initialise bd_super in bdget()
  vfs: avoid call to inode_lru_list_del() if possible
  vfs: avoid taking inode_hash_lock on pipes and sockets
  vfs: conditionally call inode_wb_list_del()
  VFS: Fix automount for negative autofs dentries
  Btrfs: load the key from the dir item in readdir into a fake dentry
  devtmpfs: missing initialialization in never-hit case
  hppfs: missing include

12 years agoMerge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Mon, 1 Aug 2011 23:46:37 +0000 (13:46 -1000)]
Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma

* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (37 commits)
  Improve slave/cyclic DMA engine documentation
  dmaengine: pl08x: handle the rest of enums in pl08x_width
  DMA: PL08x: cleanup selection of burst size
  DMA: PL08x: avoid recalculating cctl at each prepare
  DMA: PL08x: cleanup selection of buswidth
  DMA: PL08x: constify plchan->cd and plat->slave_channels
  DMA: PL08x: separately store source/destination cctl
  DMA: PL08x: separately store source/destination slave address
  DMA: PL08x: clean up LLI debugging
  DMA: PL08x: select LLI bus only once per LLI setup
  DMA: PL08x: remove unused constants
  ARM: mxs-dma: reset after disable channel
  dma: intel_mid_dma: remove redundant pci_set_drvdata calls
  dma: mxs-dma: fix unterminated platform_device_id table
  dmaengine: pl330: make platform data optional
  dmaengine: imx-sdma: return proper error if kzalloc fails
  pch_dma: Fix CTL register access issue
  dmaengine: mxs-dma: skip request_irq for NO_IRQ
  dmaengine/coh901318: fix slave submission semantics
  dmaengine/ste_dma40: allow memory buswidth/burst to be configured
  ...

Fix trivial whitespace conflict in drivers/dma/mv_xor.c

12 years agoMerge branch 'gpiolib' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Mon, 1 Aug 2011 23:41:43 +0000 (13:41 -1000)]
Merge branch 'gpiolib' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6

* 'gpiolib' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] Hook up gpiolib support

12 years agoMerge branch 'for-greg' of master.kernel.org:/pub/scm/linux/kernel/git/balbi/usb...
Greg Kroah-Hartman [Mon, 1 Aug 2011 23:41:16 +0000 (16:41 -0700)]
Merge branch 'for-greg' of master.kernel.org:/pub/scm/linux/kernel/git/balbi/usb into usb-linus

* 'for-greg' of master.kernel.org:/pub/scm/linux/kernel/git/balbi/usb:
  usb: musb: fix oops on musb_gadget_pullup
  usb: host: ehci-omap: fix .remove and failure handling path of .probe(v1)
  usb: gadget: hid: don't STALL when processing a HID Descriptor request
  usb: musb: fix Kconfig
  usb: musb: tusb6010_omap: fix build failure: error: 'musb' undeclared
  usb: gadget: composite: fix bMaxPacketSize for SuperSpeed
  usb: gadget: fusb300: remove #if 0 block
  usb: gadget: s3c2410_udc: fix unterminated platform_device_id table

12 years agoMerge branch 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Mon, 1 Aug 2011 23:40:51 +0000 (13:40 -1000)]
Merge branch 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6

* 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  efivars: Introduce PSTORE_EFI_ATTRIBUTES
  efivars: Use string functions in pstore_write
  efivars: introduce utf16_strncmp
  efivars: String functions
  efi: Add support for using efivars as a pstore backend
  pstore: Allow the user to explicitly choose a backend
  pstore: Make "part" unsigned
  pstore: Add extra context for writes and erases
  pstore: Extend API for more flexibility in new backends

12 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel...
Linus Torvalds [Mon, 1 Aug 2011 23:39:40 +0000 (13:39 -1000)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  kdb,kgdb: Allow arbitrary kgdb magic knock sequences
  kdb: Remove all references to DOING_KGDB2
  kdb,kgdb: Implement switch and pass buffer from kdb -> gdb
  kdb: cleanup unused variables missed in the original kdb merge

12 years agoMerge branch 'for-usb-linus' of git+ssh://master.kernel.org/pub/scm/linux/kernel...
Greg Kroah-Hartman [Mon, 1 Aug 2011 23:38:38 +0000 (16:38 -0700)]
Merge branch 'for-usb-linus' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus

* 'for-usb-linus' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sarah/xhci:
  usb/config: use proper endian access for wMaxPacketSize
  USB: xhci: fix OS want to own HC
  xhci: Don't submit commands or URBs to halted hosts.

12 years agoext4: prevent memory leaks from ext4_mb_init_backend() on error path
Yu Jian [Mon, 1 Aug 2011 21:41:46 +0000 (17:41 -0400)]
ext4: prevent memory leaks from ext4_mb_init_backend() on error path

In ext4_mb_init(), if the s_locality_group allocation fails it will
currently cause the allocations made in ext4_mb_init_backend() to
be leaked.  Moving the ext4_mb_init_backend() allocation after the
s_locality_group allocation avoids that problem.

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode #
Yu Jian [Mon, 1 Aug 2011 21:41:39 +0000 (17:41 -0400)]
ext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode #

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoext4: use ext4_msg() instead of printk in mballoc
Theodore Ts'o [Mon, 1 Aug 2011 21:41:35 +0000 (17:41 -0400)]
ext4: use ext4_msg() instead of printk in mballoc

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agousb: musb: fix oops on musb_gadget_pullup
John Stultz [Thu, 21 Jul 2011 00:09:34 +0000 (17:09 -0700)]
usb: musb: fix oops on musb_gadget_pullup

an 'unhandled fault' is causes when a gadget driver calls
usb_gadget_connect() while the USB cable isn't plugged into
the OTG port.

the fault is caused by an access to MUSB's memory space
while its clock is turned off due to pm_runtime kicking
in.

in order to fix the fault, we enclose musb_gadget_pullup()
with pm_runtime_get_sync() ... pm_runtime_put() calls to
be sure we will always reach that path with clock turned on.

[ balbi@ti.com : simplified commit log; removed few things
which didn't belong there ]

Cc: stable@kernel.org
Reported-by: Zach Pfeffer <zach.pfeffer@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: host: ehci-omap: fix .remove and failure handling path of .probe(v1)
Ming Lei [Thu, 28 Jul 2011 14:59:53 +0000 (22:59 +0800)]
usb: host: ehci-omap: fix .remove and failure handling path of .probe(v1)

Obviously, disabling & put regulator and iounmap(hcd->regs)
are missed in .remove and failure handling path of .probe,
so add them.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Keshava Munegowda <Keshava_mgowda@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: hid: don't STALL when processing a HID Descriptor request
Sebastian Bauer [Thu, 21 Jul 2011 13:40:07 +0000 (15:40 +0200)]
usb: gadget: hid: don't STALL when processing a HID Descriptor request

This is a patch to fix an issue with the HID gadget which, at the moment,
returns STALL on a HID descriptor request. Essentially, the patch changes
the hid gadget such that a request for the HID descriptor is handled by
copying the descriptor into the response buffer, rather than falling
through the default case, in which the request is answered by a STALL.

Signed-off-by: Sebastian Bauer <mail@sebastianbauer.info>
Acked-by: Peter Korsgaard <peter.korsgaard@barco.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: musb: fix Kconfig
Rabin Vincent [Mon, 18 Jul 2011 13:08:47 +0000 (18:38 +0530)]
usb: musb: fix Kconfig

After 622859634 (usb: musb: drop a gigantic amount of ifdeferry):

 - USB_GADGET_MUSB_HDRC is no longer selectable because it
   depends on the removed USB_MUSB_PERIPHERAL and USB_MUSB_OTG
   options

 - The Kconfig comment still says "Enable Host or Gadget support
   to see Inventra options", even though you now need to enable
   both of them to see Inventra options.

Fix the dependency and drop the anyway unnecessary comment.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: musb: tusb6010_omap: fix build failure: error: 'musb' undeclared
Sergei Trofimovich [Sun, 17 Jul 2011 15:28:00 +0000 (18:28 +0300)]
usb: musb: tusb6010_omap: fix build failure: error: 'musb' undeclared

  CC      drivers/usb/musb/tusb6010_omap.o
drivers/usb/musb/tusb6010_omap.c: In function 'tusb_omap_use_shared_dmareq':
drivers/usb/musb/tusb6010_omap.c:92: error: 'musb' undeclared (first use in this function)
drivers/usb/musb/tusb6010_omap.c:92: error: (Each undeclared identifier is reported only once
drivers/usb/musb/tusb6010_omap.c:92: error: for each function it appears in.)

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: composite: fix bMaxPacketSize for SuperSpeed
Sebastian Andrzej Siewior [Tue, 19 Jul 2011 18:21:52 +0000 (20:21 +0200)]
usb: gadget: composite: fix bMaxPacketSize for SuperSpeed

For bMaxPacketSize0 we usually take what is specified in ep0->maxpacket.
This is fine in most cases, however on SuperSpeed bMaxPacketSize0
specifies the exponent instead of the actual size in bytes. The only
valid value on SS is 9 which denotes 512 bytes.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: fusb300: remove #if 0 block
Sebastian Andrzej Siewior [Tue, 19 Jul 2011 19:47:01 +0000 (21:47 +0200)]
usb: gadget: fusb300: remove #if 0 block

The code in this block is unused and the Author is fine with removing:

| These functions were used to debug unstable hw fifo while developing
| fusb300.  It's much more stable now.
| So these functions can be removed.

Cc: "Wendy Yuan-Hsin Chen" <yhchen@faraday-tech.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: s3c2410_udc: fix unterminated platform_device_id table
Axel Lin [Tue, 12 Jul 2011 11:05:29 +0000 (19:05 +0800)]
usb: gadget: s3c2410_udc: fix unterminated platform_device_id table

platform_device_id structures need a NULL terminating
entry, add it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agoPCI: code and comments cleanup
Ram Pai [Mon, 25 Jul 2011 20:08:42 +0000 (13:08 -0700)]
PCI: code and comments cleanup

a) adjust_resource_sorted() is now called reassign_resource_sorted()
b) nice-to-have is now called optional
c) add_list is now called realloc_list.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agoPCI: make cardbus-bridge resources optional
Ram Pai [Mon, 25 Jul 2011 20:08:41 +0000 (13:08 -0700)]
PCI: make cardbus-bridge resources optional

Allocate resources to cardbus bridge only after all other genuine
resources requests are satisfied. Dont retry if resource allocation
for cardbus-bridges fail.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agoPCI: make SRIOV resources optional
Yinghai Lu [Mon, 25 Jul 2011 20:08:40 +0000 (13:08 -0700)]
PCI: make SRIOV resources optional

From: Yinghai Lu <yinghai@kernel.org>

Allocate resources to SRIOV BARs only after all other required
resource-requests are satisfied. Dont retry if resource allocation for SRIOV
BARs fail.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agoPCI : ability to relocate assigned pci-resources
Ram Pai [Mon, 25 Jul 2011 20:08:39 +0000 (13:08 -0700)]
PCI : ability to relocate assigned pci-resources

Currently pci-bridges are allocated enough resources to satisfy their immediate
requirements.  Any additional resource-requests fail if additional free space,
contiguous to the one already allocated, is not available. This behavior is not
reasonable since sufficient contiguous resources, that can satisfy the request,
are available at a different location.

This patch provides the ability to expand and relocate a allocated resource.

v2: Changelog: Fixed size calculation in pci_reassign_resource()
v3: Changelog : Split this patch. The resource.c changes are already
upstream. All the pci driver changes are in here.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agoPCI: honor child buses add_size in hot plug configuration
Yinghai Lu [Mon, 25 Jul 2011 20:08:38 +0000 (13:08 -0700)]
PCI: honor child buses add_size in hot plug configuration

git commit c8adf9a3e873eddaaec11ac410a99ef6b9656938
    "PCI: pre-allocate additional resources to devices only after
successful allocation of essential resources."

fails to take into consideration the optional-resources needed by children
devices while calculating the optional-resource needed by the bridge.

This can be a problem on some setup. For example, if a hotplug bridge has 8
children hotplug bridges, the bridge should have enough resources to accomodate
the hotplug requirements for each of its children hotplug bridges.  Currently
this is not the case.

This patch fixes the problem.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Reviewed-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agoPCI: Set PCI-E Max Payload Size on fabric
Jon Mason [Wed, 20 Jul 2011 20:20:54 +0000 (15:20 -0500)]
PCI: Set PCI-E Max Payload Size on fabric

On a given PCI-E fabric, each device, bridge, and root port can have a
different PCI-E maximum payload size.  There is a sizable performance
boost for having the largest possible maximum payload size on each PCI-E
device.  However, if improperly configured, fatal bus errors can occur.
Thus, it is important to ensure that PCI-E payloads sends by a device
are never larger than the MPS setting of all devices on the way to the
destination.

This can be achieved two ways:

- A conservative approach is to use the smallest common denominator of
  the entire tree below a root complex for every device on that fabric.

This means for example that having a 128 bytes MPS USB controller on one
leg of a switch will dramatically reduce performances of a video card or
10GE adapter on another leg of that same switch.

It also means that any hierarchy supporting hotplug slots (including
expresscard or thunderbolt I suppose, dbl check that) will have to be
entirely clamped to 128 bytes since we cannot predict what will be
plugged into those slots, and we cannot change the MPS on a "live"
system.

- A more optimal way is possible, if it falls within a couple of
  constraints:
* The top-level host bridge will never generate packets larger than the
  smallest TLP (or if it can be controlled independently from its MPS at
  least)
* The device will never generate packets larger than MPS (which can be
  configured via MRRS)
* No support of direct PCI-E <-> PCI-E transfers between devices without
  some additional code to specifically deal with that case

Then we can use an approach that basically ignores downstream requests
and focuses exclusively on upstream requests. In that case, all we need
to care about is that a device MPS is no larger than its parent MPS,
which allows us to keep all switches/bridges to the max MPS supported by
their parent and eventually the PHB.

In this case, your USB controller would no longer "starve" your 10GE
Ethernet and your hotplug slots won't affect your global MPS.
Additionally, the hotplugged devices themselves can be configured to a
larger MPS up to the value configured in the hotplug bridge.

To choose between the two available options, two PCI kernel boot args
have been added to the PCI calls.  "pcie_bus_safe" will provide the
former behavior, while "pcie_bus_perf" will perform the latter behavior.
By default, the latter behavior is used.

NOTE: due to the location of the enablement, each arch will need to add
calls to this function.  This patch only enables x86.

This patch includes a number of changes recommended by Benjamin
Herrenschmidt.

Tested-by: Jordan_Hargrave@dell.com
Signed-off-by: Jon Mason <mason@myri.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agoBtrfs: don't call writepages from within write_full_page
Josef Bacik [Mon, 1 Aug 2011 18:37:36 +0000 (14:37 -0400)]
Btrfs: don't call writepages from within write_full_page

When doing a writepage we call writepages to try and write out any other dirty
pages in the area.  This could cause problems where we commit a transaction and
then have somebody else dirtying metadata in the area as we could end up writing
out a lot more than we care about, which could cause latency on anybody who is
waiting for the transaction to completely finish committing.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: Remove unused variable 'last_index' in file.c
Mitch Harder [Tue, 12 Jul 2011 19:43:45 +0000 (19:43 +0000)]
Btrfs: Remove unused variable 'last_index' in file.c

The variable 'last_index' is calculated in the __btrfs_buffered_write
function and passed as a parameter to the prepare_pages function,
but is not used anywhere in the prepare_pages function.

Remove instances of 'last_index' in these functions.

Signed-off-by: Mitch Harder <mitch.harder@sabayonlinux.org>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up for find_first_extent_bit()
Xiao Guangrong [Thu, 14 Jul 2011 03:19:45 +0000 (03:19 +0000)]
Btrfs: clean up for find_first_extent_bit()

find_first_extent_bit() and find_first_extent_bit_state() share
most of the code, and we can just make the former call the latter.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up for wait_extent_bit()
Xiao Guangrong [Thu, 14 Jul 2011 03:19:27 +0000 (03:19 +0000)]
Btrfs: clean up for wait_extent_bit()

We can just use cond_resched_lock().

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up for insert_state()
Xiao Guangrong [Thu, 14 Jul 2011 03:19:08 +0000 (03:19 +0000)]
Btrfs: clean up for insert_state()

Don't duplicate set_state_bits().

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: remove unused members from struct extent_state
Xiao Guangrong [Thu, 14 Jul 2011 03:18:52 +0000 (03:18 +0000)]
Btrfs: remove unused members from struct extent_state

These members are not used at all.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up code for merging extent maps
Li Zefan [Thu, 14 Jul 2011 03:18:33 +0000 (03:18 +0000)]
Btrfs: clean up code for merging extent maps

unpin_extent_cache() and add_extent_mapping() shares the same code
that merges extent maps.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up code for extent_map lookup
Li Zefan [Thu, 14 Jul 2011 03:18:15 +0000 (03:18 +0000)]
Btrfs: clean up code for extent_map lookup

lookup_extent_map() and search_extent_map() can share most of code.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up search_extent_mapping()
Li Zefan [Thu, 14 Jul 2011 03:18:03 +0000 (03:18 +0000)]
Btrfs: clean up search_extent_mapping()

rb_node returned by __tree_search() can be a valid pointer or NULL,
but won't be some errno.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: remove redundant code for dir item lookup
Li Zefan [Thu, 14 Jul 2011 03:17:52 +0000 (03:17 +0000)]
Btrfs: remove redundant code for dir item lookup

When we search a dir item with a specific hash code, we can
just return NULL without further checking if btrfs_search_slot()
returns 1.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: make acl functions really no-op if acl is not enabled
Li Zefan [Thu, 14 Jul 2011 03:17:39 +0000 (03:17 +0000)]
Btrfs: make acl functions really no-op if acl is not enabled

So there's no overhead for something we don't use.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: remove remaining ref-cache code
Li Zefan [Thu, 14 Jul 2011 03:17:27 +0000 (03:17 +0000)]
Btrfs: remove remaining ref-cache code

Since commit f2a97a9dbd86eb1ef956bdf20e05c507b32beb96
("btrfs: remove all unused functions"), there's no extern functions
at all in ref-cache.c, so just remove the remaining dead code.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: remove a BUG_ON() in btrfs_commit_transaction()
Li Zefan [Thu, 14 Jul 2011 03:17:14 +0000 (03:17 +0000)]
Btrfs: remove a BUG_ON() in btrfs_commit_transaction()

wait_for_commit() always returns 0.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: use wait_event()
Li Zefan [Thu, 14 Jul 2011 03:17:00 +0000 (03:17 +0000)]
Btrfs: use wait_event()

Use wait_event() when possible to avoid code duplication.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: check the nodatasum flag when writing compressed files
Li Zefan [Thu, 14 Jul 2011 03:16:47 +0000 (03:16 +0000)]
Btrfs: check the nodatasum flag when writing compressed files

If mounting with nodatasum option, we won't csum file data for
general write or direct-io write, and this rule should also be
applied when writing compressed files.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: copy string correctly in INO_LOOKUP ioctl
Li Zefan [Thu, 14 Jul 2011 03:16:00 +0000 (03:16 +0000)]
Btrfs: copy string correctly in INO_LOOKUP ioctl

Memory areas [ptr, ptr+total_len] and [name, name+total_len]
may overlap, so it's wrong to use memcpy().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: don't print the leaf if we had an error
Josef Bacik [Wed, 13 Jul 2011 15:03:50 +0000 (15:03 +0000)]
Btrfs: don't print the leaf if we had an error

In __btrfs_free_extent we will print the leaf if we fail to find the extent we
wanted, but the problem is if we get an error we won't have a leaf so often this
leads to a NULL pointer dereference and we lose the error that actually
occurred.  So only print the leaf if ret > 0, which means we didn't find the
item we were looking for but we didn't error either.  This way the error is
preserved.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agobtrfs: make btrfs_set_root_node void
Mark Fasheh [Thu, 14 Jul 2011 21:23:06 +0000 (21:23 +0000)]
btrfs: make btrfs_set_root_node void

This is fairly trivial - btrfs_set_root_node() - always returns zero so we
can just make it void.  All callers ignore the return code now anyway.  I
also made sure to check that none of the functions that
btrfs_set_root_node() calls returns an error that we might have needed to
catch and pass back.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: fix oops while writing data to SSD partitions
liubo [Wed, 27 Jul 2011 09:49:18 +0000 (09:49 +0000)]
Btrfs: fix oops while writing data to SSD partitions

Here I have a two SSD-partitions btrfs, and they are defaultly set to
"data=raid0, metadata=raid1", then I try to fill my btrfs partition
till "No space left on device", via "dd if=/dev/zero of=/mnt/btrfs/tmp".

I get an oops panic from kernel BUG at fs/btrfs/extent-tree.c:5199!, which
refers to find_free_extent's
BUG_ON(index != get_block_group_index(block_group));

In SSD mode, in order to find enough space to alloc, we may check the
block_group cache which has been checked sometime before, but the index is not
updated, where it hits the BUG_ON.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Acked-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: Protect the readonly flag of block group
WuBo [Tue, 26 Jul 2011 03:30:11 +0000 (03:30 +0000)]
Btrfs: Protect the readonly flag of block group

The access for ro in btrfs_block_group_cache should be protected
because of the racy lock in relocation.

Signed-off-by: Wu Bo <wu.bo@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agobtrfs: Make extent-io callbacks that never fail return void
Jeff Mahoney [Thu, 21 Jul 2011 16:56:09 +0000 (16:56 +0000)]
btrfs: Make extent-io callbacks that never fail return void

The set/clear bit and the extent split/merge hooks only ever return 0.

 Changing them to return void simplifies the error handling cases later.

 This patch changes the hook prototypes, the single implementation of each,
 and the functions that call them to return void instead.

 Since all four of these hooks execute under a spinlock, they're necessarily
 simple.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: fix readahead in file defrag
Li Zefan [Wed, 20 Jul 2011 03:46:35 +0000 (03:46 +0000)]
Btrfs: fix readahead in file defrag

We passed the wrong value to btrfs_force_ra(). Fix this by changing
the argument of btrfs_force_ra() from last_index to nr_page.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: return error to caller when btrfs_unlink() failes
Tsutomu Itoh [Tue, 19 Jul 2011 07:27:20 +0000 (07:27 +0000)]
Btrfs: return error to caller when btrfs_unlink() failes

When btrfs_unlink_inode() and btrfs_orphan_add() in btrfs_unlink()
are error, the error code is returned to the caller instead of
BUG_ON().

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs:don't check the return value of __btrfs_add_inode_defrag
Wanlong Gao [Mon, 18 Jul 2011 12:19:35 +0000 (12:19 +0000)]
Btrfs:don't check the return value of __btrfs_add_inode_defrag

Don't need to check the return value of __btrfs_add_inode_defrag(),
since it will always return 0.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoMerge branch 'alloc_path' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh...
Chris Mason [Mon, 1 Aug 2011 18:27:34 +0000 (14:27 -0400)]
Merge branch 'alloc_path' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/btrfs-error-handling into for-linus

12 years agokdb,kgdb: Allow arbitrary kgdb magic knock sequences
Jason Wessel [Tue, 24 May 2011 15:43:06 +0000 (10:43 -0500)]
kdb,kgdb: Allow arbitrary kgdb magic knock sequences

The first packet that gdb sends when the kernel is in kdb mode seems
to change with every release of gdb.  Instead of continuing to add
many different gdb packets, change kdb to automatically look for any
thing that looks like a gdb packet.

Example 1 cold start test:
echo g > /proc/sysrq-trigger
$D#44+

Example 2 cold start test:
echo g > /proc/sysrq-trigger
$3#33

The second one should re-enter kdb's shell right away and is purely a
test.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12 years agokdb: Remove all references to DOING_KGDB2
Jason Wessel [Mon, 23 May 2011 18:22:54 +0000 (13:22 -0500)]
kdb: Remove all references to DOING_KGDB2

The DOING_KGDB2 was originally a state variable for one of the two
ways to automatically transition from kdb to kgdb.  Purge all these
variables and just use one single state for the transition.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12 years agokdb,kgdb: Implement switch and pass buffer from kdb -> gdb
Jason Wessel [Mon, 23 May 2011 18:17:41 +0000 (13:17 -0500)]
kdb,kgdb: Implement switch and pass buffer from kdb -> gdb

When switching from kdb mode to kgdb mode packets were getting lost
depending on the size of the fifo queue of the serial chip.  When gdb
initially connects if it is in kdb mode it should entirely send any
character buffer over to the gdbstub when switching connections.

Previously kdb was zero'ing out the character buffer and this could
lead to gdb failing to connect at all, or a lengthy pause could occur
on the initial connect.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12 years agokdb: cleanup unused variables missed in the original kdb merge
Jason Wessel [Thu, 30 Jun 2011 19:12:00 +0000 (14:12 -0500)]
kdb: cleanup unused variables missed in the original kdb merge

The BTARGS and BTSYMARG variables do not have any function in the
mainline version of kdb.

Reported-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12 years agoMerge branch 'for-next' into for-linus
Liam Girdwood [Mon, 1 Aug 2011 17:25:06 +0000 (18:25 +0100)]
Merge branch 'for-next' into for-linus

12 years agousb/config: use proper endian access for wMaxPacketSize
Sebastian Andrzej Siewior [Fri, 29 Jul 2011 09:05:45 +0000 (11:05 +0200)]
usb/config: use proper endian access for wMaxPacketSize

wMaxPacketSize is __le16 and should be accessed as such. Also fix the
wBytesPerInterval assignment while here.

v2: also fix the wBytesPerInterval assigment, noticed by Matt Evans

This patch should be backported to the 3.0 kernel.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Matt Evans <matt@ozlabs.org>
Cc: stable@kernel.org
12 years agoUSB: xhci: fix OS want to own HC
JiSheng Zhang [Sat, 16 Jul 2011 03:04:19 +0000 (11:04 +0800)]
USB: xhci: fix OS want to own HC

Software should set XHCI_HC_OS_OWNED bit to request ownership of xHC.

This patch should be backported to kernels as far back as 2.6.31.

Signed-off-by: JiSheng Zhang <jszhang3@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
12 years agoxhci: Don't submit commands or URBs to halted hosts.
Sarah Sharp [Fri, 1 Jul 2011 20:35:40 +0000 (13:35 -0700)]
xhci: Don't submit commands or URBs to halted hosts.

Commit fccf4e86200b8f5edd9a65da26f150e32ba79808
"USB: Free bandwidth when usb_disable_device is called" caused a bit of an
issue when the xHCI host controller driver is unloaded.  It changed the
USB core to remove all endpoints when a USB device is disabled.  When the
driver is unloaded, it will remove the SuperSpeed split root hub, which
will disable all devices under that roothub and then halt the host
controller.  When the second High Speed split roothub is removed, the USB
core will attempt to disable the endpoints, which will submit a Configure
Endpoint command to a halted host controller.

The command will eventually time out, but it makes the xHCI driver unload
take *minutes* if there are a couple of USB 1.1/2.0 devices attached.  We
must halt the host controller when the SuperSpeed roothub is removed,
because we can't allow any interrupts from things like port status
changes.

Make several different functions not submit commands or URBs to the host
controller when the host is halted, by adding a check in
xhci_check_args().  xhci_check_args() is used by these functions:

xhci.c-int xhci_urb_enqueue()
xhci.c-int xhci_drop_endpoint()
xhci.c-int xhci_add_endpoint()
xhci.c-int xhci_check_bandwidth()
xhci.c-void xhci_reset_bandwidth()
xhci.c-static int xhci_check_streams_endpoint()
xhci.c-int xhci_discover_or_reset_device()

It's also used by xhci_free_dev().  However, we have to take special
care in that case, because we want the device memory to be freed if the
host controller is halted.

This patch should be backported to the 2.6.39 and 3.0 kernel.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Mon, 1 Aug 2011 16:14:25 +0000 (06:14 -1000)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  CIFS: Cleanup demupltiplex thread exiting code
  CIFS: Move mid search to a separate function
  CIFS: Move RFC1002 check to a separate function
  CIFS: Simplify socket reading in demultiplex thread
  CIFS: Move buffer allocation to a separate function
  cifs: remove unneeded variable initialization in cifs_reconnect_tcon
  cifs: simplify refcounting for oplock breaks
  cifs: fix compiler warning in CIFSSMBQAllEAs
  cifs: fix name parsing in CIFSSMBQAllEAs
  cifs: don't start signing too early
  cifs: trivial: goto out here is unnecessary
  cifs: advertise the right receive buffer size to the server

12 years agoMerge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Mon, 1 Aug 2011 16:13:48 +0000 (06:13 -1000)]
Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6

* 'gpio/next' of git://git.secretlab.ca/git/linux-2.6:
  gpio_msm: Move Qualcomm MSM v2 gpio driver into drivers
  gpio_msm: Move Qualcomm v6 MSM driver into drivers
  msm: gpio: Fold register defs into C file
  msm: gpiomux: Move public API to public header
  msm: gpio: Remove ifdefs on gpio chip registers
  msm: gpio: Remove chip-specific register definitions
  msm: Remove chip-ifdefs for GPIO io mappings
  msm: gpio: Remove unsupported devices
  gpio: ab8500: fix MODULE_ALIAS for ab8500
  of/gpio: export of_gpio_simple_xlate

12 years agoMerge branch 'for-3.1-rc1' of git://gitorious.org/linux-omap-dss2/linux
Linus Torvalds [Mon, 1 Aug 2011 16:13:05 +0000 (06:13 -1000)]
Merge branch 'for-3.1-rc1' of git://gitorious.org/linux-omap-dss2/linux

* 'for-3.1-rc1' of git://gitorious.org/linux-omap-dss2/linux: (31 commits)
  OMAP: DSS2: HDMI: fix hdmi clock name
  HACK: OMAP: DSS2: clk hack for OMAP2/3
  OMAP: DSS2: DSS: Fix context save/restore
  OMAP: DSS2: DISPC: Fix context save/restore
  OMAP: DSS2: Remove ctx loss count from dss.c
  OMAP: DSS2: Remove unused code from display.c
  OMAP: DSS2: DISPC: remove finegrained clk enables/disables
  OMAP: DSS2: Remove unused opt_clock_available
  OMAP: DSS2: Use PM runtime & HWMOD support
  OMAP: DSS2: Remove CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET
  OMAP: DSS2: Remove core_dump_clocks
  OMAP: DSS2: DPI: remove unneeded SYSCK enable/disable
  OMAP: DSS2: Use omap_pm_get_dev_context_loss_count to get ctx loss count
  OMAP: DSS2: rewrite use of context_loss_count
  OMAP: DSS2: Remove clk optimization at dss init
  OMAP: DSS2: Fix init and unit sequence
  OMAP: DSS2: Clean up probe for DSS & DSI
  OMAP: DSS2: Handle dpll4_m4_ck in dss_get/put_clocks
  OMAP: DSS2: Fix FIFO threshold and burst size for OMAP4
  OMAP: DSS2: DSI: sync when disabling a display
  ...

12 years agoMerge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
Linus Torvalds [Mon, 1 Aug 2011 16:10:16 +0000 (06:10 -1000)]
Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x

* 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x: (39 commits)
  SH: static should be at beginning of declaration
  sh: move CLKDEV_xxx_ID macro to sh_clk.h
  sh: clock-shx3: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7786: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7785: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7757: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7366: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7343: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7722: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7724: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7366: modify I2C clock settings
  sh: clock-sh7343: modify I2C clock settings
  sh: clock-sh7723: modify I2C clock settings
  sh: clock-sh7722: modify I2C clock settings
  sh: clock-sh7724: modify I2C clock settings
  serial: sh-sci: Fix up pretty name printing for port IRQs.
  serial: sh-sci: Kill off per-port enable/disable callbacks.
  serial: sh-sci: Add missing module description/author bits.
  serial: sh-sci: Regtype probing doesn't need to be fatal.
  sh: Tidy up pre-clkdev clk_get() error handling.
  ...

12 years agoinput: xilinx_ps2: Add missing of_address.h header
Michal Simek [Wed, 13 Jul 2011 13:46:21 +0000 (15:46 +0200)]
input: xilinx_ps2: Add missing of_address.h header

Add missing header.

Error log:
CC      drivers/input/serio/xilinx_ps2.o
drivers/input/serio/xilinx_ps2.c: In function 'xps2_of_probe':
drivers/input/serio/xilinx_ps2.c:249: error: implicit declaration of function 'of_address_to_resource'

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoMerge branch 'msm-move-gpio' of git://codeaurora.org/quic/kernel/davidb/linux-msm...
Grant Likely [Mon, 1 Aug 2011 14:16:05 +0000 (15:16 +0100)]
Merge branch 'msm-move-gpio' of git://codeaurora.org/quic/kernel/davidb/linux-msm into gpio/next

Conflicts:
drivers/gpio/Kconfig
drivers/gpio/Makefile

12 years agoCIFS: Cleanup demupltiplex thread exiting code
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:44 +0000 (13:19 +0400)]
CIFS: Cleanup demupltiplex thread exiting code

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Move mid search to a separate function
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:43 +0000 (13:19 +0400)]
CIFS: Move mid search to a separate function

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Move RFC1002 check to a separate function
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:42 +0000 (13:19 +0400)]
CIFS: Move RFC1002 check to a separate function

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Simplify socket reading in demultiplex thread
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:41 +0000 (13:19 +0400)]
CIFS: Simplify socket reading in demultiplex thread

Move reading to separate function and remove csocket variable.

Also change semantic in a little: goto incomplete_rcv only when
we get -EAGAIN (or a familiar error) while reading rfc1002 header.
In this case we don't check for echo timeout when we don't get whole
header at once, as it was before.

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info
Theodore Ts'o [Mon, 1 Aug 2011 12:45:38 +0000 (08:45 -0400)]
ext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and ext4_kvfree()
Theodore Ts'o [Mon, 1 Aug 2011 12:45:02 +0000 (08:45 -0400)]
ext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and ext4_kvfree()

Introduce new helper functions which try kmalloc, and then fall back
to vmalloc if necessary, and use them for allocating and deallocating
s_flex_groups.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoCIFS: Move buffer allocation to a separate function
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:40 +0000 (13:19 +0400)]
CIFS: Move buffer allocation to a separate function

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agogpio_msm: Move Qualcomm MSM v2 gpio driver into drivers
David Brown [Mon, 16 May 2011 22:53:38 +0000 (15:53 -0700)]
gpio_msm: Move Qualcomm MSM v2 gpio driver into drivers

Migrate the driver for the v7-based MSM chips into drivers/gpio.  The
driver is unchanged, only moved.

Change-Id: I810db5b50b71cdca4e869aa0d0310f7f48781a55
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agogpio_msm: Move Qualcomm v6 MSM driver into drivers
David Brown [Mon, 16 May 2011 20:57:39 +0000 (13:57 -0700)]
gpio_msm: Move Qualcomm v6 MSM driver into drivers

Migrate the driver for the v6-based MSM chips into drivers/gpio.  The
driver is unchanged, only moved.

Change-Id: I03ba597b95b4d62b42da112a8efac88d67aa40f9
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: gpio: Fold register defs into C file
David Brown [Mon, 6 Jun 2011 21:09:45 +0000 (14:09 -0700)]
msm: gpio: Fold register defs into C file

No need to have a separate header file containing only register
definitions that are used by a single driver.  Fold these into the
gpio driver.

Signed-off-by: David Brown <davidb@codeaurora.org>
12 years agomsm: gpiomux: Move public API to public header
David Brown [Mon, 16 May 2011 20:32:15 +0000 (13:32 -0700)]
msm: gpiomux: Move public API to public header

The gpiomux.h header contains some SOC ifdefs.  However, the API that
is actually used by the GPIO driver only uses two functions that are
general.  Move these general definitions into a public header file.

Change-Id: Ia5df8af87dba268225598d56908e523bcfc24ef6
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: gpio: Remove ifdefs on gpio chip registers
David Brown [Thu, 12 May 2011 08:28:01 +0000 (01:28 -0700)]
msm: gpio: Remove ifdefs on gpio chip registers

Select the GPIO register configuration at runtime rather than through
idefs.

Change-Id: I02ea0a3d61bc81669f32097c32420f0688552231
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: gpio: Remove chip-specific register definitions
David Brown [Thu, 12 May 2011 08:16:46 +0000 (01:16 -0700)]
msm: gpio: Remove chip-specific register definitions

Put an SOC prefix on each GPIO register definition, eliminating the
need to have SOC ifdefs around the definitions.

Change-Id: I5a01fd328a89ce1be610847934d6e118f5465e42
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: Remove chip-ifdefs for GPIO io mappings
David Brown [Thu, 12 May 2011 07:54:36 +0000 (00:54 -0700)]
msm: Remove chip-ifdefs for GPIO io mappings

The two GPIO controllers are always mapped to the same virtual address
across all MSM devices.  Instead of selecting this at compile time,
determine the physical address at runtime, eliminating yet something
else preventing multiple MSM targets from being compiled into the same
kernel.

Change-Id: I1672219d978ab6243526adeda6badf49472baa27
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: gpio: Remove unsupported devices
David Brown [Thu, 12 May 2011 07:33:38 +0000 (00:33 -0700)]
msm: gpio: Remove unsupported devices

The MSM7x25 and MSM7x27 devices are not yet supported in the kernel.
Remove #ifdef-based tables supporting these chips for now.

Change-Id: I4d9f5abc4cc0942ce75a067097b072489493c1b8
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agoOMAP: DSS2: HDMI: fix hdmi clock name
Tomi Valkeinen [Mon, 1 Aug 2011 11:54:44 +0000 (14:54 +0300)]
OMAP: DSS2: HDMI: fix hdmi clock name

The HDMI clock (hdmi_clk) is missing in the current OMAP4 HWMOD
database. Fix this in the DSS driver by using the old clock name
(dss_48mhz_clk).

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
12 years agoHACK: OMAP: DSS2: clk hack for OMAP2/3
Tomi Valkeinen [Mon, 1 Aug 2011 11:32:23 +0000 (14:32 +0300)]
HACK: OMAP: DSS2: clk hack for OMAP2/3

The HWMOD data for OMAP2 and 3 are currently not up to date regarding
DSS (OMAP4 HWMOD data is fine). This patch makes the DSS driver to get
the opt clocks needed for OMAP2/3 with the old clock names, thus
allowing DSS driver to use runtime PM.

The HWMOD databases should be fixes ASAP, and this patch can be reverted
after that.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
12 years agoof: address: use resource_size helper
Felipe Balbi [Fri, 22 Jul 2011 19:47:21 +0000 (22:47 +0300)]
of: address: use resource_size helper

that should be the approved way of calculating
the size of resources. No functional changes.

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoext4: use the correct error exit path in ext4_init_inode_table()
Yongqiang Yang [Mon, 1 Aug 2011 10:32:19 +0000 (06:32 -0400)]
ext4: use the correct error exit path in ext4_init_inode_table()

This patch lets ext4_init_inode_table() handle errors right.
ext4_init_inode_table() should down_write() alloc_sem which
has been up_write()ed and stop the started journal handle.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agosch_sfq: fix sfq_enqueue()
Eric Dumazet [Fri, 29 Jul 2011 19:22:42 +0000 (19:22 +0000)]
sch_sfq: fix sfq_enqueue()

commit 8efa88540635 (sch_sfq: avoid giving spurious NET_XMIT_CN signals)
forgot to call qdisc_tree_decrease_qlen() to signal upper levels that a
packet (from another flow) was dropped, leading to various problems.

With help from Michal Soltys and Michal Pokrywka, who did a bisection.

Bugzilla ref: https://bugzilla.kernel.org/show_bug.cgi?id=39372
Debian ref: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631945

Reported-by: Lucas Bocchi <lucas.bocchi@gmail.com>
Reported-and-bisected-by: Michal Pokrywka <wolfmoon@o2.pl>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Michal Soltys <soltys@ziu.info>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodrivers/net/niu.c: adjust array index
Julia Lawall [Thu, 28 Jul 2011 02:46:03 +0000 (02:46 +0000)]
drivers/net/niu.c: adjust array index

Convert array index from the loop bound to the loop index.

A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2,ar;
@@

for(e1 = 0; e1 < e2; e1++) { <...
  ar[
- e2
+ e1
  ]
  ...> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: adjust array index
Julia Lawall [Thu, 28 Jul 2011 02:46:01 +0000 (02:46 +0000)]
net: adjust array index

Convert array index from the loop bound to the loop index.

A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2,ar;
@@

for(e1 = 0; e1 < e2; e1++) { <...
  ar[
- e2
+ e1
  ]
  ...> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMAINTAINERS: Remove Pekka Savola from ipv6.
David S. Miller [Mon, 1 Aug 2011 09:23:15 +0000 (02:23 -0700)]
MAINTAINERS: Remove Pekka Savola from ipv6.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoALSA: asihpi - Don't leak firmware if mem alloc fails
Jesper Juhl [Sun, 31 Jul 2011 21:16:43 +0000 (23:16 +0200)]
ALSA: asihpi - Don't leak firmware if mem alloc fails

We leak the memory allocated to 'firmware' when we fail to
release_firmware() after a kmalloc() failure in hpi_dsp_code_open().
This patch should take care of the leak.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoxfs: Fix build breakage in xfs_iops.c when CONFIG_FS_POSIX_ACL is not set
Markus Trippelsdorf [Tue, 26 Jul 2011 09:15:20 +0000 (11:15 +0200)]
xfs: Fix build breakage in xfs_iops.c when CONFIG_FS_POSIX_ACL is not set

commit 4e34e719e45, that takes the ACL checks to common code,
accidentely broke the build when CONFIG_FS_POSIX_ACL is not set:

  CC      fs/xfs/linux-2.6/xfs_iops.o
fs/xfs/linux-2.6/xfs_iops.c:1025:14: error: ‘xfs_get_acl’ undeclared here (not in a function)

Fix this by declaring xfs_get_acl a static inline function.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoVFS: Reorganise shrink_dcache_for_umount_subtree() after demise of dcache_lock
David Howells [Tue, 7 Jun 2011 13:09:30 +0000 (14:09 +0100)]
VFS: Reorganise shrink_dcache_for_umount_subtree() after demise of dcache_lock

Reorganise shrink_dcache_for_umount_subtree() in light of the demise of
dcache_lock.  Without that dcache_lock, there is no need for the batching of
removal of dentries from the system under it (we wanted to make intensive use
of the locked data whilst we held it, but didn't want to hold it for long at a
time).

This works, provided the preceding patch is correct in its removal of locking
on dentry->d_lock on the basis that no one should be locking these dentries any
more as the whole superblock is defunct.

With this patch, the calls to dentry_lru_del() and __d_shrink() are placed at
the point where each dentry is detached handled.

It is possible that, as an alternative, the batching should still be done -
but only for dentry_lru_del() of all a dentry's children in one go.  In such a
case, the batching would be done under dcache_lru_lock.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoVFS: Remove dentry->d_lock locking from shrink_dcache_for_umount_subtree()
David Howells [Tue, 7 Jun 2011 13:09:20 +0000 (14:09 +0100)]
VFS: Remove dentry->d_lock locking from shrink_dcache_for_umount_subtree()

Locks of the dcache_lock were replaced by locks of dentry->d_lock in commits
such as:

2304450783dfde7b0b94ae234edd0dbffa865073
2fd6b7f50797f2e993eea59e0a0b8c6399c811dc

as part of the RCU-based pathwalk changes, despite the fact that the caller
(shrink_dcache_for_umount()) notes in the banner comment the reasons that
d_lock is not necessary in these functions:

/*
 * destroy the dentries attached to a superblock on unmounting
 * - we don't need to use dentry->d_lock because:
 *   - the superblock is detached from all mountings and open files, so the
 *     dentry trees will not be rearranged by the VFS
 *   - s_umount is write-locked, so the memory pressure shrinker will ignore
 *     any dentries belonging to this superblock that it comes across
 *   - the filesystem itself is no longer permitted to rearrange the dentries
 *     in this superblock
 */

So remove these locks.  If the locks are actually necessary, then this banner
comment should be altered instead.

The hash table chains are protected by 1-bit locks in the hash table heads, so
those shouldn't be a problem.

Note that to make this work, __d_drop() has to be split so that the RCUwalk
barrier can be avoided.  This causes problems otherwise as it has an assertion
that dentry->d_lock is locked - but there is no need for that as no one else
can be trying to access this dentry, except to step over it (and that should
be handled by d_free(), I think).

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoVFS: Remove detached-dentry counter from shrink_dcache_for_umount_subtree()
David Howells [Tue, 7 Jun 2011 13:09:10 +0000 (14:09 +0100)]
VFS: Remove detached-dentry counter from shrink_dcache_for_umount_subtree()

Remove the detached-dentry counter from shrink_dcache_for_umount_subtree() as
the value it computes is no longer used as of commit
312d3ca856d369bb04d0443846b85b4cdde6fa8a which made the nr_dentry counters
summed per-CPU rather than global atomic.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoswitch posix_acl_chmod() to umode_t
Al Viro [Sat, 23 Jul 2011 23:03:11 +0000 (19:03 -0400)]
switch posix_acl_chmod() to umode_t

again, that's what all callers pass to it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoswitch posix_acl_from_mode() to umode_t
Al Viro [Sat, 23 Jul 2011 23:01:48 +0000 (19:01 -0400)]
switch posix_acl_from_mode() to umode_t

... seeing that this is what all callers pass to it anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoswitch posix_acl_equiv_mode() to umode_t *
Al Viro [Sat, 23 Jul 2011 22:56:36 +0000 (18:56 -0400)]
switch posix_acl_equiv_mode() to umode_t *

... so that &inode->i_mode could be passed to it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoswitch posix_acl_create() to umode_t *
Al Viro [Sat, 23 Jul 2011 22:37:50 +0000 (18:37 -0400)]
switch posix_acl_create() to umode_t *

so we can pass &inode->i_mode to it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoblock: initialise bd_super in bdget()
Lachlan McIlroy [Thu, 30 Jun 2011 01:01:45 +0000 (11:01 +1000)]
block: initialise bd_super in bdget()

bd_super is currently reset to NULL in kill_block_super() so we rely on previous
users of the block_device object to initialise this value for the next user.
This quirk was exposed on RHEL5 when a third party filesystem did not always use
kill_block_super() and therefore bd_super wasn't being reset when a block_device
object was recycled within the cache.  This may not be a problem upstream but
makes sense to be defensive.

Signed-off-by: Lachlan McIlroy <lmcilroy@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: avoid call to inode_lru_list_del() if possible
Eric Dumazet [Thu, 28 Jul 2011 04:55:13 +0000 (06:55 +0200)]
vfs: avoid call to inode_lru_list_del() if possible

inode_lru_list_del() is expensive because of per superblock lru locking,
while some inodes are not in lru list.

Adding a check in iput_final() can speedup pipe/sockets workloads on
SMP.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: avoid taking inode_hash_lock on pipes and sockets
Eric Dumazet [Thu, 28 Jul 2011 04:41:09 +0000 (06:41 +0200)]
vfs: avoid taking inode_hash_lock on pipes and sockets

Some inodes (pipes, sockets, ...) are not hashed, no need to take
contended inode_hash_lock at dismantle time.

nice speedup on SMP machines on socket intensive workloads.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>