]> err.no Git - linux-2.6/log
linux-2.6
17 years ago[MIPS] Make get_frame_info() more robust
Franck Bui-Huu [Thu, 3 Aug 2006 07:29:20 +0000 (09:29 +0200)]
[MIPS] Make get_frame_info() more robust

Now get_frame_info() wants to detect move sp instruction first. It
assumes that the save ra in the stack instruction can't happen
before allocating frame size space into the stack.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Simplify dump_stack()
Franck Bui-Huu [Thu, 3 Aug 2006 07:29:19 +0000 (09:29 +0200)]
[MIPS] Simplify dump_stack()

Make dump_stack() code not depend on CONFIG_KALLSYMS.

It also make prepare_frametrace() always inlined to get
less false entries reported by show_raw_backtrace().

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Make frame_info_init() more readable.
Franck Bui-Huu [Thu, 3 Aug 2006 07:29:18 +0000 (09:29 +0200)]
[MIPS] Make frame_info_init() more readable.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Miscellaneous cleanup in prologue analysis code
Franck Bui-Huu [Thu, 3 Aug 2006 07:29:17 +0000 (09:29 +0200)]
[MIPS] Miscellaneous cleanup in prologue analysis code

We usually use backtrace term for dumping a call tree during
debug. Therefore this patch renames show_frametrace() into
show_backtrace() and show_trace() into show_raw_backtrace().

It also uses the new function print_ip_sym().

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Remove unused MODULE_RANGE macro.
Franck Bui-Huu [Thu, 3 Aug 2006 07:29:16 +0000 (09:29 +0200)]
[MIPS] Remove unused MODULE_RANGE macro.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Make get_frame_info() more readable.
Franck Bui-Huu [Thu, 3 Aug 2006 07:29:15 +0000 (09:29 +0200)]
[MIPS] Make get_frame_info() more readable.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] c-r4k: Typo fix.
Ralf Baechle [Tue, 1 Aug 2006 22:42:30 +0000 (23:42 +0100)]
[MIPS] c-r4k: Typo fix.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] N32 rt_sigqueueinfo uses O32 padding, not N64
Peter Watkins [Thu, 27 Jul 2006 20:05:49 +0000 (16:05 -0400)]
[MIPS] N32 rt_sigqueueinfo uses O32 padding, not N64

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] dump_stack() based on prologue code analysis
Atsushi Nemoto [Sat, 29 Jul 2006 14:27:20 +0000 (23:27 +0900)]
[MIPS] dump_stack() based on prologue code analysis

Instead of dump all possible address in the stack, unwind the stack frame
based on prologue code analysis, as like as get_wchan() does.  While the
code analysis might fail for some reason, there is a new kernel option
"raw_show_trace" to disable this feature.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] db1x00: Remove unused mirage_ts.c
Yoichi Yuasa [Wed, 26 Jul 2006 14:34:19 +0000 (23:34 +0900)]
[MIPS] db1x00: Remove unused mirage_ts.c

CONFIG_WM97XX_COMODULE doesn't exist.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Rearrange show_stack, show_trace
Atsushi Nemoto [Tue, 25 Jul 2006 14:51:36 +0000 (23:51 +0900)]
[MIPS] Rearrange show_stack, show_trace

Print call-trace in show_stack() (like on other archs).  Also make
show_trace() static and simplify its argument list.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Updat mpc30x defconfig
Yoichi Yuasa [Tue, 25 Jul 2006 14:26:09 +0000 (23:26 +0900)]
[MIPS] Updat mpc30x defconfig

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Updat workpad defconfig
Yoichi Yuasa [Tue, 25 Jul 2006 14:24:54 +0000 (23:24 +0900)]
[MIPS] Updat workpad defconfig

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Update e55 defconfig
Yoichi Yuasa [Tue, 25 Jul 2006 14:24:47 +0000 (23:24 +0900)]
[MIPS] Update e55 defconfig

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Honour "panic_on_oops" sysctl.
Maxime Bizon [Thu, 20 Jul 2006 16:52:02 +0000 (18:52 +0200)]
[MIPS] Honour "panic_on_oops" sysctl.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years agopciehp - fix wrong return value
Kenji Kaneshige [Wed, 20 Sep 2006 00:04:33 +0000 (17:04 -0700)]
pciehp - fix wrong return value

This patch fixes the problem that trying to enable already enabled
slot disables the slot by returning the proper value from
pciehp_enable_slot()/pciehp_disable_slot().

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoIA64: PCI: dont disable irq which is not enabled
Satoru Takeuchi [Tue, 12 Sep 2006 17:24:14 +0000 (10:24 -0700)]
IA64: PCI: dont disable irq which is not enabled

This patch prevents pcibios_disable_device() from disabling interrupts
of devices which is not enabled.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoacpiphp: add support for ioapic hot-remove
Satoru Takeuchi [Tue, 12 Sep 2006 17:22:53 +0000 (10:22 -0700)]
acpiphp: add support for ioapic hot-remove

This patch adds support for ioapics hot-remove.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: assign ioapic resource at hotplug
Satoru Takeuchi [Tue, 12 Sep 2006 17:21:44 +0000 (10:21 -0700)]
PCI: assign ioapic resource at hotplug

We need to assign resources to ioapics being hot-added. This patch
changes pbus_assign_resources_sorted() to assign resources if the
ioapic has no assigned resources.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoacpiphp: disable bridges
Satoru Takeuchi [Tue, 12 Sep 2006 17:19:00 +0000 (10:19 -0700)]
acpiphp: disable bridges

