11 years agofirmware: convert sb16_csp driver to use firmware loader exclusively
Jaswinder Singh [Sat, 5 Jul 2008 12:35:22 +0000]
firmware: convert sb16_csp driver to use firmware loader exclusively

Signed-off-by: Jaswinder Singh <jaswinder@infradead.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agodsp56k: use request_firmware
Jaswinder Singh [Sat, 5 Jul 2008 09:58:30 +0000]
dsp56k: use request_firmware

Signed-off-by: Jaswinder Singh <jaswinder@infradead.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agoedgeport-ti: use request_firmware()
Jaswinder Singh [Fri, 4 Jul 2008 17:36:09 +0000]
edgeport-ti: use request_firmware()

Firmware blob looks like this...
        uint8_t  MajorVersion
        uint8_t  MinorVersion
        __le16   BuildNumber
        uint8_t  data[]

Signed-off-by: Jaswinder Singh <jaswinder@infradead.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agoedgeport: use request_firmware()
Jaswinder Singh [Thu, 3 Jul 2008 11:30:23 +0000]
edgeport: use request_firmware()

Version number provided in first HEX record.

Signed-off-by: Jaswinder Singh <jaswinder@infradead.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agovicam: use request_firmware()
Jaswinder Singh [Fri, 27 Jun 2008 14:20:40 +0000]
vicam: use request_firmware()

Although it wasn't actually using ihex records before, we use the Intel
HEX record format for this firmware -- because that gives us a simple
way to split it into separate chunks internally as we need, without
loading each part as a separate file.

Signed-off-by: Jaswinder Singh <jaswinder@infradead.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agodabusb: use request_firmware()
David Woodhouse [Mon, 23 Jun 2008 10:41:04 +0000]
dabusb: use request_firmware()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agocpia2: use request_firmware()
David Woodhouse [Mon, 23 Jun 2008 10:36:23 +0000]
cpia2: use request_firmware()

Thanks for Jaswinder Singh for converting the firmware blob itself to ihex.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agoip2: use request_firmware()
David Woodhouse [Wed, 11 Jun 2008 15:57:21 +0000]
ip2: use request_firmware()

Converted with help from Jaswinder Singh

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Alan Cox <alan@redhat.com>

11 years agofirmware: convert Ambassador ATM driver to request_firmware()
David Woodhouse [Thu, 5 Jun 2008 11:59:51 +0000]
firmware: convert Ambassador ATM driver to request_firmware()

Since it had various regions to be loaded to separate addresses, and it
wanted to do them in fairly small chunks anyway, switch it to use the
new ihex code. Encode the start address in the first record.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Chas Williams <chas@cmf.nrl.navy.mil>

11 years agowhiteheat: use request_firmware()
David Woodhouse [Fri, 30 May 2008 22:35:29 +0000]
whiteheat: use request_firmware()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoti_usb_3410_5052: use request_firmware()
David Woodhouse [Fri, 30 May 2008 15:49:51 +0000]
ti_usb_3410_5052: use request_firmware()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoemi62: use request_firmware()
David Woodhouse [Fri, 30 May 2008 14:35:47 +0000]
emi62: use request_firmware()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoemi26: use request_firmware()
David Woodhouse [Fri, 30 May 2008 13:19:39 +0000]
emi26: use request_firmware()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agokeyspan_pda: use request_firmware()
David Woodhouse [Fri, 30 May 2008 12:15:13 +0000]
keyspan_pda: use request_firmware()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agokeyspan: use request_firmware()
David Woodhouse [Fri, 30 May 2008 11:04:03 +0000]
keyspan: use request_firmware()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agottusb-budget: use request_firmware()
David Woodhouse [Thu, 29 May 2008 16:50:06 +0000]
ttusb-budget: use request_firmware()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>

