Commit Graph

83062 Commits (cb5f7b9a47963d9238398cd0c2676473e3c6896d)

Author SHA1 Message Date
Ingo Molnar 38cb47ba01 x86: relax RAM check in ioremap()
Kevin Winchester reported the loss of direct rendering, due to:

[    0.588184] agpgart: Detected AGP bridge 0
[    0.588184] agpgart: unable to get memory for graphics translation table.
[    0.588184] agpgart: agp_backend_initialize() failed.
[    0.588207] agpgart-amd64: probe of 0000:00:00.0 failed with error -12

and bisected it down to:

  commit 266b9f8727
  Author: Thomas Gleixner <tglx@linutronix.de>
  Date:   Wed Jan 30 13:34:06 2008 +0100

      x86: fix ioremap RAM check

this check was too strict and caused an ioremap() failure.

the problem is due to the somewhat unclean way of how the GART code
reserves a memory range for its aperture, and how it utilizes it
later on.

Allow RAM pages to be ioremap()-ed too, as long as they are reserved.

Bisected-by: Kevin Winchester <kjwinchester@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Kevin Winchester <kjwinchester@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-02-04 16:47:54 +01:00
Linus Torvalds a2e4e108c5 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (77 commits)
  [IPV6]: Reorg struct ifmcaddr6 to save some bytes
  [INET_TIMEWAIT_SOCK]: Reorganize struct inet_timewait_sock to save some bytes
  [DCCP]: Reorganize struct dccp_sock to save 8 bytes
  [INET6]: Reorganize struct inet6_dev to save 8 bytes
  [SOCK] proto: Add hashinfo member to struct proto
  EMAC driver: Fix bug: The clock divisor is set to all ones at reset.
  EMAC driver: fix bug - invalidate data cache of new_skb->data range when cache is WB
  EMAC driver: add power down mode
  EMAC driver: ADSP-BF52x arch/mach support
  EMAC driver: use simpler comment headers and strip out information that is maintained in the scm's log
  EMAC driver: bf537 MAC multicast hash filtering patch
  EMAC driver: define MDC_CLK=2.5MHz and caculate mdc_div according to SCLK.
  EMAC driver: shorten the mdelay value to solve netperf performance issue
  [netdrvr] sis190: build fix
  sky2: fix Wake On Lan interaction with BIOS
  sky2: restore multicast addresses after recovery
  pci-skeleton: Misc fixes to build neatly
  phylib: Add Realtek 821x eth PHY support
  natsemi: Update locking documentation
  PHYLIB: Locking fixes for PHY I/O potentially sleeping
  ...
2008-02-04 07:43:36 -08:00
Linus Torvalds a6cc48eeea Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6:
  Driver core: Remove unneeded get_{device,driver}() calls.
  Driver core: Update some prototypes in platform.txt
  driver core: convert to use class_find_device api
  PM: Export device_pm_schedule_removal
  nozomi: finish constification
  nozomi: constify driver
  nozomi driver update
  Add ja_JP translation of stable_kernel_rules.txt
  kobject: kerneldoc comment fix
  kobject: Always build in kernel/ksysfs.o.
2008-02-04 07:42:46 -08:00
Linus Torvalds 7cf7669143 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6:
  PCI: fix 4x section mismatch warnings
  PCI: fix section mismatch warnings referring to pci_do_scan_bus
  pci: pci_enable_device_bars() fix for lpfc driver
  Revert "PCI: PCIE ASPM support"
2008-02-04 07:42:16 -08:00
Richard Purdie 4cd9d6f774 [ARM] 4736/1: Export atags to userspace and allow kexec to use customised atags
Currently, the atags used by kexec are fixed to the ones originally used
to boot the kernel. This is less than ideal as changing the commandline,
initrd and other options would be a useful feature.

This patch exports the atags used for the current kernel to userspace
through an "atags" file in procfs. The presence of the file is
controlled by its own Kconfig option and cleans up several ifdef blocks
into a separate file. The tags for the new kernel are assumed to be at
a fixed location before the kernel image itself. The location of the
tags used to boot the original kernel is unimportant and no longer
saved.