Currently acpiphp calls pci_enable_device() against all
hot-added bridges, but acpiphp does not call pci_disable_device()
against them in hot-remove. So ioapic hot-remove would fail.
This patch fixes this issue.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoacpiphp: stop bus device before acpi_bus_trim
Satoru Takeuchi [Tue, 12 Sep 2006 17:17:46 +0000 (10:17 -0700)]
acpiphp: stop bus device before acpi_bus_trim

Contrary to PCI bridge hot-add, we need to follow the sequence below
for PCI bridge hot-removal.

  (1) Stop devices (detach drivers, remove from the global list, etc.)
  (2) Unbind ACPI node from the devices (remove the _PRT entries)
  (3) Remove devices (remove from the device list, etc.)

This patch fixes acpiphp driver to follow above sequence for P2P
bridge hot-removal.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: add pci_stop_bus_device
Satoru Takeuchi [Tue, 12 Sep 2006 17:16:36 +0000 (10:16 -0700)]
PCI: add pci_stop_bus_device

This patch adds pci_stop_bus_device() which stops a PCI device (detach
the driver, remove from the global list and so on) and any children.
This is needed for ACPI based PCI-to-PCI bridge hot-remove, and it will
be also needed for ACPI based PCI root bridge hot-remove.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoacpiphp: do not initialize existing ioapics
Satoru Takeuchi [Tue, 12 Sep 2006 17:15:10 +0000 (10:15 -0700)]
acpiphp: do not initialize existing ioapics

Currently acpiphp initializes all ioapics under the bus on which
hot-add event occured. It also initializes already working ioapics.
This patch fixes this bug.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoacpiphp: initialize ioapics before starting devices
Satoru Takeuchi [Tue, 12 Sep 2006 17:13:44 +0000 (10:13 -0700)]
acpiphp: initialize ioapics before starting devices

Currently acpiphp initializes ioapics after starting devices,
but ioapics should be initialized before starting devices.
This patch fixes this bug.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoacpiphp: set hpp values before starting devices
Satoru Takeuchi [Tue, 12 Sep 2006 17:12:16 +0000 (10:12 -0700)]
acpiphp: set hpp values before starting devices

Currently acpiphp sets hpp values after starting devices, but
the values should be set before starting devices. This patch
fixes this bug.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI Hotplug: cleanup pcihp skeleton code.
Satoru Takeuchi [Wed, 6 Sep 2006 07:47:28 +0000 (16:47 +0900)]
PCI Hotplug: cleanup pcihp skeleton code.

Cleanup pcihp skeleton code.

Fix some typos and remove some unnecessary blank lines.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Restore PCI Express capability registers after PM event
Michael S. Tsirkin [Mon, 21 Aug 2006 13:22:22 +0000 (16:22 +0300)]
PCI: Restore PCI Express capability registers after PM event

Restore PCI Express capability registers after PM event.
This includes maxumum MTU for PCI express and other vital data.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: drivers/pci/hotplug/acpiphp_glue.c: make a function static
Adrian Bunk [Tue, 15 Aug 2006 06:07:38 +0000 (23:07 -0700)]
PCI: drivers/pci/hotplug/acpiphp_glue.c: make a function static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Multiprobe sanitizer
Alan Cox [Wed, 16 Aug 2006 16:42:18 +0000 (17:42 +0100)]
PCI: Multiprobe sanitizer

There are numerous drivers that can use multithreaded probing but having
some kind of global flag as the way to control this makes migration to
threaded probing hard and since it enables it everywhere and is almost
as likely to cause serious pain as holding a clog dance in a minefield.

If we have a pci_driver multithread_probe flag to inherit you can turn
it on for one driver at a time.

From playing so far however I think we need a different model at the
device layer which serializes until the called probe function says "ok
you can start another one now". That would need some kind of flag and
semaphore plus a helper function.

Anyway in the absence of that this is a starting point to usefully play
with this stuff

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: fix __must_check warnings
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
PCI: fix __must_check warnings

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI Hotplug: fix __must_check warnings
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
PCI Hotplug: fix __must_check warnings

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoSHPCHP: fix __must_check warnings
Greg Kroah-Hartman [Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)]
SHPCHP: fix __must_check warnings

Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI-Express AER implemetation: pcie_portdrv error handler
Zhang, Yanmin [Mon, 31 Jul 2006 07:26:16 +0000 (15:26 +0800)]
PCI-Express AER implemetation: pcie_portdrv error handler

Patch 4 implements error handlers for pcie_portdrv.

Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI-Express AER implemetation: AER core and aerdriver
Zhang, Yanmin [Mon, 31 Jul 2006 07:21:33 +0000 (15:21 +0800)]
PCI-Express AER implemetation: AER core and aerdriver

Patch 3 implements the core part of PCI-Express AER and aerdrv
port service driver.

When a root port service device is probed, the aerdrv will call
request_irq to register irq handler for AER error interrupt.

When a device sends an PCI-Express error message to the root port,
the root port will trigger an interrupt, by either MSI or IO-APIC,
then kernel would run the irq handler. The handler collects root
error status register and schedules a work. The work will call
the core part to process the error based on its type
(Correctable/non-fatal/fatal).

As for Correctable errors, the patch chooses to just clear the correctable
error status register of the device.

As for the non-fatal error, the patch follows generic PCI error handler
rules to call the error callback functions of the endpoint's driver. If
the device is a bridge, the patch chooses to broadcast the error to
downstream devices.

As for the fatal error, the patch resets the pci-express link and
follows generic PCI error handler rules to call the error callback
functions of the endpoint's driver. If the device is a bridge, the patch
chooses to broadcast the error to downstream devices.

Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI-Express AER implemetation: export pcie_port_bus_type
Zhang, Yanmin [Mon, 31 Jul 2006 07:18:39 +0000 (15:18 +0800)]
PCI-Express AER implemetation: export pcie_port_bus_type