11 years agokaweth: use request_firmware()
David Woodhouse [Thu, 29 May 2008 14:17:17 +0000]
kaweth: use request_firmware()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agosmctr: use request_firmware()
David Woodhouse [Thu, 29 May 2008 13:39:16 +0000]
smctr: use request_firmware()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agofirmware: convert ymfpci driver to use firmware loader exclusively
David Woodhouse [Thu, 29 May 2008 12:07:34 +0000]
firmware: convert ymfpci driver to use firmware loader exclusively

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agofirmware: convert maestro3 driver to use firmware loader exclusively
David Woodhouse [Thu, 29 May 2008 11:48:34 +0000]
firmware: convert maestro3 driver to use firmware loader exclusively

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agofirmware: convert korg1212 driver to use firmware loader exclusively
David Woodhouse [Mon, 26 May 2008 22:01:27 +0000]
firmware: convert korg1212 driver to use firmware loader exclusively

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoihex: Add support for long records to ihex2fw.c
David Woodhouse [Thu, 26 Jun 2008 12:55:30 +0000]
ihex: Add support for long records to ihex2fw.c

Some drivers could do with using records like Intel HEX, but with each
record being larger than 256 bytes. This has been possible in the binary
representation (struct ihex_binrec) in the kernel since the beginning --
at least of the the current version of history. But we haven't been able
to represent that in the .HEX files which get converted to .fw files.

This adds a '-w' option to ihex2fw to make it interpret the first _two_
bytes of each line as the record length, instead of only one byte. And
adds makefile rules for %.H16->%.fw which use that.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoihex: add ihex2fw tool for converting HEX files into firmware images
David Woodhouse [Sat, 31 May 2008 12:07:18 +0000]
ihex: add ihex2fw tool for converting HEX files into firmware images

Not the straight conversion to binary which objcopy can do for us, but
actually representing each record with its original {addr, length},
because some drivers need that information preserved.

Fix up 'firmware_install' to be able to build $(hostprogs-y) too.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoihex: request_ihex_firmware() function to load and validate firmware
David Woodhouse [Sat, 31 May 2008 12:20:37 +0000]
ihex: request_ihex_firmware() function to load and validate firmware

Provide a helper to load the file and validate it in one call, to
simplify error handling in the drivers which are going to use it.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoihex.h: binary representation of ihex records
David Woodhouse [Fri, 30 May 2008 10:57:27 +0000]
ihex.h: binary representation of ihex records

Some devices need their firmware as a set of {address, len, data...}
records in some specific order rather than a simple blob.

The normal way of doing this kind of thing is 'ihex', which is a text
format and not entirely suitable for use in the kernel.

This provides a binary representation which is very similar, but much
more compact -- and a helper routine to skip to the next record,
because the alignment constraints mean that everybody will screw it up
for themselves otherwise.

Also a helper function which can verify that a 'struct firmware'
contains a valid set of ihex records, and that following them won't run
off the end of the loaded data.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agofirmware: Add firmware installation to modules_install, add firmware_install
David Woodhouse [Thu, 29 May 2008 08:01:51 +0000]
firmware: Add firmware installation to modules_install, add firmware_install

For 'make modules_install', install any firmware required by
the modules which are being installed.

Also add a 'make firmware_install' target which doesn't depend on the
configuration, but installs _all_ available in-kernel-tree firmware into
$(INSTALL_FW_PATH), which defaults to /lib/firmware. This is intended
for distributors to make arch-independent (and config-independent)
packages containing firmware.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agofirmware: Add CONFIG_FIRMWARE_IN_KERNEL option.
David Woodhouse [Wed, 25 Jun 2008 12:56:07 +0000]
firmware: Add CONFIG_FIRMWARE_IN_KERNEL option.

This will control whether we build firmware into the kernel image for
_every_ driver which we convert to request_firmware(), to avoid a
proliferation of 'CONFIG_XXX_FIRMWARE' options for each one.

Default to 'y' for now, which is the wrong thing to do but people seem
to be insisting on it and refusing to even review patches until it's
done. And it does preserve the existing behaviour for built-in drivers.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agofirmware: Add CONFIG_EXTRA_FIRMWARE option
David Woodhouse [Fri, 23 May 2008 12:58:12 +0000]
firmware: Add CONFIG_EXTRA_FIRMWARE option

This allows arbitrary firmware files to be included in the static kernel
where the firmware loader can find them without requiring userspace to
be alive.

(Updated and CONFIG_EXTRA_FIRMWARE_DIR added with lots of help from
Johannes Berg).

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