Based on a patch from Uli Luckas <u.luckas@road.de>

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Uli Luckas <u.luckas@road.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:21:03 +00:00
Juergen Beisert c9a28fa7b9 [ARM] 4798/1: pcm027: fix missing header file
This patch adds a PXA2xx specific header file to control chip setup.
Without, the PCM027 BSP can't be built.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:17:34 +00:00
eric miao 6a0bd09dcd [ARM] 4803/1: pxa: fix building issue of poodle.c caused by patch 4737/1
The is caused by the patch below:

  [ARM] 4737/1: Refactor corgi_lcd to improve readability + bugfix

It renamed the confusing get_hsync_len() to get_hsync_invperiod(), which
unfortunately leaves poodle.c un-modified.

Signed-off-by: eric miao <eric.miao@marvell.com>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:17:34 +00:00
eric miao bb548dd432 [ARM] 4801/1: pxa: fix building issues of missing pxa2xx-regs.h
Some machines are missing "pxa2xx-regs.h" due to the following patch:

  [ARM] pxa: move memory controller registers into pxa2xx-regs.h

This patch fixes the issue by including the pxa2xx-regs.h where necessary.

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:17:34 +00:00
eric miao b1d907f9cc [ARM] pxa: introduce sysdev for pxa3xx static memory controller
Introduce a sysdev for pxa3xx static memory controller, mainly
for register saving/restoring in PM

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:17:33 +00:00
eric miao c4d1fb627f [ARM] pxa: add preliminary suspend/resume code for pxa3xx
1. clear RDH bit after resuming back from D3, otherwise, the multi function
   pins will retain the low power state

2. save/restore essential system registers

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:17:33 +00:00
eric miao 16dfdbf038 [ARM] pxa: introduce sysdev for GPIO register saving/restoring
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:17:33 +00:00
eric miao c016550490 [ARM] pxa: introduce sysdev for IRQ register saving/restoring
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:17:33 +00:00
eric miao cd5604d561 [ARM] pxa: fix the warning of undeclared "struct pxaohci_platform_data"
The header file <asm/arch/ohci.h> was missing in the original file,
include it to fix the warning.

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:17:32 +00:00
eric miao 14271a705a [ARM] pxa: change set_kset_name() to direct name assignment for MFP sysclass
Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:17:32 +00:00
Marc Pignat a78de2f704 [ARM] 4802/1: Fix typo and remove vague comment
Fix typo and remove vague comment

Signed-off-by: Marc Pignat <marc.pignat@hevs.ch>
Acked-by: Andrew Victor <linux@maxim.org.za>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:16:39 +00:00
Guennadi Liakhovetski fa3218d859 [ARM] 4660/3: at91: allow selecting UART for early kernel messages
Currently early kernel messages, i.e., those from uncompression, go to the
debugging UART. And if it is enabled in the platform configuration, but
not initialized by the bootloader, the machine hangs, waiting for UART
status change. Besides, having those messages on another UART - typically
the console UART - may be preferrable. This patch allows selecting the
UART in kernel configuration.

Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:16:39 +00:00
David Brownell e83aff58bf [ARM] 4739/1: at91sam9263: make gpio bank C and D irqs work
On the at91sam9263, IRQs for GPIO banks C and D don't currently work.
This is because banks C, D, and E share one clock and toplevel IRQ, but
the AT91 code setting up and handling GPIO IRQs expects no sharing.
This patch:

 - Fixes GPIO IRQ setup and handling to cope with GPIO banks that are
   shared like on sam9263 chips, by setting up a list of those banks
   and making the IRQ dispatching logic scan that list.

 - Precomputes the address of each bank's registers, saving it with
   other per-bank data so that it no longer needs to be constantly
   recomputed during IRQs and other GPIO operations.  That shrinks
   hot-path code, while helping the GPIO bank irq updates.

 - Fixes a minor bug where IRQ_TYPE_NONE was wrongly rejected (it just
   means "use the default", which is "both edges" here).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:16:39 +00:00
Rod Whitby 43816bcb72 [ARM] 4809/2: ixp4xx: Merge dsmg600-power.c into dsmg600-setup.c
There is no reason to have power control in a separate file from the
board setup code.  Merge it back into the board setup file and remove
superfluous header includes.