Patch 2 exports pcie_port_bus_type.

Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI-Express AER implemetation: aer howto document
Zhang, Yanmin [Mon, 31 Jul 2006 07:15:18 +0000 (15:15 +0800)]
PCI-Express AER implemetation: aer howto document

PCI-Express AER (Advanced Error Reporting) provides more robust error reporting.
The series of patches enable kernel support to AER.

The initial patches were written by Tom Long Nguyen. I ported them to the kernel
2.6.18-rc3. Many thanks to Rajesh Shah and Narayanan Chandramouli for their great
review comments and testing help.

Patch 1 consists of the pciaer-howto.txt document.

Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCIE: check and return bus_register errors
Randy Dunlap [Sun, 9 Jul 2006 05:58:25 +0000 (22:58 -0700)]
PCIE: check and return bus_register errors

Have pcie_port_bus_register() notice and return errors.
Mark it __must_check so that its caller(s) must check its return value.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Blacklist PCI-E chipsets depending on Hypertransport MSI capability
Brice Goglin [Thu, 31 Aug 2006 05:55:32 +0000 (01:55 -0400)]
MSI: Blacklist PCI-E chipsets depending on Hypertransport MSI capability

Introduce msi_ht_cap_enabled() to check the MSI capability in the
Hypertransport configuration space.
It is used in a generic quirk quirk_msi_ht_cap() to check whether
MSI is enabled on hypertransport chipset, and a nVidia specific quirk
quirk_nvidia_ck804_msi_ht_cap() where two 2 HT MSI mappings have to
be checked.
Both quirks set the PCI_BUS_FLAGS_NO_MSI bus flag when MSI is disabled.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Rename PCI_CAP_ID_HT_IRQCONF into PCI_CAP_ID_HT
Brice Goglin [Thu, 31 Aug 2006 05:55:24 +0000 (01:55 -0400)]
MSI: Rename PCI_CAP_ID_HT_IRQCONF into PCI_CAP_ID_HT

0x08 is the HT capability, while PCI_CAP_ID_HT_IRQCONF would be
the subtype 0x80 that mpic_scan_ht_pic() uses.
Rename PCI_CAP_ID_HT_IRQCONF into PCI_CAP_ID_HT.

And by the way, use it in the ipath driver instead of defining its
own HT_CAPABILITY_ID.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Export the PCI_BUS_FLAGS_NO_MSI flag in sysfs
Brice Goglin [Thu, 31 Aug 2006 05:55:15 +0000 (01:55 -0400)]
MSI: Export the PCI_BUS_FLAGS_NO_MSI flag in sysfs

Export the PCI_BUS_FLAGS_NO_MSI flag of a PCI bus in the sysfs files
of its parent device and make it writable. Could be used to:
* disable MSI on a device which has not been blacklisted yet
* allow MSI when some setpci hacks enable MSI support (for instance
  on the ServerWorks HT2000 chipset where the MSI HT cap is disabled
  by default).
Architecture where some bus have no parent chipset cannot use this
strategy to change MSI support.

If the chipset does not have a subordinate bus, its 'bus_msi' file
is empty.

Also document and warn about the possible danger of changing the flag.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Factorize common code in pci_msi_supported()
Brice Goglin [Thu, 31 Aug 2006 05:55:07 +0000 (01:55 -0400)]
MSI: Factorize common code in pci_msi_supported()

pci_enable_msi() and pci_enable_msix() use the same code to detect
whether MSI might be enabled on this device. Factorize this code in
pci_msi_supported(). And improve the documentation about the fact
that only the root chipset must support MSI, but it is hard to
find the root bus so we check all parent busses MSI flags.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Cleanup existing MSI quirks
Brice Goglin [Thu, 31 Aug 2006 05:54:56 +0000 (01:54 -0400)]
MSI: Cleanup existing MSI quirks

Move MSI quirks in CONFIG_PCI_MSI, document why the serverworks quirk
does not simply set PCI_BUS_FLAGS_NO_MSI, and create a generic quirk
for other chipsets where setting PCI_BUS_FLAGS_NO_MSI is fine.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoResources: insert identical resources above existing resources
Matthew Wilcox [Fri, 30 Jun 2006 09:31:24 +0000 (02:31 -0700)]
Resources: insert identical resources above existing resources

If you have two resources which aree exactly the same size,
insert_resource() currently inserts the new one below the existing one.
This is wrong because there's no way to insert a resource of the same size
above an existing one.

I took this opportunity to rewrite the initial loop to be a for-loop
instead of a goto-loop and fix the documentation.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: Drop unimplemented slave functions
Jean Delvare [Sun, 3 Sep 2006 20:41:08 +0000 (22:41 +0200)]
i2c: Drop unimplemented slave functions

i2c: Drop unimplemented slave functions

Drop the function declarations for slave mode support of i2c adapters.
This was never implemented, and by the time it is I bet we will want
something different anyway.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: Constify i2c_algorithm declarations, part 2
Jean Delvare [Sun, 3 Sep 2006 20:39:46 +0000 (22:39 +0200)]
i2c: Constify i2c_algorithm declarations, part 2

i2c: Constify i2c_algorithm declarations, part 2

Make struct i2c_algorithm declarations const in all i2c bus drivers
where it is possible.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: Constify i2c_algorithm declarations, part 1
Jean Delvare [Sun, 3 Sep 2006 20:38:52 +0000 (22:38 +0200)]
i2c: Constify i2c_algorithm declarations, part 1