11 years agofirmware: allow firmware files to be built into kernel image
David Woodhouse [Fri, 23 May 2008 12:52:42 +0000]
firmware: allow firmware files to be built into kernel image

Some drivers have their own hacks to bypass the kernel's firmware loader
and build their firmware into the kernel; this renders those unnecessary.

Other drivers don't use the firmware loader at all, because they always
want the firmware to be available. This allows them to start using the
firmware loader.

A third set of drivers already use the firmware loader, but can't be
used without help from userspace, which sometimes requires an initrd.
This allows them to work in a static kernel.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agofirmware: make fw->data const
David Woodhouse [Fri, 23 May 2008 17:38:49 +0000]
firmware: make fw->data const

In preparation for supporting firmware files linked into the static
kernel, make fw->data const to ensure that users aren't modifying it (so
that we can pass a pointer to the original in-kernel copy, rather than
having to copy it).

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoFix a const pointer usage warning in the Digigram miXart soundcard driver
David Howells [Tue, 8 Jul 2008 16:43:01 +0000]
Fix a const pointer usage warning in the Digigram miXart soundcard driver

Fix a const pointer usage warning in the Digigram miXart soundcard driver.  A
const pointer is being passed to copy_from_user() to load the firmware into.
This is okay in this case because the function has allocated the firmware
struct itself, but the const qualifier is part of the firmware struct - so the
patch casts the const away.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agoFix a const pointer usage warning in the Digigram pcxhr soundcard driver
David Howells [Tue, 8 Jul 2008 16:45:58 +0000]
Fix a const pointer usage warning in the Digigram pcxhr soundcard driver

Fix a const pointer usage warning in the Digigram pcxhr compatible soundcard
driver.  A const pointer is being passed to copy_from_user() to load the
firmware into.  This is okay in this case because the function has allocated
the firmware struct itself, but the const qualifier is part of the firmware
struct - so the patch casts the const away.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agoFix a const pointer error in the Conexant cx23418 MPEG encoder driver
David Howells [Tue, 8 Jul 2008 16:38:56 +0000]
Fix a const pointer error in the Conexant cx23418 MPEG encoder driver

Fix a const pointer to non-const pointer assignment error in the Conexant
cx23418 MPEG encoder driver.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agoFix a const assignment in moxa_load_fw()
David Howells [Tue, 8 Jul 2008 16:37:15 +0000]
Fix a const assignment in moxa_load_fw()

Fix an assignment of a const pointer to a non-const pointer in moxa_load_fw().

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agoFix a const pointer usage warning in the Digigram VX soundcard driver
David Howells [Tue, 8 Jul 2008 16:36:45 +0000]
Fix a const pointer usage warning in the Digigram VX soundcard driver

Fix a const pointer usage warning in the Digigram VX soundcard driver.  A
const pointer is being passed to copy_from_user() to load the firmware into.
This is okay in this case because the function has allocated the firmware
struct itself, but the const qualifier will be part of the firmware
struct - so the patch casts the const away.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

11 years agoisight: treat firmware data as const
gregkh@suse.de [Thu, 29 May 2008 17:17:38 +0000]
isight: treat firmware data as const

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agox86 microcode: firmware data is const
Greg Kroah-Hartman [Thu, 29 May 2008 17:05:08 +0000]
x86 microcode: firmware data is const

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agodell_rbu: firmware data is const
Greg Kroah-Hartman [Thu, 29 May 2008 17:05:08 +0000]
dell_rbu: firmware data is const

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoymfpci: treat firmware data as const
David Woodhouse [Thu, 29 May 2008 11:40:00 +0000]
ymfpci: treat firmware data as const

Standardise both in-kernel and loaded firmware to be stored as
little-endian instead of host-endian.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agomaestro3: treat firmware data as const
David Woodhouse [Thu, 29 May 2008 08:58:27 +0000]
maestro3: treat firmware data as const

The maestro3 driver is byte-swapping its firmware to be host-endian in
advance, when it doesn't seem to be necessary -- we could just use
le16_to_cpu() as we load it.

Doing that means that we need to switch the in-tree firmware to be
little-endian too.