--

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:27 +00:00
Rod Whitby c7d1623e58 [ARM] 4808/2: ixp4xx: Merge nas100d-power.c into nas100d-setup.c
There is no reason to have power control in a separate file from the
board setup code.  Merge it back into the board setup file and remove
superfluous header includes.

--

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:27 +00:00
Rod Whitby 0929ac3ea4 [ARM] 4807/2: ixp4xx: Merge nslu2-power.c into nslu2-setup.c
There is no reason to have power control in a separate file from the
board setup code.  Merge it back into the board setup file, removing
superfluous header includes and removing superfluous constants from
the machine header file.

--

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:26 +00:00
Rod Whitby b7edc84a96 [ARM] 4806/1: ixp4xx: Ethernet support for the nslu2 and nas100d boards
Enables the new ixp4xx qmgr and npe drivers in ixp4xx_defconfig.

Sets up the corresponding platform data for the nslu2 and nas100d
boards, and reads the ethernet MAC address from the internal flash.

Tested on both little-endian and big-endian kernels.

Tested-by: Tom King <tom@websb.net>

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Michael Westerhof <mwester@dls.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:26 +00:00
Rod Whitby 1208ebf25b [ARM] 4805/1: ixp4xx: Use leds-gpio driver instead of IXP4XX-GPIO-LED driver
These are the only three boards to use the IXP4XX-GPIO-LED driver, and
they can all use the new leds-gpio driver instead with no change in
functionality.

--

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:26 +00:00
Rod Whitby 7822591370 [ARM] 4715/2: Ethernet support for IXDP425 boards
Adds IXDP425 platform support for two built-in 10/100 Ethernet ports.

This patch will do nothing until the actual Ethernet driver is
also included.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:25 +00:00
Krzysztof Halasa 80bbdd27e4 [ARM] 4714/2: Headers for IXP4xx built-in Ethernet and WAN drivers
Adds platform structs and #defines required by drivers for
IXP4xx built-in Ethernet and WAN (sync serial) ports.

The actual drivers will reside in drivers/net/arm and
drivers/net/wan and will be submitted separately.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:25 +00:00
Krzysztof Halasa 82a96f5790 [ARM] 4713/3: Adds drivers for IXP4xx QMgr and NPE features
This patch adds drivers for IXP4xx hardware Queue Manager and for
Network Processor Engines. Requires patch #4712 (reading/writing
CPU feature (aka fuse) bits).

Posted to linux-arm-kernel on 2 Dec 2007 and revised.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:25 +00:00
Krzysztof Halasa c18f65816e [ARM] 4712/2: Adds functions to read and write IXP4xx "feature" bits
Adds functions to read and write IXP4xx "feature" (aka "fuse")
bits, containing information about available/enabled CPU features.

The uncompress.h included by boot/compressed/misc.c resides in
a different space than rest of the kernel and thus can't use
asm/hardware.h (including asm/arch/cpu.h - which, in turn, may use
EXPORTed symbol "processor_id").

Posted to linux-arm-kernel on 2 Dec 2007 and revised.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:25 +00:00
Rod Whitby a9a424ce9a [ARM] 4774/2: ixp4xx: Register dsmg600 rtc i2c_board_info
Register the i2c board info related to the RTC chip on the dsmg600
board to allow it to be found automatically on boot.

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:24 +00:00
Rod Whitby 400d823148 [ARM] 4773/2: ixp4xx: Register nas100d rtc i2c_board_info
Register the i2c board info related to the RTC chip on the nas100d
board to allow it to be found automatically on boot.

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:24 +00:00
Rod Whitby e28067d533 [ARM] 4772/2: ixp4xx: Register nslu2 rtc i2c_board_info
Register the i2c board info related to the RTC chip on the nslu2 board
to allow it to be found automatically on boot.

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:24 +00:00
Rod Whitby 2bea80187f [ARM] 4769/2: ixp4xx: Button updates for the dsmg600 board
* Remove the superfluous declaration of ctrl_alt_del().
 * Convert GPIO and IRQ handling to use the <asm/gpio.h> api.
 * Perform the reset on the release of the power button, so that
   NAS devices which have been set to auto-power-on (by solder
   bridging the power button) do not continuously power cycle.
 * Remove all superflous constants from dsmg600.h

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:24 +00:00
Rod Whitby 14645ebabd [ARM] 4768/2: ixp4xx: Button and LED updates for the nas100d board
* Convert GPIO and IRQ handling to use the <asm/gpio.h> api.
 * Perform the reset only after the power button has been held down
   for at least two seconds.  Do the reset on the release of the power
   button, so that NAS devices which have been set to auto-power-on (by
   solder bridging the power button) do not continuously power cycle.
 * Remove all superflous constants from nas100d.h
 * Add LED constants to nas100d.h while we're there.
 * Update the board LED setup code to use those constants.

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:23 +00:00
Rod Whitby 8e93675e5b [ARM] 4767/2: ixp4xx: Add bitops.h include to io.h
Add include of <linux/bitops.h> to io.h to solve compilations errors in
files such as drivers/w1/w1_io.c caused by the ixp4xx version of io.h
using the BIT() macro without including <linux/bitops.h> first.

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:23 +00:00
Rod Whitby 95053aec4d [ARM] 4766/2: ixp4xx: Update ixp4xx_defconfig, enabling all supported boards
This updates the defconfig for the ixp4xx machine in arch/arm/config
taking all the defaults, with the following additions:

