pandora-kernel.git
15 years agoRevert USB: usb-serial ch341: support for DTR/RTS/CTS
Greg Kroah-Hartman [Tue, 7 Apr 2009 18:56:32 +0000 (11:56 -0700)]
Revert USB: usb-serial ch341: support for DTR/RTS/CTS

Reverts commit 664d5df92e88b6ef091048a802b3750f4e989180 as the commit
log information was not complete, and we didn't have a proper
signed-off-by by the author of the original BSD code.

Cc: Werner Cornelius <Werner.Cornelius@cornelius-consult.de>
Cc: Boris Hajduk <boris@hajduk.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: fix possible panic while resuming
Kim Kyuwon [Fri, 27 Mar 2009 01:56:51 +0000 (18:56 -0700)]
USB: musb: fix possible panic while resuming

During driver resume processing, musb could cause a kernel panic.
Fix by enabling the clock earlier, with the resume_early method.

Signed-off-by: Kim Kyuwon <q1.kim@samsung.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: fix isochronous TXDMA (take 2)
Sergei Shtylyov [Fri, 27 Mar 2009 01:29:19 +0000 (18:29 -0700)]
USB: musb: fix isochronous TXDMA (take 2)

Multi-frame isochronous TX URBs transfers in DMA mode never
complete with CPPI DMA because musb_host_tx() doesn't restart
DMA on the second frame, only emitting a debug message.
With Inventra DMA they complete, but in PIO mode.  To fix:

 - Factor out programming of the DMA transfer from
   musb_ep_program() into musb_tx_dma_program();

 - Reorder the code at the end of musb_host_tx() to
   facilitate the fallback to PIO iff DMA fails;

 - Handle the buffer offset consistently for both
   PIO and DMA modes;

 - Add an argument to musb_ep_program() for the same
   reason (it only worked correctly with non-zero
   offset of the first frame in PIO mode);

 - Set the completed isochronous frame descriptor's
   'actual_length' and 'status' fields correctly in
   DMA mode.

Also, since CPPI reportedly doesn't like sending isochronous
packets in the RNDIS mode, change the criterion for this
mode to be used only for multi-packet transfers.  (There's
no need for that mode in the single-packet case anyway.)

[ dbrownell@users.sourceforge.net: split comment paragraph
into bullet list, shrink patch delta, style tweaks ]

Signed-off-by: Pavel Kiryukhin <pkiryukhin@ru.mvista.com>
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: sanitize clearing TXCSR DMA bits (take 2)
Sergei Shtylyov [Fri, 27 Mar 2009 01:27:47 +0000 (18:27 -0700)]
USB: musb: sanitize clearing TXCSR DMA bits (take 2)