Take the least intrusive way of doing this, which is to switch the
existing snd_m3_convert_from_le() function to convert _to_ little-endian
instead, and use it on the in-tree firmware instead of the loaded
firmware. It's a bit suboptimal but doesn't matter much right now
because we're about to remove the special cases for the in-tree version
anyway.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agotuners: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:13:34 +0000]
tuners: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agogp8psk: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:13:08 +0000]
gp8psk: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agocxusb: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:12:42 +0000]
cxusb: treat firmware data as const

...which means allocating our own copy when we want to modify it.

(stupid thinko fixed by mkrufky)

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>

11 years agodvb frontends: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:12:23 +0000]
dvb frontends: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agottusb-dec: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:12:00 +0000]
ttusb-dec: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agobt8xx: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:11:44 +0000]
bt8xx: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agocxgb3: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:10:55 +0000]
cxgb3: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoirda-usb: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:10:26 +0000]
irda-usb: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoatmel: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:09:29 +0000]
atmel: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agop54: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:08:55 +0000]
p54: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agort2x00: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:08:39 +0000]
rt2x00: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agozd1201: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:08:19 +0000]
zd1201: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoaic94xx: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:05:45 +0000]
aic94xx: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agocxacru: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:05:28 +0000]
cxacru: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoueagle-atm: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:05:10 +0000]
ueagle-atm: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agovx: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:02:49 +0000]
vx: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agopcxhr: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:02:28 +0000]
pcxhr: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoriptide: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:02:03 +0000]
riptide: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agovx222: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:01:40 +0000]
vx222: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agomyri10ge: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 23:00:07 +0000]
myri10ge: treat firmware data as const

... which means allocating our own buffer for reading it back.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agocx25840: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 22:58:24 +0000]
cx25840: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Tyler Trafford <ttrafford@gmail.com>
Acked-by: Mike Isely <isely@pobox.com>

11 years agocyclades: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 22:57:19 +0000]
cyclades: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agobluetooth: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 22:56:51 +0000]
bluetooth: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agolibertas: treat firmware data as const
David Woodhouse [Fri, 23 May 2008 17:37:51 +0000]
libertas: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Wed, 9 Jul 2008 21:16:23 +0000]
Merge branch 'for-linus' of git://git./linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  RDMA/cxgb3: Fix regression caused by class_device -> device conversion

11 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
Linus Torvalds [Wed, 9 Jul 2008 04:48:26 +0000]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
  [PATCH] ocfs2/dlm: Fixes oops in dlm_new_lockres()

11 years agopowerpc: Add missing reference to coherent_dma_mask
Vitaly Bordug [Wed, 9 Jul 2008 03:13:38 +0000]
powerpc: Add missing reference to coherent_dma_mask

There is dma_mask in of_device upon of_platform_device_create()
but we don't actually set coherent_dma_mask. This may cause weird
behavior of USB subsystem using of_device USB host drivers.

Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Wed, 9 Jul 2008 01:10:51 +0000]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: tcrypt - Fix memory leak in test_cipher

11 years agokernel/printk.c: Made printk_recursion_bug_msg static.
Daniel Guilak [Tue, 8 Jul 2008 22:02:06 +0000]
kernel/printk.c: Made printk_recursion_bug_msg static.

Signed-off-by: Daniel Guilak <daniel@danielguilak.com>
Acked-by: Josh Triplett <josh@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agoRDMA/cxgb3: Fix regression caused by class_device -> device conversion
Steve Wise [Tue, 8 Jul 2008 21:40:05 +0000]
RDMA/cxgb3: Fix regression caused by class_device -> device conversion