i2c: Constify i2c_algorithm declarations, part 1

Make struct i2c_algorithm declarations const in all i2c algorithm
drivers.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: Let drivers constify i2c_algorithm data
David Brownell [Sun, 3 Sep 2006 20:37:11 +0000 (22:37 +0200)]
i2c: Let drivers constify i2c_algorithm data

i2c: Let drivers constify i2c_algorithm data

Let drivers constify I2C algorithm method operations tables,
moving them from ".data" to ".rodata".

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-isa: Restore driver owner
Jean Delvare [Sun, 3 Sep 2006 20:36:14 +0000 (22:36 +0200)]
i2c-isa: Restore driver owner

i2c-isa: Restore driver owner

Commit 2b48716d1d2f2edb1e7cbc5ecf1cb2cb39373e33 back in January
2006 was a bit overzealous. It removed .owner from all i2c drivers,
including i2c-isa ones, while they still need it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-viapro: Add support for the VT8237A and VT8251
Rudolf Marek [Sun, 3 Sep 2006 20:35:21 +0000 (22:35 +0200)]
i2c-viapro: Add support for the VT8237A and VT8251

i2c-viapro: Add support for the VT8237A and VT8251

Documentation update included. Compile tested.

Signed-off-by: Rudolf Marek <r.marek@sh.cvut.cz>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: Warn on i2c client creation failure
Jean Delvare [Sun, 3 Sep 2006 20:25:04 +0000 (22:25 +0200)]
i2c: Warn on i2c client creation failure

i2c: Warn on i2c client creation failure

Warn when an i2c client creation fails. If we don't, the user will
never know something wrong happened, as i2c client creation is
typically called through an attach_adapter callback, those return value
we currently ignore for technical reasons.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-core: Drop useless bitmaskings
Jean Delvare [Sun, 3 Sep 2006 20:24:00 +0000 (22:24 +0200)]
i2c-core: Drop useless bitmaskings

i2c-core: Drop useless bitmaskings

The code generated is exactly the same.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-algo-pcf: Discard the mdelay data struct member
Adrian Bunk [Sun, 3 Sep 2006 20:22:50 +0000 (22:22 +0200)]
i2c-algo-pcf: Discard the mdelay data struct member

i2c-algo-pcf: Discard the mdelay data struct member

Just as i2c-algo-bit, i2c-algo-pcf has an unused mdelay struct member,
which we can get rid of to spare some code and memory.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-algo-bit: Cleanups
Jean Delvare [Sun, 3 Sep 2006 20:22:12 +0000 (22:22 +0200)]
i2c-algo-bit: Cleanups

i2c-algo-bit: Cleanups

* Uninline long functions (saves around 1 kB or 15%)
* Refactor code in sclhi()
* Drop redundant udelay on repeated start

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-isa: Fail adding driver on attach_adapter error
David Hubbard [Sun, 3 Sep 2006 20:21:20 +0000 (22:21 +0200)]
i2c-isa: Fail adding driver on attach_adapter error

i2c-isa: Fail adding driver on attach_adapter error

Signed-off-by: David Hubbard <david.c.hubbard@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: __must_check fixes (chip drivers)
Jean Delvare [Sun, 3 Sep 2006 20:20:24 +0000 (22:20 +0200)]
i2c: __must_check fixes (chip drivers)

i2c: __must_check fixes (chip drivers)

Check for error on sysfs file creation.
Delete sysfs files on device removal.

The approach taken for the most complex case (pcf8591) is similar to
what Mark M. Hoffman proposed for hardware monitoring chip drivers.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ben Gardner <bgardner@wabtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-dev: attach/detach_adapter cleanups
Jean Delvare [Sun, 3 Sep 2006 20:19:25 +0000 (22:19 +0200)]
i2c-dev: attach/detach_adapter cleanups

i2c-dev: attach/detach_adapter cleanups

* Only print that an adapter was attached when it succeeds.
* i2c_dev == NULL on detach simply means that the attach failed
  before, this isn't an error per se.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-stub: Chip address as a module parameter
Jean Delvare [Sun, 13 Aug 2006 21:46:44 +0000 (23:46 +0200)]
i2c-stub: Chip address as a module parameter

i2c-stub: Chip address as a module parameter

Add a mandatory chip_addr parameter to i2c-stub. This parameter
defines to which chip address the driver will respond, instead of
reponding to all addresses as before. The idea is to prevent the
users from loading i2c-stub at random and being then confused by
the results of sensors-detect or other user-space tools.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: Plan i2c-isa for removal
Jean Delvare [Sun, 13 Aug 2006 21:45:52 +0000 (23:45 +0200)]
i2c: Plan i2c-isa for removal

i2c: Plan i2c-isa for removal

i2c-isa doesn't make much sense in the device driver model. Drivers
relying on it are better implemented as platform drivers. We must
wait for recent versions of libsensors (2.10.0 or later) to be widely
deployed beforehand, though. This move should also make it easier to
convert i2c-core to the device driver model.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: New bus driver for TI OMAP boards
Komal Shah [Sun, 13 Aug 2006 21:44:09 +0000 (23:44 +0200)]
i2c: New bus driver for TI OMAP boards

i2c: New bus driver for TI OMAP boards