The MUSB code clears TXCSR_DMAMODE incorrectly in several
places, either asserting that TXCSR_DMAENAB is clear (when
sometimes it isn't) or clearing both bits together.  Recent
versions of the programmer's guide require DMAENAB to be
cleared first, although some older ones didn't.

Fix this and while at it:

 - In musb_gadget::txstate(), stop clearing the AUTOSET
   and DMAMODE bits for the CPPI case since they never
   get set anyway (the former bit is reserved on DaVinci);
   but do clear the DMAENAB bit on the DMA error path.

 - In musb_host::musb_ep_program(), remove the duplicate
   DMA controller specific code code clearing the TXCSR
   previous state, add the code to clear TXCSR DMA bits
   on the Inventra DMA error path, to replace such code
   (executed late) on the PIO path.

 - In musbhsdma::dma_channel_abort()/dma_controller_irq(),
   add/use the 'offset' variable to avoid MUSB_EP_OFFSET()
   invocations on every RXCSR/TXCSR access.

[dbrownell@users.sourceforge.net: don't introduce CamelCase,
shrink diff]

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb: bugfixes for multi-packet TXDMA support
Sergei Shtylyov [Fri, 27 Mar 2009 01:26:40 +0000 (18:26 -0700)]
USB: musb: bugfixes for multi-packet TXDMA support

We really want to use DMA mode 1 for all multi-packet transfers;
that's one IRQ on DMA completion, instead of one per packet.

There is an important issue with such transfers, especially on
the host side:  when such transfers end with a full-size packet,
we must defer musb_dma_completion() calls until the FIFO empties.
Else we report URB completions too soon, and may clobber data in
the FIFO fifo when writing the next packet (losing data).

The Inventra DMA support uses DMA mode 1, but it ignores that
issue.  The CPPI DMA support uses mode 0, but doesn't handle
its TXPKTRDY interrupts quite right either; it can get stale
"packet ready" interrupts, and report transfer completion too
early using slightly different code paths, also losing data.

So I'm solving it in a generic way -- by adding a sort of the
"interrupt filter" into musb_host_tx(), catching these cases
where a DMA completion IRQ doesn't suffice and removing some
needlessly controller-specific logic.  When a TXDMA interrupt
happens and DMA request mode 1 is active, that filter resets
to mode 0 and defers URB completion processing until TXPKTRDY,
unless the FIFO is already empty.  Related filtering logic in
Inventra and CPPI code gets removed.

Since it should be competely safe now to use the DMA request
mode 1 for host side transfers with the CPPI DMA controller,
set it in musb_h_tx_dma_start() ... now renamed (and shared).

[ dbrownell@users.sourceforge.net: don't introduce more
CamElCase; use more concise explanations ]

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb_host, fix ep0 fifo flushing
David Brownell [Fri, 27 Mar 2009 00:38:30 +0000 (17:38 -0700)]
USB: musb_host, fix ep0 fifo flushing

The MUSB host side can't share generic TX FIFO flush logic
with EP0; the EP0 TX status register bits are different
from those for other entpoints.

Resolve this issue by providing a new EP0-specific routine
to flush and reset the FIFO, which pays careful attention to
restrictions listed in the latest programmer's guide.  This
gets rid of an open issue whereby the usbtest control write
test (#14) failed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: usb-storage: augment unusual_devs entry for Simple Tech/Datafab
Alan Stern [Tue, 24 Mar 2009 14:39:13 +0000 (10:39 -0400)]
USB: usb-storage: augment unusual_devs entry for Simple Tech/Datafab

This patch (as1227) adds the MAX_SECTORS_64 flag to the unusual_devs
entry for the Simple Tech/Datafab controller.  This fixes Bugzilla
#12882.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: binbin <binbinsh@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: musb_host, minor enqueue locking fix (v2)
David Brownell [Fri, 27 Mar 2009 00:36:57 +0000 (17:36 -0700)]
USB: musb_host, minor enqueue locking fix (v2)

Someone noted that the enqueue path used an unlocked access
for usb_host_endpoint->hcpriv ... fix that, by being safe
and always accessing it under spinlock protection.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: fix oops in cdc-wdm in case of malformed descriptors
Oliver Neukum [Sat, 4 Apr 2009 07:25:15 +0000 (09:25 +0200)]
USB: fix oops in cdc-wdm in case of malformed descriptors

cdc-wdm needs to ignore extremely malformed descriptors.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: qcserial: Add extra device IDs
Matthew Garrett [Sat, 4 Apr 2009 16:24:24 +0000 (17:24 +0100)]
USB: qcserial: Add extra device IDs

Add a set of device IDs from the Windows drivers. These aren't complete
(there's a couple of cases where a QDL device is identified without the
associated modem being identified), but it's better than the current
situation.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: option: Add ids for D-Link DWM-652 3.5G modem
Pascal Terjan [Tue, 7 Apr 2009 12:40:42 +0000 (14:40 +0200)]
USB: option: Add ids for D-Link DWM-652 3.5G modem

This patch allows D-Link DWM-652 3.5G modem to work.
It is an express card but was only tested with the provided usb adapter as I
don't have machines with express card connector.

/dev/ttyUSB{0,1,2} get created, and using comgt on ttyUSB1 works fine :

[root@plop tmp]# comgt -d /dev/ttyUSB1 -e

Enter PIN number: XXXX
Waiting for Registration..(120 sec max).
Registered on Home network: "Orange France",2
Signal Quality: 15,99

From: Pascal Terjan <pterjan@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: ftdi_sio: add vendor/project id for JETI specbos 1201 spectrometer
Peter Korsgaard [Wed, 25 Mar 2009 10:32:59 +0000 (11:32 +0100)]
USB: ftdi_sio: add vendor/project id for JETI specbos 1201 spectrometer

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb gadget: fix ethernet link reports to ethtool
Jonathan McDowell [Thu, 26 Mar 2009 07:45:27 +0000 (00:45 -0700)]
usb gadget: fix ethernet link reports to ethtool

The g_ether USB gadget driver currently decides whether or not there's a
link to report back for eth_get_link based on if the USB link speed is
set. The USB gadget speed is however often set even before the device is
enumerated. It seems more sensible to only report a "link" if we're
actually connected to a host that wants to talk to us. The patch below
does this for me - tested with the PXA27x UDC driver.

Signed-off-by: Jonathan McDowell <noodles@earth.li>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Fri, 17 Apr 2009 17:08:13 +0000 (10:08 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: ads7846 - fix unsafe disable_irq
  Input: mainstone-wm97xx - fix condition in pen_up
  Input: pc110pad - remove unused variable dev
  Input: bf54x-keys - remove depreciated IRQF_SAMPLE_RANDOM flag
  Input: ad7877, ad7879 - remove depreciated IRQF_SAMPLE_RANDOM flag
  Input: da9034-ts - make pen {down,up} events more reliable
  Input: da9034-ts - add Bin Yang as co-author of the driver
  Input: atkbd - add forced release keys quirk for Samsung NC20
  Input: atkbd - add forced release keys quirk for Samsung Q45
  Input: gameport - fix attach driver code
  Input: hp_sdc_rtc should depend on serio
  Input: wm97xx - don't specify IRQF_SAMPLE_RANDOM
  Input: ads7846 - introduce platform specific way to synchronize sampling
  Input: remove unnecessary synchronize_rcu() call
  Input: i8042 - add a DMI table for the i8042.reset option
  Input: i8042 - introduce a tougher reset

15 years agoGet rid of final remnants of include/asm-$(ARCH)
Linus Torvalds [Fri, 17 Apr 2009 16:59:27 +0000 (09:59 -0700)]
Get rid of final remnants of include/asm-$(ARCH)

This renames include/asm-h8300/timer.h into arch/h8300/include/asm: it
was left over just because that file had been created in the -mm tree
before the whole h8300 header subdirectory had been moved, and then got
merged in the old location afterwards.

(See commits e0b0f9e4ead2468f84c26332ec42b118e76af572: "h8300: update
timer handler - new files" and 758db3f2118703a1e36374dae5d58bed963e7e0d:
"[h8300] move include/asm-h8300 to arch/h8300/include/asm" for details).

This also removes a left-over .gitignore file in include/asm-arm that
became stale when the ARM header files were moved (which happened in
multiple commits, just see "git log -- include/asm-arm" for details).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'for-linus' of git://www.linux-m32r.org/git/takata/linux-2.6_dev
Linus Torvalds [Fri, 17 Apr 2009 16:57:17 +0000 (09:57 -0700)]
Merge branch 'for-linus' of git://linux-m32r.org/git/takata/linux-2.6_dev

* 'for-linus' of git://www.linux-m32r.org/git/takata/linux-2.6_dev:
  m32r: move include/asm-m32r/* to arch/m32r/include/asm/
  m32r: move include/asm-m32r headers to arch/m32r/include/asm

15 years agoMerge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 17 Apr 2009 16:56:11 +0000 (09:56 -0700)]
Merge branch 'x86-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: fix microcode driver newly spewing warnings
  x86, PAT: Remove page granularity tracking for vm_insert_pfn maps
  x86: disable X86_PTRACE_BTS for now
  x86, documentation: kernel-parameters replace X86-32,X86-64 with X86
  x86: pci-swiotlb.c swiotlb_dma_ops should be static
  x86, PAT: Remove duplicate memtype reserve in devmem mmap
  x86, PAT: Consolidate code in pat_x_mtrr_type() and reserve_memtype()
  x86, PAT: Changing memtype to WC ensuring no WB alias
  x86, PAT: Handle faults cleanly in set_memory_ APIs
  x86, PAT: Change order of cpa and free in set_memory_wb
  x86, CPA: Change idmap attribute before ioremap attribute setup

15 years agoAFS: Guard afs_file_readpage_read_complete() definition with CONFIG_AFS_FSCACHE
Matt Kraai [Fri, 17 Apr 2009 11:56:38 +0000 (12:56 +0100)]
AFS: Guard afs_file_readpage_read_complete() definition with CONFIG_AFS_FSCACHE

If CONFIG_AFS_FSCACHE is not defined, the following warning is displayed when
fs/afs/file.c is compiled:

 fs/afs/file.c:111: warning: ‘afs_file_readpage_read_complete’ defined but not used

This occurs because all calls to this function are guarded by
CONFIG_AFS_FSCACHE.  Thus, guard its definition as well.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agovfat: Note the NLS requirement
Alan Cox [Fri, 17 Apr 2009 11:22:35 +0000 (12:22 +0100)]
vfat: Note the NLS requirement

Close bug #4754. Stop people getting into a situation where they can't
get their FAT filesystems to mount as they expect.

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoALSA: hda - Set function_id only on FG nodes
Takashi Iwai [Fri, 17 Apr 2009 16:04:41 +0000 (18:04 +0200)]
ALSA: hda - Set function_id only on FG nodes

(Re)set function_id only from the value on FG nodes.
The current code overrides the value with the last widget.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoASoC: OMAP: Update contact addresses
Jarkko Nikula [Fri, 17 Apr 2009 11:42:26 +0000 (14:42 +0300)]
ASoC: OMAP: Update contact addresses

My email address is going to expire soon so update it. Adding also
Peter Ujfalusi <peter.ujfalusi@nokia.com> as a second contact to OMAP core
drivers since I won't have anymore access to non-public OMAP documentation
in the future and Peter is working with these drivers as well.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: pxa-ssp: Don't use SSCR0_SerClkDiv and SSCR0_SCR
Philipp Zabel [Fri, 17 Apr 2009 09:39:38 +0000 (11:39 +0200)]
ASoC: pxa-ssp: Don't use SSCR0_SerClkDiv and SSCR0_SCR

Those macros are just screwed as soon as CONFIG_PXA25x is enabled.

This patch
- changes ssp_set_scr to take an ssp_dev pointer instead of ssp_device
- adds a corresponding ssp_get_scr function.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agosplice: fix new kernel-doc warnings
Randy Dunlap [Fri, 17 Apr 2009 02:09:55 +0000 (19:09 -0700)]
splice: fix new kernel-doc warnings

splice: fix kernel-doc warnings

  Warning(fs/splice.c:617): bad line:
  Warning(fs/splice.c:722): No description found for parameter 'sd'
  Warning(fs/splice.c:722): Excess function parameter 'pipe' description in 'splice_from_pipe_begin'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years ago[ARM] S3C24XX: ADC: Check pending queue before freeing adc client
Ramax Lo [Tue, 14 Apr 2009 15:56:18 +0000 (23:56 +0800)]
[ARM] S3C24XX: ADC: Check pending queue before freeing adc client

Check pending queue and remove the adc client being released.

Signed-off-by: Ramax Lo <ramaxlo@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
15 years ago[ARM] S3C: Fix ADC driver sparse warning
Ben Dooks [Fri, 17 Apr 2009 11:36:49 +0000 (12:36 +0100)]
[ARM] S3C: Fix ADC driver sparse warning

The symbol 's3c_adc_try' in arch/arm/plat-s3c24xx/adc.c
does not need to be exported and thus should be static.

This fixes the following sparse warning:

adc.c:103:6: warning: symbol 's3c_adc_try' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
15 years ago[ARM] Osiris: Fix double initialisation in machine block
Ben Dooks [Fri, 17 Apr 2009 11:36:47 +0000 (12:36 +0100)]
[ARM] Osiris: Fix double initialisation in machine block

The .init_machine entry in mach-osiris.c had the same entry
twice, so remove one definition to fix the following warning
from sparse:

mach-osiris.c:416:3: warning: Initializer entry defined twice
mach-osiris.c:418:3:   also defined here

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
15 years ago[ARM] Anubis: Fix sparse warnings for items that should be static
Ben Dooks [Fri, 17 Apr 2009 11:36:46 +0000 (12:36 +0100)]
[ARM] Anubis: Fix sparse warnings for items that should be static

Make 'anubis_ide_platdata' statis as it is not used outside
the file it is in, fixing the following sparse warning:

mach-anubis.c:246:27: warning: symbol 'anubis_ide_platdata' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
15 years ago[ARM] JIVE: Fix sparse warnings about items which should be static
Ben Dooks [Fri, 17 Apr 2009 11:36:45 +0000 (12:36 +0100)]
[ARM] JIVE: Fix sparse warnings about items which should be static

Make 'jive_vgg2432a4_display' and 'jive_lcd_config' static as
they are not exported, and are generating the following sparse
warnings:

mach-jive.c:280:26: warning: symbol 'jive_vgg2432a4_display' was not declared. Should it be static?
mach-jive.c:313:28: warning: symbol 'jive_lcd_config' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
15 years ago[ARM] S3C: Fix sparse warning from missing 's3c_device_hwmon'
Ben Dooks [Fri, 17 Apr 2009 11:36:44 +0000 (12:36 +0100)]
[ARM] S3C: Fix sparse warning from missing 's3c_device_hwmon'

Fix the following sparse warning due to s3c_device_hwmon being
missing from <plat/devs.h>

devs.c:380:24: warning: symbol 's3c_device_hwmon' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
15 years ago[ARM] S3C24XX: Fix sparse error in gpiolib.c
Ben Dooks [Fri, 17 Apr 2009 11:36:43 +0000 (12:36 +0100)]
[ARM] S3C24XX: Fix sparse error in gpiolib.c

Fix the following sparse error generated by including
<plat/gpio-core.h> instead of <mach/gpio-core.h>

gpiolib.c:78:22: warning: symbol 's3c24xx_gpios' was not declared. Should it be static?

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
15 years agoALSA: MAINTAINERS - Update SOUND
Joe Perches [Thu, 16 Apr 2009 06:38:45 +0000 (23:38 -0700)]
ALSA: MAINTAINERS - Update SOUND

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: emu10k1 - off by 1 in snd_emu10k1_wait()
Roel Kluin [Thu, 16 Apr 2009 21:54:04 +0000 (23:54 +0200)]
ALSA: emu10k1 - off by 1 in snd_emu10k1_wait()

With `while (count++ < 16384)' count reaches 16385.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agom32r: move include/asm-m32r/* to arch/m32r/include/asm/
Hirokazu Takata [Fri, 17 Apr 2009 01:46:25 +0000 (10:46 +0900)]
m32r: move include/asm-m32r/* to arch/m32r/include/asm/

Move remained files, ftrace.h and swab.h, to arch/m32r/include/asm/.

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
15 years agocifs: remove unneeded bcc_ptr update in CIFSTCon
Jeff Layton [Thu, 16 Apr 2009 17:48:49 +0000 (13:48 -0400)]
cifs: remove unneeded bcc_ptr update in CIFSTCon

This pointer isn't used again after this point. It's also not updated in
the ascii case, so there's no need to update it here.

Pointed-out-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: add cFYI messages with some of the saved strings from ssetup/tcon
Jeff Layton [Thu, 16 Apr 2009 15:21:53 +0000 (11:21 -0400)]
cifs: add cFYI messages with some of the saved strings from ssetup/tcon

...to make it easier to find problems in this area in the future.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: fix buffer size for tcon->nativeFileSystem field
Jeff Layton [Thu, 16 Apr 2009 15:21:52 +0000 (11:21 -0400)]
cifs: fix buffer size for tcon->nativeFileSystem field

The buffer for this was resized recently to fix a bug. It's still
possible however that a malicious server could overflow this field
by sending characters in it that are >2 bytes in the local charset.
Double the size of the buffer to account for this possibility.

Also get rid of some really strange and seemingly pointless NULL
termination. It's NULL terminating the string in the source buffer,
but by the time that happens, we've already copied the string.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: fix unicode string area word alignment in session setup
Jeff Layton [Tue, 14 Apr 2009 15:00:53 +0000 (11:00 -0400)]
cifs: fix unicode string area word alignment in session setup

The handling of unicode string area alignment is wrong.
decode_unicode_ssetup improperly assumes that it will always be preceded
by a pad byte. This isn't the case if the string area is already
word-aligned.

This problem, combined with the bad buffer sizing for the serverDomain
string can cause memory corruption. The bad alignment can make it so
that the alignment of the characters is off. This can make them
translate to characters that are greater than 2 bytes each. If this
happens we can overflow the allocation.

Fix this by fixing the alignment in CIFS_SessSetup instead so we can
verify it against the head of the response. Also, clean up the
workaround for improperly terminated strings by checking for a
odd-length unicode buffers and then forcibly terminating them.

Finally, resize the buffer for serverDomain. Now that we've fixed
the alignment, it's probably fine, but a malicious server could
overflow it.

A better solution for handling these strings is still needed, but
this should be a suitable bandaid.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years ago[CIFS] Fix build break caused by change to new current_umask helper function
Steve French [Wed, 15 Apr 2009 03:09:39 +0000 (03:09 +0000)]
[CIFS] Fix build break caused by change to new current_umask helper function

Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years ago[CIFS] Fix sparse warnings
Steve French [Sun, 12 Apr 2009 18:18:40 +0000 (18:18 +0000)]
[CIFS] Fix sparse warnings

Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com>
CC: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years ago[CIFS] Add support for posix open during lookup
Steve French [Thu, 9 Apr 2009 01:14:32 +0000 (01:14 +0000)]
[CIFS] Add support for posix open during lookup

This patch by utilizing lookup intents, and thus removing a network
roundtrip in the open path, improves performance dramatically on
open (30% or more) to Samba and other servers which support the
cifs posix extensions

Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: no need to use rcu_assign_pointer on immutable keys
Jeff Layton [Mon, 23 Mar 2009 05:47:11 +0000 (01:47 -0400)]
cifs: no need to use rcu_assign_pointer on immutable keys

cifs: no need to use rcu_assign_pointer on immutable keys

Neither keytype in use by CIFS has an "update" method. This means that
the keys are immutable once instantiated. We don't need to use RCU
to set the payload data pointers.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: remove dnotify thread code
Jeff Layton [Mon, 23 Mar 2009 05:47:12 +0000 (01:47 -0400)]
cifs: remove dnotify thread code

cifs: remove dnotify thread code

Al Viro recently removed the dir_notify code from the kernel along with
the CIFS code that used it. We can also get rid of the dnotify thread
as well.

In actuality, it never had anything to do with dir_notify anyway. All
it did was unnecessarily wake up all the tasks waiting on the response
queues every 15s. Previously that happened to prevent tasks from hanging
indefinitely when the server went unresponsive, but we put those to
sleep with proper timeouts now so there's no reason to keep this around.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years ago[CIFS] remove some build warnings
Steve French [Thu, 9 Apr 2009 00:36:44 +0000 (00:36 +0000)]
[CIFS] remove some build warnings

Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: vary timeout on writes past EOF based on offset (try #5)
Jeff Layton [Fri, 3 Apr 2009 17:44:00 +0000 (13:44 -0400)]
cifs: vary timeout on writes past EOF based on offset (try #5)

This is the fourth version of this patch:

The first three generated a compiler warning asking for explicit curly
braces.

The first two didn't handle update the size correctly when writes that
didn't start at the eof were done.

The first patch also didn't update the size correctly when it explicitly
set via truncate().

This patch adds code to track the client's current understanding of the
size of the file on the server separate from the i_size, and then to use
this info to semi-intelligently set the timeout for writes past the EOF.

This helps prevent timeouts when trying to write large, sparse files on
windows servers.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years ago[CIFS] Fix build break from recent DFS patch when DFS support not enabled
Steve French [Fri, 3 Apr 2009 03:12:08 +0000 (03:12 +0000)]
[CIFS] Fix build break from recent DFS patch when DFS support not enabled

Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agoRemote DFS root support.
Igor Mammedov [Wed, 1 Apr 2009 13:54:42 +0000 (17:54 +0400)]
Remote DFS root support.

Allows to mount share on a server that returns -EREMOTE
 at the tree connect stage or at the check on a full path
 accessibility.

Signed-off-by: Igor Mammedov <niallain@gmail.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years ago[CIFS] Endian convert UniqueId when reporting inode numbers from server files
Steve French [Wed, 1 Apr 2009 05:22:00 +0000 (05:22 +0000)]
[CIFS] Endian convert UniqueId when reporting inode numbers from server files

Jeff made a good point that we should endian convert the UniqueId when we use
it to set i_ino Even though this value is opaque to the client, when comparing
the inode numbers of the same server file from two different clients (one
big endian, one little endian) or when we compare a big endian client's view
of i_ino with what the server thinks - we should get the same value

Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: remove some pointless conditionals before kfree()
Wei Yongjun [Tue, 31 Mar 2009 08:28:36 +0000 (16:28 +0800)]
cifs: remove some pointless conditionals before kfree()

Remove some pointless conditionals before kfree().

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agocifs: flush data on any setattr
Jeff Layton [Thu, 26 Mar 2009 17:35:37 +0000 (13:35 -0400)]
cifs: flush data on any setattr

We already flush all the dirty pages for an inode before doing
ATTR_SIZE and ATTR_MTIME changes. There's another problem though -- if
we change the mode so that the file becomes read-only then we may not
be able to write data to it after a reconnect.

Fix this by just going back to flushing all the dirty data on any
setattr call. There are probably some cases that can be optimized out,
but I'm not sure they're worthwhile and we need to consider them more
carefully to make sure that we don't cause regressions if we have
to reconnect before writeback occurs.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
15 years agoMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 17 Apr 2009 01:17:22 +0000 (18:17 -0700)]
Merge branch 'tracing-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tracing: Fix branch tracer header
  tracing: Fix power tracer header

15 years agoMerge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 17 Apr 2009 01:16:29 +0000 (18:16 -0700)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: Avoid printing sched_group::__cpu_power for default case
  tracing, sched: mark get_parent_ip() notrace

15 years agom32r: move include/asm-m32r headers to arch/m32r/include/asm
Hirokazu Takata [Thu, 27 Nov 2008 17:46:48 +0000 (02:46 +0900)]
m32r: move include/asm-m32r headers to arch/m32r/include/asm

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
15 years agoMerge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 17 Apr 2009 00:56:39 +0000 (17:56 -0700)]
Merge branch 'core-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  kernel/softirq.c: fix sparse warning
  rcu: Make hierarchical RCU less IPI-happy

15 years agokernel/softirq.c: fix sparse warning
H Hartley Sweeten [Thu, 16 Apr 2009 23:30:18 +0000 (19:30 -0400)]
kernel/softirq.c: fix sparse warning

Fix sparse warning in kernel/softirq.c.

  warning: do-while statement is not a compound statement

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
LKML-Reference: <BD79186B4FD85F4B8E60E381CAEE1909015F9033@mi8nycmail19.Mi8.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoMerge branch 'x86/uv' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux...
Linus Torvalds [Thu, 16 Apr 2009 23:43:20 +0000 (16:43 -0700)]
Merge branch 'x86/uv' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86/uv' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: UV BAU distribution and payload MMRs
  x86: UV: BAU partition-relative distribution map
  x86, uv: add Kconfig dependency on NUMA for UV systems
  x86: prevent /sys/firmware/sgi_uv from being created on non-uv systems
  x86, UV: Fix for nodes with memory and no cpus
  x86, UV: system table in bios accessed after unmap
  x86: UV BAU messaging timeouts
  x86: UV BAU and nodes with no memory

15 years agoUIO: fix specific device driver missing statement for depmod
Hans J. Koch [Sat, 11 Apr 2009 02:18:25 +0000 (04:18 +0200)]
UIO: fix specific device driver missing statement for depmod

On Fri, Apr 10, 2009 at 01:50:50PM -0700, Andrew Morton wrote:
> On Fri, 10 Apr 2009 13:32:01 GMT
> bugzilla-daemon@bugzilla.kernel.org wrote:
>
> > http://bugzilla.kernel.org/show_bug.cgi?id=13059

drivers/uio/uio_cif.c misses a MODULE_DEVICE_TABLE, this fixes it.

Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDriver core: remove pr_fmt() from dynamic_dev_dbg() printk
Jason Baron [Wed, 8 Apr 2009 16:12:52 +0000 (12:12 -0400)]
Driver core: remove pr_fmt() from dynamic_dev_dbg() printk

When pr_fmt() was added to the pr_debug() code, we added it not only to the
dynamic_pr_debug() function, but also to the dynamic_dev_dbg() funciton.
However, dev_dbg() doesn't make use of pr_fmt(), so neither should
dynamic_dev_dbg().

Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: prevent device_for_each_child from oopsing
Greg Kroah-Hartman [Wed, 15 Apr 2009 23:00:12 +0000 (16:00 -0700)]
driver core: prevent device_for_each_child from oopsing

David Vrabel noticed that the wireless usb stack likes to call
device_for_each_chile() with an empty bus.  This used to work fine, but
now oopses.  This patch fixes the oops and makes the code behave like it
used to.

Reported-by: David Vrabel <david.vrabel@csr.com>
Tested-by: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodynamic debug: resurrect old pr_debug() semantics as pr_devel()
Michael Ellerman [Thu, 9 Apr 2009 21:48:24 +0000 (14:48 -0700)]
dynamic debug: resurrect old pr_debug() semantics as pr_devel()

pr_debug() used to produce zero code unless DEBUG was #defined.  This is
now no longer the case in practice[1].

There are places where it's useful to have debugging printks, but we don't
want them to generate any code in production kernels.

So add a new macro, pr_devel(), for _devel_opment, to provide the old
semantics, ie.  if the programmer doesn't explicitly enable debugging, no
code is produced.

[1]: You can turn CONFIG_DYNAMIC_DEBUG off, but it's enabled in at least
     one distro kernel, so it's not really a solution.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Greg Banks <gnb@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDriver Core: early platform driver
Magnus Damm [Mon, 30 Mar 2009 21:37:25 +0000 (14:37 -0700)]
Driver Core: early platform driver

V3 of the early platform driver implementation.

Platform drivers are great for embedded platforms because we can separate
driver configuration from the actual driver.  So base addresses,
interrupts and other configuration can be kept with the processor or board
code, and the platform driver can be reused by many different platforms.

For early devices we have nothing today.  For instance, to configure early
timers and early serial ports we cannot use platform devices.  This
because the setup order during boot.  Timers are needed before the
platform driver core code is available.  The same goes for early printk
support.  Early in this case means before initcalls.

These early drivers today have their configuration either hard coded or
they receive it using some special configuration method.  This is working
quite well, but if we want to support both regular kernel modules and
early devices then we need to have two ways of configuring the same
driver.  A single way would be better.

The early platform driver patch is basically a set of functions that allow
drivers to register themselves and architecture code to locate them and
probe.  Registration happens through early_param().  The time for the
probe is decided by the architecture code.

See Documentation/driver-model/platform.txt for more details.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: David Brownell <david-b@pacbell.net>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoproc: mounts_poll() make consistent to mdstat_poll
KOSAKI Motohiro [Thu, 9 Apr 2009 04:57:59 +0000 (13:57 +0900)]
proc: mounts_poll() make consistent to mdstat_poll

In recently sysfs_poll discussion, Neil Brown pointed out /proc/mounts
also should be fixed.

SUSv3 says "Regular files shall always poll TRUE for reading and
writing".  see
http://www.opengroup.org/onlinepubs/009695399/functions/poll.html

Then, mounts_poll()'s default should be "POLLIN | POLLRDNORM".  it mean
always readable.

In addition, event trigger should use "POLLERR | POLLPRI" instead
POLLERR.  it makes consistent to mdstat_poll() and sysfs_poll(). and,
select(2) can handle POLLPRI easily.

Reported-by: Neil Brown <neilb@suse.de>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Ram Pai <linuxram@us.ibm.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: sysfs poll keep the poll rule of regular file.
KOSAKI Motohiro [Thu, 9 Apr 2009 04:53:22 +0000 (13:53 +0900)]
sysfs: sysfs poll keep the poll rule of regular file.

Currently, following test programs don't finished.

% ruby -e '
Thread.new { sleep }
File.read("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies")
'

strace expose the reason.

...
open("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbf9fa6b8) = -1 ENOTTY (Inappropriate ioctl for device)
fstat64(3, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
_llseek(3, 0, [0], SEEK_CUR)            = 0
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
read(3, "1400000 1300000 1200000 1100000 1"..., 4096) = 62
select(4, [3], NULL, NULL, NULL

Because Ruby (the scripting language) VM assume select system-call
against regular file don't block.  it because SUSv3 says "Regular files
shall always poll TRUE for reading and writing".  see
http://www.opengroup.org/onlinepubs/009695399/functions/poll.html it
seems valid assumption.

But sysfs_poll() don't keep this rule although sysfs file can read and
write always.

This patch restore proper poll behavior to sysfs.
/sys/block/md*/md/sync_action polling application and another sysfs
updating sensitive application still can use POLLERR and POLLPRI.

Cc: Neil Brown <neilb@suse.de>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: allow non-root users to listen to uevents
Kay Sievers [Fri, 3 Apr 2009 17:04:15 +0000 (19:04 +0200)]
driver core: allow non-root users to listen to uevents

Users can read sysfs files, there is no reason they should not be
allowed to listen to uevents.  This lets xorg and other userspace
programs properly get these messages without having to be root.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: fix driver_match_device
Ming Lei [Fri, 27 Mar 2009 13:50:00 +0000 (21:50 +0800)]
driver core: fix driver_match_device

This patch fixes a bug introduced in commit
49b420a13ff95b449947181190b08367348e3e1b.

If a instance of bus_type doesn't have  .match method,
all .probe of drivers in the bus should be called, or else
the .probe have not a chance to be called.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: don't use global workqueue in sysfs_schedule_callback()
Alex Chiang [Wed, 25 Mar 2009 21:11:36 +0000 (15:11 -0600)]
sysfs: don't use global workqueue in sysfs_schedule_callback()

A sysfs attribute using sysfs_schedule_callback() to commit suicide
may end up calling device_unregister(), which will eventually call
a driver's ->remove function.

Drivers may call flush_scheduled_work() in their shutdown routines,
in which case lockdep will complain with something like the following:

  =============================================
  [ INFO: possible recursive locking detected ]
  2.6.29-rc8-kk #1
  ---------------------------------------------
  events/4/56 is trying to acquire lock:
  (events){--..}, at: [<ffffffff80257fc0>] flush_workqueue+0x0/0xa0

  but task is already holding lock:
  (events){--..}, at: [<ffffffff80257648>] run_workqueue+0x108/0x230

  other info that might help us debug this:
  3 locks held by events/4/56:
  #0:  (events){--..}, at: [<ffffffff80257648>] run_workqueue+0x108/0x230
  #1:  (&ss->work){--..}, at: [<ffffffff80257648>] run_workqueue+0x108/0x230
  #2:  (pci_remove_rescan_mutex){--..}, at: [<ffffffff803c10d1>] remove_callback+0x21/0x40

  stack backtrace:
  Pid: 56, comm: events/4 Not tainted 2.6.29-rc8-kk #1
  Call Trace:
  [<ffffffff8026dfcd>] validate_chain+0xb7d/0x1260
  [<ffffffff8026eade>] __lock_acquire+0x42e/0xa40
  [<ffffffff8026f148>] lock_acquire+0x58/0x80
  [<ffffffff80257fc0>] ? flush_workqueue+0x0/0xa0
  [<ffffffff8025800d>] flush_workqueue+0x4d/0xa0
  [<ffffffff80257fc0>] ? flush_workqueue+0x0/0xa0
  [<ffffffff80258070>] flush_scheduled_work+0x10/0x20
  [<ffffffffa0144065>] e1000_remove+0x55/0xfe [e1000e]
  [<ffffffff8033ee30>] ? sysfs_schedule_callback_work+0x0/0x50
  [<ffffffff803bfeb2>] pci_device_remove+0x32/0x70
  [<ffffffff80441da9>] __device_release_driver+0x59/0x90
  [<ffffffff80441edb>] device_release_driver+0x2b/0x40
  [<ffffffff804419d6>] bus_remove_device+0xa6/0x120
  [<ffffffff8043e46b>] device_del+0x12b/0x190
  [<ffffffff8043e4f6>] device_unregister+0x26/0x70
  [<ffffffff803ba969>] pci_stop_dev+0x49/0x60
  [<ffffffff803baab0>] pci_remove_bus_device+0x40/0xc0
  [<ffffffff803c10d9>] remove_callback+0x29/0x40
  [<ffffffff8033ee4f>] sysfs_schedule_callback_work+0x1f/0x50
  [<ffffffff8025769a>] run_workqueue+0x15a/0x230
  [<ffffffff80257648>] ? run_workqueue+0x108/0x230
  [<ffffffff8025846f>] worker_thread+0x9f/0x100
  [<ffffffff8025bce0>] ? autoremove_wake_function+0x0/0x40
  [<ffffffff802583d0>] ? worker_thread+0x0/0x100
  [<ffffffff8025b89d>] kthread+0x4d/0x80
  [<ffffffff8020d4ba>] child_rip+0xa/0x20
  [<ffffffff8020cebc>] ? restore_args+0x0/0x30
  [<ffffffff8025b850>] ? kthread+0x0/0x80
  [<ffffffff8020d4b0>] ? child_rip+0x0/0x20

Although we know that the device_unregister path will never acquire
a lock that a driver might try to acquire in its ->remove, in general
we should never attempt to flush a workqueue from within the same
workqueue, and lockdep rightly complains.

So as long as sysfs attributes cannot commit suicide directly and we
are stuck with this callback mechanism, put the sysfs callbacks on
their own workqueue instead of the global one.

This has the side benefit that if a suicidal sysfs attribute kicks
off a long chain of ->remove callbacks, we no longer induce a long
delay on the global queue.

This also fixes a missing module_put in the error path introduced
by sysfs-only-allow-one-scheduled-removal-callback-per-kobj.patch.

We never destroy the workqueue, but I'm not sure that's a
problem.

Reported-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Tested-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agox86: fix microcode driver newly spewing warnings
Dmitry Adamushko [Wed, 15 Apr 2009 14:51:48 +0000 (16:51 +0200)]
x86: fix microcode driver newly spewing warnings

Jeff Garzik reported this WARN_ON() noise:

> Kernel: 2.6.30-rc1-00306-g8371f87
> Hardware: ICH10 x86-64
>
> This is a regression from 2.6.29.  Microcode spews the following WARNING
> multiple times during boot:
>
> ------------[ cut here ]------------
> WARNING: at fs/sysfs/group.c:138 sysfs_remove_group+0xeb/0xf0()
> Hardware name:         sysfs group ffffffffa0209700 not found for
>  kobject 'cpu0'

Keep sysfs files around for cpus even when we failed to locate
microcode for them at the moment of module loading. The appropriate
microcode firmware can become available later on.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agosched: Avoid printing sched_group::__cpu_power for default case
Gautham R Shenoy [Tue, 14 Apr 2009 03:39:36 +0000 (09:09 +0530)]
sched: Avoid printing sched_group::__cpu_power for default case

Commit 46e0bb9c12f4 ("sched: Print sched_group::__cpu_power
in sched_domain_debug") produces a messy dmesg output while
attempting to print the sched_group::__cpu_power for each
group in the sched_domain hierarchy.

Fix this by avoid printing the __cpu_power for default cases.
(i.e, __cpu_power == SCHED_LOAD_SCALE).

[ Impact: reduce syslog clutter ]

Reported-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
Fixed-by: Tony Luck <tony.luck@intel.com>
Cc: a.p.zijlstra@chello.nl
LKML-Reference: <20090414033936.GA534@in.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, PAT: Remove page granularity tracking for vm_insert_pfn maps
Pallipadi, Venkatesh [Wed, 8 Apr 2009 22:37:16 +0000 (15:37 -0700)]
x86, PAT: Remove page granularity tracking for vm_insert_pfn maps

This change resolves the problem of too many single page entries
in pat_memtype_list and "freeing invalid memtype" errors with i915,
reported here:

  http://marc.info/?l=linux-kernel&m=123845244713183&w=2

Remove page level granularity track and untrack of vm_insert_pfn.
memtype tracking at page granularity does not scale and cleaner
approach would be for the driver to request a type for a bigger
IO address range or PCI io memory range for that device, either at
mmap time or driver init time and just use that type during
vm_insert_pfn.

This patch just removes the track/untrack of vm_insert_pfn. That
means we will be in same state as 2.6.28, with respect to these APIs.

Newer APIs for the drivers to request a memtype for a bigger region
is coming soon.

[ Impact: fix Xorg startup warnings and hangs ]

Reported-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Tested-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
LKML-Reference: <20090408223716.GC3493@linux-os.sc.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Thu, 16 Apr 2009 21:42:04 +0000 (14:42 -0700)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  ata: Report 16/32bit PIO as best we can
  libata: use ATA_ID_CFA_*
  pata_legacy: fix no device fail path
  pata_hpt37x: fix HPT370 DMA timeouts
  libata: handle SEMB signature better

15 years agomm: pass correct mm when growing stack
Hugh Dickins [Thu, 16 Apr 2009 20:58:12 +0000 (21:58 +0100)]
mm: pass correct mm when growing stack

Tetsuo Handa reports seeing the WARN_ON(current->mm == NULL) in
security_vm_enough_memory(), when do_execve() is touching the
target mm's stack, to set up its args and environment.

Yes, a UMH_NO_WAIT or UMH_WAIT_PROC call_usermodehelper() spawns
an mm-less kernel thread to do the exec.  And in any case, that
vm_enough_memory check when growing stack ought to be done on the
target mm, not on the execer's mm (though apart from the warning,
it only makes a slight tweak to OVERCOMMIT_NEVER behaviour).

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoRevert "kobject: don't block for each kobject_uevent".
Hugh Dickins [Thu, 16 Apr 2009 20:55:29 +0000 (21:55 +0100)]
Revert "kobject: don't block for each kobject_uevent".

This reverts commit f520360d93cdc37de5d972dac4bf3bdef6a7f6a7.

Tetsuo Handa, running a kernel with CONFIG_DEBUG_PAGEALLOC=y and
CONFIG_UEVENT_HELPER_PATH=/sbin/hotplug, has been hitting RCU detected
CPU stalls: it's been spinning in the loop where do_execve() counts up
the args (but why wasn't fixup_exception working? dunno).

The recent change, switching kobject_uevent_env() from UMH_WAIT_EXEC
to UMH_NO_WAIT, is broken: the exec uses args on the local stack here,
and an env which is kfreed as soon as call_usermodehelper() returns.
It very much needs to wait for the exec to be done.

An alternative would be to keep the UMH_NO_WAIT, and complicate the code
to allocate and free these resources correctly? but no, as GregKH
pointed out when making the commit, CONFIG_UEVENT_HELPER_PATH="" is a
much better optimization - though some distros are still saying
/sbin/hotplug in their .config, yet with no such binary in their initrd
or their root.

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Will Newton <will.newton@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years ago[ARM] 5455/1: Fix IRQ noise from VIC code
Linus Walleij [Thu, 16 Apr 2009 20:17:56 +0000 (21:17 +0100)]
[ARM] 5455/1: Fix IRQ noise from VIC code

The VIC code will attempt to perform som
default set_irq_chip() and set_irq_chip_data()
on all IRQs supported by the VIC, while the new
IRQ handling code strictly checks for the global
NR_IRQS to be respected also for these IRQs.

This patch will respect the interrupt mask passed
to the VIC driver and will prevent it from
attempting to call these functions on any unused
interrupts.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years agoata: Report 16/32bit PIO as best we can
Alan Cox [Thu, 9 Apr 2009 16:31:17 +0000 (17:31 +0100)]
ata: Report 16/32bit PIO as best we can

The legacy old IDE ioctl API for this is a bit primitive so we try
and map stuff sensibly onto it.

- Set PIO over DMA devices to report 32bit
- Add ability to change the PIO32 settings if the controller permits it
- Add that functionality into the sff drivers
- Add that functionality into the VLB legacy driver
- Turn on the 32bit PIO on the ninja32 and add support there

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agolibata: use ATA_ID_CFA_*
Sergei Shtylyov [Mon, 13 Apr 2009 16:50:00 +0000 (20:50 +0400)]
libata: use ATA_ID_CFA_*

Use ATA_ID_CFA_* constants for CFA specific identify data words 162 and 163.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agopata_legacy: fix no device fail path
Tejun Heo [Tue, 14 Apr 2009 03:59:03 +0000 (12:59 +0900)]
pata_legacy: fix no device fail path

When pata_legacy can't detect any device, it unregisters the
platform_device and fails detection.  However, it forgets to detach
ata host triggering weird failures as the host later gets freed by
devres while still attached.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agopata_hpt37x: fix HPT370 DMA timeouts
Sergei Shtylyov [Tue, 14 Apr 2009 14:39:14 +0000 (18:39 +0400)]
pata_hpt37x: fix HPT370 DMA timeouts

The libata driver has copied the code from the IDE driver which caused a post
2.4.18 regression on many HPT370[A] chips -- DMA stopped to work completely,
only causing timeouts.  Now remove hpt370_bmdma_start() for good...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agolibata: handle SEMB signature better
Tejun Heo [Tue, 14 Apr 2009 21:21:10 +0000 (06:21 +0900)]
libata: handle SEMB signature better

WDC WD1600JS-62MHB5 successfully hits the window between ATA/ATAPI-7
and Serial ATA II standards and reports 3c/c3 signature which now is
assigned to SEMB.  Make ata_dev_classify() report ATA_DEV_SEMB on the
sig and let ata_dev_read_id() work around it by trying IDENTIFY once.

This fixes bko#11579.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: David Haun <drhaun88@gmail.com>
Reported-by: Lars Wirzenius <liw@liw.fi>
Reported-by: Juan Manuel <jmcarranza@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agox86: UV BAU distribution and payload MMRs
Cliff Wickman [Thu, 16 Apr 2009 12:53:09 +0000 (07:53 -0500)]
x86: UV BAU distribution and payload MMRs

This patch correctly sets BAU memory mapped registers to point
to the sending activation descriptor table and target payload table.

The "Broadcast Assist Unit" is used for TLB shootdown in UV.

The memory mapped registers that point to sending and receiving
memory structures contain node numbers.

In one case the __pa() function did not provide the node id of
memory on blade zero in configurations where that id is nonzero.
In another case, it was assumed that memory was allocated on
the local node.  That assumption is not true in a configuration
in which the node has no memory.

Tested on the UV hardware simulator.

[ Impact: fix possible runtime crash due to incorrect TLB logic ]

Signed-off-by: Cliff Wickman <cpw@sgi.com>
LKML-Reference: <E1LuR5Z-0007An-B8@eag09.americas.sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years ago[ARM] 5454/1: ep93xx_eth: fix sparse warnings
Hartley Sweeten [Thu, 16 Apr 2009 16:56:10 +0000 (17:56 +0100)]
[ARM] 5454/1: ep93xx_eth: fix sparse warnings

Fix 50+ sparse warnings in the ep93xx ethernet driver.

  warning: incorrect type in argument 1 (different address spaces)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years agoMerge branch 'next' into for-linus
Dmitry Torokhov [Thu, 16 Apr 2009 15:51:52 +0000 (08:51 -0700)]
Merge branch 'next' into for-linus

15 years agoMerge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6
Russell King [Thu, 16 Apr 2009 15:16:34 +0000 (16:16 +0100)]
Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6

15 years ago[ARM] remove .gitignore from include/asm-arm
Russell King [Thu, 16 Apr 2009 15:09:08 +0000 (16:09 +0100)]
[ARM] remove .gitignore from include/asm-arm

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years agoAdd block_write_full_page_endio for passing endio handler
Chris Mason [Wed, 15 Apr 2009 17:22:38 +0000 (13:22 -0400)]
Add block_write_full_page_endio for passing endio handler

block_write_full_page doesn't allow the caller to control what happens
when the IO is over.  This adds a new call named block_write_full_page_endio
so the buffer head end_io handler can be provided by the caller.

This will be used by the ext3 data=guarded mode to do i_size updates in
a workqueue based end_io handler.  end_buffer_async_write is also
exported so it can be called to do the dirty work of managing page
writeback for the higher level end_io handler.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Acked-by: Theodore Tso <tytso@mit.edu>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoExport filemap_write_and_wait_range
Chris Mason [Wed, 15 Apr 2009 17:22:37 +0000 (13:22 -0400)]
Export filemap_write_and_wait_range

This wasn't exported before and is useful (used by the experimental ext3
data=guarded code)

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Acked-by: Theodore Tso <tytso@mit.edu>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Thu, 16 Apr 2009 14:41:56 +0000 (07:41 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (64 commits)
  phylib: Fix delay argument of schedule_delayed_work
  NET/ixgbe: Fix powering off during shutdown
  NET/e1000e: Fix powering off during shutdown
  NET/e1000: Fix powering off during shutdown
  packet: avoid warnings when high-order page allocation fails
  gianfar: stop send queue before resetting gianfar
  myr10ge: again fix lro_gen_skb() alignment
  declance: convert to net_device_ops
  bfin_mac: convert to net_device_ops
  au1000: convert to net_device_ops
  atarilance: convert to net_device_ops
  a2065: convert to net_device_ops
  ixgbe: update real_num_tx_queues on changing num_rx_queues
  ixgbe: fix tx queue index
  Revert "rose: zero length frame filtering in af_rose.c"
  sfc: Use correct macro to set event bitfield
  sfc: Match calls to netif_napi_add() and netif_napi_del()
  bonding: Remove debug printk
  e1000/e1000: fix compile warning
  ehea: Fix incomplete conversion to net_device_ops
  ...

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Thu, 16 Apr 2009 14:40:48 +0000 (07:40 -0700)]
Merge git://git./linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc: remove some pointless conditionals before kfree()
  sbus: changed ioctls to unlocked
  sparc: asm/atomic.h on 32bit should include asm/system.h for xchg
  sparc64: Fix smp_callin() locking.

15 years agoUpdate MAINTAINERS
Russell King [Thu, 16 Apr 2009 13:05:27 +0000 (14:05 +0100)]
Update MAINTAINERS

Update rmk's email address, and expand on what he's responsible for.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years agoASoC: OMAP: Fix FS polarity in OSK5912 machine driver
Jarkko Nikula [Wed, 15 Apr 2009 10:48:17 +0000 (13:48 +0300)]
ASoC: OMAP: Fix FS polarity in OSK5912 machine driver

Using inverted FS polarity in OSK5912 must be an error since TLV320AIC23
do not have support for inverted polarities. This is mostly due the hassle
with the DSP formats in OMAP McBSP DAI and inversion on OMAP side probably
just made this configuration working at some point.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Acked-by: Arun KS <arunks@mistralsolutions.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: OMAP: Fix DSP_B format in OMAP McBSP DAI driver
Jarkko Nikula [Wed, 15 Apr 2009 10:48:16 +0000 (13:48 +0300)]
ASoC: OMAP: Fix DSP_B format in OMAP McBSP DAI driver

The DSP format wasn't still correct in OMAP McBSP DAI even after the commit
bd25867a6cbe7a00ef7dbe8d9ddebc91b00b9b3f.

Thanks to Peter Ujfalusi <peter.ujfalusi@nokia.com> for noticing and being
part of the fix. Now the FS length definition is more clear by defining
it with  FWID(0).

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Fix include build error in s3c2412-i2s.c
Ben Dooks [Thu, 16 Apr 2009 09:32:21 +0000 (10:32 +0100)]
ASoC: Fix include build error in s3c2412-i2s.c

Fix accidental change of <mach/regs-gpio.h> to
<plat/regs-gpio.h> in s3c2412-i2s.c

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Fix s3c-i2s-v2.c snd_soc_dai changes
Ben Dooks [Thu, 16 Apr 2009 09:32:22 +0000 (10:32 +0100)]
ASoC: Fix s3c-i2s-v2.c snd_soc_dai changes

Fix the build error in s3c-i2s-v2.c caused by
a change to the snd_soc_dai ops field.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: s3c-i2s-v2.c fix for s3c_i2sv2_iis_calc_rate
Ben Dooks [Thu, 16 Apr 2009 09:32:23 +0000 (10:32 +0100)]
ASoC: s3c-i2s-v2.c fix for s3c_i2sv2_iis_calc_rate

The definition of s3c_i2sv2_iis_calc_rate was never
renamed from s3c2412_iis_calc_rate, so rename this
to allow the build to work.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: Fix jive_wm8750.c build problems
Ben Dooks [Thu, 16 Apr 2009 09:32:20 +0000 (10:32 +0100)]
ASoC: Fix jive_wm8750.c build problems

Fix build errors in sound/soc/s3c24xx/jive_wm8750.c
from changes to ASoC.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoASoC: pxa-ssp: allow setting of dai format 0
Daniel Mack [Wed, 15 Apr 2009 18:24:45 +0000 (20:24 +0200)]
ASoC: pxa-ssp: allow setting of dai format 0

pxa_ssp_set_dai_fmt() currently has an early exit if the desired format
equals the current configuration. This is correct behaviour unless this
function is called with a zero value parameter for the first time.
Zero is a valid value for this function, but the early exit is bogus in
this case.

Hence, set priv->dai_fmt to -1 in the beginning so we can configure the
port.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: pHilipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoALSA: hda - Add upper-limit of mixer amp for AD1884A-laptop model, too
Takashi Iwai [Thu, 16 Apr 2009 12:19:19 +0000 (14:19 +0200)]
ALSA: hda - Add upper-limit of mixer amp for AD1884A-laptop model, too

Add the upper-limit of mixer amp for AD1884A-laptop model just like
the mobile model for some HP laptops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agomxc defconfig updates
Sascha Hauer [Wed, 8 Apr 2009 09:39:34 +0000 (11:39 +0200)]
mxc defconfig updates

This patch removes several i.MX board specific defconfig files in favour
for a mx1_defconfig, mx27_defconfig and mx3_defconfig. All config files
have all currently available boards, i.MX specific drivers and the network
device drivers for the boards enabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
15 years agomx31ads: Mark as having full regulatoion constraints with 1133-EV1 board
Mark Brown [Mon, 13 Apr 2009 12:05:28 +0000 (13:05 +0100)]
mx31ads: Mark as having full regulatoion constraints with 1133-EV1 board

This allows the regulator API to power off unused regulators at the end
of init.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agomx31ads: Depend on all the WM8350 core dependencies for WM1133-EV1 board
Mark Brown [Tue, 14 Apr 2009 10:25:18 +0000 (11:25 +0100)]
mx31ads: Depend on all the WM8350 core dependencies for WM1133-EV1 board

Otherwise we'd need massive ifdefs in the code.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 years agoFix ifdef in plat-mxc/irc.c
Darius Augulis [Wed, 8 Apr 2009 13:17:50 +0000 (16:17 +0300)]
Fix ifdef in plat-mxc/irc.c

Move ifdef under function brackets. This fixes compile crach when IRQ priorities
are disabled.

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
15 years agoMX1ADS: remove I2C ifdefs
Darius Augulis [Wed, 8 Apr 2009 08:15:00 +0000 (11:15 +0300)]
MX1ADS: remove I2C ifdefs

Signed-off-by: Darius Augulis <augulis.darius@gmail.com>