The change to iwch_provider.c in commit f4e91eb4 ("IB: convert struct
class_device to struct device") undid the fix done in commit 7f049f2f
("RDMA/cxgb3: Hold rtnl_lock() around ethtool get_drvinfo call").  It
removed the calls to rtnl_lock() that serialized the iw_cxgb3 ethtool
ops calls into the cxgb3 driver.  This locking is needed to avoid
messing up the internal state of the cxgb3 driver.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

11 years agoFix broken fix for fsl-diu-db
Takashi Iwai [Tue, 8 Jul 2008 16:41:17 +0000]
Fix broken fix for fsl-diu-db

On 2.6.26-rc9, the commit 05946bce839b4fed5442dbfab77060fb75e051f3
("fsl_diu_fb: fix build with CONFIG_PM=y, plus fix some warnings")
breaks its previous fix f969c5672b16b857e5231ad3c78f08d8ef3305aa
("fsl-diu-db: compile fix")

This patch reverts the broken part.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agoMerge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
Linus Torvalds [Tue, 8 Jul 2008 19:40:57 +0000]
Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  SUNRPC: Fix an rpcbind breakage for the case of IPv6 lookups
  SUNRPC: Fix a double-free in rpcbind
  NFS: Fix readdir cache invalidation

11 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Tue, 8 Jul 2008 19:40:19 +0000]
Merge branch 'upstream' of git://ftp.linux-mips.org/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Fix 32bit kernels on R4k with 128 byte cache line size
  [MIPS] Atlas, decstation: Fix section mismatches triggered by defconfigs

11 years agoreiserfs: discard prealloc in reiserfs_delete_inode
Jeff Mahoney [Tue, 8 Jul 2008 18:37:06 +0000]
reiserfs: discard prealloc in reiserfs_delete_inode

With the removal of struct file from the xattr code,
reiserfs_file_release() isn't used anymore, so the prealloc isn't
discarded.  This causes hangs later down the line.

This patch adds it to reiserfs_delete_inode.  In most cases it will be a
no-op due to it already having been called, but will avoid hangs with
xattrs.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agoSUNRPC: Fix an rpcbind breakage for the case of IPv6 lookups
Trond Myklebust [Tue, 1 Jul 2008 19:20:55 +0000]
SUNRPC: Fix an rpcbind breakage for the case of IPv6 lookups

Now that rpcb_next_version has been split into an IPv4 version and an IPv6
version, we Oops when rpcb_call_async attempts to look up the IPv6-specific
RPC procedure in rpcb_next_version.

Fix the Oops simply by having rpcb_getport_async pass the correct RPC
procedure as an argument.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

11 years agoSUNRPC: Fix a double-free in rpcbind
Trond Myklebust [Mon, 7 Jul 2008 16:18:52 +0000]
SUNRPC: Fix a double-free in rpcbind

It is wrong to be freeing up the rpcbind arguments if the call to
rpcb_call_async() fails, since they should already have been freed up by
rpcb_map_release().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

11 years agoNFS: Fix readdir cache invalidation
Trond Myklebust [Mon, 7 Jul 2008 17:26:10 +0000]
NFS: Fix readdir cache invalidation

invalidate_inode_pages2_range() takes page offset arguments, not byte
ranges.

Another thought is that individual pages might perhaps get evicted by VM
pressure, in which case we might perhaps want to re-read not only the
evicted page, but all subsequent pages too (in case the server returns
more/less data per page so that the alignment of the next entry
changes). We should therefore remove the condition that we only do this on
page->index==0.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

11 years ago[MIPS] Fix 32bit kernels on R4k with 128 byte cache line size
Thomas Bogendoerfer [Tue, 8 Jul 2008 12:46:34 +0000]
[MIPS] Fix 32bit kernels on R4k with 128 byte cache line size

The generated copy_page for R4k CPU with a 128 byte cache line size used
Create Dirty Exclusive cache line operations even if only part of the
cache line was filled.  This change avoids generating cache operations,
if only part of the cache line size is copied in one loop. It also
increases the maxmimum loop size, because the generated code even fits
into the available space for r4k CPUs with 128 byte cache line size.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

11 years ago[MIPS] Atlas, decstation: Fix section mismatches triggered by defconfigs
Shane McDonald [Sat, 5 Jul 2008 23:19:42 +0000]
[MIPS] Atlas, decstation: Fix section mismatches triggered by defconfigs

Resolve these mismatches by defining affected functions with the __cpuinit
attribute, rather than __init.

Signed-off-by: Shane McDonald <mcdonald.shane@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Tue, 8 Jul 2008 18:19:11 +0000]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
  it8213: fix return value in it8213_init_one()
  palm_bk3710: fix IDECLK period calculation
  ide: add __ide_default_irq() inline helper