This patch adds I2C bus driver for various Texas
Instruments (TI) OMAP1/2 (http://www.ti.com/omap) series
based boards like OMAP1510/1610/1710/242x.

Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-algo-bit: Discard the mdelay data struct member
Jean Delvare [Sun, 27 Aug 2006 09:46:49 +0000 (11:46 +0200)]
i2c-algo-bit: Discard the mdelay data struct member

i2c-algo-bit: Discard the mdelay data struct member

The i2c_algo_bit_data structure has an mdelay member, which is not
used by the algorithm code (the code has always been ifdef'd out.)
Let's discard it to save some code and memory.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-matroxfb: Struct init conversion
Jean Delvare [Sun, 13 Aug 2006 21:40:09 +0000 (23:40 +0200)]
i2c-matroxfb: Struct init conversion

i2c-matroxfb: Struct init conversion

Convert the struct i2c_algo_bit_data initialization to proper C99
style.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Petr Vandrovec <vandrove@vc.cvut.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: Fix copy-n-paste in subsystem Kconfig
Arthur Othieno [Sun, 13 Aug 2006 21:39:11 +0000 (23:39 +0200)]
i2c: Fix copy-n-paste in subsystem Kconfig

i2c: Fix copy-n-paste in subsystem Kconfig

We have:
  drivers/i2c/Kconfig:2:# Character device configuration
Which is obviously not true..

Signed-off-by: Arthur Othieno <apgo@patchbomb.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-au1550: Add I2C support for Au1200
Domen Puncer [Sun, 13 Aug 2006 21:37:13 +0000 (23:37 +0200)]
i2c-au1550: Add I2C support for Au1200

i2c-au1550: Add I2C support for Au1200

Signed-off-by: Domen Puncer <domen.puncer@ultra.si>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-au1550: Add SMBus functionality flag
Domen Puncer [Sun, 13 Aug 2006 21:36:27 +0000 (23:36 +0200)]
i2c-au1550: Add SMBus functionality flag

i2c-au1550: Add SMBus functionality flag

Add SMBus functionality flag, so we can use eeprom and similar
drivers.

Signed-off-by: Domen Puncer <domen.puncer@ultra.si>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-au1550: Fix timeout problem
Domen Puncer [Sun, 13 Aug 2006 21:35:40 +0000 (23:35 +0200)]
i2c-au1550: Fix timeout problem

i2c-au1550: Fix timeout problem

Fix from Jordan Crouse:
If the transmit and recieve FIFOS are not empty, forceably flush them
rather then waiting for them to drain on their own.

This solves at least a problem reported by Clem Taylor:
http://www.linux-mips.org/archives/linux-mips/2006-05/msg00240.html
(1% of I2C transactions would timeout)

Signed-off-by: Domen Puncer <domen.puncer@ultra.si>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-sibyte: Kip Walker is gone
Jean Delvare [Sun, 13 Aug 2006 21:34:05 +0000 (23:34 +0200)]
i2c-sibyte: Kip Walker is gone

i2c-sibyte: Kip Walker is gone

Kip Walker no longer works at Broadcom, and his e-mail address there
bounces back, so let's drop it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-algo-sibyte: Merge into i2c-sibyte
Jean Delvare [Sun, 13 Aug 2006 21:33:16 +0000 (23:33 +0200)]
i2c-algo-sibyte: Merge into i2c-sibyte

i2c-algo-sibyte: Merge into i2c-sibyte

Merge i2c-algo-sibyte into i2c-sibyte, as this is a complete,
hardware-dependent SMBus implementation and not a reusable algorithm.

Perform some basic coding style cleanups while we're here (mainly
space-based indentation replaced by tabulations.)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-algo-sibyte: Cleanups
Jean Delvare [Sun, 13 Aug 2006 21:32:37 +0000 (23:32 +0200)]
i2c-algo-sibyte: Cleanups

i2c-algo-sibyte: Cleanups

* Delete empty algo_control implementation.
* Simplify i2c_sibyte_del_bus.
* Delete empty module init and cleanup functions.
* Drop out-of-date #ifdef MODULE construct.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: __must_check fixes, i2c-dev
Jean Delvare [Tue, 15 Aug 2006 16:30:24 +0000 (18:30 +0200)]
i2c: __must_check fixes, i2c-dev

i2c: __must_check fixes (i2c-dev)

Check for error on sysfs file creation.
Check for error on device creation.
Delete sysfs file on device destruction.

I couldn't test this one beyond compilation, as it applies on top of
another patch in Greg's tree [1] which breaks all my systems when I
apply it (my udev isn't recent enough.) Anyone with bleeding edge udev
is welcome to test and report.

[1] http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/i2c/i2c-dev-device.patch

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c: __must_check fixes (core drivers)
Jean Delvare [Tue, 15 Aug 2006 16:26:30 +0000 (18:26 +0200)]
i2c: __must_check fixes (core drivers)

i2c: __must_check fixes (core drivers)

Check for error on sysfs file creation.
Check for error on device registration.
Check for error on class device registration.

Greg, I am not familiar with completion, can you please tell me if I
need to take care of it in the error paths (as I did in this patch,
see /* Needed? */ comments), or if it isn't needed?

These patches were tested, including forced errors, so they should work
fine. But of course more testing can't hurt.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-dev: Drop the client template
Jean Delvare [Sat, 1 Jul 2006 15:20:57 +0000 (17:20 +0200)]
i2c-dev: Drop the client template

i2c-dev: Drop the client template

Drop the i2c-dev client template. This saves about 360 bytes of
memory. I got the idea from a similar cleanup Hans-Frieder Vogt
made to i2c-nforce2 recently.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-dev: Use a list for data storage
Jean Delvare [Sat, 1 Jul 2006 15:17:38 +0000 (17:17 +0200)]
i2c-dev: Use a list for data storage

i2c-dev: Use a list for data storage

Use a list instead of a static array for storing the i2c-dev data.
Given that most systems have less than 10 i2c busses, most of the
space was wasted, so this saves around 1 kB of memory (2 kB on 64-bit
archs.)

The drawback is that lookup was in O(1) and is now in O(N), but given
that the values of N are always small, I don't think this is a problem.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoi2c-dev: Cleanups
Jean Delvare [Sat, 1 Jul 2006 15:16:57 +0000 (17:16 +0200)]
i2c-dev: Cleanups

i2c-dev: Cleanups

* We no more need to include platform_device.h.
* Delete the to_i2c_dev macro, which is no more used (and no more valid
  either.)
* Drop i2c_dev.minor. Now that the minor number always matches the i2c
  adapter number, this field is redundant with i2c_dev.adap->nr.
* Delete i2c_dev_get_by_adapter() which is now redundant with
  i2c_dev_get_by_minor() for the same reason.
* Drop the local variable dev in i2cdev_attach_adapter(), we can
  easily do without it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMerge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
Linus Torvalds [Tue, 26 Sep 2006 20:07:55 +0000 (13:07 -0700)]
Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6

* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (225 commits)
  [PATCH] Don't set calgary iommu as default y
  [PATCH] i386/x86-64: New Intel feature flags
  [PATCH] x86: Add a cumulative thermal throttle event counter.
  [PATCH] i386: Make the jiffies compares use the 64bit safe macros.
  [PATCH] x86: Refactor thermal throttle processing
  [PATCH] Add 64bit jiffies compares (for use with get_jiffies_64)
  [PATCH] Fix unwinder warning in traps.c
  [PATCH] x86: Allow disabling early pci scans with pci=noearly or disallowing conf1
  [PATCH] x86: Move direct PCI scanning functions out of line
  [PATCH] i386/x86-64: Make all early PCI scans dependent on CONFIG_PCI
  [PATCH] Don't leak NT bit into next task
  [PATCH] i386/x86-64: Work around gcc bug with noreturn functions in unwinder
  [PATCH] Fix some broken white space in ia32_signal.c
  [PATCH] Initialize argument registers for 32bit signal handlers.
  [PATCH] Remove all traces of signal number conversion
  [PATCH] Don't synchronize time reading on single core AMD systems
  [PATCH] Remove outdated comment in x86-64 mmconfig code
  [PATCH] Use string instructions for Core2 copy/clear
  [PATCH] x86: - restore i8259A eoi status on resume
  [PATCH] i386: Split multi-line printk in oops output.
  ...

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
Linus Torvalds [Tue, 26 Sep 2006 18:49:46 +0000 (11:49 -0700)]
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (47 commits)
  Driver core: Don't call put methods while holding a spinlock
  Driver core: Remove unneeded routines from driver core
  Driver core: Fix potential deadlock in driver core
  PCI: enable driver multi-threaded probe
  Driver Core: add ability for drivers to do a threaded probe
  sysfs: add proper sysfs_init() prototype
  drivers/base: check errors
  drivers/base: Platform notify needs to occur before drivers attach to the device
  v4l-dev2: handle __must_check
  add CONFIG_ENABLE_MUST_CHECK
  add __must_check to device management code
  Driver core: fixed add_bind_files() definition
  Driver core: fix comments in drivers/base/power/resume.c
  sysfs_remove_bin_file: no return value, dump_stack on error
  kobject: must_check fixes
  Driver core: add ability for devices to create and remove bin files
  Class: add support for class interfaces for devices
  Driver core: create devices/virtual/ tree
  Driver core: add device_rename function
  Driver core: add ability for classes to handle devices properly
  ...

17 years ago[PATCH] s390: fix cmm kernel thread handling
Heiko Carstens [Tue, 26 Sep 2006 06:33:11 +0000 (23:33 -0700)]
[PATCH] s390: fix cmm kernel thread handling

Convert cmm's usage of kernel_thread to kthread_run.  Also create the
cmmthread at module load time, so it is possible to check if creation of
the thread fails.

In addition the cmmthread now gets terminated when the module gets unloaded
instead of leaving a stale kernel thread.  Also check the return values of
other registration functions at module load and handle their return values
appropriately.

Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Make UML use ptrace-abi.h
Jeff Dike [Tue, 26 Sep 2006 06:33:10 +0000 (23:33 -0700)]
[PATCH] Make UML use ptrace-abi.h

Include the host architecture's ptrace-abi.h instead of ptrace.h.

There was some cpp mangling of names around the ptrace.h include to avoid
symbol clashes between UML and the host architecture.  Most of these can go
away.  The exception is struct pt_regs, which is convenient to have in
userspace, but must be renamed in order that UML can define its own.

ptrace-x86_64.h needed to have some now-obsolete cpp cruft and a declaration
removed.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Split i386 and x86_64 ptrace.h
Jeff Dike [Tue, 26 Sep 2006 06:33:09 +0000 (23:33 -0700)]
[PATCH] Split i386 and x86_64 ptrace.h

The use of SEGMENT_RPL_MASK in the i386 ptrace.h introduced by
x86-allow-a-kernel-to-not-be-in-ring-0.patch broke the UML build, as UML
includes the underlying architecture's ptrace.h, but has no easy access to the
x86 segment definitions.

Rather than kludging around this, as in the past, this patch splits the
userspace-usable parts, which are the bits that UML needs, of ptrace.h into
ptrace-abi.h, which is included back into ptrace.h.  Thus, there is no net
effect on i386.

As a side-effect, this creates a ptrace header which is close to being usable
in /usr/include.

x86_64 is also treated in this way for consistency.  There was some trailing
whitespace there, which is cleaned up.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] UML: tty locking
Alan Cox [Tue, 26 Sep 2006 06:33:08 +0000 (23:33 -0700)]
[PATCH] UML: tty locking

Ensure current->signal->tty doesn't get freed during log_exec().

Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: stack usage reduction
Jeff Dike [Tue, 26 Sep 2006 06:33:08 +0000 (23:33 -0700)]
[PATCH] uml: stack usage reduction

The KSTK_* macros used an inordinate amount of stack.  In order to overcome
an impedance mismatch between their interface, which just returns a single
register value, and the interface of get_thread_regs, which took a full
pt_regs, the implementation created an on-stack pt_regs, filled it in, and
returned one field.  do_task_stat calls KSTK_* twice, resulting in two
local pt_regs, blowing out the stack.

This patch changes the interface (and name) of get_thread_regs to just
return a single register from a jmp_buf.

The include of archsetjmp.h" in registers.h to get the definition of
jmp_buf exposed a bogus include of <setjmp.h> in start_up.c.  <setjmp.h>
shouldn't be used anywhere any more since UML uses the klibc
setjmp/longjmp.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: clean our set_ether_mac
Paolo 'Blaisorblade' Giarrusso [Tue, 26 Sep 2006 06:33:07 +0000 (23:33 -0700)]
[PATCH] uml: clean our set_ether_mac

Clean set_ether_mac usage.  Maybe could also be removed, but surely it can't
be a global function taking a void* argument.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: Jeff Dike <jdike@addtoit.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: Remove unused variable
Jeff Dike [Tue, 26 Sep 2006 06:33:06 +0000 (23:33 -0700)]
[PATCH] uml: Remove unused variable

timer_irq_inited was useless, so it is removed.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: timer cleanups
Jeff Dike [Tue, 26 Sep 2006 06:33:05 +0000 (23:33 -0700)]
[PATCH] uml: timer cleanups

set_interval returns an error instead of panicing if setitimer fails.  Some of
its callers now check the return.

enable_timer is largely tt-mode-specific, so it is marked as such, and the
only skas-mode caller is made to call set-interval instead.

user_time_init was a no-value-added wrapper around set_interval, so it is
gone.

Since set_interval is now called from kernel code, callers no longer pass
ITIMER_* to it.  Instead, they pass a flag which is converted into ITIMER_REAL
or ITIMER_VIRTUAL.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: Move signal handlers to arch code
Jeff Dike [Tue, 26 Sep 2006 06:33:04 +0000 (23:33 -0700)]
[PATCH] uml: Move signal handlers to arch code

Have most signals go through an arch-provided handler which recovers the
sigcontext and then calls a generic handler.  This replaces the
ARCH_GET_SIGCONTEXT macro, which was somewhat fragile.  On x86_64, recovering
%rdx (which holds the sigcontext pointer) must be the first thing that
happens.  sig_handler duly invokes that first, but there is no guarantee that
I can see that instructions won't be reordered such that %rdx is used before
that.  Having the arch provide the handler seems much more robust.

Some signals in some parts of UML require their own handlers - these places
don't call set_handler any more.  They call sigaction or signal themselves.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: SIGIO cleanups
Jeff Dike [Tue, 26 Sep 2006 06:33:04 +0000 (23:33 -0700)]
[PATCH] uml: SIGIO cleanups

- Various cleanups in the sigio code.

- Removed explicit zero-initializations of a few structures.

- Improved some error messages.

- An API change - there was an asymmetry between reactivate_fd calling
  maybe_sigio_broken, which goes through all the machinery of figuring out if
  a file descriptor supports SIGIO and applying the workaround to it if not,
  and deactivate_fd, which just turns off the descriptor.

  This is changed so that only activate_fd calls maybe_sigio_broken, when
  the descriptor is first seen.  reactivate_fd now calls add_sigio_fd, which
  is symmetric with ignore_sigio_fd.

  This removes a recursion which makes a critical section look more critical
  than it really was, obsoleting a big comment to that effect.  This requires
  keeping track of all descriptors which are getting the SIGIO treatment, not
  just the ones being polled at any given moment, so that reactivate_fd,
  through add_sigio_fd, doesn't try to tell the SIGIO thread about descriptors
  it doesn't care about.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: Improve SIGBUS diagnostics
Jeff Dike [Tue, 26 Sep 2006 06:33:03 +0000 (23:33 -0700)]
[PATCH] uml: Improve SIGBUS diagnostics

UML can get a SIGBUS anywhere if the tmpfs mount being used for its memory
runs out of space.  This patch adds a printk before the panic to provide a
clue as to what likely went wrong.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: Fix handling of failed execs of helpers
Jeff Dike [Tue, 26 Sep 2006 06:33:02 +0000 (23:33 -0700)]
[PATCH] uml: Fix handling of failed execs of helpers

There were some bugs in handling failures to exec helper programs.  errno was
passed back from the child with the wrong sign.  It was also ignored.  In the
case where it mattered, the errno from the (successful) read in the parent was
used instead.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: Whitespace fixes
Jeff Dike [Tue, 26 Sep 2006 06:33:01 +0000 (23:33 -0700)]
[PATCH] uml: Whitespace fixes

arch/um/kernel/tlb.c had some pretty serious whitespace problems.  I also
fixed some returns.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: Fix stack alignment
Jeff Dike [Tue, 26 Sep 2006 06:33:01 +0000 (23:33 -0700)]
[PATCH] uml: Fix stack alignment

Stack randomization needs to be conditional on the personality allowing it.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: Use ARRAY_SIZE more assiduously
Jeff Dike [Tue, 26 Sep 2006 06:33:00 +0000 (23:33 -0700)]
[PATCH] uml: Use ARRAY_SIZE more assiduously

There were a bunch of missed ARRAY_SIZE opportunities.

Also, some formatting fixes in the affected areas of code.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: Use klibc setjmp/longjmp
Jeff Dike [Tue, 26 Sep 2006 06:32:59 +0000 (23:32 -0700)]
[PATCH] uml: Use klibc setjmp/longjmp

This patch adds an implementation of setjmp and longjmp to UML, allowing
access to the inside of a jmpbuf without needing the access macros formerly
provided by libc.

The implementation is stolen from klibc.  I copy the relevant files into
arch/um.  I have another patch which avoids the copying, but requires klibc be
in the tree.

setjmp and longjmp users required some tweaking.  Includes of <setjmp.h> were
removed and includes of the UML longjmp.h were added where necessary.  There
are also replacements of siglongjmp with UML_LONGJMP which I somehow missed
earlier.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] PM: Add pm_trace switch
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:58 +0000 (23:32 -0700)]
[PATCH] PM: Add pm_trace switch