1) Enable support for the nslu2, loft, gateway7001, wg302v2,
   dsmg600, and gtwx5715 boards.
2) Enable EABI, OABI, HOTPLUG and FW_LOADER.
3) Enable the RTC subsystem, with drivers for the RTC chips on the
   nslu2 (x1205) and nas100d/dsmg600 (pcf8563) boards.
4) Enable the LEDS subsystem to support the nslu2, nas100d and
   dsmg600 boards.  Enable the ixp4xx beeper driver.
5) Enable the USB subsystem, USB host driver support and USB mass
   storage support (required for boot disk on nslu2 board).
6) Enable the ATA subsystem, with drivers for the nas100d/dsmg600
   (pata_artop) and avila (ixp4xx_cf) boards.

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:15:23 +00:00
Kristoffer Ericson 85e6c7a7db [ARM] 4810/1: - Fix 'section mismatch' building warnings
Warning message :
WARNING: vmlinux.o(.text+0x9afc): Section mismatch: reference to .init.text:sa1110_mb_enable (between 'sa1111_probe' and 'sa1111_remove')
WARNING: vmlinux.o(.text+0x13b1ac): Section mismatch: reference to .init.text:pcmcia_jornada720_init (between 'pcmcia_probe' and 'pcmcia_remove')

* fixes the 'section mismatch' building warnings for target sa1100. Solution is __init -> __devinit. Thanks to Randy Dunlap for pointing out the solution.

Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:14:07 +00:00
Peter Zijlstra 66a2c077c3 [ARM] xtime_seqlock: fix more ARM machines for xtime deadlocking
move update_process_times() out from under xtime_lock.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:14:07 +00:00
Russell King 2f65baff3a [ARM] 21285 serial: fix build error
drivers/serial/21285.c: In function 'serial21285_set_termios':
drivers/serial/21285.c:280: error: 'tty' undeclared (first use in this function)
drivers/serial/21285.c:280: error: (Each undeclared identifier is reported only once
drivers/serial/21285.c:280: error: for each function it appears in.)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-02-04 13:14:06 +00:00
Rusty Russell 6b35e40767 virtio: balloon driver
After discussions with Anthony Liguori, it seems that the virtio
balloon can be made even simpler.  Here's my attempt.

The device configuration tells the driver how much memory it should
take from the guest (ie. balloon size).  The guest feeds the page
numbers it has taken via one virtqueue.

A second virtqueue feeds the page numbers the driver wants back: if
the device has the VIRTIO_BALLOON_F_MUST_TELL_HOST bit, then this
queue is compulsory, otherwise it's advisory (and the guest can simply
fault the pages back in).

This driver can be enhanced later to deflate the balloon via a
shrinker, oom callback or we could even go for a complete set of
in-guest regulators.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:13 +11:00
Anthony Liguori 55a7c06604 virtio: Use PCI revision field to indicate virtio PCI ABI version
As Avi pointed out, as we continue to massage the virtio PCI ABI, we can make
things a little more friendly to users by utilizing the PCI revision field to
indicate which version of the ABI we're using.  This is a hard ABI version
and incrementing it will cause the guest driver to break.