11 years agoit8213: fix return value in it8213_init_one()
Bartlomiej Zolnierkiewicz [Tue, 8 Jul 2008 17:27:23 +0000]
it8213: fix return value in it8213_init_one()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

11 years agopalm_bk3710: fix IDECLK period calculation
Sergei Shtylyov [Tue, 8 Jul 2008 17:27:22 +0000]
palm_bk3710: fix IDECLK period calculation

The driver uses completely bogus rounding formula for calculating period from
the IDECLK frequency which gives one-off period values (e.g. 11 ns with 100 MHz
IDECLK) which in turn can lead to overclocked IDE transfer timings.  Actually,
rounding is just wrong in this case, so use a mere division for a safe result.

While at it, also:

- give 'ide_palm_clk' variable a more suitable name;

- get rid of the useless 'ideclkp' variable;

- drop the LISP stype 'p' postfix from the 'clkp' variable's name. :-)

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: mcherkashin@ru.mvista.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

11 years agoide: add __ide_default_irq() inline helper
Bartlomiej Zolnierkiewicz [Tue, 8 Jul 2008 17:27:22 +0000]
ide: add __ide_default_irq() inline helper

Add __ide_default_irq() inline helper and use it instead of
ide_default_irq() in ide-probe.c and ns87415.c (all host drivers
except IDE PCI ones always setup hwif->irq so it is enough to
check only for I/O bases 0x1f0 and 0x170).

This fixes post-2.6.25 regression since ide_default_irq()
define could shadow ide_default_irq() inline.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

11 years agoMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Tue, 8 Jul 2008 16:29:34 +0000]
Merge branch 'for-linus' of git://git390.osdl.marist.edu/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] protect _PAGE_SPECIAL bit against mprotect

11 years agoCorrect hash flushing from huge_ptep_set_wrprotect()
David Gibson [Tue, 8 Jul 2008 05:58:16 +0000]
Correct hash flushing from huge_ptep_set_wrprotect()

As Andy Whitcroft recently pointed out, the current powerpc version of
huge_ptep_set_wrprotect() has a bug.  It just calls ptep_set_wrprotect()
which in turn calls pte_update() then hpte_need_flush() with the 'huge'
argument set to 0.  This will cause hpte_need_flush() to flush the wrong
hash entries (of any).  Andy's fix for this is already in the powerpc
tree as commit 016b33c4958681c24056abed8ec95844a0da80a3.

I have confirmed this is a real bug, not masked by some other
synchronization, with a new testcase for libhugetlbfs.  A process write
a (MAP_PRIVATE) hugepage mapping, fork(), then alter the mapping and
have the child incorrectly see the second write.

Therefore, this should be fixed for 2.6.26, and for the stable tree.
Here is a suitable patch for 2.6.26, which I think will also be suitable
for the stable tree (neither of the headers in question has been changed
much recently).

It is cut down slighlty from Andy's original version, in that it does
not include a 32-bit version of huge_ptep_set_wrprotect().  Currently,
hugepages are not supported on any 32-bit powerpc platform.  When they
are, a suitable 32-bit version can be added - the only 32-bit hardware
which supports hugepages does not use the conventional hashtable MMU and
so will have different needs anyway.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years ago[S390] protect _PAGE_SPECIAL bit against mprotect
Nick Piggin [Tue, 8 Jul 2008 09:31:06 +0000]
[S390] protect _PAGE_SPECIAL bit against mprotect

Stop mprotect's pte_modify from wiping out the s390 pte_special bit, which
caused oops thereafter when vm_normal_page thought X's abnormal was normal.

Debugged-by: Ryan Hope <rmh3093@gmail.com>
Debugged-by: Zan Lynx <zlynx@acm.org>
Acked-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

11 years agocrypto: tcrypt - Fix memory leak in test_cipher
Darren Jenkins [Tue, 8 Jul 2008 07:51:44 +0000]
crypto: tcrypt - Fix memory leak in test_cipher

Coverity CID: 2306 & 2307 RESOURCE_LEAK