Add the pm_trace attribute in /sys/power which has to be explicitly set to
one to really enable the "PM tracing" code compiled in when CONFIG_PM_TRACE
is set (which modifies the machine's CMOS clock in unpredictable ways).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] i386: Detect clock skew during suspend
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:57 +0000 (23:32 -0700)]
[PATCH] i386: Detect clock skew during suspend

Detect the situations in which the time after a resume from disk would be
earlier than the time before the suspend and prevent them from happening on
i386.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: John Stultz <johnstul@us.ibm.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] suspend: make it possible to disable serial console suspend
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:57 +0000 (23:32 -0700)]
[PATCH] suspend: make it possible to disable serial console suspend

Hack uart_suspend_port() and uart_resume_port() so that serial console
ports are not suspended if CONFIG_DISABLE_CONSOLE_SUSPEND is set.

This makes it possible to debug the suspend and resume routines of all
device drivers as well as the lowest-level swsusp code with the help of the
serial console.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] PM: make it possible to disable console suspending
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:56 +0000 (23:32 -0700)]
[PATCH] PM: make it possible to disable console suspending

Change suspend_console() so that it waits for all consoles to flush the
remaining messages and make it possible to switch the console suspending off
with the help of a Kconfig option.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Stefan Seyfried <seife@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] swsusp: Use memory bitmaps during resume
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:55 +0000 (23:32 -0700)]
[PATCH] swsusp: Use memory bitmaps during resume