This is the necessary changes to virtio_pci to support this.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:12 +11:00
Anthony Liguori 3343660d8c virtio: PCI device
This is a PCI device that implements a transport for virtio.  It allows virtio
devices to be used by QEMU based VMMs like KVM or Xen.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:11 +11:00
Christian Borntraeger d50ed907dc virtio_blk: implement naming for vda-vdz,vdaa-vdzz,vdaaa-vdzzz
Am Freitag, 1. Februar 2008 schrieb Christian Borntraeger:
> Right. I will fix that with an additional patch.

This patch goes on top of the minor number patch. Please let me know if
you want a merged patch:

Currently virtio_blk creates the disk name combinging "vd"  with 'a'++.
This will give strange names after vdz. I have implemented names up to
vdzzz - inspired by the sd.c code. That should be sufficient for now.

There is one driver in the kernel (driver/s390/block/dasd_genhd.c) that
implements names from dasda-dasdzzzz allowing even more disks. Maybe
a janitor can come up with a common implementation usable for all kind
of block device drivers.

I have tested this patch with 100 disks - seems to work.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:11 +11:00
Christian Borntraeger 4f3bf19c6e virtio_blk: Dont waste major numbers
Rusty,

currently virtio_blk uses one major number per device. While this works
quite well on most systems it is wasteful and will exhaust major numbers
on larger installations.

This patch allocates a major number on init and will use 16 minor numbers
for each disk. That will allow ~64k virtio_blk disks.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:10 +11:00
Christian Borntraeger 135da0b037 virtio_blk: provide getgeo
Rusty,

I currently try to make my guest boot from an virtio root device
without having an external kernel. Some of the tools that I tried
expect HDIO_GETGEO to work. The most interesting value is likely
the geo.start value to get the offset of a partition. This value
is filled by block/ioctl.c if fops->getgeo is set. This patch also
fills in some standard values for heads, sectors and cylinders.

Makes sense?

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:09 +11:00
Dor Laor 6c0cd7c000 virtio_net: parametrize the napi_weight for virtio receive queue.
It is done in order to improve performance.

Signed-off-by: Dor Laor <dor.laor@qumranet.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:09 +11:00
Rusty Russell 2cb9c6bafc virtio: free transmit skbs when notified, not on next xmit.
This fixes a potential dangling xmit problem.

We also suppress refill interrupts until we need them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:08 +11:00
Rusty Russell a48bd8f670 virtio: flush buffers on open
Fix bug found by Christian Borntraeger: if the other side fills all
the registered network buffers before we enable NAPI, we will never
get an interrupt.  The simplest fix is to process the input queue once
on open.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:07 +11:00
Christian Borntraeger e70f2f1bb8 virtnet: remove double ether_setup
Hello Rusty,

virtnet_probe already calls alloc_etherdev, which calls ether_setup.
There is no need to do that again.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:07 +11:00
Rusty Russell c6fd47011b virtio: Allow virtio to be modular and used by modules
This is needed for the virtio PCI device to be compiled as a module.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:06 +11:00
Rusty Russell 15f9c8903c virtio: Use the sg_phys convenience function.
Simple cleanup.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:05 +11:00
Anthony Liguori 0ad07ec1fd virtio: Put the virtio under the virtualization menu
This patch moves virtio under the virtualization menu and changes virtio
devices to not claim to only be for lguest.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:05 +11:00
Rusty Russell 81a8deab1c virtio: handle interrupts after callbacks turned off
Anthony Liguori found double interrupt suppression in the virtio_net
driver, triggered by two skb_recv_done's in a row.  This is because
virtio_ring's interrupt suppression is a best-effort optimization: it
contains no synchronization so the host can miss it and still send
interrupts.

But it's certainly nicer for virtio users if calling disable_cb
actually disables callbacks, so we check for the race in the interrupt
routine.

Note: SMP guests might require syncronization here, but since
disable_cb is actually called from interrupt context, there has to be
some form of synchronization before the next same interrupt handler is
called (Linux guarantees that the same device's irq handler will never
run simultanously on multiple CPUs).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-02-04 23:50:04 +11:00