In the second for loop in test_cipher(), data is allocated space with
kzalloc() and is only ever freed in an error case.
Looking at this loop, data is written to this memory but nothing seems
to read from it.
So here is a patch removing the allocation, I think this is the right
fix.

Only compile tested.

Signed-off-by: Darren Jenkins <darrenrjenkins@gmailcom>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

11 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Mon, 7 Jul 2008 23:59:43 +0000]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  Revert "PCI: Correct last two HP entries in the bfsort whitelist"

11 years agoRevert "PCI: Correct last two HP entries in the bfsort whitelist"
Jesse Barnes [Mon, 7 Jul 2008 16:55:26 +0000]
Revert "PCI: Correct last two HP entries in the bfsort whitelist"

This reverts commit a1676072558854b95336c8f7db76b0504e909a0a.  It duplicates
the change from 8d64c781f0c5fbfdf8016bd1634506ff2ad1376a and only one should be
applied, otherwise some of the Dell quirks are lost.

Thanks to Tony Camuso for catching this.

Acked-by: Tony Camuso <tcamuso@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

11 years ago[PATCH] ocfs2/dlm: Fixes oops in dlm_new_lockres()
Sunil Mushran [Mon, 7 Jul 2008 17:06:29 +0000]
[PATCH] ocfs2/dlm: Fixes oops in dlm_new_lockres()

Patch fixes a race that can result in an oops while adding a
lockres to the dlm lockres tracking list.

Bug introduced by mainline commit 29576f8bb54045be944ba809d4fca1ad77c94165.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>

11 years ago[UML] fix gcc ICEs and unresolved externs
Jeff Dike [Mon, 7 Jul 2008 17:36:56 +0000]
[UML] fix gcc ICEs and unresolved externs

There are various constraints on the use of unit-at-a-time:
 - i386 uses no-unit-at-a-time for pre-4.0 (not 4.3)
 - x86_64 uses unit-at-a-time always

Uli reported a crash on x86_64 with gcc 4.1.2 with unit-at-a-time,
resulting in commit c0a18111e571138747a98af18b3a2124df56a0d1

Ingo reported a gcc internal error with gcc 4.3 with no-unit-at-a-timem,
resulting in 22eecde2f9034764a3fd095eecfa3adfb8ec9a98

Benny Halevy is seeing extern inlines not resolved with gcc 4.3 with
no-unit-at-a-time

This patch reintroduces unit-at-a-time for gcc >= 4.0, bringing back the
possibility of Uli's crash.  If that happens, we'll debug it.

I started seeing both the internal compiler errors and unresolved
inlines on Fedora 9.  This patch fixes both problems, without so far
reintroducing the crash reported by Uli.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Benny Halevy <bhalevy@panasas.com>
Cc: Adrian Bunk <bunk@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Mon, 7 Jul 2008 16:24:28 +0000]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  can: add sanity checks
  fs_enet: restore promiscuous and multicast settings in restart()
  ibm_newemac: Fixes entry of short packets
  ibm_newemac: Fixes kernel crashes when speed of cable connected changes
  pasemi_mac: Access iph->tot_len with correct endianness
  ehea: Access iph->tot_len with correct endianness
  ehea: fix race condition
  ehea: add MODULE_DEVICE_TABLE
  ehea: fix might sleep problem
  forcedeth: fix lockdep warning on ethtool -s
  Add missing skb->dev assignment in Frame Relay RX code
  bridge: fix use-after-free in br_cleanup_bridges()
  tcp: fix a size_t < 0 comparison in tcp_read_sock
  tcp: net/ipv4/tcp.c needs linux/scatterlist.h
  libertas: support USB persistence on suspend/resume (resend)
  iwlwifi: drop skb silently for Tx request in monitor mode
  iwlwifi: fix incorrect 5GHz rates reported in monitor mode

11 years agopowerpc: Fix unterminated of_device_id array in legacy_serial.c
Benjamin Herrenschmidt [Mon, 7 Jul 2008 06:39:50 +0000]
powerpc: Fix unterminated of_device_id array in legacy_serial.c