Make swsusp use memory bitmaps to store its internal information during the
resume phase of the suspend-resume cycle.

If the pfns of saveable pages are saved during the suspend phase instead of
the kernel virtual addresses of these pages, we can use them during the resume
phase directly to set the corresponding bits in a memory bitmap.  Then, this
bitmap is used to mark the page frames corresponding to the pages that were
saveable before the suspend (aka "unsafe" page frames).

Next, we allocate as many page frames as needed to store the entire suspend
image and make sure that there will be some extra free "safe" page frames for
the list of PBEs constructed later.  Subsequently, the image is loaded and, if
possible, the data loaded from it are written into their "original" page
frames (ie.  the ones they had occupied before the suspend).

The image data that cannot be written into their "original" page frames are
loaded into "safe" page frames and their "original" kernel virtual addresses,
as well as the addresses of the "safe" pages containing their copies, are
stored in a list of PBEs.  Finally, the list of PBEs is used to copy the
remaining image data into their "original" page frames (this is done
atomically, by the architecture-dependent parts of swsusp).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] swsusp: Introduce memory bitmaps
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:54 +0000 (23:32 -0700)]
[PATCH] swsusp: Introduce memory bitmaps

Introduce the memory bitmap data structure and make swsusp use in the suspend
phase.

The current swsusp's internal data structure is not very efficient from the
memory usage point of view, so it seems reasonable to replace it with a data
structure that will require less memory, such as a pair of bitmaps.

The idea is to use bitmaps that may be allocated as sets of individual pages,
so that we can avoid making allocations of order greater than 0.  For this
reason the memory bitmap structure consists of several linked lists of objects
that contain pointers to memory pages with the actual bitmap data.  Still, for
a typical system all of these lists fit in a single page, so it's reasonable
to introduce an additional mechanism allowing us to allocate all of them
efficiently without sacrificing the generality of the design.  This is done
with the help of the chain_allocator structure and associated functions.

We need to use two memory bitmaps during the suspend phase of the
suspend-resume cycle.  One of them is necessary for marking the saveable
pages, and the second is used to mark the pages in which to store the copies
of them (aka image pages).

First, the bitmaps are created and we allocate as many image pages as needed
(the corresponding bits in the second bitmap are set as soon as the pages are
allocated).  Second, the bits corresponding to the saveable pages are set in
the first bitmap and the saveable pages are copied to the image pages.
Finally, the first bitmap is used to save the kernel virtual addresses of the
saveable pages and the second one is used to save the contents of the image
pages.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] swsusp: Introduce some helpful constants
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:52 +0000 (23:32 -0700)]
[PATCH] swsusp: Introduce some helpful constants

Introduce some constants that hopefully will help improve the readability of
code in kernel/power/snapshot.c.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Change the name of pagedir_nosave
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:52 +0000 (23:32 -0700)]
[PATCH] Change the name of pagedir_nosave

The name of the pagedir_nosave variable does not make sense any more, so it
seems reasonable to change it to something more meaningful.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] swsusp: clean up suspend header
Rafael J. Wysocki [Tue, 26 Sep 2006 06:32:51 +0000 (23:32 -0700)]
[PATCH] swsusp: clean up suspend header

Remove some things that are no longer used or defined elsewhere from suspend.h
and make the inline version of software_suspend() return the right error code.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>