A recent patch to legacy_serial.c factored out some code by
using the of_match_node() facility to match a node against
an array of possible matches. However, the patch didn't properly
terminate the array causing potential crashes in cases where no
match is found. In addition, the name of the array was poorly
chosen for a static symbol making debugging harder.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agovsprintf: add support for '%pS' and '%pF' pointer formats
Linus Torvalds [Sun, 6 Jul 2008 23:43:12 +0000]
vsprintf: add support for '%pS' and '%pF' pointer formats

They print out a pointer in symbolic format, if possible (ie using
symbolic KALLSYMS information).  The '%pS' format is for regular direct
pointers (which can point to data or code and that you find on the stack
during backtraces etc), while '%pF' is for C function pointer types.

On most architectures, the two mean exactly the same thing, but some
architectures use an indirect pointer for C function pointers, where the
function pointer points to a function descriptor (which in turn contains
the actual pointer to the code).  The '%pF' code automatically does the
appropriate function descriptor dereference on such architectures.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agovsprintf: add infrastructure support for extended '%p' specifiers
Linus Torvalds [Sun, 6 Jul 2008 23:24:57 +0000]
vsprintf: add infrastructure support for extended '%p' specifiers

This expands the kernel '%p' handling with an arbitrary alphanumberic
specifier extension string immediately following the '%p'.  Right now
it's just being ignored, but the next commit will start adding some
specific pointer type extensions.

NOTE! The reason the extension is appended to the '%p' is to allow
minimal gcc type checking: gcc will still see the '%p' and will check
that the argument passed in is indeed a pointer, and yet will not
complain about the extended information that gcc doesn't understand
about (on the other hand, it also won't actually check that the pointer
type and the extension are compatible).

Alphanumeric characters were chosen because there is no sane existing
use for a string format with a hex pointer representation immediately
followed by alphanumerics (which is what such a format string would have
traditionally resulted in).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agovsprintf: split out '%p' handling logic
Linus Torvalds [Sun, 6 Jul 2008 23:16:15 +0000]
vsprintf: split out '%p' handling logic

The actual code is the same, just split out into a helper function.
This makes it easier to read, and allows for simple future extension
of %p handling.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agovsprintf: split out '%s' handling logic
Linus Torvalds [Sun, 6 Jul 2008 23:06:25 +0000]
vsprintf: split out '%s' handling logic

The actual code is the same, just split out into a helper function.
This makes it easier to read, and allows for future sharing of the
string code.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agoMerge branch 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 6 Jul 2008 18:16:23 +0000]
Merge branch 'kvm-updates-2.6.26' of git://git./linux/kernel/git/avi/kvm

* 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
  KVM: IOAPIC: Fix level-triggered irq injection hang
  x86: KVM guest: Add memory clobber to hypercalls

11 years agopxamci: fix byte aligned DMA transfers
Philipp Zabel [Sat, 5 Jul 2008 23:15:34 +0000]
pxamci: fix byte aligned DMA transfers

The pxa27x DMA controller defaults to 64-bit alignment. This caused
the SCR reads to fail (and, depending on card type, error out) when
card->raw_scr was not aligned on a 8-byte boundary.

For performance reasons all scatter-gather addresses passed to
pxamci_request should be aligned on 8-byte boundaries, but if
this can't be guaranteed, byte aligned DMA transfers in the
have to be enabled in the controller to get correct behaviour.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

11 years agoRevert "USB: don't explicitly reenable root-hub status interrupts"
Linus Torvalds [Sun, 6 Jul 2008 17:27:25 +0000]
Revert "USB: don't explicitly reenable root-hub status interrupts"

This reverts commit e872154921a6b5256a3c412dd69158ac0b135176.

Andrey Borzenkov reports that it resulted in a totally hung machine for
him when loading the OHCI driver.  Extensive netconsole capture with
SysRq output shows that modprobe gets stuck in ohci_hub_status_data()
when probing and enabling the OHCI controller, see for example

http://lkml.org/lkml/2008/7/5/236

for an analysis.

The problem appears to be an interrupt flood triggered by the commit
that gets reverted, and Andrey confirmed that the revert makes things
work for him again.

Reported-and-tested-by: Andrey Borzenkov <arvidjaar@mail.ru>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <david-b@pacbell.net>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>