rpms/kernel-xen-2.6/devel linux-2.6-alsa-kill-annoying-messages.patch, NONE, 1.1 linux-2.6-debug-vm-would-have-oomkilled.patch, NONE, 1.1 linux-2.6-drm-i915-modeset.patch, NONE, 1.1 linux-2.6-drm-radeon-fix-oops.patch, NONE, 1.1 linux-2.6-imac-transparent-bridge.patch, NONE, 1.1 linux-2.6-input-macbook-appletouch.patch, NONE, 1.1 linux-2.6-ms-wireless-receiver.patch, NONE, 1.1 linux-2.6-powerpc-zImage-32MiB.patch, NONE, 1.1 linux-2.6-sata-eeepc-faster.patch, NONE, 1.1 linux-2.6-sparc-selinux-mprotect-checks.patch, NONE, 1.1 linux-2.6-utrace.patch, 1.3, 1.4 linux-2.6-windfarm-pm121-fix.patch, NONE, 1.1 linux-2.6-windfarm-pm121.patch, NONE, 1.1 linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch, NONE, 1.1 linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch, 1.3, 1.4 linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch, 1.3, 1.4 linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch, 1.3, 1.4 linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch, 1.2, 1.3 linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch, 1.2, 1.3 linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch, 1.2, 1.3 linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch, 1.2, 1.3 linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch, 1.2, 1.3 linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch, 1.2, 1.3 linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch, 1.2, 1.3 linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch, 1.2, 1.3 linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch, 1.3, 1.4 linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch, NONE, 1.1 linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch, NONE, 1.1 patch-2.6.25-rc7-git6.bz2.sign, NONE, 1.1 patch-2.6.25-rc7.bz2.sign, NONE, 1.1 .cvsignore, 1.12, 1.13 .gitignore, 1.2, 1.3 Makefile, 1.6, 1.7 Makefile.config, 1.6, 1.7 config-debug, 1.3, 1.4 config-generic, 1.3, 1.4 config-nodebug, 1.3, 1.4 config-powerpc-generic, 1.3, 1.4 config-powerpc32-generic, 1.3, 1.4 config-powerpc64, 1.3, 1.4 config-sparc64-generic, 1.3, 1.4 config-x86_64-generic, 1.3, 1.4 kernel.spec, 1.20, 1.21 linux-2.6-compile-fix-gcc-43.patch, 1.2, 1.3 linux-2.6-drm-git-mm.patch, 1.2, 1.3 linux-2.6-firewire-git-pending.patch, 1.2, 1.3 linux-2.6-firewire-git-update.patch, 1.2, 1.3 linux-2.6-wireless-pending.patch, 1.2, 1.3 linux-2.6-wireless.patch, 1.3, 1.4 linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch, 1.1, 1.2 linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch, 1.1, 1.2 linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch, 1.1, 1.2 linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch, 1.2, 1.3 nouveau-drm.patch, 1.3, 1.4 sources, 1.12, 1.13 upstream, 1.2, 1.3 linux-2.6-blkcipher-depend-on-chainiv.patch, 1.2, NONE linux-2.6-drm-git-i915-remove-priv-access.patch, 1.2, NONE linux-2.6-drm-git-mm-revert-nopfn.patch, 1.2, NONE linux-2.6-ia32-syscall-restart.patch, 1.2, NONE linux-2.6-ppc32-ucmpdi2.patch, 1.2, NONE linux-2.6-utrace-core.patch, 1.3, NONE linux-2.6-utrace-ptrace-compat-avr32.patch, 1.2, NONE linux-2.6-utrace-ptrace-compat-ia64.patch, 1.3, NONE linux-2.6-utrace-ptrace-compat-s390.patch, 1.3, NONE linux-2.6-utrace-ptrace-compat-sparc64.patch, 1.3, NONE linux-2.6-utrace-ptrace-compat.patch, 1.3, NONE linux-2.6-utrace-regset-avr32.patch, 1.2, NONE linux-2.6-utrace-regset-ia64.patch, 1.3, NONE linux-2.6-utrace-regset-s390.patch, 1.3, NONE linux-2.6-utrace-regset-sparc64.patch, 1.3, NONE linux-2.6-utrace-regset.patch, 1.3, NONE linux-2.6-utrace-tracehook-avr32.patch, 1.2, NONE linux-2.6-utrace-tracehook-ia64.patch, 1.3, NONE linux-2.6-utrace-tracehook-s390.patch, 1.3, NONE linux-2.6-utrace-tracehook-sparc64.patch, 1.3, NONE linux-2.6-utrace-tracehook-um.patch, 1.3, NONE linux-2.6-utrace-tracehook.patch, 1.3, NONE linux-2.6-virtio_blk-fix-sysfs-bits.patch, 1.2, NONE linux-2.6-wireless-pending-too.patch, 1.2, NONE linux-2.6-xen-0004-xen-Make-hvc0-the-preferred-console-in-domU.patch, 1.2, NONE linux-2.6-xen-0006-fbdev-Make-deferred-I-O-work-as-advertized.patch, 1.2, NONE linux-2.6-xen-0007-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch, 1.2, NONE linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch, 1.2, NONE linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch, 1.2, NONE linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch, 1.1, NONE linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch, 1.1, NONE linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch, 1.1, NONE linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch, 1.1, NONE linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch, 1.2, NONE linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch, 1.2, NONE linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch, 1.2, NONE linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch, 1.2, NONE linux-2.6-xen-0018-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch, 1.2, NONE linux-2.6-xen-0019-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch, 1.1, NONE linux-2.6-xen-0020-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch, 1.1, NONE patch-2.6.25-rc4.bz2.sign, 1.2, NONE
Mark McLoughlin (markmc)
fedora-extras-commits at redhat.com
Tue Apr 1 10:39:08 UTC 2008
Author: markmc
Update of /cvs/pkgs/rpms/kernel-xen-2.6/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11887
Modified Files:
.cvsignore .gitignore Makefile Makefile.config config-debug
config-generic config-nodebug config-powerpc-generic
config-powerpc32-generic config-powerpc64
config-sparc64-generic config-x86_64-generic kernel.spec
linux-2.6-compile-fix-gcc-43.patch linux-2.6-drm-git-mm.patch
linux-2.6-firewire-git-pending.patch
linux-2.6-firewire-git-update.patch
linux-2.6-wireless-pending.patch linux-2.6-wireless.patch
linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch
linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch
linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch
linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch
nouveau-drm.patch sources upstream
Added Files:
linux-2.6-alsa-kill-annoying-messages.patch
linux-2.6-debug-vm-would-have-oomkilled.patch
linux-2.6-drm-i915-modeset.patch
linux-2.6-drm-radeon-fix-oops.patch
linux-2.6-imac-transparent-bridge.patch
linux-2.6-input-macbook-appletouch.patch
linux-2.6-ms-wireless-receiver.patch
linux-2.6-powerpc-zImage-32MiB.patch
linux-2.6-sata-eeepc-faster.patch
linux-2.6-sparc-selinux-mprotect-checks.patch
linux-2.6-utrace.patch linux-2.6-windfarm-pm121-fix.patch
linux-2.6-windfarm-pm121.patch
linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch
linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
patch-2.6.25-rc7-git6.bz2.sign patch-2.6.25-rc7.bz2.sign
Removed Files:
linux-2.6-blkcipher-depend-on-chainiv.patch
linux-2.6-drm-git-i915-remove-priv-access.patch
linux-2.6-drm-git-mm-revert-nopfn.patch
linux-2.6-ia32-syscall-restart.patch
linux-2.6-ppc32-ucmpdi2.patch linux-2.6-utrace-core.patch
linux-2.6-utrace-ptrace-compat-avr32.patch
linux-2.6-utrace-ptrace-compat-ia64.patch
linux-2.6-utrace-ptrace-compat-s390.patch
linux-2.6-utrace-ptrace-compat-sparc64.patch
linux-2.6-utrace-ptrace-compat.patch
linux-2.6-utrace-regset-avr32.patch
linux-2.6-utrace-regset-ia64.patch
linux-2.6-utrace-regset-s390.patch
linux-2.6-utrace-regset-sparc64.patch
linux-2.6-utrace-regset.patch
linux-2.6-utrace-tracehook-avr32.patch
linux-2.6-utrace-tracehook-ia64.patch
linux-2.6-utrace-tracehook-s390.patch
linux-2.6-utrace-tracehook-sparc64.patch
linux-2.6-utrace-tracehook-um.patch
linux-2.6-utrace-tracehook.patch
linux-2.6-virtio_blk-fix-sysfs-bits.patch
linux-2.6-wireless-pending-too.patch
linux-2.6-xen-0004-xen-Make-hvc0-the-preferred-console-in-domU.patch
linux-2.6-xen-0006-fbdev-Make-deferred-I-O-work-as-advertized.patch
linux-2.6-xen-0007-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch
linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch
linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch
linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch
linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch
linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch
linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch
linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch
linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
linux-2.6-xen-0018-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
linux-2.6-xen-0019-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
linux-2.6-xen-0020-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
patch-2.6.25-rc4.bz2.sign
Log Message:
* Tue Apr 1 2008 Mark McLoughlin <markmc at redhat.com>
- Update to kernel-2_6_25-0_182_rc7_git6_fc9
- Fix oops when dlclose()ing some prelink libs (#436453)
- Drop the patch to make hvc0 the preferred console (#437706, #434761)
linux-2.6-alsa-kill-annoying-messages.patch:
--- NEW FILE linux-2.6-alsa-kill-annoying-messages.patch ---
From: Adel Gadllah <adel.gadllah at gmail.com>
snd-hda-intel: don't print using snd_printdd on device open
When CONFIG_SND_DEBUG_DETECT is set the hda-intel driver prints verbose
info like this:
ALSA sound/pci/hda/hda_intel.c:1259: azx_pcm_prepare: bufsize=0x4400,
fragsize=0x1100, format=0x11
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
stream=0x5, channel=0, format=0x11
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
stream=0x5, channel=0, format=0x11
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
stream=0x0, channel=0, format=0x0
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
stream=0x0, channel=0, format=0x0
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
stream=0x0, channel=0, format=0x0
Don't print anything in functions that get called when the device gets
opened/prepared for output.
Signed-off-by: Adel Gadllah <adel.gadllah at gmail.com>
Signed-off-by: Chuck Ebbert <cebbert at redhat.com>
CC: Takashi Iwai <tiwai at suse.de>
---
Orignal patch was mangled by sender's mail software.
diff -upNr linux-2.6.24.2.orign/sound/pci/hda/hda_codec.c linux-2.6.24.2/sound/pci/hda/hda_codec.c
--- linux-2.6.24.2.orign/sound/pci/hda/hda_codec.c 2008-02-11 06:51:11.000000000 +0100
+++ linux-2.6.24.2/sound/pci/hda/hda_codec.c 2008-02-17 11:08:58.000000000 +0100
@@ -677,9 +677,6 @@ void snd_hda_codec_setup_stream(struct h
if (!nid)
return;
- snd_printdd("hda_codec_setup_stream: "
- "NID=0x%x, stream=0x%x, channel=%d, format=0x%x\n",
- nid, stream_tag, channel_id, format);
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID,
(stream_tag << 4) | channel_id);
msleep(1);
diff -upNr linux-2.6.24.2.orign/sound/pci/hda/hda_intel.c linux-2.6.24.2/sound/pci/hda/hda_intel.c
--- linux-2.6.24.2.orign/sound/pci/hda/hda_intel.c 2008-02-11 06:51:11.000000000 +0100
+++ linux-2.6.24.2/sound/pci/hda/hda_intel.c 2008-02-17 11:10:16.000000000 +0100
@@ -1249,9 +1249,6 @@ static int azx_pcm_prepare(struct snd_pc
return -EINVAL;
}
- snd_printdd("azx_pcm_prepare: bufsize=0x%x, fragsize=0x%x, "
- "format=0x%x\n",
- azx_dev->bufsize, azx_dev->fragsize, azx_dev->format_val);
azx_setup_periods(azx_dev);
azx_setup_controller(chip, azx_dev);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
linux-2.6-debug-vm-would-have-oomkilled.patch:
--- NEW FILE linux-2.6-debug-vm-would-have-oomkilled.patch ---
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index b2a2d68..3b132ee 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -67,6 +67,7 @@ extern int sysctl_overcommit_ratio;
extern int sysctl_panic_on_oom;
extern int sysctl_oom_kill_allocating_task;
extern int sysctl_oom_dump_tasks;
+extern int sysctl_would_have_oomkilled;
extern int max_threads;
extern int core_uses_pid;
extern int suid_dumpable;
@@ -861,6 +862,14 @@ static struct ctl_table vm_table[] = {
.proc_handler = &proc_dointvec,
},
{
+ .ctl_name = CTL_UNNUMBERED,
+ .procname = "would_have_oomkilled",
+ .data = &sysctl_would_have_oomkilled,
+ .maxlen = sizeof(sysctl_would_have_oomkilled),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
+ {
.ctl_name = VM_OVERCOMMIT_RATIO,
.procname = "overcommit_ratio",
.data = &sysctl_overcommit_ratio,
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index f255eda..3335a94 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -30,6 +30,7 @@
int sysctl_panic_on_oom;
int sysctl_oom_kill_allocating_task;
int sysctl_oom_dump_tasks;
+int sysctl_would_have_oomkilled;
static DEFINE_SPINLOCK(zone_scan_mutex);
/* #define DEBUG */
@@ -321,6 +322,12 @@ static void __oom_kill_task(struct task_struct *p, int verbose)
return;
}
+ if (sysctl_would_have_oomkilled == 1) {
+ printk(KERN_ERR "Would have killed process %d (%s). But continuing instead.\n",
+ task_pid_nr(p), p->comm);
+ return;
+ }
+
if (verbose)
printk(KERN_ERR "Killed process %d (%s)\n",
task_pid_nr(p), p->comm);
@@ -363,6 +370,12 @@ static int oom_kill_task(struct task_struct *p)
return 1;
} while_each_thread(g, q);
+ if (sysctl_would_have_oomkilled == 1) {
+ printk(KERN_ERR "Would have killed process %d (%s). But continuing instead.\n",
+ task_pid_nr(p), p->comm);
+ return 1;
+ }
+
__oom_kill_task(p, 1);
/*
linux-2.6-drm-i915-modeset.patch:
--- NEW FILE linux-2.6-drm-i915-modeset.patch ---
diff --git a/drivers/char/drm/Makefile b/drivers/char/drm/Makefile
index 721548c..2190a4c 100644
--- a/drivers/char/drm/Makefile
+++ b/drivers/char/drm/Makefile
@@ -7,14 +7,15 @@ drm-objs := drm_auth.o drm_bufs.o drm_context.o drm_dma.o drm_drawable.o \
drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \
drm_agpsupport.o drm_scatter.o ati_pcigart.o drm_pci.o \
drm_sysfs.o drm_hashtab.o drm_sman.o drm_mm.o drm_object.o \
- drm_fence.o drm_ttm.o drm_bo.o drm_bo_move.o drm_bo_lock.o
+ drm_fence.o drm_ttm.o drm_bo.o drm_bo_move.o drm_bo_lock.o \
+ drm_modes.o drm_crtc.o drm_edid.o
tdfx-objs := tdfx_drv.o
r128-objs := r128_drv.o r128_cce.o r128_state.o r128_irq.o
mga-objs := mga_drv.o mga_dma.o mga_state.o mga_warp.o mga_irq.o
i810-objs := i810_drv.o i810_dma.o
i830-objs := i830_drv.o i830_dma.o i830_irq.o
-i915-objs := i915_drv.o i915_dma.o i915_irq.o i915_mem.o i915_fence.o i915_buffer.o
+i915-objs := i915_drv.o i915_dma.o i915_irq.o i915_mem.o i915_fence.o i915_buffer.o i915_init.o intel_display.o intel_lvds.o intel_crt.o intel_i2c.o intel_modes.o intel_sdvo.o intel_tv.o intel_fb.o
nouveau-objs := nouveau_drv.o nouveau_state.o nouveau_fifo.o nouveau_mem.o \
nouveau_object.o nouveau_irq.o nouveau_notifier.o nouveau_swmthd.o \
nouveau_sgdma.o nouveau_dma.o nouveau_buffer.o nouveau_fence.o \
diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h
index 8fe8ac1..8f1c8d4 100644
--- a/drivers/char/drm/drm.h
+++ b/drivers/char/drm/drm.h
@@ -884,6 +884,185 @@ struct drm_mm_init_arg {
uint64_t p_size;
};
+struct drm_mm_info_arg {
+ unsigned int mem_type;
+ uint64_t p_size;
+};
+
+
+/*
+ * Drm mode setting
+ */
+#define DRM_DISPLAY_INFO_LEN 32
+#define DRM_OUTPUT_NAME_LEN 32
+#define DRM_DISPLAY_MODE_LEN 32
+#define DRM_PROP_NAME_LEN 32
+
+#define DRM_MODE_TYPE_BUILTIN (1<<0)
+#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN)
+#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN)
+#define DRM_MODE_TYPE_PREFERRED (1<<3)
+#define DRM_MODE_TYPE_DEFAULT (1<<4)
+#define DRM_MODE_TYPE_USERDEF (1<<5)
+#define DRM_MODE_TYPE_DRIVER (1<<6)
+
+struct drm_mode_modeinfo {
+ unsigned int clock;
+ unsigned short hdisplay, hsync_start, hsync_end, htotal, hskew;
+ unsigned short vdisplay, vsync_start, vsync_end, vtotal, vscan;
+
+ unsigned int vrefresh; /* vertical refresh * 1000 */
+
+ unsigned int flags;
+ unsigned int type;
+ char name[DRM_DISPLAY_MODE_LEN];
+};
+
+struct drm_mode_card_res {
+ uint64_t fb_id_ptr;
+ uint64_t crtc_id_ptr;
+ uint64_t output_id_ptr;
+ int count_fbs;
+ int count_crtcs;
+ int count_outputs;
+ int min_width, max_width;
+ int min_height, max_height;
+};
+
+struct drm_mode_crtc {
+ uint64_t set_outputs_ptr;
+
+ unsigned int crtc_id; /**< Id */
+ unsigned int fb_id; /**< Id of framebuffer */
+
+ int x, y; /**< Position on the frameuffer */
+
+ int count_outputs;
+ unsigned int outputs; /**< Outputs that are connected */
+
+ int count_possibles;
+ unsigned int possibles; /**< Outputs that can be connected */
+ int gamma_size;
+ int mode_valid;
+ struct drm_mode_modeinfo mode;
+};
+
+#define DRM_MODE_OUTPUT_NONE 0
+#define DRM_MODE_OUTPUT_DAC 1
+#define DRM_MODE_OUTPUT_TMDS 2
+#define DRM_MODE_OUTPUT_LVDS 3
+#define DRM_MODE_OUTPUT_TVDAC 4
+
+struct drm_mode_get_output {
+
+ uint64_t modes_ptr;
+ uint64_t props_ptr;
+ uint64_t prop_values_ptr;
+
+ int count_modes;
+ int count_props;
+ unsigned int output; /**< Id */
+ unsigned int crtc; /**< Id of crtc */
+ unsigned int output_type;
+ unsigned int output_type_id;
+
+ unsigned int connection;
+ unsigned int mm_width, mm_height; /**< HxW in millimeters */
+ unsigned int subpixel;
+ int count_crtcs;
+ int count_clones;
+ unsigned int crtcs; /**< possible crtc to connect to */
+ unsigned int clones; /**< list of clones */
+};
+
+#define DRM_MODE_PROP_PENDING (1<<0)
+#define DRM_MODE_PROP_RANGE (1<<1)
+#define DRM_MODE_PROP_IMMUTABLE (1<<2)
+#define DRM_MODE_PROP_ENUM (1<<3) // enumerated type with text strings
+#define DRM_MODE_PROP_BLOB (1<<4)
+
+struct drm_mode_property_enum {
+ uint64_t value;
+ unsigned char name[DRM_PROP_NAME_LEN];
+};
+
+struct drm_mode_get_property {
+ uint64_t values_ptr; /* values and blob lengths */
+ uint64_t enum_blob_ptr; /* enum and blob id ptrs */
+
+ unsigned int prop_id;
+ unsigned int flags;
+ unsigned char name[DRM_PROP_NAME_LEN];
+
+ int count_values;
+ int count_enum_blobs;
+};
+
+struct drm_mode_output_set_property {
+ uint64_t value;
+ unsigned int prop_id;
+ unsigned int output_id;
+};
+
+struct drm_mode_get_blob {
+ uint32_t blob_id;
+ uint32_t length;
+ uint64_t data;
+};
+
+struct drm_mode_fb_cmd {
+ unsigned int buffer_id;
+ unsigned int width, height;
+ unsigned int pitch;
+ unsigned int bpp;
+ unsigned int handle;
+ unsigned int depth;
+};
+
+struct drm_mode_mode_cmd {
+ unsigned int output_id;
+ struct drm_mode_modeinfo mode;
+};
+
+#define DRM_MODE_CURSOR_BO 0x01
+#define DRM_MODE_CURSOR_MOVE 0x02
+
+/*
+ * depending on the value in flags diffrent members are used.
+ *
+ * CURSOR_BO uses
+ * crtc
+ * width
+ * height
+ * handle - if 0 turns the cursor of
+ *
+ * CURSOR_MOVE uses
+ * crtc
+ * x
+ * y
+ */
+struct drm_mode_cursor {
+ unsigned int flags;
+ unsigned int crtc;
+ int x;
+ int y;
+ uint32_t width;
+ uint32_t height;
+ unsigned int handle;
+};
+
+/*
+ * oh so ugly hotplug
[...15937 lines suppressed...]
+ */
+ tv_format_atom = MakeAtom(TV_FORMAT_NAME, sizeof(TV_FORMAT_NAME) - 1,
+ TRUE);
+
+ for (i = 0; i < NUM_TV_MODES; i++)
+ tv_format_name_atoms[i] = MakeAtom (tv_modes[i].name,
+ strlen (tv_modes[i].name),
+ TRUE);
+
+ err = intel_tv_format_configure_property (output);
+
+ if (err != 0) {
+ xf86DrvMsg(dev->scrnIndex, X_ERROR,
+ "RRConfigureOutputProperty error, %d\n", err);
+ }
+
+ /* Set the current value of the tv_format property */
+ if (!intel_tv_format_set_property (output))
+ xf86DrvMsg(dev->scrnIndex, X_ERROR,
+ "RRChangeOutputProperty error, %d\n", err);
+
+ for (i = 0; i < 4; i++)
+ {
+ INT32 range[2];
+ margin_atoms[i] = MakeAtom(margin_names[i], strlen (margin_names[i]),
+ TRUE);
+
+ range[0] = 0;
+ range[1] = 100;
+ err = RRConfigureOutputProperty(output->randr_output, margin_atoms[i],
+ TRUE, TRUE, FALSE, 2, range);
+
+ if (err != 0)
+ xf86DrvMsg(dev->scrnIndex, X_ERROR,
+ "RRConfigureOutputProperty error, %d\n", err);
+
+ err = RRChangeOutputProperty(output->randr_output, margin_atoms[i],
+ XA_INTEGER, 32, PropModeReplace,
+ 1, &tv_priv->margin[i],
+ FALSE, TRUE);
+ if (err != 0)
+ xf86DrvMsg(dev->scrnIndex, X_ERROR,
+ "RRChangeOutputProperty error, %d\n", err);
+ }
+#endif
+}
+
+static bool
+intel_tv_set_property(struct drm_output *output, struct drm_property *property,
+ uint64_t val)
+{
+ struct drm_device *dev = output->dev;
+ int ret = 0;
+
+ if (property == dev->mode_config.tv_left_margin_property ||
+ property == dev->mode_config.tv_right_margin_property ||
+ property == dev->mode_config.tv_top_margin_property ||
+ property == dev->mode_config.tv_bottom_margin_property) {
+ ret = drm_output_property_set_value(output, property, val);
+ } else {
+ /* TV mode handling here */
+ }
+
+ return ret;
+}
+
+static const struct drm_output_funcs intel_tv_output_funcs = {
+ .dpms = intel_tv_dpms,
+ .save = intel_tv_save,
+ .restore = intel_tv_restore,
+ .mode_valid = intel_tv_mode_valid,
+ .mode_fixup = intel_tv_mode_fixup,
+ .prepare = intel_output_prepare,
+ .mode_set = intel_tv_mode_set,
+ .commit = intel_output_commit,
+ .detect = intel_tv_detect,
+ .get_modes = intel_tv_get_modes,
+ .cleanup = intel_tv_destroy,
+ .set_property = intel_tv_set_property,
+};
+
+void
+intel_tv_init(struct drm_device *dev)
+{
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ struct drm_output *output;
+ struct intel_output *intel_output;
+ struct intel_tv_priv *tv_priv;
+ u32 tv_dac_on, tv_dac_off, save_tv_dac;
+
+ /* FIXME: better TV detection and/or quirks */
+#if 0
+ if (tv_priv->quirk_flag & QUIRK_IGNORE_TV)
+ return;
+#endif
+ if ((I915_READ(TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED)
+ return;
+
+ /*
+ * Sanity check the TV output by checking to see if the
+ * DAC register holds a value
+ */
+ save_tv_dac = I915_READ(TV_DAC);
+
+ I915_WRITE(TV_DAC, save_tv_dac | TVDAC_STATE_CHG_EN);
+ tv_dac_on = I915_READ(TV_DAC);
+
+ I915_WRITE(TV_DAC, save_tv_dac & ~TVDAC_STATE_CHG_EN);
+ tv_dac_off = I915_READ(TV_DAC);
+
+ I915_WRITE(TV_DAC, save_tv_dac);
+
+ /*
+ * If the register does not hold the state change enable
+ * bit, (either as a 0 or a 1), assume it doesn't really
+ * exist
+ */
+ if ((tv_dac_on & TVDAC_STATE_CHG_EN) == 0 ||
+ (tv_dac_off & TVDAC_STATE_CHG_EN) != 0)
+ return;
+
+ output = drm_output_create(dev, &intel_tv_output_funcs,
+ DRM_MODE_OUTPUT_TVDAC);
+
+ if (!output)
+ return;
+
+ intel_output = drm_calloc(1, sizeof(struct intel_output) +
+ sizeof(struct intel_tv_priv), DRM_MEM_DRIVER);
+ if (!intel_output) {
+ drm_output_destroy(output);
+ return;
+ }
+
+ tv_priv = (struct intel_tv_priv *)(intel_output + 1);
+ intel_output->type = INTEL_OUTPUT_TVOUT;
+ output->possible_crtcs = ((1 << 0) | (1 << 1));
+ output->possible_clones = (1 << INTEL_OUTPUT_TVOUT);
+ intel_output->dev_priv = tv_priv;
+ tv_priv->type = TV_TYPE_UNKNOWN;
+
+ tv_priv->tv_format = NULL;
+
+ /* BIOS margin values */
+ tv_priv->margin[TV_MARGIN_LEFT] = 54;
+ tv_priv->margin[TV_MARGIN_TOP] = 36;
+ tv_priv->margin[TV_MARGIN_RIGHT] = 46;
+ tv_priv->margin[TV_MARGIN_BOTTOM] = 37;
+
+ if (!tv_priv->tv_format)
+ tv_priv->tv_format = kstrdup(tv_modes[0].name, GFP_KERNEL);
+
+ output->driver_private = intel_output;
+ output->interlace_allowed = FALSE;
+ output->doublescan_allowed = FALSE;
+}
diff --git a/drivers/char/drm/nouveau_mem.c b/drivers/char/drm/nouveau_mem.c
index a508a37..622fe99 100644
--- a/drivers/char/drm/nouveau_mem.c
+++ b/drivers/char/drm/nouveau_mem.c
@@ -372,7 +372,7 @@ nouveau_mem_init_ttm(struct drm_device *dev)
bar1_size = drm_get_resource_len(dev, 1) >> PAGE_SHIFT;
if (bar1_size < vram_size) {
if ((ret = drm_bo_init_mm(dev, DRM_BO_MEM_PRIV0,
- bar1_size, vram_size - bar1_size))) {
+ bar1_size, vram_size - bar1_size, 1))) {
DRM_ERROR("Failed PRIV0 mm init: %d\n", ret);
return ret;
}
@@ -383,7 +383,7 @@ nouveau_mem_init_ttm(struct drm_device *dev)
#ifdef HACK_OLD_MM
vram_size /= 4;
#endif
- if ((ret = drm_bo_init_mm(dev, DRM_BO_MEM_VRAM, 0, vram_size))) {
+ if ((ret = drm_bo_init_mm(dev, DRM_BO_MEM_VRAM, 0, vram_size, 1))) {
DRM_ERROR("Failed VRAM mm init: %d\n", ret);
return ret;
}
@@ -403,7 +403,7 @@ nouveau_mem_init_ttm(struct drm_device *dev)
if ((ret = drm_bo_init_mm(dev, DRM_BO_MEM_TT, 0,
dev_priv->gart_info.aper_size >>
- PAGE_SHIFT))) {
+ PAGE_SHIFT, 1))) {
DRM_ERROR("Failed TT mm init: %d\n", ret);
return ret;
}
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index 6f75512..8e4a494 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -3012,7 +3012,7 @@ static int radeon_cp_getparam(struct drm_device *dev, void *data, struct drm_fil
*/
case RADEON_PARAM_SAREA_HANDLE:
/* The lock is the first dword in the sarea. */
- value = (long)dev->lock.hw_lock;
+ value = (long)dev->primary->master->lock.hw_lock;
break;
#endif
case RADEON_PARAM_GART_TEX_HANDLE:
linux-2.6-drm-radeon-fix-oops.patch:
--- NEW FILE linux-2.6-drm-radeon-fix-oops.patch ---
diff -up linux-2.6.24.noarch/drivers/char/drm/radeon_state.c.da linux-2.6.24.noarch/drivers/char/drm/radeon_state.c
--- linux-2.6.24.noarch/drivers/char/drm/radeon_state.c.da 2008-03-31 11:28:35.000000000 +1000
+++ linux-2.6.24.noarch/drivers/char/drm/radeon_state.c 2008-03-31 11:28:48.000000000 +1000
@@ -3088,7 +3088,8 @@ static int radeon_cp_setparam(struct drm
dev_priv->gart_info.table_size = RADEON_PCIGART_TABLE_SIZE;
break;
case RADEON_SETPARAM_VBLANK_CRTC:
- return radeon_vblank_crtc_set(dev, sp->value);
+ if (dev_priv)
+ return radeon_vblank_crtc_set(dev, sp->value);
break;
default:
DRM_DEBUG("Invalid parameter %d\n", sp->param);
linux-2.6-imac-transparent-bridge.patch:
--- NEW FILE linux-2.6-imac-transparent-bridge.patch ---
--- linux/arch/powerpc/platforms/powermac/pci.c~ 2008-03-22 19:08:07.000000000 +0000
+++ linux/arch/powerpc/platforms/powermac/pci.c 2008-03-23 09:10:46.000000000 +0000
@@ -1271,6 +1271,12 @@ void pmac_pci_fixup_pciata(struct pci_de
}
}
DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata);
+#else /* CONFIG_PPC64 */
+static void __devinit imac_transparent_bridge(struct pci_dev *dev)
+{
+ dev->transparent = 1;
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, 0x005b, imac_transparent_bridge);
#endif /* CONFIG_PPC32 */
/*
linux-2.6-input-macbook-appletouch.patch:
--- NEW FILE linux-2.6-input-macbook-appletouch.patch ---
https://bugzilla.redhat.com/show_bug.cgi?id=426574
Based on patch from ubuntu at
https://bugs.edge.launchpad.net/ubuntu/+source/linux-meta/+bug/162090
--- vanilla-2.6.25-rc5/drivers/input/mouse/appletouch.c 2008-01-24 17:58:37.000000000 -0500
+++ linux-2.6.24.noarch/drivers/input/mouse/appletouch.c 2008-03-11 13:42:59.000000000 -0400
@@ -62,6 +62,11 @@
#define GEYSER4_ISO_PRODUCT_ID 0x021B
#define GEYSER4_JIS_PRODUCT_ID 0x021C
+/* Codes in updated driver for macbook3,1 support (and others?) */
+#define GEYSER4_HF_ANSI_PRODUCT_ID 0x0229
+#define GEYSER4_HF_ISO_PRODUCT_ID 0x022a
+#define GEYSER4_HF_JIS_PRODUCT_ID 0x021b
+
#define ATP_DEVICE(prod) \
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
USB_DEVICE_ID_MATCH_INT_CLASS | \
@@ -93,6 +98,11 @@ static struct usb_device_id atp_table []
{ ATP_DEVICE(GEYSER4_ISO_PRODUCT_ID) },
{ ATP_DEVICE(GEYSER4_JIS_PRODUCT_ID) },
+ /* Core2 Duo MacBook3,1 */
+ { ATP_DEVICE(GEYSER4_HF_ANSI_PRODUCT_ID) },
+ { ATP_DEVICE(GEYSER4_HF_ISO_PRODUCT_ID) },
+ { ATP_DEVICE(GEYSER4_HF_JIS_PRODUCT_ID) },
+
/* Terminating entry */
{ }
};
@@ -217,7 +227,10 @@ static inline int atp_is_geyser_3(struct
(productId == GEYSER3_JIS_PRODUCT_ID) ||
(productId == GEYSER4_ANSI_PRODUCT_ID) ||
(productId == GEYSER4_ISO_PRODUCT_ID) ||
- (productId == GEYSER4_JIS_PRODUCT_ID);
+ (productId == GEYSER4_JIS_PRODUCT_ID) ||
+ (productId == GEYSER4_HF_ANSI_PRODUCT_ID) ||
+ (productId == GEYSER4_HF_ISO_PRODUCT_ID) ||
+ (productId == GEYSER4_HF_JIS_PRODUCT_ID);
}
/*
linux-2.6-ms-wireless-receiver.patch:
--- NEW FILE linux-2.6-ms-wireless-receiver.patch ---
diff -up linux-2.6.24.noarch/include/linux/hid.h.jx linux-2.6.24.noarch/include/linux/hid.h
--- linux-2.6.24.noarch/include/linux/hid.h.jx 2008-03-14 10:49:43.000000000 -0400
+++ linux-2.6.24.noarch/include/linux/hid.h 2008-03-14 10:56:08.000000000 -0400
@@ -296,6 +296,7 @@
#define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010
#define HID_QUIRK_RDESC_BUTTON_CONSUMER 0x00000020
#define HID_QUIRK_RDESC_SAMSUNG_REMOTE 0x00000040
+#define HID_QUIRK_RDESC_USAGE_NOT_PHYSICAL 0x00000080
/*
* This is the global environment of the parser. This information is
--- linux-2.6.24.noarch/drivers/hid/usbhid/hid-quirks.c.jx 2008-03-14 10:49:43.000000000 -0400
+++ linux-2.6.24.noarch/drivers/hid/usbhid/hid-quirks.c 2008-03-14 10:57:10.000000000 -0400
@@ -583,7 +583,7 @@
{ USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP },
{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K, HID_QUIRK_MICROSOFT_KEYS },
- { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_LK6K, HID_QUIRK_MICROSOFT_KEYS },
+ { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_LK6K, HID_QUIRK_MICROSOFT_KEYS | HID_QUIRK_RDESC_USAGE_NOT_PHYSICAL },
{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
@@ -1085,6 +1085,28 @@
}
}
+/*
+ * Microsoft Wireless Desktop Receiver (Model 1028) has several
+ * 'Usage Min/Max' where it ought to have 'Physical Min/Max'
+ */
+static void usbhid_fixup_microsoft_descriptor(unsigned char *rdesc, int rsize)
+{
+ if (rsize == 571 && rdesc[284] == 0x19
+ && rdesc[286] == 0x2a
+ && rdesc[304] == 0x19
+ && rdesc[306] == 0x29
+ && rdesc[352] == 0x1a
+ && rdesc[355] == 0x2a
+ && rdesc[557] == 0x19
+ && rdesc[559] == 0x29) {
+ printk(KERN_INFO "Fixing up Microsoft Wireless Receiver Model 1028 report descriptor\n");
+ rdesc[284] = rdesc[304] = rdesc[558] = 0x35;
+ rdesc[352] = 0x36;
+ rdesc[286] = rdesc[355] = 0x46;
+ rdesc[306] = rdesc[559] = 0x45;
+ }
+}
+
static void __usbhid_fixup_report_descriptor(__u32 quirks, char *rdesc, unsigned rsize)
{
if ((quirks & HID_QUIRK_RDESC_CYMOTION))
@@ -1108,6 +1130,8 @@
if (quirks & HID_QUIRK_RDESC_SAMSUNG_REMOTE)
usbhid_fixup_samsung_irda_descriptor(rdesc, rsize);
+ if (quirks & HID_QUIRK_RDESC_USAGE_NOT_PHYSICAL)
+ usbhid_fixup_microsoft_descriptor(rdesc, rsize);
}
/**
linux-2.6-powerpc-zImage-32MiB.patch:
--- NEW FILE linux-2.6-powerpc-zImage-32MiB.patch ---
--- linux-2.6.24.ppc64/arch/powerpc/boot/zImage.lds.S~ 2008-01-24 22:58:37.000000000 +0000
+++ linux-2.6.24.ppc64/arch/powerpc/boot/zImage.lds.S 2008-03-26 16:56:50.000000000 +0000
@@ -3,7 +3,7 @@ ENTRY(_zimage_start)
EXTERN(_zimage_start)
SECTIONS
{
- . = (4*1024*1024);
+ . = (32*1024*1024);
_start = .;
.text :
{
linux-2.6-sata-eeepc-faster.patch:
--- NEW FILE linux-2.6-sata-eeepc-faster.patch ---
The Asus Eee PC prints this during bootup..
ata2.00: limited to UDMA/33 due to 40-wire cable
Which is unfortunate, as it has..
ata2.00: ATA-4: SILICONMOTION SM223AC, , max UDMA/66
I believe there actually is no cable, and the flash is directly
connected to the controller.
[root at eee ~]# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 64 MB in 3.08 seconds = 20.76 MB/sec
With the patch below it returns..
TBD
Signed-off-by: Dave Jones <davej at redhat.com>
--- linux-2.6.24.noarch/drivers/ata/ata_piix.c~ 2008-03-31 23:43:05.000000000 -0400
+++ linux-2.6.24.noarch/drivers/ata/ata_piix.c 2008-03-31 23:44:34.000000000 -0400
@@ -716,6 +716,7 @@ struct ich_laptop {
static const struct ich_laptop ich_laptop[] = {
/* devid, subvendor, subdev */
+ { 0x2653, 0x1043, 0x82d8 }, /* ICH6M on Asus Eee PC */
{ 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
{ 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */
{ 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */
linux-2.6-sparc-selinux-mprotect-checks.patch:
--- NEW FILE linux-2.6-sparc-selinux-mprotect-checks.patch ---
diff -up linux-2.6.24.sparc64/security/selinux/hooks.c.BAD linux-2.6.24.sparc64/security/selinux/hooks.c
--- linux-2.6.24.sparc64/security/selinux/hooks.c.BAD 2008-03-21 14:28:06.000000000 -0400
+++ linux-2.6.24.sparc64/security/selinux/hooks.c 2008-03-21 14:29:10.000000000 -0400
@@ -2825,6 +2825,7 @@ static int selinux_file_ioctl(struct fil
static int file_map_prot_check(struct file *file, unsigned long prot, int shared)
{
+#ifndef CONFIG_SPARC
if ((prot & PROT_EXEC) && (!file || (!shared && (prot & PROT_WRITE)))) {
/*
* We are making executable an anonymous mapping or a
@@ -2835,6 +2836,7 @@ static int file_map_prot_check(struct fi
if (rc)
return rc;
}
+#endif
if (file) {
/* read access is always possible with a mapping */
@@ -2885,6 +2887,7 @@ static int selinux_file_mprotect(struct
if (selinux_checkreqprot)
prot = reqprot;
+#ifndef CONFIG_SPARC
if ((prot & PROT_EXEC) && !(vma->vm_flags & VM_EXEC)) {
rc = 0;
if (vma->vm_start >= vma->vm_mm->start_brk &&
@@ -2909,6 +2912,7 @@ static int selinux_file_mprotect(struct
if (rc)
return rc;
}
+#endif
return file_map_prot_check(vma->vm_file, prot, vma->vm_flags&VM_SHARED);
}
linux-2.6-utrace.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.3 -r 1.4 linux-2.6-utrace.patch
Index: linux-2.6-utrace.patch
===================================================================
RCS file: linux-2.6-utrace.patch
diff -N linux-2.6-utrace.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-utrace.patch 1 Apr 2008 10:38:06 -0000 1.4
@@ -0,0 +1,9357 @@
+ Documentation/DocBook/Makefile | 2 +-
+ Documentation/DocBook/utrace.tmpl | 23 +
+ Documentation/utrace.txt | 579 +++++++++
+ arch/mips/kernel/irixelf.c | 2 -
+ arch/powerpc/kernel/asm-offsets.c | 4 -
+ arch/powerpc/kernel/process.c | 5 -
+ arch/powerpc/kernel/ptrace.c | 35 +-
+ arch/powerpc/kernel/ptrace32.c | 2 +-
+ arch/powerpc/kernel/signal.c | 8 +-
+ arch/powerpc/kernel/signal_32.c | 19 +-
+ arch/powerpc/kernel/sys_ppc32.c | 5 -
+ arch/sparc64/kernel/binfmt_aout32.c | 2 -
+ arch/sparc64/kernel/process.c | 23 +-
+ arch/sparc64/kernel/ptrace.c | 28 +-
+ arch/sparc64/kernel/sys_sparc32.c | 41 +-
+ arch/x86/ia32/ia32_aout.c | 6 -
+ arch/x86/ia32/ia32_signal.c | 10 -
+ arch/x86/ia32/ia32entry.S | 14 +-
+ arch/x86/ia32/sys_ia32.c | 5 -
+ arch/x86/kernel/entry_64.S | 8 +-
+ arch/x86/kernel/ptrace.c | 157 +--
+ arch/x86/kernel/signal_32.c | 37 +-
+ arch/x86/kernel/signal_64.c | 33 +-
+ arch/x86/kernel/vm86_32.c | 9 +-
+ fs/binfmt_aout.c | 6 -
+ fs/binfmt_elf.c | 6 -
+ fs/binfmt_elf_fdpic.c | 7 -
+ fs/binfmt_flat.c | 3 -
+ fs/binfmt_som.c | 2 -
+ fs/compat.c | 6 +-
+ fs/eventpoll.c | 3 +-
+ fs/exec.c | 12 +-
+ fs/proc/array.c | 9 +-
+ fs/proc/base.c | 43 +-
+ fs/select.c | 4 +-
+ include/asm-alpha/ptrace.h | 1 +
+ include/asm-ia64/ptrace.h | 1 +
+ include/asm-ia64/thread_info.h | 2 +-
+ include/asm-powerpc/ptrace.h | 1 +
+ include/asm-s390/thread_info.h | 2 +-
+ include/asm-sparc64/ptrace.h | 2 +
+ include/asm-x86/ptrace.h | 2 +
+ include/linux/init_task.h | 3 -
+ include/linux/ptrace.h | 71 +-
+ include/linux/sched.h | 46 +-
+ include/linux/thread_info.h | 10 +-
+ include/linux/tracehook.h | 493 ++++++++
+ include/linux/utrace.h | 544 ++++++++
+ init/Kconfig | 29 +
+ kernel/Makefile | 1 +
+ kernel/compat.c | 3 +-
+ kernel/exit.c | 371 +++---
+ kernel/fork.c | 72 +-
+ kernel/ptrace.c | 2112 +++++++++++++++++++++++++-------
+ kernel/signal.c | 288 +----
+ kernel/sys_ni.c | 4 +
+ kernel/utrace.c | 2377 +++++++++++++++++++++++++++++++++++
+ mm/nommu.c | 4 +-
+ security/selinux/hooks.c | 59 +-
+ security/selinux/include/objsec.h | 1 -
+ 58 files changed, 6306 insertions(+), 1287 deletions(-)
+
+diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
+index 300e170..7cf3afc 100644
+--- a/Documentation/DocBook/Makefile
++++ b/Documentation/DocBook/Makefile
+@@ -7,7 +7,7 @@
+ # list of DOCBOOKS.
+
+ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \
+- kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
++ kernel-hacking.xml kernel-locking.xml deviceiobook.xml utrace.xml \
+ procfs-guide.xml writing_usb_driver.xml networking.xml \
+ kernel-api.xml filesystems.xml lsm.xml usb.xml \
+ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
+diff --git a/Documentation/DocBook/utrace.tmpl b/Documentation/DocBook/utrace.tmpl
+new file mode 100644
+index ...f185043 100644
+--- /dev/null
++++ b/Documentation/DocBook/utrace.tmpl
+@@ -0,0 +1,23 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
++ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
++
++<book id="utrace">
++ <bookinfo>
++ <title>The utrace User Debugging Infrastructure</title>
++ </bookinfo>
++
++<toc></toc>
++
++<chapter><title>The utrace core API</title>
++!Iinclude/linux/utrace.h
++!Ekernel/utrace.c
++ </chapter>
++
++<chapter><title>Machine state access via utrace</title>
++!Finclude/linux/regset.h struct user_regset
++!Finclude/linux/regset.h struct user_regset_view
++!Finclude/linux/regset.h task_user_regset_view
++ </chapter>
++
++</book>
+diff --git a/Documentation/utrace.txt b/Documentation/utrace.txt
+new file mode 100644
+index ...4d24c33 100644
+--- /dev/null
++++ b/Documentation/utrace.txt
+@@ -0,0 +1,579 @@
++DRAFT DRAFT DRAFT WORK IN PROGRESS DRAFT DRAFT DRAFT
++
++This is work in progress and likely to change.
++
++
++ Roland McGrath <roland at redhat.com>
++
++---
++
++ User Debugging Data & Event Rendezvous
++ ---- --------- ---- - ----- ----------
++
++See linux/utrace.h for all the declarations used here.
++See also linux/tracehook.h for the utrace_regset declarations.
++
++The UTRACE is infrastructure code for tracing and controlling user
++threads. This is the foundation for writing tracing engines, which
++can be loadable kernel modules. The UTRACE interfaces provide three
++basic facilities:
++
++* Thread event reporting
++
++ Tracing engines can request callbacks for events of interest in
++ the thread: signals, system calls, exit, exec, clone, etc.
++
++* Core thread control
++
++ Tracing engines can prevent a thread from running (keeping it in
++ TASK_TRACED state), or make it single-step or block-step (when
++ hardware supports it). Engines can cause a thread to abort system
++ calls, they change the behaviors of signals, and they can inject
++ signal-style actions at will.
++
++* Thread machine state access
++
++ Tracing engines can read and write a thread's registers and
++ similar per-thread CPU state.
++
++
++ Tracing engines
++ ------- -------
++
++The basic actors in UTRACE are the thread and the tracing engine.
++A tracing engine is some body of code that calls into the utrace_*
++interfaces, represented by a struct utrace_engine_ops. (Usually it's a
++kernel module, though the legacy ptrace support is a tracing engine
++that is not in a kernel module.) The UTRACE interface operates on
++individual threads (struct task_struct). If an engine wants to
++treat several threads as a group, that is up to its higher-level
++code. Using the UTRACE starts out by attaching an engine to a thread.
++
++ struct utrace_attached_engine *
++ utrace_attach(struct task_struct *target, int flags,
++ const struct utrace_engine_ops *ops, void *data);
++
++Calling utrace_attach is what sets up a tracing engine to trace a
++thread. Use UTRACE_ATTACH_CREATE in flags, and pass your engine's ops.
++Check the return value with IS_ERR. If successful, it returns a
++struct pointer that is the handle used in all other utrace_* calls.
++The data argument is stored in the utrace_attached_engine structure,
++for your code to use however it wants.
++
++ int utrace_detach(struct task_struct *target,
++ struct utrace_attached_engine *engine);
++
++The utrace_detach call removes an engine from a thread.
++No more callbacks will be made after this returns success.
++
++
++An attached engine does nothing by default.
++An engine makes something happen by setting its flags.
++
++ int utrace_set_flags(struct task_struct *target,
++ struct utrace_attached_engine *engine,
++ unsigned long flags);
++
++The synchronization issues related to these two calls
++are discussed further below in "Teardown Races".
++
++
++ Action Flags
++ ------ -----
++
[...8964 lines suppressed...]
++ current);
++ if (ret)
++ break;
++ }
++ }
++ }
++ rcu_read_unlock();
++
++ return ret;
++}
++
++/*
++ * Called on the current task to return LSM_UNSAFE_* bits implied by tracing.
++ * Called with task_lock() held.
++ */
++int
++utrace_unsafe_exec(struct task_struct *tsk)
++{
++ struct utrace *utrace = tsk->utrace;
++ struct list_head *pos, *next;
++ struct utrace_attached_engine *engine;
++ const struct utrace_engine_ops *ops;
++ int unsafe = 0;
++
++ /* XXX must change for sharing */
++ list_for_each_safe_rcu(pos, next, &utrace->engines) {
++ engine = list_entry(pos, struct utrace_attached_engine, entry);
++ ops = rcu_dereference(engine->ops);
++ if (ops->unsafe_exec)
++ unsafe |= (*ops->unsafe_exec)(engine, tsk);
++ }
++
++ return unsafe;
++}
+diff --git a/mm/nommu.c b/mm/nommu.c
+index 5d8ae08..515beac 100644
+--- a/mm/nommu.c
++++ b/mm/nommu.c
+@@ -22,7 +22,7 @@
+ #include <linux/pagemap.h>
+ #include <linux/slab.h>
+ #include <linux/vmalloc.h>
+-#include <linux/ptrace.h>
++#include <linux/tracehook.h>
+ #include <linux/blkdev.h>
+ #include <linux/backing-dev.h>
+ #include <linux/mount.h>
+@@ -734,7 +734,7 @@ static unsigned long determine_vm_flags(
+ * it's being traced - otherwise breakpoints set in it may interfere
+ * with another untraced process
+ */
+- if ((flags & MAP_PRIVATE) && (current->ptrace & PT_PTRACED))
++ if ((flags & MAP_PRIVATE) && tracehook_expect_breakpoints(current))
+ vm_flags &= ~VM_MAYSHARE;
+
+ return vm_flags;
+diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
+index 41a049f..44b756b 100644
+--- a/security/selinux/hooks.c
++++ b/security/selinux/hooks.c
+@@ -24,7 +24,7 @@
+
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+-#include <linux/ptrace.h>
++#include <linux/tracehook.h>
+ #include <linux/errno.h>
+ #include <linux/sched.h>
+ #include <linux/security.h>
+@@ -162,7 +162,7 @@ static int task_alloc_security(struct ta
+ return -ENOMEM;
+
+ tsec->task = task;
+- tsec->osid = tsec->sid = tsec->ptrace_sid = SECINITSID_UNLABELED;
++ tsec->osid = tsec->sid = SECINITSID_UNLABELED;
+ task->security = tsec;
+
+ return 0;
+@@ -1638,19 +1638,13 @@ static inline u32 file_to_av(struct file
+
+ static int selinux_ptrace(struct task_struct *parent, struct task_struct *child)
+ {
+- struct task_security_struct *psec = parent->security;
+- struct task_security_struct *csec = child->security;
+ int rc;
+
+ rc = secondary_ops->ptrace(parent,child);
+ if (rc)
+ return rc;
+
+- rc = task_has_perm(parent, child, PROCESS__PTRACE);
+- /* Save the SID of the tracing process for later use in apply_creds. */
+- if (!(child->ptrace & PT_PTRACED) && !rc)
+- csec->ptrace_sid = psec->sid;
+- return rc;
++ return task_has_perm(parent, child, PROCESS__PTRACE);
+ }
+
+ static int selinux_capget(struct task_struct *target, kernel_cap_t *effective,
+@@ -2119,12 +2113,25 @@ static void selinux_bprm_apply_creds(str
+ /* Check for ptracing, and update the task SID if ok.
+ Otherwise, leave SID unchanged and kill. */
+ if (unsafe & (LSM_UNSAFE_PTRACE | LSM_UNSAFE_PTRACE_CAP)) {
+- rc = avc_has_perm(tsec->ptrace_sid, sid,
+- SECCLASS_PROCESS, PROCESS__PTRACE,
+- NULL);
+- if (rc) {
+- bsec->unsafe = 1;
+- return;
++ struct task_struct *tracer;
++ struct task_security_struct *sec;
++ u32 ptsid = 0;
++
++ rcu_read_lock();
++ tracer = tracehook_tracer_task(current);
++ if (likely(tracer != NULL)) {
++ sec = tracer->security;
++ ptsid = sec->sid;
++ }
++ rcu_read_unlock();
++
++ if (ptsid != 0) {
++ rc = avc_has_perm(ptsid, sid, SECCLASS_PROCESS,
++ PROCESS__PTRACE, NULL);
++ if (rc) {
++ bsec->unsafe = 1;
++ return;
++ }
+ }
+ }
+ tsec->sid = sid;
+@@ -2207,7 +2214,7 @@ static void selinux_bprm_post_apply_cred
+
+ /* Wake up the parent if it is waiting so that it can
+ recheck wait permission to the new task SID. */
+- wake_up_interruptible(¤t->parent->signal->wait_chldexit);
++ wake_up_interruptible(¤t->real_parent->signal->wait_chldexit);
+ }
+
+ /* superblock security operations */
+@@ -3080,11 +3087,6 @@ static int selinux_task_alloc_security(s
+ tsec2->keycreate_sid = tsec1->keycreate_sid;
+ tsec2->sockcreate_sid = tsec1->sockcreate_sid;
+
+- /* Retain ptracer SID across fork, if any.
+- This will be reset by the ptrace hook upon any
+- subsequent ptrace_attach operations. */
+- tsec2->ptrace_sid = tsec1->ptrace_sid;
+-
+ return 0;
+ }
+
+@@ -5050,6 +5052,7 @@ static int selinux_setprocattr(struct ta
+ char *name, void *value, size_t size)
+ {
+ struct task_security_struct *tsec;
++ struct task_struct *tracer;
+ u32 sid = 0;
+ int error;
+ char *str = value;
+@@ -5138,18 +5141,24 @@ static int selinux_setprocattr(struct ta
+ /* Check for ptracing, and update the task SID if ok.
+ Otherwise, leave SID unchanged and fail. */
+ task_lock(p);
+- if (p->ptrace & PT_PTRACED) {
+- error = avc_has_perm_noaudit(tsec->ptrace_sid, sid,
++ rcu_read_lock();
++ tracer = tracehook_tracer_task(p);
++ if (tracer != NULL) {
++ struct task_security_struct *ptsec = tracer->security;
++ u32 ptsid = ptsec->sid;
++ rcu_read_unlock();
++ error = avc_has_perm_noaudit(ptsid, sid,
+ SECCLASS_PROCESS,
+ PROCESS__PTRACE, 0, &avd);
+ if (!error)
+ tsec->sid = sid;
+ task_unlock(p);
+- avc_audit(tsec->ptrace_sid, sid, SECCLASS_PROCESS,
++ avc_audit(ptsid, sid, SECCLASS_PROCESS,
+ PROCESS__PTRACE, &avd, error, NULL);
+ if (error)
+ return error;
+ } else {
++ rcu_read_unlock();
+ tsec->sid = sid;
+ task_unlock(p);
+ }
+diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
+index c6c2bb4..1db31c2 100644
+--- a/security/selinux/include/objsec.h
++++ b/security/selinux/include/objsec.h
+@@ -35,7 +35,6 @@ struct task_security_struct {
+ u32 create_sid; /* fscreate SID */
+ u32 keycreate_sid; /* keycreate SID */
+ u32 sockcreate_sid; /* fscreate SID */
+- u32 ptrace_sid; /* SID of ptrace parent */
+ };
+
+ struct inode_security_struct {
linux-2.6-windfarm-pm121-fix.patch:
--- NEW FILE linux-2.6-windfarm-pm121-fix.patch ---
--- linux-2.6.24.ppc64/drivers/macintosh/windfarm_pm121.c~ 2008-03-22 19:13:22.000000000 +0000
+++ linux-2.6.24.ppc64/drivers/macintosh/windfarm_pm121.c 2008-03-23 09:05:54.000000000 +0000
@@ -867,7 +867,7 @@ static struct wf_control* pm121_register
{
if (controls[id] == NULL && !strcmp(ct->name, match)) {
if (wf_get_control(ct) == 0)
- controls[FAN_OD] = ct;
+ controls[id] = ct;
}
return controls[id];
}
@@ -879,10 +879,10 @@ static void pm121_new_control(struct wf_
if (pm121_all_controls_ok)
return;
- all = all && pm121_register_control(ct, "optical-driver-fan", FAN_OD);
- all = all && pm121_register_control(ct, "hard-driver-fan", FAN_HD);
- all = all && pm121_register_control(ct, "cpu-driver-fan", FAN_CPU);
- all = all && pm121_register_control(ct, "cpufreq-clamp", CPUFREQ);
+ all = pm121_register_control(ct, "optical-drive-fan", FAN_OD) && all;
+ all = pm121_register_control(ct, "hard-drive-fan", FAN_HD) && all;
+ all = pm121_register_control(ct, "cpu-fan", FAN_CPU) && all;
+ all = pm121_register_control(ct, "cpufreq-clamp", CPUFREQ) && all;
if (all)
pm121_all_controls_ok = 1;
@@ -909,24 +909,24 @@ static void pm121_new_sensor(struct wf_s
if (pm121_all_sensors_ok)
return;
- all = all && pm121_register_sensor(sr, "cpu-temp",
- &sensor_cpu_temp);
- all = all && pm121_register_sensor(sr, "cpu-current",
- &sensor_cpu_current);
- all = all && pm121_register_sensor(sr, "cpu-voltage",
- &sensor_cpu_voltage);
- all = all && pm121_register_sensor(sr, "cpu-power",
- &sensor_cpu_power);
- all = all && pm121_register_sensor(sr, "hard-drive-temp",
- &sensor_hard_drive_temp);
- all = all && pm121_register_sensor(sr, "optical-drive-temp",
- &sensor_optical_drive_temp);
- all = all && pm121_register_sensor(sr, "incoming-air-temp",
- &sensor_incoming_air_temp);
- all = all && pm121_register_sensor(sr, "north-bridge-temp",
- &sensor_north_bridge_temp);
- all = all && pm121_register_sensor(sr, "gpu-temp",
- &sensor_gpu_temp);
+ all = pm121_register_sensor(sr, "cpu-temp",
+ &sensor_cpu_temp) && all;
+ all = pm121_register_sensor(sr, "cpu-current",
+ &sensor_cpu_current) && all;
+ all = pm121_register_sensor(sr, "cpu-voltage",
+ &sensor_cpu_voltage) && all;
+ all = pm121_register_sensor(sr, "cpu-power",
+ &sensor_cpu_power) && all;
+ all = pm121_register_sensor(sr, "hard-drive-temp",
+ &sensor_hard_drive_temp) && all;
+ all = pm121_register_sensor(sr, "optical-drive-temp",
+ &sensor_optical_drive_temp) && all;
+ all = pm121_register_sensor(sr, "incoming-air-temp",
+ &sensor_incoming_air_temp) && all;
+ all = pm121_register_sensor(sr, "north-bridge-temp",
+ &sensor_north_bridge_temp) && all;
+ all = pm121_register_sensor(sr, "gpu-temp",
+ &sensor_gpu_temp) && all;
if (all)
pm121_all_sensors_ok = 1;
linux-2.6-windfarm-pm121.patch:
--- NEW FILE linux-2.6-windfarm-pm121.patch ---
>From linuxppc-dev-bounces+dwmw2=infradead.org at ozlabs.org Sat Jan 26 11:57:27 2008
Return-path: <linuxppc-dev-bounces+dwmw2=infradead.org at ozlabs.org>
Envelope-to: dwmw2 at baythorne.infradead.org
Delivery-date: Sat, 26 Jan 2008 11:57:28 +0000
Received: from pentafluge.infradead.org ([2001:770:15f::1]) by
baythorne.infradead.org with esmtps (Exim 4.68 #1 (Red Hat Linux)) id
1JIjf4-0007PK-Lq for dwmw2 at baythorne.infradead.org; Sat, 26 Jan 2008
11:57:27 +0000
Received: from ozlabs.org ([203.10.76.45]) by pentafluge.infradead.org with
esmtps (Exim 4.68 #1 (Red Hat Linux)) id 1JIjep-0002yH-Db for
dwmw2 at infradead.org; Sat, 26 Jan 2008 11:57:25 +0000
Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix)
with ESMTP id 3F138DDE42 for <dwmw2 at infradead.org>; Sat, 26 Jan 2008
22:57:07 +1100 (EST)
X-Original-To: linuxppc-dev at ozlabs.org
Delivered-To: linuxppc-dev at ozlabs.org
Received: from fg-out-1718.google.com (fg-out-1718.google.com
[72.14.220.158]) by ozlabs.org (Postfix) with ESMTP id C34F2DDE05 for
<linuxppc-dev at ozlabs.org>; Sat, 26 Jan 2008 22:56:53 +1100 (EST)
Received: by fg-out-1718.google.com with SMTP id 16so871497fgg.39 for
<linuxppc-dev at ozlabs.org>; Sat, 26 Jan 2008 03:56:50 -0800 (PST)
Received: by 10.86.50.8 with SMTP id x8mr2930559fgx.30.1201348610311; Sat,
26 Jan 2008 03:56:50 -0800 (PST)
Received: from ?192.168.0.1? ( [82.243.217.90]) by mx.google.com with
ESMTPS id e11sm3476258fga.5.2008.01.26.03.56.47 (version=TLSv1/SSLv3
cipher=RC4-MD5); Sat, 26 Jan 2008 03:56:48 -0800 (PST)
Subject: [PATCH] windfarm: add PowerMac 12,1 support
From: =?ISO-8859-1?Q?=C9tienne?= Bersac <bersace03 at gmail.com>
To: linuxppc-dev <linuxppc-dev at ozlabs.org>
Date: Sat, 26 Jan 2008 12:55:25 +0100
Message-Id: <1201348525.6859.1.camel at thilivren>
Mime-Version: 1.0
X-Mailer: Evolution 2.12.1
X-BeenThere: linuxppc-dev at ozlabs.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>
List-Unsubscribe: <https://ozlabs.org/mailman/listinfo/linuxppc-dev>,
<mailto:linuxppc-dev-request at ozlabs.org?subject=unsubscribe>
List-Archive: <http://ozlabs.org/pipermail/linuxppc-dev>
List-Post: <mailto:linuxppc-dev at ozlabs.org>
List-Help: <mailto:linuxppc-dev-request at ozlabs.org?subject=help>
List-Subscribe: <https://ozlabs.org/mailman/listinfo/linuxppc-dev>,
<mailto:linuxppc-dev-request at ozlabs.org?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Sender: linuxppc-dev-bounces+dwmw2=infradead.org at ozlabs.org
Errors-To: linuxppc-dev-bounces+dwmw2=infradead.org at ozlabs.org
X-Spam-Score: 0.0 (/)
X-Evolution-Source: imap://dwmw2@pentafluge.infradead.org/
Content-Transfer-Encoding: 8bit
From: Ãtienne Bersac <bersace at gmail.com>
Implement a new driver named windfarm_pm121 which drive fans on PowerMac
12,1 machine : iMac G5 iSight (rev C) 17" and 20". It's based on
windfarm_pm81 driver from Benjamin Herrenschmidt.
Signed-off-by: Ãtienne Bersac <bersace at gmail.com>
---
Implement fan control for PowerMac 12,1 machines. This needs update to
windfarm_lm75 and windfarm_max6690 sensors drivers in order to properly
match sensors by their location. The code is based on windfarm_pm81
driver, adapted to the complexity of PowerMac 12,1 : 4 system control
loops instead of one, per-control target correction and per-model
control rubber-banding.
All the data are copied from Darwin 8.10 AppleMacRISC4PE-185.0.0 module
as well as correction formula.
diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig
index 3673dd2..4c048b3 100644
--- a/arch/powerpc/configs/g5_defconfig
+++ b/arch/powerpc/configs/g5_defconfig
@@ -667,6 +667,7 @@ CONFIG_WINDFARM=y
CONFIG_WINDFARM_PM81=y
CONFIG_WINDFARM_PM91=y
CONFIG_WINDFARM_PM112=y
+CONFIG_WINDFARM_PM121=y
# CONFIG_PMAC_RACKMETER is not set
CONFIG_NETDEVICES=y
# CONFIG_NETDEVICES_MULTIQUEUE is not set
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index 77f50b6..2d028e6 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -234,6 +234,14 @@ config WINDFARM_PM112
which are the recent dual and quad G5 machines using the
970MP dual-core processor.
+config WINDFARM_PM121
+ tristate "Support for thermal management on PowerMac12,1"
+ depends on WINDFARM && I2C && PMAC_SMU
+ select I2C_POWERMAC
+ help
+ This driver provides thermal control for the PowerMac12,1
+ which is the iMac G5 (iSight) 970MP
+
config ANSLCD
tristate "Support for ANS LCD display"
depends on ADB_CUDA && PPC_PMAC
diff --git a/drivers/macintosh/Makefile b/drivers/macintosh/Makefile
index 2dfc3f4..e3132ef 100644
--- a/drivers/macintosh/Makefile
+++ b/drivers/macintosh/Makefile
@@ -42,4 +42,9 @@ obj-$(CONFIG_WINDFARM_PM112) += windfarm_pm112.o windfarm_smu_sat.o \
windfarm_smu_sensors.o \
windfarm_max6690_sensor.o \
windfarm_lm75_sensor.o windfarm_pid.o
+obj-$(CONFIG_WINDFARM_PM121) += windfarm_pm121.o windfarm_smu_sat.o \
+ windfarm_smu_controls.o \
+ windfarm_smu_sensors.o \
+ windfarm_max6690_sensor.o \
+ windfarm_lm75_sensor.o windfarm_pid.o
obj-$(CONFIG_PMAC_RACKMETER) += rack-meter.o
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c
index 7e10c3a..b92b959 100644
--- a/drivers/macintosh/windfarm_lm75_sensor.c
+++ b/drivers/macintosh/windfarm_lm75_sensor.c
@@ -127,6 +127,12 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter,
*/
if (!strcmp(loc, "Hard drive") || !strcmp(loc, "DRIVE BAY"))
lm->sens.name = "hd-temp";
+ else if (!strcmp(loc, "Incoming Air Temp"))
+ lm->sens.name = "incoming-air-temp";
+ else if (!strcmp(loc, "ODD Temp"))
+ lm->sens.name = "optical-drive-temp";
+ else if (!strcmp(loc, "HD Temp"))
+ lm->sens.name = "hard-drive-temp";
else
goto fail;
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c
index 5f03aab..e207a90 100644
--- a/drivers/macintosh/windfarm_max6690_sensor.c
+++ b/drivers/macintosh/windfarm_max6690_sensor.c
@@ -77,18 +77,28 @@ static struct wf_sensor_ops wf_max6690_ops = {
.owner = THIS_MODULE,
};
-static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr)
+static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr,
+ const char *loc)
{
struct wf_6690_sensor *max;
- char *name = "backside-temp";
+ char *name;
max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL);
if (max == NULL) {
printk(KERN_ERR "windfarm: Couldn't create MAX6690 sensor %s: "
- "no memory\n", name);
+ "no memory\n", loc);
return;
}
+ if (!strcmp(loc, "BACKSIDE"))
+ name = "backside-temp";
+ else if (!strcmp(loc, "NB Ambient"))
+ name = "north-bridge-temp";
+ else if (!strcmp(loc, "GPU Ambient"))
+ name = "gpu-temp";
+ else
+ goto fail;
+
max->sens.ops = &wf_max6690_ops;
max->sens.name = name;
max->i2c.addr = addr >> 1;
@@ -138,9 +148,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
if (loc == NULL || addr == 0)
continue;
printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
- if (strcmp(loc, "BACKSIDE"))
- continue;
- wf_max6690_create(adapter, addr);
+ wf_max6690_create(adapter, addr, loc);
}
return 0;
diff --git a/drivers/macintosh/windfarm_pm121.c b/drivers/macintosh/windfarm_pm121.c
new file mode 100644
index 0000000..5276156
--- /dev/null
+++ b/drivers/macintosh/windfarm_pm121.c
@@ -0,0 +1,1040 @@
+/*
+ * Windfarm PowerMac thermal control. iMac G5 iSight
+ *
+ * (c) Copyright 2007 Ãtienne Bersac <bersace at gmail.com>
+ *
+ * Bits & pieces from windfarm_pm81.c by (c) Copyright 2005 Benjamin
+ * Herrenschmidt, IBM Corp. <benh at kernel.crashing.org>
+ *
+ * Released under the term of the GNU GPL v2.
+ *
+ *
+ *
+ * PowerMac12,1
+ * ============
+ *
+ *
+ * The algorithm used is the PID control algorithm, used the same way
+ * the published Darwin code does, using the same values that are
+ * present in the Darwin 8.10 snapshot property lists (note however
+ * that none of the code has been re-used, it's a complete
+ * re-implementation
+ *
+ * There is two models using PowerMac12,1. Model 2 is iMac G5 iSight
+ * 17" while Model 3 is iMac G5 20". They do have both the same
+ * controls with a tiny difference. The control-ids of hard-drive-fan
+ * and cpu-fan is swapped.
+ *
+ *
+ * Target Correction :
+ *
+ * controls have a target correction calculated as :
+ *
+ * new_min = ((((average_power * slope) >> 16) + offset) >> 16) + min_value
+ * new_value = max(new_value, max(new_min, 0))
+ *
+ * OD Fan control correction.
+ *
+ * # model_id: 2
+ * offset : -19563152
+ * slope : 1956315
+ *
+ * # model_id: 3
+ * offset : -15650652
+ * slope : 1565065
+ *
+ * HD Fan control correction.
+ *
+ * # model_id: 2
+ * offset : -15650652
+ * slope : 1565065
+ *
+ * # model_id: 3
+ * offset : -19563152
+ * slope : 1956315
+ *
+ * CPU Fan control correction.
+ *
+ * # model_id: 2
+ * offset : -25431900
+ * slope : 2543190
+ *
+ * # model_id: 3
+ * offset : -15650652
+ * slope : 1565065
+ *
+ *
+ * Target rubber-banding :
+ *
+ * Some controls have a target correction which depends on another
+ * control value. The correction is computed in the following way :
+ *
+ * new_min = ref_value * slope + offset
+ *
+ * ref_value is the value of the reference control. If new_min is
+ * greater than 0, then we correct the target value using :
+ *
+ * new_target = max (new_target, new_min >> 16)
+ *
+ *
+ * # model_id : 2
+ * control : cpu-fan
+ * ref : optical-drive-fan
+ * offset : -15650652
+ * slope : 1565065
+ *
+ * # model_id : 3
+ * control : optical-drive-fan
+ * ref : hard-drive-fan
+ * offset : -32768000
+ * slope : 65536
+ *
+ *
+ * In order to have the moste efficient correction with those
+ * dependencies, we must trigger HD loop before OD loop before CPU
+ * loop.
+ *
+ *
+ * The various control loops found in Darwin config file are:
+ *
+ * HD Fan control loop.
+ *
+ * # model_id: 2
+ * control : hard-drive-fan
+ * sensor : hard-drive-temp
+ * PID params : G_d = 0x00000000
+ * G_p = 0x002D70A3
+ * G_r = 0x00019999
+ * History = 2 entries
+ * Input target = 0x370000
+ * Interval = 5s
+ *
+ * # model_id: 3
+ * control : hard-drive-fan
+ * sensor : hard-drive-temp
+ * PID params : G_d = 0x00000000
+ * G_p = 0x002170A3
+ * G_r = 0x00019999
+ * History = 2 entries
+ * Input target = 0x370000
+ * Interval = 5s
+ *
+ * OD Fan control loop.
+ *
+ * # model_id: 2
+ * control : optical-drive-fan
+ * sensor : optical-drive-temp
+ * PID params : G_d = 0x00000000
+ * G_p = 0x001FAE14
+ * G_r = 0x00019999
+ * History = 2 entries
+ * Input target = 0x320000
+ * Interval = 5s
+ *
+ * # model_id: 3
+ * control : optical-drive-fan
+ * sensor : optical-drive-temp
+ * PID params : G_d = 0x00000000
+ * G_p = 0x001FAE14
+ * G_r = 0x00019999
+ * History = 2 entries
+ * Input target = 0x320000
+ * Interval = 5s
+ *
+ * GPU Fan control loop.
+ *
+ * # model_id: 2
+ * control : hard-drive-fan
+ * sensor : gpu-temp
+ * PID params : G_d = 0x00000000
+ * G_p = 0x002A6666
+ * G_r = 0x00019999
+ * History = 2 entries
+ * Input target = 0x5A0000
+ * Interval = 5s
+ *
+ * # model_id: 3
+ * control : cpu-fan
+ * sensor : gpu-temp
+ * PID params : G_d = 0x00000000
+ * G_p = 0x0010CCCC
+ * G_r = 0x00019999
+ * History = 2 entries
+ * Input target = 0x500000
+ * Interval = 5s
+ *
+ * KODIAK (aka northbridge) Fan control loop.
+ *
+ * # model_id: 2
+ * control : optical-drive-fan
+ * sensor : north-bridge-temp
+ * PID params : G_d = 0x00000000
+ * G_p = 0x003BD70A
+ * G_r = 0x00019999
+ * History = 2 entries
+ * Input target = 0x550000
+ * Interval = 5s
+ *
+ * # model_id: 3
+ * control : hard-drive-fan
+ * sensor : north-bridge-temp
+ * PID params : G_d = 0x00000000
+ * G_p = 0x0030F5C2
+ * G_r = 0x00019999
+ * History = 2 entries
+ * Input target = 0x550000
+ * Interval = 5s
+ *
+ * CPU Fan control loop.
+ *
+ * control : cpu-fan
+ * sensors : cpu-temp, cpu-power
+ * PID params : from SDB partition
+ *
+ *
+ * CPU Slew control loop.
+ *
+ * control : cpufreq-clamp
+ * sensor : cpu-temp
+ *
+ */
+
+#undef DEBUG
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <linux/wait.h>
+#include <linux/kmod.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <asm/prom.h>
+#include <asm/machdep.h>
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/sections.h>
+#include <asm/smu.h>
+
+#include "windfarm.h"
+#include "windfarm_pid.h"
+
+#define VERSION "0.3"
+
+static int pm121_mach_model; /* machine model id */
+
+/* Controls & sensors */
+static struct wf_sensor *sensor_cpu_power;
+static struct wf_sensor *sensor_cpu_temp;
+static struct wf_sensor *sensor_cpu_voltage;
+static struct wf_sensor *sensor_cpu_current;
+static struct wf_sensor *sensor_gpu_temp;
+static struct wf_sensor *sensor_north_bridge_temp;
+static struct wf_sensor *sensor_hard_drive_temp;
+static struct wf_sensor *sensor_optical_drive_temp;
+static struct wf_sensor *sensor_incoming_air_temp; /* unused ! */
+
+enum {
+ FAN_CPU,
+ FAN_HD,
+ FAN_OD,
+ CPUFREQ,
+ N_CONTROLS
+};
+static struct wf_control *controls[N_CONTROLS] = {};
+
+/* Set to kick the control loop into life */
+static int pm121_all_controls_ok, pm121_all_sensors_ok, pm121_started;
+
+enum {
+ FAILURE_FAN = 1 << 0,
+ FAILURE_SENSOR = 1 << 1,
+ FAILURE_OVERTEMP = 1 << 2
+};
+
+/* All sys loops. Note the HD before the OD loop in order to have it
+ run before. */
+enum {
+ LOOP_GPU, /* control = hd or cpu, but luckily,
+ it doesn't matter */
+ LOOP_HD, /* control = hd */
+ LOOP_KODIAK, /* control = hd or od */
+ LOOP_OD, /* control = od */
+ N_LOOPS
+};
+
+static const char *loop_names[N_LOOPS] = {
+ "GPU",
+ "HD",
+ "KODIAK",
+ "OD",
+};
+
+#define PM121_NUM_CONFIGS 2
+
+static unsigned int pm121_failure_state;
+static int pm121_readjust, pm121_skipping;
+static s32 average_power;
+
+struct pm121_correction {
+ int offset;
+ int slope;
+};
+
+static struct pm121_correction corrections[N_CONTROLS][PM121_NUM_CONFIGS] = {
+ /* FAN_OD */
+ {
+ /* MODEL 2 */
+ { .offset = -19563152,
+ .slope = 1956315
+ },
+ /* MODEL 3 */
+ { .offset = -15650652,
+ .slope = 1565065
+ },
+ },
+ /* FAN_HD */
+ {
+ /* MODEL 2 */
+ { .offset = -15650652,
+ .slope = 1565065
+ },
+ /* MODEL 3 */
+ { .offset = -19563152,
+ .slope = 1956315
+ },
+ },
+ /* FAN_CPU */
+ {
+ /* MODEL 2 */
+ { .offset = -25431900,
+ .slope = 2543190
+ },
+ /* MODEL 3 */
+ { .offset = -15650652,
+ .slope = 1565065
+ },
+ },
+ /* CPUFREQ has no correction (and is not implemented at all) */
+};
+
+struct pm121_connection {
+ unsigned int control_id;
+ unsigned int ref_id;
+ struct pm121_correction correction;
+};
+
+static struct pm121_connection pm121_connections[] = {
+ /* MODEL 2 */
+ { .control_id = FAN_CPU,
+ .ref_id = FAN_OD,
+ { .offset = -32768000,
+ .slope = 65536
+ }
+ },
+ /* MODEL 3 */
+ { .control_id = FAN_OD,
+ .ref_id = FAN_HD,
+ { .offset = -32768000,
+ .slope = 65536
+ }
+ },
+};
+
+/* pointer to the current model connection */
+static struct pm121_connection *pm121_connection;
+
+/*
+ * ****** System Fans Control Loop ******
+ *
+ */
+
+/* Since each loop handles only one control and we want to avoid
+ * writing virtual control, we store the control correction with the
+ * loop params. Some data are not set, there are common to all loop
+ * and thus, hardcoded.
+ */
+struct pm121_sys_param {
+ /* purely informative since we use mach_model-2 as index */
+ int model_id;
+ struct wf_sensor **sensor; /* use sensor_id instead ? */
+ s32 gp, itarget;
+ unsigned int control_id;
+};
+
+static struct pm121_sys_param
+pm121_sys_all_params[N_LOOPS][PM121_NUM_CONFIGS] = {
+ /* GPU Fan control loop */
+ {
+ { .model_id = 2,
+ .sensor = &sensor_gpu_temp,
+ .gp = 0x002A6666,
+ .itarget = 0x5A0000,
+ .control_id = FAN_HD,
+ },
+ { .model_id = 3,
+ .sensor = &sensor_gpu_temp,
+ .gp = 0x0010CCCC,
+ .itarget = 0x500000,
+ .control_id = FAN_CPU,
+ },
+ },
+ /* HD Fan control loop */
+ {
+ { .model_id = 2,
+ .sensor = &sensor_hard_drive_temp,
+ .gp = 0x002D70A3,
+ .itarget = 0x370000,
+ .control_id = FAN_HD,
+ },
+ { .model_id = 3,
+ .sensor = &sensor_hard_drive_temp,
+ .gp = 0x002170A3,
+ .itarget = 0x370000,
+ .control_id = FAN_HD,
+ },
+ },
+ /* KODIAK Fan control loop */
+ {
+ { .model_id = 2,
+ .sensor = &sensor_north_bridge_temp,
+ .gp = 0x003BD70A,
+ .itarget = 0x550000,
+ .control_id = FAN_OD,
+ },
+ { .model_id = 3,
+ .sensor = &sensor_north_bridge_temp,
+ .gp = 0x0030F5C2,
+ .itarget = 0x550000,
+ .control_id = FAN_HD,
+ },
+ },
+ /* OD Fan control loop */
+ {
+ { .model_id = 2,
+ .sensor = &sensor_optical_drive_temp,
+ .gp = 0x001FAE14,
+ .itarget = 0x320000,
+ .control_id = FAN_OD,
+ },
+ { .model_id = 3,
+ .sensor = &sensor_optical_drive_temp,
+ .gp = 0x001FAE14,
+ .itarget = 0x320000,
+ .control_id = FAN_OD,
+ },
+ },
+};
+
+/* the hardcoded values */
+#define PM121_SYS_GD 0x00000000
+#define PM121_SYS_GR 0x00019999
+#define PM121_SYS_HISTORY_SIZE 2
+#define PM121_SYS_INTERVAL 5
+
+/* State data used by the system fans control loop
+ */
+struct pm121_sys_state {
+ int ticks;
+ s32 setpoint;
+ struct wf_pid_state pid;
+};
+
+struct pm121_sys_state *pm121_sys_state[N_LOOPS] = {};
+
+/*
+ * ****** CPU Fans Control Loop ******
+ *
+ */
+
+#define PM121_CPU_INTERVAL 1
+
+/* State data used by the cpu fans control loop
+ */
+struct pm121_cpu_state {
+ int ticks;
+ s32 setpoint;
+ struct wf_cpu_pid_state pid;
+};
+
+static struct pm121_cpu_state *pm121_cpu_state;
+
+
+
+/*
+ * ***** Implementation *****
+ *
+ */
+
+/* correction the value using the output-low-bound correction algo */
+static s32 pm121_correct(s32 new_setpoint,
+ unsigned int control_id,
+ s32 min)
+{
+ s32 new_min;
+ struct pm121_correction *correction;
+ correction = &corrections[control_id][pm121_mach_model - 2];
+
+ new_min = (average_power * correction->slope) >> 16;
+ new_min += correction->offset;
+ new_min = (new_min >> 16) + min;
+
+ return max(new_setpoint, max(new_min, 0));
+}
+
+static s32 pm121_connect(unsigned int control_id, s32 setpoint)
+{
+ s32 new_min, value, new_setpoint;
+
+ if (pm121_connection->control_id == control_id) {
+ controls[control_id]->ops->get_value(controls[control_id],
+ &value);
+ new_min = value * pm121_connection->correction.slope;
+ new_min += pm121_connection->correction.offset;
+ if (new_min > 0) {
+ new_setpoint = max(setpoint, (new_min >> 16));
+ if (new_setpoint != setpoint) {
+ pr_debug("pm121: %s depending on %s, "
+ "corrected from %d to %d RPM\n",
+ controls[control_id]->name,
+ controls[pm121_connection->ref_id]->name,
+ (int) setpoint, (int) new_setpoint);
+ }
+ } else
+ new_setpoint = setpoint;
+ }
+ /* no connection */
+ else
+ new_setpoint = setpoint;
+
+ return new_setpoint;
+}
+
+/* FAN LOOPS */
+static void pm121_create_sys_fans(int loop_id)
+{
+ struct pm121_sys_param *param = NULL;
+ struct wf_pid_param pid_param;
+ struct wf_control *control = NULL;
+ int i;
+
+ /* First, locate the params for this model */
+ for (i = 0; i < PM121_NUM_CONFIGS; i++) {
+ if (pm121_sys_all_params[loop_id][i].model_id == pm121_mach_model) {
+ param = &(pm121_sys_all_params[loop_id][i]);
+ break;
+ }
+ }
+
+ /* No params found, put fans to max */
+ if (param == NULL) {
+ printk(KERN_WARNING "pm121: %s fan config not found "
+ " for this machine model\n",
+ loop_names[loop_id]);
+ goto fail;
+ }
+
+ control = controls[param->control_id];
+
+ /* Alloc & initialize state */
+ pm121_sys_state[loop_id] = kmalloc(sizeof(struct pm121_sys_state),
+ GFP_KERNEL);
+ if (pm121_sys_state[loop_id] == NULL) {
+ printk(KERN_WARNING "pm121: Memory allocation error\n");
+ goto fail;
+ }
+ pm121_sys_state[loop_id]->ticks = 1;
+
+ /* Fill PID params */
+ pid_param.gd = PM121_SYS_GD;
+ pid_param.gp = param->gp;
+ pid_param.gr = PM121_SYS_GR;
+ pid_param.interval = PM121_SYS_INTERVAL;
+ pid_param.history_len = PM121_SYS_HISTORY_SIZE;
+ pid_param.itarget = param->itarget;
+ pid_param.min = control->ops->get_min(control);
+ pid_param.max = control->ops->get_max(control);
+
+ wf_pid_init(&pm121_sys_state[loop_id]->pid, &pid_param);
+
+ pr_debug("pm121: %s Fan control loop initialized.\n"
+ " itarged=%d.%03d, min=%d RPM, max=%d RPM\n",
+ loop_names[loop_id], FIX32TOPRINT(pid_param.itarget),
+ pid_param.min, pid_param.max);
+ return;
+
+ fail:
+ /* note that this is not optimal since another loop may still
+ control the same control */
+ printk(KERN_WARNING "pm121: failed to set up %s loop "
+ "setting \"%s\" to max speed.\n",
+ loop_names[loop_id], control->name);
+
+ if (control)
+ wf_control_set_max(control);
+}
+
+static void pm121_sys_fans_tick(int loop_id)
+{
+ struct pm121_sys_param *param;
+ struct pm121_sys_state *st;
+ struct wf_sensor *sensor;
+ struct wf_control *control;
+ s32 temp, new_setpoint;
+ int rc;
+
+ param = &(pm121_sys_all_params[loop_id][pm121_mach_model-2]);
+ st = pm121_sys_state[loop_id];
+ sensor = *(param->sensor);
+ control = controls[param->control_id];
+
+ if (--st->ticks != 0) {
+ if (pm121_readjust)
+ goto readjust;
+ return;
+ }
+ st->ticks = PM121_SYS_INTERVAL;
+
+ rc = sensor->ops->get_value(sensor, &temp);
+ if (rc) {
+ printk(KERN_WARNING "windfarm: %s sensor error %d\n",
+ sensor->name, rc);
+ pm121_failure_state |= FAILURE_SENSOR;
+ return;
+ }
+
+ pr_debug("pm121: %s Fan tick ! %s: %d.%03d\n",
+ loop_names[loop_id], sensor->name,
+ FIX32TOPRINT(temp));
+
+ new_setpoint = wf_pid_run(&st->pid, temp);
+
+ /* correction */
+ new_setpoint = pm121_correct(new_setpoint,
+ param->control_id,
+ st->pid.param.min);
+ /* linked corretion */
+ new_setpoint = pm121_connect(param->control_id, new_setpoint);
+
+ if (new_setpoint == st->setpoint)
+ return;
+ st->setpoint = new_setpoint;
+ pr_debug("pm121: %s corrected setpoint: %d RPM\n",
+ control->name, (int)new_setpoint);
+ readjust:
+ if (control && pm121_failure_state == 0) {
+ rc = control->ops->set_value(control, st->setpoint);
+ if (rc) {
+ printk(KERN_WARNING "windfarm: %s fan error %d\n",
+ control->name, rc);
+ pm121_failure_state |= FAILURE_FAN;
+ }
+ }
+}
+
+
+/* CPU LOOP */
+static void pm121_create_cpu_fans(void)
+{
+ struct wf_cpu_pid_param pid_param;
+ const struct smu_sdbp_header *hdr;
+ struct smu_sdbp_cpupiddata *piddata;
+ struct smu_sdbp_fvt *fvt;
+ struct wf_control *fan_cpu;
+ s32 tmax, tdelta, maxpow, powadj;
+
+ fan_cpu = controls[FAN_CPU];
+
+ /* First, locate the PID params in SMU SBD */
+ hdr = smu_get_sdb_partition(SMU_SDB_CPUPIDDATA_ID, NULL);
+ if (hdr == 0) {
+ printk(KERN_WARNING "pm121: CPU PID fan config not found.\n");
+ goto fail;
+ }
+ piddata = (struct smu_sdbp_cpupiddata *)&hdr[1];
+
+ /* Get the FVT params for operating point 0 (the only supported one
+ * for now) in order to get tmax
+ */
+ hdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL);
+ if (hdr) {
+ fvt = (struct smu_sdbp_fvt *)&hdr[1];
+ tmax = ((s32)fvt->maxtemp) << 16;
+ } else
+ tmax = 0x5e0000; /* 94 degree default */
+
+ /* Alloc & initialize state */
+ pm121_cpu_state = kmalloc(sizeof(struct pm121_cpu_state),
+ GFP_KERNEL);
+ if (pm121_cpu_state == NULL)
+ goto fail;
+ pm121_cpu_state->ticks = 1;
+
+ /* Fill PID params */
+ pid_param.interval = PM121_CPU_INTERVAL;
+ pid_param.history_len = piddata->history_len;
+ if (pid_param.history_len > WF_CPU_PID_MAX_HISTORY) {
+ printk(KERN_WARNING "pm121: History size overflow on "
+ "CPU control loop (%d)\n", piddata->history_len);
+ pid_param.history_len = WF_CPU_PID_MAX_HISTORY;
+ }
+ pid_param.gd = piddata->gd;
+ pid_param.gp = piddata->gp;
+ pid_param.gr = piddata->gr / pid_param.history_len;
+
+ tdelta = ((s32)piddata->target_temp_delta) << 16;
+ maxpow = ((s32)piddata->max_power) << 16;
+ powadj = ((s32)piddata->power_adj) << 16;
+
+ pid_param.tmax = tmax;
+ pid_param.ttarget = tmax - tdelta;
+ pid_param.pmaxadj = maxpow - powadj;
+
+ pid_param.min = fan_cpu->ops->get_min(fan_cpu);
+ pid_param.max = fan_cpu->ops->get_max(fan_cpu);
+
+ wf_cpu_pid_init(&pm121_cpu_state->pid, &pid_param);
+
+ pr_debug("pm121: CPU Fan control initialized.\n");
+ pr_debug(" ttarged=%d.%03d, tmax=%d.%03d, min=%d RPM, max=%d RPM,\n",
+ FIX32TOPRINT(pid_param.ttarget), FIX32TOPRINT(pid_param.tmax),
+ pid_param.min, pid_param.max);
+
+ return;
+
+ fail:
+ printk(KERN_WARNING "pm121: CPU fan config not found, max fan speed\n");
+
+ if (controls[CPUFREQ])
+ wf_control_set_max(controls[CPUFREQ]);
+ if (fan_cpu)
+ wf_control_set_max(fan_cpu);
+}
+
+
+static void pm121_cpu_fans_tick(struct pm121_cpu_state *st)
+{
+ s32 new_setpoint, temp, power;
+ struct wf_control *fan_cpu = NULL;
+ int rc;
+
+ if (--st->ticks != 0) {
+ if (pm121_readjust)
+ goto readjust;
+ return;
+ }
+ st->ticks = PM121_CPU_INTERVAL;
+
+ fan_cpu = controls[FAN_CPU];
+
+ rc = sensor_cpu_temp->ops->get_value(sensor_cpu_temp, &temp);
+ if (rc) {
+ printk(KERN_WARNING "pm121: CPU temp sensor error %d\n",
+ rc);
+ pm121_failure_state |= FAILURE_SENSOR;
+ return;
+ }
+
+ rc = sensor_cpu_power->ops->get_value(sensor_cpu_power, &power);
+ if (rc) {
+ printk(KERN_WARNING "pm121: CPU power sensor error %d\n",
+ rc);
+ pm121_failure_state |= FAILURE_SENSOR;
+ return;
+ }
+
+ pr_debug("pm121: CPU Fans tick ! CPU temp: %d.%03d°C, power: %d.%03d\n",
+ FIX32TOPRINT(temp), FIX32TOPRINT(power));
+
+ if (temp > st->pid.param.tmax)
+ pm121_failure_state |= FAILURE_OVERTEMP;
+
+ new_setpoint = wf_cpu_pid_run(&st->pid, power, temp);
+
+ /* correction */
+ new_setpoint = pm121_correct(new_setpoint,
+ FAN_CPU,
+ st->pid.param.min);
+
+ /* connected correction */
+ new_setpoint = pm121_connect(FAN_CPU, new_setpoint);
+
+ if (st->setpoint == new_setpoint)
+ return;
+ st->setpoint = new_setpoint;
+ pr_debug("pm121: CPU corrected setpoint: %d RPM\n", (int)new_setpoint);
+
+ readjust:
+ if (fan_cpu && pm121_failure_state == 0) {
+ rc = fan_cpu->ops->set_value(fan_cpu, st->setpoint);
+ if (rc) {
+ printk(KERN_WARNING "pm121: %s fan error %d\n",
+ fan_cpu->name, rc);
+ pm121_failure_state |= FAILURE_FAN;
+ }
+ }
+}
+
+/*
+ * ****** Common ******
+ *
+ */
+
+static void pm121_tick(void)
+{
+ unsigned int last_failure = pm121_failure_state;
+ unsigned int new_failure;
+ s32 total_power;
+ int i;
+
+ if (!pm121_started) {
+ pr_debug("pm121: creating control loops !\n");
+ for (i = 0; i < N_LOOPS; i++)
+ pm121_create_sys_fans(i);
+
+ pm121_create_cpu_fans();
+ pm121_started = 1;
+ }
+
+ /* skipping ticks */
+ if (pm121_skipping && --pm121_skipping)
+ return;
+
+ /* compute average power */
+ total_power = 0;
+ for (i = 0; i < pm121_cpu_state->pid.param.history_len; i++)
+ total_power += pm121_cpu_state->pid.powers[i];
+
+ average_power = total_power / pm121_cpu_state->pid.param.history_len;
+
+
+ pm121_failure_state = 0;
+ for (i = 0 ; i < N_LOOPS; i++) {
+ if (pm121_sys_state[i])
+ pm121_sys_fans_tick(i);
+ }
+
+ if (pm121_cpu_state)
+ pm121_cpu_fans_tick(pm121_cpu_state);
+
+ pm121_readjust = 0;
+ new_failure = pm121_failure_state & ~last_failure;
+
+ /* If entering failure mode, clamp cpufreq and ramp all
+ * fans to full speed.
+ */
+ if (pm121_failure_state && !last_failure) {
+ for (i = 0; i < N_CONTROLS; i++) {
+ if (controls[i])
+ wf_control_set_max(controls[i]);
+ }
+ }
+
+ /* If leaving failure mode, unclamp cpufreq and readjust
+ * all fans on next iteration
+ */
+ if (!pm121_failure_state && last_failure) {
+ if (controls[CPUFREQ])
+ wf_control_set_min(controls[CPUFREQ]);
+ pm121_readjust = 1;
+ }
+
+ /* Overtemp condition detected, notify and start skipping a couple
+ * ticks to let the temperature go down
+ */
+ if (new_failure & FAILURE_OVERTEMP) {
+ wf_set_overtemp();
+ pm121_skipping = 2;
+ }
+
+ /* We only clear the overtemp condition if overtemp is cleared
+ * _and_ no other failure is present. Since a sensor error will
+ * clear the overtemp condition (can't measure temperature) at
+ * the control loop levels, but we don't want to keep it clear
+ * here in this case
+ */
+ if (new_failure == 0 && last_failure & FAILURE_OVERTEMP)
+ wf_clear_overtemp();
+}
+
+
+static struct wf_control* pm121_register_control(struct wf_control *ct,
+ const char *match,
+ unsigned int id)
+{
+ if (controls[id] == NULL && !strcmp(ct->name, match)) {
+ if (wf_get_control(ct) == 0)
+ controls[FAN_OD] = ct;
+ }
+ return controls[id];
+}
+
+static void pm121_new_control(struct wf_control *ct)
+{
+ int all = 1;
+
+ if (pm121_all_controls_ok)
+ return;
+
+ all = all && pm121_register_control(ct, "optical-driver-fan", FAN_OD);
+ all = all && pm121_register_control(ct, "hard-driver-fan", FAN_HD);
+ all = all && pm121_register_control(ct, "cpu-driver-fan", FAN_CPU);
+ all = all && pm121_register_control(ct, "cpufreq-clamp", CPUFREQ);
+
+ if (all)
+ pm121_all_controls_ok = 1;
+}
+
+
+
+
+static struct wf_sensor* pm121_register_sensor(struct wf_sensor *sensor,
+ const char *match,
+ struct wf_sensor **var)
+{
+ if (*var == NULL && !strcmp(sensor->name, match)) {
+ if (wf_get_sensor(sensor) == 0)
+ *var = sensor;
+ }
+ return *var;
+}
+
+static void pm121_new_sensor(struct wf_sensor *sr)
+{
+ int all = 1;
+
+ if (pm121_all_sensors_ok)
+ return;
+
+ all = all && pm121_register_sensor(sr, "cpu-temp",
+ &sensor_cpu_temp);
+ all = all && pm121_register_sensor(sr, "cpu-current",
+ &sensor_cpu_current);
+ all = all && pm121_register_sensor(sr, "cpu-voltage",
+ &sensor_cpu_voltage);
+ all = all && pm121_register_sensor(sr, "cpu-power",
+ &sensor_cpu_power);
+ all = all && pm121_register_sensor(sr, "hard-drive-temp",
+ &sensor_hard_drive_temp);
+ all = all && pm121_register_sensor(sr, "optical-drive-temp",
+ &sensor_optical_drive_temp);
+ all = all && pm121_register_sensor(sr, "incoming-air-temp",
+ &sensor_incoming_air_temp);
+ all = all && pm121_register_sensor(sr, "north-bridge-temp",
+ &sensor_north_bridge_temp);
+ all = all && pm121_register_sensor(sr, "gpu-temp",
+ &sensor_gpu_temp);
+
+ if (all)
+ pm121_all_sensors_ok = 1;
+}
+
+
+
+static int pm121_notify(struct notifier_block *self,
+ unsigned long event, void *data)
+{
+ switch (event) {
+ case WF_EVENT_NEW_CONTROL:
+ pr_debug("pm121: new control %s detected\n",
+ ((struct wf_control *)data)->name);
+ pm121_new_control(data);
+ break;
+ case WF_EVENT_NEW_SENSOR:
+ pr_debug("pm121: new sensor %s detected\n",
+ ((struct wf_sensor *)data)->name);
+ pm121_new_sensor(data);
+ break;
+ case WF_EVENT_TICK:
+ if (pm121_all_controls_ok && pm121_all_sensors_ok)
+ pm121_tick();
+ break;
+ }
+
+ return 0;
+}
+
+static struct notifier_block pm121_events = {
+ .notifier_call = pm121_notify,
+};
+
+static int pm121_init_pm(void)
+{
+ const struct smu_sdbp_header *hdr;
+
+ hdr = smu_get_sdb_partition(SMU_SDB_SENSORTREE_ID, NULL);
+ if (hdr != 0) {
+ struct smu_sdbp_sensortree *st =
+ (struct smu_sdbp_sensortree *)&hdr[1];
+ pm121_mach_model = st->model_id;
+ }
+
+ pm121_connection = &pm121_connections[pm121_mach_model - 2];
+
+ printk(KERN_INFO "pm121: Initializing for iMac G5 iSight model ID %d\n",
+ pm121_mach_model);
+
+ return 0;
+}
+
+
+static int pm121_probe(struct platform_device *ddev)
+{
+ wf_register_client(&pm121_events);
+
+ return 0;
+}
+
+static int __devexit pm121_remove(struct platform_device *ddev)
+{
+ wf_unregister_client(&pm121_events);
+ return 0;
+}
+
+static struct platform_driver pm121_driver = {
+ .probe = pm121_probe,
+ .remove = __devexit_p(pm121_remove),
+ .driver = {
+ .name = "windfarm",
+ .bus = &platform_bus_type,
+ },
+};
+
+
+static int __init pm121_init(void)
+{
+ int rc = -ENODEV;
+
+ if (machine_is_compatible("PowerMac12,1"))
+ rc = pm121_init_pm();
+
+ if (rc == 0) {
+ request_module("windfarm_smu_controls");
+ request_module("windfarm_smu_sensors");
+ request_module("windfarm_smu_sat");
+ request_module("windfarm_lm75_sensor");
+ request_module("windfarm_max6690_sensor");
+ request_module("windfarm_cpufreq_clamp");
+ platform_driver_register(&pm121_driver);
+ }
+
+ return rc;
+}
+
+static void __exit pm121_exit(void)
+{
+
+ platform_driver_unregister(&pm121_driver);
+}
+
+
+module_init(pm121_init);
+module_exit(pm121_exit);
+
+MODULE_AUTHOR("Ãtienne Bersac <bersace at gmail.com>");
+MODULE_DESCRIPTION("Thermal control logic for iMac G5 (iSight)");
+MODULE_LICENSE("GPL");
+
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index 58c2590..961fa0e 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -218,6 +218,10 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
fct->ctrl.name = "cpu-fan";
else if (!strcmp(l, "Hard Drive") || !strcmp(l, "Hard drive"))
fct->ctrl.name = "drive-bay-fan";
+ else if (!strcmp(l, "HDD Fan")) /* seen on iMac G5 iSight */
+ fct->ctrl.name = "hard-drive-fan";
+ else if (!strcmp(l, "ODD Fan")) /* same */
+ fct->ctrl.name = "optical-drive-fan";
/* Unrecognized fan, bail out */
if (fct->ctrl.name == NULL)
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev at ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev
linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch:
--- NEW FILE linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch ---
>From 80358c19beb40110031f9e0f68db37bfceb6b6d4 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Fri, 28 Mar 2008 14:40:38 +0000
Subject: [PATCH] xen: Do not pin/unpin PMD pages
During process startup, in xen_pgd_pin(), we pin PTE pages
but not PMD pages. If we then later map and unmap using an
otherwise unused PMD page, the unpin in release_pd() fails
because it wasn't previously pinned.
i.e. with this simple test case:
int fd = open("/dev/zero", O_RDONLY);
munmap(mmap((void *)0x40000000, 0x1000_LEN, PROT_READ, MAP_PRIVATE, fd, 0), 0x1000);
close(fd);
we currently get:
kernel BUG at arch/x86/xen/enlighten.c:678!
...
EIP is at xen_release_pt+0x79/0xa9
...
Call Trace:
[<c041da25>] ? __pmd_free_tlb+0x1a/0x75
[<c047a192>] ? free_pgd_range+0x1d2/0x2b5
[<c047a2f3>] ? free_pgtables+0x7e/0x93
[<c047b272>] ? unmap_region+0xb9/0xf5
[<c047c1bd>] ? do_munmap+0x193/0x1f5
[<c047c24f>] ? sys_munmap+0x30/0x3f
[<c0408cce>] ? syscall_call+0x7/0xb
=======================
and xen complains:
(XEN) mm.c:2241:d4 Mfn 1cc37 not pinned
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
arch/x86/xen/enlighten.c | 31 ++++++++++++++++++++++---------
arch/x86/xen/mmu.c | 7 -------
arch/x86/xen/mmu.h | 7 +++++++
3 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index f32795f..75760a7 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -683,10 +683,10 @@ static void xen_release_pt_init(u32 pfn)
make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
}
-static void pin_pagetable_pfn(unsigned level, unsigned long pfn)
+static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn)
{
struct mmuext_op op;
- op.cmd = level;
+ op.cmd = cmd;
op.arg1.mfn = pfn_to_mfn(pfn);
if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF))
BUG();
@@ -694,7 +694,8 @@ static void pin_pagetable_pfn(unsigned level, unsigned long pfn)
/* This needs to make sure the new pte page is pinned iff its being
attached to a pinned pagetable. */
-static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level)
+static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn,
+ enum pt_level level)
{
struct page *page = pfn_to_page(pfn);
@@ -703,7 +704,8 @@ static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level)
if (!PageHighMem(page)) {
make_lowmem_page_readonly(__va(PFN_PHYS(pfn)));
- pin_pagetable_pfn(level, pfn);
+ if (level == PT_PTE)
+ pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn);
} else
/* make sure there are no stray mappings of
this page */
@@ -713,27 +715,38 @@ static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level)
static void xen_alloc_pt(struct mm_struct *mm, u32 pfn)
{
- xen_alloc_ptpage(mm, pfn, MMUEXT_PIN_L1_TABLE);
+ xen_alloc_ptpage(mm, pfn, PT_PTE);
}
static void xen_alloc_pd(struct mm_struct *mm, u32 pfn)
{
- xen_alloc_ptpage(mm, pfn, MMUEXT_PIN_L2_TABLE);
+ xen_alloc_ptpage(mm, pfn, PT_PMD);
}
/* This should never happen until we're OK to use struct page */
-static void xen_release_pt(u32 pfn)
+static void xen_release_ptpage(u32 pfn, enum pt_level level)
{
struct page *page = pfn_to_page(pfn);
if (PagePinned(page)) {
if (!PageHighMem(page)) {
- pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn);
+ if (level == PT_PTE)
+ pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn);
make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
}
}
}
+static void xen_release_pt(u32 pfn)
+{
+ xen_release_ptpage(pfn, PT_PTE);
+}
+
+static void xen_release_pd(u32 pfn)
+{
+ xen_release_ptpage(pfn, PT_PMD);
+}
+
#ifdef CONFIG_HIGHPTE
static void *xen_kmap_atomic_pte(struct page *page, enum km_type type)
{
@@ -854,7 +867,7 @@ static __init void xen_pagetable_setup_done(pgd_t *base)
pv_mmu_ops.alloc_pt = xen_alloc_pt;
pv_mmu_ops.alloc_pd = xen_alloc_pd;
pv_mmu_ops.release_pt = xen_release_pt;
- pv_mmu_ops.release_pd = xen_release_pt;
+ pv_mmu_ops.release_pd = xen_release_pd;
pv_mmu_ops.set_pte = xen_set_pte;
setup_shared_info();
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 0144395..2a054ef 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -310,13 +310,6 @@ pgd_t xen_make_pgd(unsigned long pgd)
}
#endif /* CONFIG_X86_PAE */
-enum pt_level {
- PT_PGD,
- PT_PUD,
- PT_PMD,
- PT_PTE
-};
-
/*
(Yet another) pagetable walker. This one is intended for pinning a
pagetable. This means that it walks a pagetable and calls the
diff --git a/arch/x86/xen/mmu.h b/arch/x86/xen/mmu.h
index c9ff27f..b5e189b 100644
--- a/arch/x86/xen/mmu.h
+++ b/arch/x86/xen/mmu.h
@@ -3,6 +3,13 @@
#include <linux/linkage.h>
#include <asm/page.h>
+enum pt_level {
+ PT_PGD,
+ PT_PUD,
+ PT_PMD,
+ PT_PTE
+};
+
/*
* Page-directory addresses above 4GB do not fit into architectural %cr3.
* When accessing %cr3, or equivalent field in vcpu_guest_context, guests
--
1.5.4.1
linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch:
Index: linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
===================================================================
RCS file: linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
diff -N linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch 1 Apr 2008 10:38:07 -0000 1.4
@@ -0,0 +1,1254 @@
+From 0a831ce74b5f19e615fe9756afa06af6c5226e94 Mon Sep 17 00:00:00 2001
+From: Markus Armbruster <armbru at redhat.com>
+Date: Mon, 25 Feb 2008 14:06:46 +0100
+Subject: [PATCH] xen pvfb: Para-virtual framebuffer, keyboard and pointer driver
+
+This is a pair of Xen para-virtual frontend device drivers:
+drivers/video/xen-fbfront.c provides a framebuffer, and
+drivers/input/xen-kbdfront provides keyboard and mouse.
+
+The backends run in dom0 user space.
+
+The two drivers are not in two separate patches, because the
+intermediate step (one driver, not the other) is somewhat problematic:
+the backend in dom0 needs both drivers, and will refuse to complete
+device initialization unless they're both present.
+
+Signed-off-by: Markus Armbruster <armbru at redhat.com>
+---
+ drivers/input/Kconfig | 9 +
+ drivers/input/Makefile | 2 +
+ drivers/input/xen-kbdfront.c | 340 +++++++++++++++++++++++
+ drivers/video/Kconfig | 14 +
+ drivers/video/Makefile | 1 +
+ drivers/video/xen-fbfront.c | 550 ++++++++++++++++++++++++++++++++++++++
+ include/xen/interface/io/fbif.h | 124 +++++++++
+ include/xen/interface/io/kbdif.h | 114 ++++++++
+ 8 files changed, 1154 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/input/xen-kbdfront.c
+ create mode 100644 drivers/video/xen-fbfront.c
+ create mode 100644 include/xen/interface/io/fbif.h
+ create mode 100644 include/xen/interface/io/kbdif.h
+
+diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig
+index d84ac4a..747633c 100644
+--- a/drivers/input/Kconfig
++++ b/drivers/input/Kconfig
+@@ -149,6 +149,15 @@ config INPUT_APMPOWER
+ To compile this driver as a module, choose M here: the
+ module will be called apm-power.
+
++config XEN_KBDDEV_FRONTEND
++ tristate "Xen virtual keyboard and mouse support"
++ depends on XEN_FBDEV_FRONTEND
++ default y
++ help
++ This driver implements the front-end of the Xen virtual
++ keyboard and mouse device driver. It communicates with a back-end
++ in another domain.
++
+ comment "Input Device Drivers"
+
+ source "drivers/input/keyboard/Kconfig"
+diff --git a/drivers/input/Makefile b/drivers/input/Makefile
+index 24bdec1..606e1b9 100644
+--- a/drivers/input/Makefile
++++ b/drivers/input/Makefile
+@@ -24,3 +24,5 @@ obj-$(CONFIG_INPUT_MISC) += misc/
+ obj-$(CONFIG_INPUT_LIRC) += lirc/
+
+ obj-$(CONFIG_INPUT_APMPOWER) += apm-power.o
++
++obj-$(CONFIG_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o
+diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c
+new file mode 100644
+index 0000000..0f47f46
+--- /dev/null
++++ b/drivers/input/xen-kbdfront.c
+@@ -0,0 +1,340 @@
++/*
++ * Xen para-virtual input device
++ *
++ * Copyright (C) 2005 Anthony Liguori <aliguori at us.ibm.com>
++ * Copyright (C) 2006-2008 Red Hat, Inc., Markus Armbruster <armbru at redhat.com>
++ *
++ * Based on linux/drivers/input/mouse/sermouse.c
++ *
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License. See the file COPYING in the main directory of this archive for
++ * more details.
++ */
++
++/*
++ * TODO:
++ *
++ * Switch to grant tables together with xen-fbfront.c.
++ */
++
++#include <linux/kernel.h>
++#include <linux/errno.h>
++#include <linux/module.h>
++#include <linux/input.h>
++#include <asm/xen/hypervisor.h>
++#include <xen/events.h>
++#include <xen/page.h>
++#include <xen/interface/io/fbif.h>
++#include <xen/interface/io/kbdif.h>
++#include <xen/xenbus.h>
++
++struct xenkbd_info {
++ struct input_dev *kbd;
++ struct input_dev *ptr;
++ struct xenkbd_page *page;
++ int irq;
++ struct xenbus_device *xbdev;
++ char phys[32];
++};
++
++static int xenkbd_remove(struct xenbus_device *);
++static int xenkbd_connect_backend(struct xenbus_device *, struct xenkbd_info *);
++static void xenkbd_disconnect_backend(struct xenkbd_info *);
++
++/*
++ * Note: if you need to send out events, see xenfb_do_update() for how
++ * to do that.
++ */
++
++static irqreturn_t input_handler(int rq, void *dev_id)
++{
++ struct xenkbd_info *info = dev_id;
++ struct xenkbd_page *page = info->page;
++ __u32 cons, prod;
++
++ prod = page->in_prod;
++ if (prod == page->in_cons)
++ return IRQ_HANDLED;
++ rmb(); /* ensure we see ring contents up to prod */
++ for (cons = page->in_cons; cons != prod; cons++) {
++ union xenkbd_in_event *event;
++ struct input_dev *dev;
++ event = &XENKBD_IN_RING_REF(page, cons);
++
++ dev = info->ptr;
++ switch (event->type) {
++ case XENKBD_TYPE_MOTION:
++ input_report_rel(dev, REL_X, event->motion.rel_x);
++ input_report_rel(dev, REL_Y, event->motion.rel_y);
++ break;
++ case XENKBD_TYPE_KEY:
++ dev = NULL;
++ if (test_bit(event->key.keycode, info->kbd->keybit))
++ dev = info->kbd;
++ if (test_bit(event->key.keycode, info->ptr->keybit))
++ dev = info->ptr;
++ if (dev)
++ input_report_key(dev, event->key.keycode,
++ event->key.pressed);
++ else
++ printk(KERN_WARNING
++ "xenkbd: unhandled keycode 0x%x\n",
++ event->key.keycode);
++ break;
++ case XENKBD_TYPE_POS:
++ input_report_abs(dev, ABS_X, event->pos.abs_x);
++ input_report_abs(dev, ABS_Y, event->pos.abs_y);
++ break;
++ }
++ if (dev)
++ input_sync(dev);
++ }
++ mb(); /* ensure we got ring contents */
++ page->in_cons = cons;
++ notify_remote_via_irq(info->irq);
++
++ return IRQ_HANDLED;
++}
++
++static int __devinit xenkbd_probe(struct xenbus_device *dev,
++ const struct xenbus_device_id *id)
++{
++ int ret, i;
++ struct xenkbd_info *info;
++ struct input_dev *kbd, *ptr;
++
++ info = kzalloc(sizeof(*info), GFP_KERNEL);
++ if (!info) {
++ xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure");
++ return -ENOMEM;
++ }
++ dev->dev.driver_data = info;
++ info->xbdev = dev;
++ info->irq = -1;
++ snprintf(info->phys, sizeof(info->phys), "xenbus/%s", dev->nodename);
++
++ info->page = (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
++ if (!info->page)
++ goto error_nomem;
++
++ /* keyboard */
++ kbd = input_allocate_device();
++ if (!kbd)
++ goto error_nomem;
++ kbd->name = "Xen Virtual Keyboard";
++ kbd->phys = info->phys;
++ kbd->id.bustype = BUS_PCI;
++ kbd->id.vendor = 0x5853;
++ kbd->id.product = 0xffff;
++ kbd->evbit[0] = BIT(EV_KEY);
++ for (i = KEY_ESC; i < KEY_UNKNOWN; i++)
++ set_bit(i, kbd->keybit);
++ for (i = KEY_OK; i < KEY_MAX; i++)
++ set_bit(i, kbd->keybit);
++
++ ret = input_register_device(kbd);
++ if (ret) {
++ input_free_device(kbd);
++ xenbus_dev_fatal(dev, ret, "input_register_device(kbd)");
++ goto error;
++ }
++ info->kbd = kbd;
++
++ /* pointing device */
++ ptr = input_allocate_device();
++ if (!ptr)
++ goto error_nomem;
++ ptr->name = "Xen Virtual Pointer";
++ ptr->phys = info->phys;
++ ptr->id.bustype = BUS_PCI;
++ ptr->id.vendor = 0x5853;
++ ptr->id.product = 0xfffe;
++ ptr->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
++ for (i = BTN_LEFT; i <= BTN_TASK; i++)
++ set_bit(i, ptr->keybit);
++ ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y);
++ input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
++ input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
++
++ ret = input_register_device(ptr);
++ if (ret) {
++ input_free_device(ptr);
++ xenbus_dev_fatal(dev, ret, "input_register_device(ptr)");
++ goto error;
++ }
++ info->ptr = ptr;
++
++ ret = xenkbd_connect_backend(dev, info);
++ if (ret < 0)
++ goto error;
++
++ return 0;
++
++ error_nomem:
++ ret = -ENOMEM;
++ xenbus_dev_fatal(dev, ret, "allocating device memory");
++ error:
++ xenkbd_remove(dev);
++ return ret;
++}
++
++static int xenkbd_resume(struct xenbus_device *dev)
++{
++ struct xenkbd_info *info = dev->dev.driver_data;
++
++ xenkbd_disconnect_backend(info);
++ memset(info->page, 0, PAGE_SIZE);
++ return xenkbd_connect_backend(dev, info);
++}
++
++static int xenkbd_remove(struct xenbus_device *dev)
++{
++ struct xenkbd_info *info = dev->dev.driver_data;
++
++ xenkbd_disconnect_backend(info);
++ if (info->kbd)
++ input_unregister_device(info->kbd);
++ if (info->ptr)
++ input_unregister_device(info->ptr);
++ free_page((unsigned long)info->page);
++ kfree(info);
++ return 0;
++}
++
++static int xenkbd_connect_backend(struct xenbus_device *dev,
++ struct xenkbd_info *info)
++{
++ int ret, evtchn;
++ struct xenbus_transaction xbt;
++
++ ret = xenbus_alloc_evtchn(dev, &evtchn);
++ if (ret)
++ return ret;
++ ret = bind_evtchn_to_irqhandler(evtchn, input_handler,
++ 0, dev->devicetype, info);
++ if (ret < 0) {
++ xenbus_free_evtchn(dev, evtchn);
++ xenbus_dev_fatal(dev, ret, "bind_evtchn_to_irqhandler");
++ return ret;
++ }
++ info->irq = ret;
++
++ again:
++ ret = xenbus_transaction_start(&xbt);
++ if (ret) {
++ xenbus_dev_fatal(dev, ret, "starting transaction");
++ return ret;
++ }
++ ret = xenbus_printf(xbt, dev->nodename, "page-ref", "%lu",
++ virt_to_mfn(info->page));
++ if (ret)
++ goto error_xenbus;
++ ret = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
++ evtchn);
++ if (ret)
++ goto error_xenbus;
++ ret = xenbus_transaction_end(xbt, 0);
++ if (ret) {
++ if (ret == -EAGAIN)
++ goto again;
++ xenbus_dev_fatal(dev, ret, "completing transaction");
++ return ret;
++ }
++
++ xenbus_switch_state(dev, XenbusStateInitialised);
++ return 0;
++
++ error_xenbus:
++ xenbus_transaction_end(xbt, 1);
++ xenbus_dev_fatal(dev, ret, "writing xenstore");
++ return ret;
++}
++
++static void xenkbd_disconnect_backend(struct xenkbd_info *info)
++{
++ if (info->irq >= 0)
++ unbind_from_irqhandler(info->irq, info);
++ info->irq = -1;
++}
++
++static void xenkbd_backend_changed(struct xenbus_device *dev,
++ enum xenbus_state backend_state)
++{
++ struct xenkbd_info *info = dev->dev.driver_data;
++ int ret, val;
++
++ switch (backend_state) {
++ case XenbusStateInitialising:
++ case XenbusStateInitialised:
++ case XenbusStateUnknown:
++ case XenbusStateClosed:
++ break;
++
++ case XenbusStateInitWait:
++InitWait:
++ ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
++ "feature-abs-pointer", "%d", &val);
++ if (ret < 0)
++ val = 0;
++ if (val) {
++ ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,
++ "request-abs-pointer", "1");
++ if (ret)
++ printk(KERN_WARNING
++ "xenkbd: can't request abs-pointer");
++ }
++ xenbus_switch_state(dev, XenbusStateConnected);
++ break;
++
++ case XenbusStateConnected:
++ /*
++ * Work around xenbus race condition: If backend goes
++ * through InitWait to Connected fast enough, we can
++ * get Connected twice here.
++ */
++ if (dev->state != XenbusStateConnected)
++ goto InitWait; /* no InitWait seen yet, fudge it */
++ break;
++
++ case XenbusStateClosing:
++ xenbus_frontend_closed(dev);
++ break;
++ }
++}
++
++static struct xenbus_device_id xenkbd_ids[] = {
++ { "vkbd" },
++ { "" }
++};
++
++static struct xenbus_driver xenkbd = {
++ .name = "vkbd",
++ .owner = THIS_MODULE,
++ .ids = xenkbd_ids,
++ .probe = xenkbd_probe,
++ .remove = xenkbd_remove,
++ .resume = xenkbd_resume,
++ .otherend_changed = xenkbd_backend_changed,
++};
++
++static int __init xenkbd_init(void)
++{
++ if (!is_running_on_xen())
++ return -ENODEV;
++
++ /* Nothing to do if running in dom0. */
++ if (is_initial_xendomain())
++ return -ENODEV;
++
++ return xenbus_register_frontend(&xenkbd);
++}
++
++static void __exit xenkbd_cleanup(void)
++{
++ xenbus_unregister_driver(&xenkbd);
++}
++
++module_init(xenkbd_init);
++module_exit(xenkbd_cleanup);
++
++MODULE_LICENSE("GPL");
+diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
+index 1bd5fb3..e3dc8f8 100644
+--- a/drivers/video/Kconfig
++++ b/drivers/video/Kconfig
+@@ -1930,6 +1930,20 @@ config FB_VIRTUAL
+
+ If unsure, say N.
+
++config XEN_FBDEV_FRONTEND
++ tristate "Xen virtual frame buffer support"
++ depends on FB && XEN
++ select FB_SYS_FILLRECT
++ select FB_SYS_COPYAREA
++ select FB_SYS_IMAGEBLIT
++ select FB_SYS_FOPS
++ select FB_DEFERRED_IO
++ default y
++ help
++ This driver implements the front-end of the Xen virtual
++ frame buffer driver. It communicates with a back-end
++ in another domain.
++
+ source "drivers/video/omap/Kconfig"
+
+ source "drivers/video/backlight/Kconfig"
+diff --git a/drivers/video/Makefile b/drivers/video/Makefile
+index 11c0e5e..f172b9b 100644
+--- a/drivers/video/Makefile
++++ b/drivers/video/Makefile
+@@ -114,6 +114,7 @@ obj-$(CONFIG_FB_PS3) += ps3fb.o
+ obj-$(CONFIG_FB_SM501) += sm501fb.o
+ obj-$(CONFIG_FB_XILINX) += xilinxfb.o
+ obj-$(CONFIG_FB_OMAP) += omap/
++obj-$(CONFIG_XEN_FBDEV_FRONTEND) += xen-fbfront.o
+
+ # Platform or fallback drivers go here
+ obj-$(CONFIG_FB_UVESA) += uvesafb.o
+diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
+new file mode 100644
+index 0000000..619a6f8
+--- /dev/null
++++ b/drivers/video/xen-fbfront.c
+@@ -0,0 +1,550 @@
++/*
++ * Xen para-virtual frame buffer device
++ *
++ * Copyright (C) 2005-2006 Anthony Liguori <aliguori at us.ibm.com>
++ * Copyright (C) 2006-2008 Red Hat, Inc., Markus Armbruster <armbru at redhat.com>
++ *
++ * Based on linux/drivers/video/q40fb.c
++ *
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License. See the file COPYING in the main directory of this archive for
++ * more details.
++ */
++
++/*
++ * TODO:
++ *
++ * Switch to grant tables when they become capable of dealing with the
++ * frame buffer.
++ */
++
++#include <linux/kernel.h>
++#include <linux/errno.h>
++#include <linux/fb.h>
++#include <linux/module.h>
++#include <linux/vmalloc.h>
++#include <linux/mm.h>
++#include <asm/xen/hypervisor.h>
++#include <xen/events.h>
++#include <xen/page.h>
++#include <xen/interface/io/fbif.h>
++#include <xen/interface/io/protocols.h>
++#include <xen/xenbus.h>
++
++struct xenfb_info {
++ unsigned char *fb;
++ struct fb_info *fb_info;
++ int x1, y1, x2, y2; /* dirty rectangle,
++ protected by dirty_lock */
++ spinlock_t dirty_lock;
++ int nr_pages;
++ int irq;
++ struct xenfb_page *page;
++ unsigned long *mfns;
++ int update_wanted; /* XENFB_TYPE_UPDATE wanted */
++
++ struct xenbus_device *xbdev;
++};
++
++static u32 xenfb_mem_len = XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8;
++
++static int xenfb_remove(struct xenbus_device *);
++static void xenfb_init_shared_page(struct xenfb_info *);
++static int xenfb_connect_backend(struct xenbus_device *, struct xenfb_info *);
++static void xenfb_disconnect_backend(struct xenfb_info *);
++
++static void xenfb_do_update(struct xenfb_info *info,
++ int x, int y, int w, int h)
++{
++ union xenfb_out_event event;
++ u32 prod;
++
++ event.type = XENFB_TYPE_UPDATE;
++ event.update.x = x;
++ event.update.y = y;
++ event.update.width = w;
++ event.update.height = h;
++
++ prod = info->page->out_prod;
++ /* caller ensures !xenfb_queue_full() */
++ mb(); /* ensure ring space available */
++ XENFB_OUT_RING_REF(info->page, prod) = event;
++ wmb(); /* ensure ring contents visible */
++ info->page->out_prod = prod + 1;
++
++ notify_remote_via_irq(info->irq);
++}
++
++static int xenfb_queue_full(struct xenfb_info *info)
++{
++ u32 cons, prod;
++
++ prod = info->page->out_prod;
++ cons = info->page->out_cons;
++ return prod - cons == XENFB_OUT_RING_LEN;
++}
++
++static void xenfb_refresh(struct xenfb_info *info,
++ int x1, int y1, int w, int h)
++{
++ unsigned long flags;
++ int y2 = y1 + h - 1;
++ int x2 = x1 + w - 1;
++
++ if (!info->update_wanted)
++ return;
++
++ spin_lock_irqsave(&info->dirty_lock, flags);
++
++ /* Combine with dirty rectangle: */
++ if (info->y1 < y1)
++ y1 = info->y1;
++ if (info->y2 > y2)
++ y2 = info->y2;
++ if (info->x1 < x1)
++ x1 = info->x1;
++ if (info->x2 > x2)
++ x2 = info->x2;
++
++ if (xenfb_queue_full(info)) {
++ /* Can't send right now, stash it in the dirty rectangle */
++ info->x1 = x1;
++ info->x2 = x2;
++ info->y1 = y1;
++ info->y2 = y2;
++ spin_unlock_irqrestore(&info->dirty_lock, flags);
++ return;
++ }
++
++ /* Clear dirty rectangle: */
++ info->x1 = info->y1 = INT_MAX;
++ info->x2 = info->y2 = 0;
++
++ spin_unlock_irqrestore(&info->dirty_lock, flags);
++
++ if (x1 <= x2 && y1 <= y2)
++ xenfb_do_update(info, x1, y1, x2 - x1 + 1, y2 - y1 + 1);
++}
++
++static void xenfb_deferred_io(struct fb_info *fb_info,
++ struct list_head *pagelist)
++{
++ struct xenfb_info *info = fb_info->par;
++ struct page *page;
++ unsigned long beg, end;
++ int y1, y2, miny, maxy;
++
++ miny = INT_MAX;
++ maxy = 0;
++ list_for_each_entry(page, pagelist, lru) {
++ beg = page->index << PAGE_SHIFT;
++ end = beg + PAGE_SIZE - 1;
++ y1 = beg / fb_info->fix.line_length;
++ y2 = end / fb_info->fix.line_length;
++ if (y2 >= fb_info->var.yres)
++ y2 = fb_info->var.yres - 1;
++ if (miny > y1)
++ miny = y1;
++ if (maxy < y2)
++ maxy = y2;
++ }
++ xenfb_refresh(info, 0, miny, fb_info->var.xres, maxy - miny + 1);
++}
++
++static struct fb_deferred_io xenfb_defio = {
++ .delay = HZ / 20,
++ .deferred_io = xenfb_deferred_io,
++};
++
++static int xenfb_setcolreg(unsigned regno, unsigned red, unsigned green,
++ unsigned blue, unsigned transp,
++ struct fb_info *info)
++{
++ u32 v;
++
++ if (regno > info->cmap.len)
++ return 1;
++
++#define CNVT_TOHW(val, width) ((((val)<<(width))+0x7FFF-(val))>>16)
++ red = CNVT_TOHW(red, info->var.red.length);
++ green = CNVT_TOHW(green, info->var.green.length);
++ blue = CNVT_TOHW(blue, info->var.blue.length);
++ transp = CNVT_TOHW(transp, info->var.transp.length);
++#undef CNVT_TOHW
++
++ v = (red << info->var.red.offset) |
++ (green << info->var.green.offset) |
++ (blue << info->var.blue.offset);
++
++ switch (info->var.bits_per_pixel) {
++ case 16:
++ case 24:
++ case 32:
++ ((u32 *)info->pseudo_palette)[regno] = v;
++ break;
++ }
++
++ return 0;
++}
++
++static void xenfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
++{
++ struct xenfb_info *info = p->par;
++
++ sys_fillrect(p, rect);
++ xenfb_refresh(info, rect->dx, rect->dy, rect->width, rect->height);
++}
++
++static void xenfb_imageblit(struct fb_info *p, const struct fb_image *image)
++{
++ struct xenfb_info *info = p->par;
++
++ sys_imageblit(p, image);
++ xenfb_refresh(info, image->dx, image->dy, image->width, image->height);
++}
++
++static void xenfb_copyarea(struct fb_info *p, const struct fb_copyarea *area)
++{
++ struct xenfb_info *info = p->par;
++
++ sys_copyarea(p, area);
++ xenfb_refresh(info, area->dx, area->dy, area->width, area->height);
++}
++
++static ssize_t xenfb_write(struct fb_info *p, const char __user *buf,
++ size_t count, loff_t *ppos)
++{
++ struct xenfb_info *info = p->par;
++ ssize_t res;
++
++ res = fb_sys_write(p, buf, count, ppos);
++ xenfb_refresh(info, 0, 0, info->page->width, info->page->height);
++ return res;
++}
++
++static struct fb_ops xenfb_fb_ops = {
++ .owner = THIS_MODULE,
++ .fb_read = fb_sys_read,
++ .fb_write = xenfb_write,
++ .fb_setcolreg = xenfb_setcolreg,
++ .fb_fillrect = xenfb_fillrect,
++ .fb_copyarea = xenfb_copyarea,
++ .fb_imageblit = xenfb_imageblit,
++};
++
++static irqreturn_t xenfb_event_handler(int rq, void *dev_id)
++{
++ /*
++ * No in events recognized, simply ignore them all.
++ * If you need to recognize some, see xen-kbdfront's
++ * input_handler() for how to do that.
++ */
++ struct xenfb_info *info = dev_id;
++ struct xenfb_page *page = info->page;
++
++ if (page->in_cons != page->in_prod) {
++ info->page->in_cons = info->page->in_prod;
++ notify_remote_via_irq(info->irq);
++ }
++
++ /* Flush dirty rectangle: */
++ xenfb_refresh(info, INT_MAX, INT_MAX, -INT_MAX, -INT_MAX);
++
++ return IRQ_HANDLED;
++}
++
++static int __devinit xenfb_probe(struct xenbus_device *dev,
++ const struct xenbus_device_id *id)
++{
++ struct xenfb_info *info;
++ struct fb_info *fb_info;
++ int ret;
++
++ info = kzalloc(sizeof(*info), GFP_KERNEL);
++ if (info == NULL) {
++ xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure");
++ return -ENOMEM;
++ }
++ dev->dev.driver_data = info;
++ info->xbdev = dev;
++ info->irq = -1;
++ info->x1 = info->y1 = INT_MAX;
++ spin_lock_init(&info->dirty_lock);
++
++ info->fb = vmalloc(xenfb_mem_len);
++ if (info->fb == NULL)
++ goto error_nomem;
++ memset(info->fb, 0, xenfb_mem_len);
++
++ info->nr_pages = (xenfb_mem_len + PAGE_SIZE - 1) >> PAGE_SHIFT;
++
++ info->mfns = vmalloc(sizeof(unsigned long) * info->nr_pages);
++ if (!info->mfns)
++ goto error_nomem;
++
++ /* set up shared page */
++ info->page = (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
++ if (!info->page)
++ goto error_nomem;
++
++ xenfb_init_shared_page(info);
++
++ /* abusing framebuffer_alloc() to allocate pseudo_palette */
++ fb_info = framebuffer_alloc(sizeof(u32) * 256, NULL);
++ if (fb_info == NULL)
++ goto error_nomem;
++
++ /* complete the abuse: */
++ fb_info->pseudo_palette = fb_info->par;
++ fb_info->par = info;
++
++ fb_info->screen_base = info->fb;
++
++ fb_info->fbops = &xenfb_fb_ops;
++ fb_info->var.xres_virtual = fb_info->var.xres = info->page->width;
++ fb_info->var.yres_virtual = fb_info->var.yres = info->page->height;
++ fb_info->var.bits_per_pixel = info->page->depth;
++
++ fb_info->var.red = (struct fb_bitfield){16, 8, 0};
++ fb_info->var.green = (struct fb_bitfield){8, 8, 0};
++ fb_info->var.blue = (struct fb_bitfield){0, 8, 0};
++
++ fb_info->var.activate = FB_ACTIVATE_NOW;
++ fb_info->var.height = -1;
++ fb_info->var.width = -1;
++ fb_info->var.vmode = FB_VMODE_NONINTERLACED;
++
++ fb_info->fix.visual = FB_VISUAL_TRUECOLOR;
++ fb_info->fix.line_length = info->page->line_length;
++ fb_info->fix.smem_start = 0;
++ fb_info->fix.smem_len = xenfb_mem_len;
++ strcpy(fb_info->fix.id, "xen");
++ fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
++ fb_info->fix.accel = FB_ACCEL_NONE;
++
++ fb_info->flags = FBINFO_FLAG_DEFAULT;
++
++ ret = fb_alloc_cmap(&fb_info->cmap, 256, 0);
++ if (ret < 0) {
++ framebuffer_release(fb_info);
++ xenbus_dev_fatal(dev, ret, "fb_alloc_cmap");
++ goto error;
++ }
++
++ fb_info->fbdefio = &xenfb_defio;
++ fb_deferred_io_init(fb_info);
++
++ ret = register_framebuffer(fb_info);
++ if (ret) {
++ fb_deferred_io_cleanup(fb_info);
++ fb_dealloc_cmap(&fb_info->cmap);
++ framebuffer_release(fb_info);
++ xenbus_dev_fatal(dev, ret, "register_framebuffer");
++ goto error;
++ }
++ info->fb_info = fb_info;
++
++ ret = xenfb_connect_backend(dev, info);
++ if (ret < 0)
++ goto error;
++
++ return 0;
++
++ error_nomem:
++ ret = -ENOMEM;
++ xenbus_dev_fatal(dev, ret, "allocating device memory");
++ error:
++ xenfb_remove(dev);
++ return ret;
++}
++
++static int xenfb_resume(struct xenbus_device *dev)
++{
++ struct xenfb_info *info = dev->dev.driver_data;
++
++ xenfb_disconnect_backend(info);
++ xenfb_init_shared_page(info);
++ return xenfb_connect_backend(dev, info);
++}
++
++static int xenfb_remove(struct xenbus_device *dev)
++{
++ struct xenfb_info *info = dev->dev.driver_data;
++
++ xenfb_disconnect_backend(info);
++ if (info->fb_info) {
++ fb_deferred_io_cleanup(info->fb_info);
++ unregister_framebuffer(info->fb_info);
++ fb_dealloc_cmap(&info->fb_info->cmap);
++ framebuffer_release(info->fb_info);
++ }
++ free_page((unsigned long)info->page);
++ vfree(info->mfns);
++ vfree(info->fb);
++ kfree(info);
++
++ return 0;
++}
++
++static unsigned long vmalloc_to_mfn(void *address)
++{
++ return pfn_to_mfn(vmalloc_to_pfn(address));
++}
++
++static void xenfb_init_shared_page(struct xenfb_info *info)
++{
++ int i;
++
++ for (i = 0; i < info->nr_pages; i++)
++ info->mfns[i] = vmalloc_to_mfn(info->fb + i * PAGE_SIZE);
++
++ info->page->pd[0] = vmalloc_to_mfn(info->mfns);
++ info->page->pd[1] = 0;
++ info->page->width = XENFB_WIDTH;
++ info->page->height = XENFB_HEIGHT;
++ info->page->depth = XENFB_DEPTH;
++ info->page->line_length = (info->page->depth / 8) * info->page->width;
++ info->page->mem_length = xenfb_mem_len;
++ info->page->in_cons = info->page->in_prod = 0;
++ info->page->out_cons = info->page->out_prod = 0;
++}
++
++static int xenfb_connect_backend(struct xenbus_device *dev,
++ struct xenfb_info *info)
++{
++ int ret, evtchn;
++ struct xenbus_transaction xbt;
++
++ ret = xenbus_alloc_evtchn(dev, &evtchn);
++ if (ret)
++ return ret;
++ ret = bind_evtchn_to_irqhandler(evtchn, xenfb_event_handler,
++ 0, dev->devicetype, info);
++ if (ret < 0) {
++ xenbus_free_evtchn(dev, evtchn);
++ xenbus_dev_fatal(dev, ret, "bind_evtchn_to_irqhandler");
++ return ret;
++ }
++ info->irq = ret;
++
++ again:
++ ret = xenbus_transaction_start(&xbt);
++ if (ret) {
++ xenbus_dev_fatal(dev, ret, "starting transaction");
++ return ret;
++ }
++ ret = xenbus_printf(xbt, dev->nodename, "page-ref", "%lu",
++ virt_to_mfn(info->page));
++ if (ret)
++ goto error_xenbus;
++ ret = xenbus_printf(xbt, dev->nodename, "event-channel", "%u",
++ evtchn);
++ if (ret)
++ goto error_xenbus;
++ ret = xenbus_printf(xbt, dev->nodename, "protocol", "%s",
++ XEN_IO_PROTO_ABI_NATIVE);
++ if (ret)
++ goto error_xenbus;
++ ret = xenbus_printf(xbt, dev->nodename, "feature-update", "1");
++ if (ret)
++ goto error_xenbus;
++ ret = xenbus_transaction_end(xbt, 0);
++ if (ret) {
++ if (ret == -EAGAIN)
++ goto again;
++ xenbus_dev_fatal(dev, ret, "completing transaction");
++ return ret;
++ }
++
++ xenbus_switch_state(dev, XenbusStateInitialised);
++ return 0;
++
++ error_xenbus:
++ xenbus_transaction_end(xbt, 1);
++ xenbus_dev_fatal(dev, ret, "writing xenstore");
++ return ret;
++}
++
++static void xenfb_disconnect_backend(struct xenfb_info *info)
++{
++ if (info->irq >= 0)
++ unbind_from_irqhandler(info->irq, info);
++ info->irq = -1;
++}
++
++static void xenfb_backend_changed(struct xenbus_device *dev,
++ enum xenbus_state backend_state)
++{
++ struct xenfb_info *info = dev->dev.driver_data;
++ int val;
++
++ switch (backend_state) {
++ case XenbusStateInitialising:
++ case XenbusStateInitialised:
++ case XenbusStateUnknown:
++ case XenbusStateClosed:
++ break;
++
++ case XenbusStateInitWait:
++InitWait:
++ xenbus_switch_state(dev, XenbusStateConnected);
++ break;
++
++ case XenbusStateConnected:
++ /*
++ * Work around xenbus race condition: If backend goes
++ * through InitWait to Connected fast enough, we can
++ * get Connected twice here.
++ */
++ if (dev->state != XenbusStateConnected)
++ goto InitWait; /* no InitWait seen yet, fudge it */
++
++ if (xenbus_scanf(XBT_NIL, info->xbdev->otherend,
++ "request-update", "%d", &val) < 0)
++ val = 0;
++ if (val)
++ info->update_wanted = 1;
++ break;
++
++ case XenbusStateClosing:
++ xenbus_frontend_closed(dev);
++ break;
++ }
++}
++
++static struct xenbus_device_id xenfb_ids[] = {
++ { "vfb" },
++ { "" }
++};
++
++static struct xenbus_driver xenfb = {
++ .name = "vfb",
++ .owner = THIS_MODULE,
++ .ids = xenfb_ids,
++ .probe = xenfb_probe,
++ .remove = xenfb_remove,
++ .resume = xenfb_resume,
++ .otherend_changed = xenfb_backend_changed,
++};
++
++static int __init xenfb_init(void)
++{
++ if (!is_running_on_xen())
++ return -ENODEV;
++
++ /* Nothing to do if running in dom0. */
++ if (is_initial_xendomain())
++ return -ENODEV;
++
++ return xenbus_register_frontend(&xenfb);
++}
++
++static void __exit xenfb_cleanup(void)
++{
++ xenbus_unregister_driver(&xenfb);
++}
++
++module_init(xenfb_init);
++module_exit(xenfb_cleanup);
++
++MODULE_LICENSE("GPL");
+diff --git a/include/xen/interface/io/fbif.h b/include/xen/interface/io/fbif.h
+new file mode 100644
+index 0000000..5a934dd
+--- /dev/null
++++ b/include/xen/interface/io/fbif.h
+@@ -0,0 +1,124 @@
++/*
++ * fbif.h -- Xen virtual frame buffer device
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to
++ * deal in the Software without restriction, including without limitation the
++ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++ * sell copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Copyright (C) 2005 Anthony Liguori <aliguori at us.ibm.com>
++ * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru at redhat.com>
++ */
++
++#ifndef __XEN_PUBLIC_IO_FBIF_H__
++#define __XEN_PUBLIC_IO_FBIF_H__
++
++/* Out events (frontend -> backend) */
++
++/*
++ * Out events may be sent only when requested by backend, and receipt
++ * of an unknown out event is an error.
++ */
++
++/* Event type 1 currently not used */
++/*
++ * Framebuffer update notification event
++ * Capable frontend sets feature-update in xenstore.
++ * Backend requests it by setting request-update in xenstore.
++ */
++#define XENFB_TYPE_UPDATE 2
++
++struct xenfb_update {
++ uint8_t type; /* XENFB_TYPE_UPDATE */
++ int32_t x; /* source x */
++ int32_t y; /* source y */
++ int32_t width; /* rect width */
++ int32_t height; /* rect height */
++};
++
++#define XENFB_OUT_EVENT_SIZE 40
++
++union xenfb_out_event {
++ uint8_t type;
++ struct xenfb_update update;
++ char pad[XENFB_OUT_EVENT_SIZE];
++};
++
++/* In events (backend -> frontend) */
++
++/*
++ * Frontends should ignore unknown in events.
++ * No in events currently defined.
++ */
++
++#define XENFB_IN_EVENT_SIZE 40
++
++union xenfb_in_event {
++ uint8_t type;
++ char pad[XENFB_IN_EVENT_SIZE];
++};
++
++/* shared page */
++
++#define XENFB_IN_RING_SIZE 1024
++#define XENFB_IN_RING_LEN (XENFB_IN_RING_SIZE / XENFB_IN_EVENT_SIZE)
++#define XENFB_IN_RING_OFFS 1024
++#define XENFB_IN_RING(page) \
++ ((union xenfb_in_event *)((char *)(page) + XENFB_IN_RING_OFFS))
++#define XENFB_IN_RING_REF(page, idx) \
++ (XENFB_IN_RING((page))[(idx) % XENFB_IN_RING_LEN])
++
++#define XENFB_OUT_RING_SIZE 2048
++#define XENFB_OUT_RING_LEN (XENFB_OUT_RING_SIZE / XENFB_OUT_EVENT_SIZE)
++#define XENFB_OUT_RING_OFFS (XENFB_IN_RING_OFFS + XENFB_IN_RING_SIZE)
++#define XENFB_OUT_RING(page) \
++ ((union xenfb_out_event *)((char *)(page) + XENFB_OUT_RING_OFFS))
++#define XENFB_OUT_RING_REF(page, idx) \
++ (XENFB_OUT_RING((page))[(idx) % XENFB_OUT_RING_LEN])
++
++struct xenfb_page {
++ uint32_t in_cons, in_prod;
++ uint32_t out_cons, out_prod;
++
++ int32_t width; /* width of the framebuffer (in pixels) */
++ int32_t height; /* height of the framebuffer (in pixels) */
++ uint32_t line_length; /* length of a row of pixels (in bytes) */
++ uint32_t mem_length; /* length of the framebuffer (in bytes) */
++ uint8_t depth; /* depth of a pixel (in bits) */
++
++ /*
++ * Framebuffer page directory
++ *
++ * Each directory page holds PAGE_SIZE / sizeof(*pd)
++ * framebuffer pages, and can thus map up to PAGE_SIZE *
++ * PAGE_SIZE / sizeof(*pd) bytes. With PAGE_SIZE == 4096 and
++ * sizeof(unsigned long) == 4, that's 4 Megs. Two directory
++ * pages should be enough for a while.
++ */
++ unsigned long pd[2];
++};
++
++/*
++ * Wart: xenkbd needs to know resolution. Put it here until a better
++ * solution is found, but don't leak it to the backend.
++ */
++#ifdef __KERNEL__
++#define XENFB_WIDTH 800
++#define XENFB_HEIGHT 600
++#define XENFB_DEPTH 32
++#endif
++
++#endif
+diff --git a/include/xen/interface/io/kbdif.h b/include/xen/interface/io/kbdif.h
+new file mode 100644
+index 0000000..fb97f42
+--- /dev/null
++++ b/include/xen/interface/io/kbdif.h
+@@ -0,0 +1,114 @@
++/*
++ * kbdif.h -- Xen virtual keyboard/mouse
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to
++ * deal in the Software without restriction, including without limitation the
++ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++ * sell copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Copyright (C) 2005 Anthony Liguori <aliguori at us.ibm.com>
++ * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru at redhat.com>
++ */
++
++#ifndef __XEN_PUBLIC_IO_KBDIF_H__
++#define __XEN_PUBLIC_IO_KBDIF_H__
++
++/* In events (backend -> frontend) */
++
++/*
++ * Frontends should ignore unknown in events.
++ */
++
++/* Pointer movement event */
++#define XENKBD_TYPE_MOTION 1
++/* Event type 2 currently not used */
++/* Key event (includes pointer buttons) */
++#define XENKBD_TYPE_KEY 3
++/*
++ * Pointer position event
++ * Capable backend sets feature-abs-pointer in xenstore.
++ * Frontend requests ot instead of XENKBD_TYPE_MOTION by setting
++ * request-abs-update in xenstore.
++ */
++#define XENKBD_TYPE_POS 4
++
++struct xenkbd_motion {
++ uint8_t type; /* XENKBD_TYPE_MOTION */
++ int32_t rel_x; /* relative X motion */
++ int32_t rel_y; /* relative Y motion */
++};
++
++struct xenkbd_key {
++ uint8_t type; /* XENKBD_TYPE_KEY */
++ uint8_t pressed; /* 1 if pressed; 0 otherwise */
++ uint32_t keycode; /* KEY_* from linux/input.h */
++};
++
++struct xenkbd_position {
++ uint8_t type; /* XENKBD_TYPE_POS */
++ int32_t abs_x; /* absolute X position (in FB pixels) */
++ int32_t abs_y; /* absolute Y position (in FB pixels) */
++};
++
++#define XENKBD_IN_EVENT_SIZE 40
++
++union xenkbd_in_event {
++ uint8_t type;
++ struct xenkbd_motion motion;
++ struct xenkbd_key key;
++ struct xenkbd_position pos;
++ char pad[XENKBD_IN_EVENT_SIZE];
++};
++
++/* Out events (frontend -> backend) */
++
++/*
++ * Out events may be sent only when requested by backend, and receipt
++ * of an unknown out event is an error.
++ * No out events currently defined.
++ */
++
++#define XENKBD_OUT_EVENT_SIZE 40
++
++union xenkbd_out_event {
++ uint8_t type;
++ char pad[XENKBD_OUT_EVENT_SIZE];
++};
++
++/* shared page */
++
++#define XENKBD_IN_RING_SIZE 2048
++#define XENKBD_IN_RING_LEN (XENKBD_IN_RING_SIZE / XENKBD_IN_EVENT_SIZE)
++#define XENKBD_IN_RING_OFFS 1024
++#define XENKBD_IN_RING(page) \
++ ((union xenkbd_in_event *)((char *)(page) + XENKBD_IN_RING_OFFS))
++#define XENKBD_IN_RING_REF(page, idx) \
++ (XENKBD_IN_RING((page))[(idx) % XENKBD_IN_RING_LEN])
++
++#define XENKBD_OUT_RING_SIZE 1024
++#define XENKBD_OUT_RING_LEN (XENKBD_OUT_RING_SIZE / XENKBD_OUT_EVENT_SIZE)
++#define XENKBD_OUT_RING_OFFS (XENKBD_IN_RING_OFFS + XENKBD_IN_RING_SIZE)
++#define XENKBD_OUT_RING(page) \
++ ((union xenkbd_out_event *)((char *)(page) + XENKBD_OUT_RING_OFFS))
++#define XENKBD_OUT_RING_REF(page, idx) \
++ (XENKBD_OUT_RING((page))[(idx) % XENKBD_OUT_RING_LEN])
++
++struct xenkbd_page {
++ uint32_t in_cons, in_prod;
++ uint32_t out_cons, out_prod;
++};
++
++#endif
+--
+1.5.4.1
+
linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch:
Index: linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
===================================================================
RCS file: linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
diff -N linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch 1 Apr 2008 10:38:07 -0000 1.4
@@ -0,0 +1,97 @@
+From 39e9d001b6bc96cf01e7957ec8f0266237239473 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Fri, 22 Feb 2008 12:42:52 +0000
+Subject: [PATCH] xen: Module autoprobing support for frontend drivers
+
+Add module aliases to support autoprobing modules
+for xen frontend devices.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/block/xen-blkfront.c | 1 +
+ drivers/net/xen-netfront.c | 1 +
+ drivers/xen/xenbus/xenbus_probe.c | 27 +++++++++++++++++++++++++--
+ 3 files changed, 27 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
+index 2e7c81e..0c47c02 100644
+--- a/drivers/block/xen-blkfront.c
++++ b/drivers/block/xen-blkfront.c
+@@ -1005,3 +1005,4 @@ module_exit(xlblk_exit);
+ MODULE_DESCRIPTION("Xen virtual block device frontend");
+ MODULE_LICENSE("GPL");
+ MODULE_ALIAS_BLOCKDEV_MAJOR(XENVBD_MAJOR);
++MODULE_ALIAS("xen:vbd");
+diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
+index 7483d45..b3fa27e 100644
+--- a/drivers/net/xen-netfront.c
++++ b/drivers/net/xen-netfront.c
+@@ -1809,3 +1809,4 @@ module_exit(netif_exit);
+
+ MODULE_DESCRIPTION("Xen virtual network device frontend");
+ MODULE_LICENSE("GPL");
++MODULE_ALIAS("xen:vif");
+diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
+index 4750de3..336363c 100644
+--- a/drivers/xen/xenbus/xenbus_probe.c
++++ b/drivers/xen/xenbus/xenbus_probe.c
+@@ -88,6 +88,16 @@ int xenbus_match(struct device *_dev, struct device_driver *_drv)
+ return match_device(drv->ids, to_xenbus_device(_dev)) != NULL;
+ }
+
++static int xenbus_uevent(struct device *_dev, struct kobj_uevent_env *env)
++{
++ struct xenbus_device *dev = to_xenbus_device(_dev);
++
++ if (add_uevent_var(env, "MODALIAS=xen:%s", dev->devicetype))
++ return -ENOMEM;
++
++ return 0;
++}
++
+ /* device/<type>/<id> => <type>-<id> */
+ static int frontend_bus_id(char bus_id[BUS_ID_SIZE], const char *nodename)
+ {
+@@ -166,6 +176,7 @@ static struct xen_bus_type xenbus_frontend = {
+ .bus = {
+ .name = "xen",
+ .match = xenbus_match,
++ .uevent = xenbus_uevent,
+ .probe = xenbus_dev_probe,
+ .remove = xenbus_dev_remove,
+ .shutdown = xenbus_dev_shutdown,
+@@ -438,6 +449,12 @@ static ssize_t xendev_show_devtype(struct device *dev,
+ }
+ DEVICE_ATTR(devtype, S_IRUSR | S_IRGRP | S_IROTH, xendev_show_devtype, NULL);
+
++static ssize_t xendev_show_modalias(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "xen:%s\n", to_xenbus_device(dev)->devicetype);
++}
++DEVICE_ATTR(modalias, S_IRUSR | S_IRGRP | S_IROTH, xendev_show_modalias, NULL);
+
+ int xenbus_probe_node(struct xen_bus_type *bus,
+ const char *type,
+@@ -492,10 +509,16 @@ int xenbus_probe_node(struct xen_bus_type *bus,
+
+ err = device_create_file(&xendev->dev, &dev_attr_devtype);
+ if (err)
+- goto fail_remove_file;
++ goto fail_remove_nodename;
++
++ err = device_create_file(&xendev->dev, &dev_attr_modalias);
++ if (err)
++ goto fail_remove_devtype;
+
+ return 0;
+-fail_remove_file:
++fail_remove_devtype:
++ device_remove_file(&xendev->dev, &dev_attr_devtype);
++fail_remove_nodename:
+ device_remove_file(&xendev->dev, &dev_attr_nodename);
+ fail_unregister:
+ device_unregister(&xendev->dev);
+--
+1.5.4.1
+
linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch:
Index: linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
===================================================================
RCS file: linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
diff -N linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch 1 Apr 2008 10:38:07 -0000 1.4
@@ -0,0 +1,37 @@
+From e0a0e15328d21827da1734778ed89fa31a83d217 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Thu, 21 Feb 2008 11:13:12 +0000
+Subject: [PATCH] xen: Add compatibility aliases for frontend drivers
+
+Before getting merged, xen-blkfront was xenblk and
+xen-netfront was xennet.
+
+Add compatibility module aliases to ease upgrades.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/block/xen-blkfront.c | 1 +
+ drivers/net/xen-netfront.c | 1 +
+ 2 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
+index 0c47c02..8ce168d 100644
+--- a/drivers/block/xen-blkfront.c
++++ b/drivers/block/xen-blkfront.c
+@@ -1006,3 +1006,4 @@ MODULE_DESCRIPTION("Xen virtual block device frontend");
+ MODULE_LICENSE("GPL");
+ MODULE_ALIAS_BLOCKDEV_MAJOR(XENVBD_MAJOR);
+ MODULE_ALIAS("xen:vbd");
++MODULE_ALIAS("xenblk");
+diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
+index b3fa27e..e62018a 100644
+--- a/drivers/net/xen-netfront.c
++++ b/drivers/net/xen-netfront.c
+@@ -1810,3 +1810,4 @@ module_exit(netif_exit);
+ MODULE_DESCRIPTION("Xen virtual network device frontend");
+ MODULE_LICENSE("GPL");
+ MODULE_ALIAS("xen:vif");
++MODULE_ALIAS("xennet");
+--
+1.5.4.1
+
linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch:
Index: linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
===================================================================
RCS file: linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
diff -N linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch 1 Apr 2008 10:38:07 -0000 1.3
@@ -0,0 +1,107 @@
+From 4dabd728abdcdec2d9e1c1c7177479c03d8b5782 Mon Sep 17 00:00:00 2001
+From: Christian Limpach <Christian.Limpach at xensource.com>
+Date: Wed, 19 Mar 2008 15:54:48 +0000
+Subject: [PATCH] xen blkfront: Delay wait for block devices until after the disk is added.
+
+When the xen block frontend driver is built as a module the module load
+is only synchronous up to the point where the frontend and the backend
+become connected rather than when the disk is added.
+
+This means that there can be a race on boot between loading the module and
+loading the dm-* modules and doing the scan for LVM physical volumes (all
+in the initrd). In the failure case the disk is not present until after the
+scan for physical volumes is complete.
+
+Taken from:
+
+ http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/11483a00c017
+
+Signed-off-by: Christian Limpach <Christian.Limpach at xensource.com>
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/block/xen-blkfront.c | 11 +++++++++++
+ drivers/xen/xenbus/xenbus_probe.c | 5 ++++-
+ include/xen/xenbus.h | 1 +
+ 3 files changed, 16 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
+index 8ce168d..74f943a 100644
+--- a/drivers/block/xen-blkfront.c
++++ b/drivers/block/xen-blkfront.c
+@@ -89,6 +89,7 @@ struct blkfront_info
+ struct blk_shadow shadow[BLK_RING_SIZE];
+ unsigned long shadow_free;
+ int feature_barrier;
++ int is_ready;
+
+ /**
+ * The number of people holding this device open. We won't allow a
+@@ -840,6 +841,8 @@ static void blkfront_connect(struct blkfront_info *info)
+ spin_unlock_irq(&blkif_io_lock);
+
+ add_disk(info->gd);
++
++ info->is_ready = 1;
+ }
+
+ /**
+@@ -932,6 +935,13 @@ static int blkfront_remove(struct xenbus_device *dev)
+ return 0;
+ }
+
++static int blkfront_is_ready(struct xenbus_device *dev)
++{
++ struct blkfront_info *info = dev->dev.driver_data;
++
++ return info->is_ready;
++}
++
+ static int blkif_open(struct inode *inode, struct file *filep)
+ {
+ struct blkfront_info *info = inode->i_bdev->bd_disk->private_data;
+@@ -978,6 +988,7 @@ static struct xenbus_driver blkfront = {
+ .remove = blkfront_remove,
+ .resume = blkfront_resume,
+ .otherend_changed = backend_changed,
++ .is_ready = blkfront_is_ready,
+ };
+
+ static int __init xlblk_init(void)
+diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
+index 336363c..57ceb53 100644
+--- a/drivers/xen/xenbus/xenbus_probe.c
++++ b/drivers/xen/xenbus/xenbus_probe.c
+@@ -869,6 +869,7 @@ static int is_disconnected_device(struct device *dev, void *data)
+ {
+ struct xenbus_device *xendev = to_xenbus_device(dev);
+ struct device_driver *drv = data;
++ struct xenbus_driver *xendrv;
+
+ /*
+ * A device with no driver will never connect. We care only about
+@@ -881,7 +882,9 @@ static int is_disconnected_device(struct device *dev, void *data)
+ if (drv && (dev->driver != drv))
+ return 0;
+
+- return (xendev->state != XenbusStateConnected);
++ xendrv = to_xenbus_driver(dev->driver);
++ return (xendev->state != XenbusStateConnected ||
++ (xendrv->is_ready && !xendrv->is_ready(xendev)));
+ }
+
+ static int exists_disconnected_device(struct device_driver *drv)
+diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
+index 6f7c290..6369d89 100644
+--- a/include/xen/xenbus.h
++++ b/include/xen/xenbus.h
+@@ -97,6 +97,7 @@ struct xenbus_driver {
+ int (*uevent)(struct xenbus_device *, char **, int, char *, int);
+ struct device_driver driver;
+ int (*read_otherend_details)(struct xenbus_device *dev);
++ int (*is_ready)(struct xenbus_device *dev);
+ };
+
+ static inline struct xenbus_driver *to_xenbus_driver(struct device_driver *drv)
+--
+1.5.4.1
+
linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch:
Index: linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
===================================================================
RCS file: linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
diff -N linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch 1 Apr 2008 10:38:07 -0000 1.3
@@ -0,0 +1,78 @@
+From bbb538981bce7a062c4b47f38b7633295015be83 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Tue, 19 Feb 2008 15:34:32 +0000
+Subject: [PATCH] xen: Add a vmlinuz target
+
+Although patches are in progress to allow Xen boot
+a DomU using a bzImage, support for booting a Dom0
+using a bzImage is still a ways off.
+
+For now, just add a target to build a gzip-ed ELF
+file which Xen can use to boot both Dom0 and DomU.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ arch/x86/Makefile | 9 +++++++++
+ arch/x86/boot/.gitignore | 1 +
+ arch/x86/boot/Makefile | 9 +++++++++
+ 3 files changed, 19 insertions(+), 0 deletions(-)
+
+diff --git a/arch/x86/Makefile b/arch/x86/Makefile
+index f1e739a..14a752e 100644
+--- a/arch/x86/Makefile
++++ b/arch/x86/Makefile
+@@ -206,6 +206,15 @@ boot := arch/x86/boot
+ PHONY += zImage bzImage compressed zlilo bzlilo \
+ zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
+
++ifdef CONFIG_XEN
++PHONY += vmlinuz
++all: vmlinuz
++
++vmlinuz: KBUILD_IMAGE := $(boot)/vmlinuz
++vmlinuz: vmlinux
++ $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
++endif
++
+ # Default kernel to build
+ all: bzImage
+
+diff --git a/arch/x86/boot/.gitignore b/arch/x86/boot/.gitignore
+index b1bdc4c..35e7956 100644
+--- a/arch/x86/boot/.gitignore
++++ b/arch/x86/boot/.gitignore
+@@ -5,3 +5,4 @@ setup.bin
+ setup.elf
+ cpustr.h
+ mkcpustr
++vmlinuz
+diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
+index f88458e..61bba92 100644
+--- a/arch/x86/boot/Makefile
++++ b/arch/x86/boot/Makefile
+@@ -26,6 +26,7 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
+ #RAMDISK := -DRAMDISK=512
+
+ targets := vmlinux.bin setup.bin setup.elf zImage bzImage
++targets += vmlinuz vmlinux-stripped
+ subdir- := compressed
+
+ setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
+@@ -105,6 +106,14 @@ $(obj)/setup.bin: $(obj)/setup.elf FORCE
+ $(obj)/compressed/vmlinux: FORCE
+ $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@
+
++$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE
++ $(call if_changed,gzip)
++ @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
++
++$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded
++$(obj)/vmlinux-stripped: vmlinux FORCE
++ $(call if_changed,objcopy)
++
+ # Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
+ FDARGS =
+ # Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
+--
+1.5.4.1
+
linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch:
Index: linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
===================================================================
RCS file: linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
diff -N linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch 1 Apr 2008 10:38:07 -0000 1.3
@@ -0,0 +1,124 @@
+From 2e3248aaf569ff7e3ab2bc77f1414ac015d2c16c Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Mon, 4 Feb 2008 08:30:37 +0000
+Subject: [PATCH] xen: Add empty xenctrl module
+
+Add the basic infrastructure for a xenctrl module
+which will contain the various kernel interfaces
+used by (mainly Dom0) Xen userspace.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ arch/x86/xen/Kconfig | 7 +++++
+ drivers/xen/Makefile | 2 +
+ drivers/xen/xenctrl/Makefile | 4 +++
+ drivers/xen/xenctrl/main.c | 62 ++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 75 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/Makefile
+ create mode 100644 drivers/xen/xenctrl/main.c
+
+diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
+index 4d5f264..4723bc1 100644
+--- a/arch/x86/xen/Kconfig
++++ b/arch/x86/xen/Kconfig
+@@ -11,3 +11,10 @@ config XEN
+ This is the Linux Xen port. Enabling this will allow the
+ kernel to boot in a paravirtualized environment under the
+ Xen hypervisor.
++
++config XENCTRL
++ tristate "Xen's user space control interfaces"
++ depends on XEN && PROC_FS
++ default y if XEN
++ help
++ This is the /proc/xen interface used by Xen's libxc.
+diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
+index 56592f0..6737463 100644
+--- a/drivers/xen/Makefile
++++ b/drivers/xen/Makefile
+@@ -1,2 +1,4 @@
+ obj-y += grant-table.o
+ obj-y += xenbus/
++
++obj-$(CONFIG_XENCTRL) += xenctrl/
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+new file mode 100644
+index 0000000..1f43a43
+--- /dev/null
++++ b/drivers/xen/xenctrl/Makefile
+@@ -0,0 +1,4 @@
++obj-$(CONFIG_XENCTRL) += xenctrl.o
++
++xenctrl-objs =
++xenctrl-objs += main.o
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+new file mode 100644
+index 0000000..2965ceb
+--- /dev/null
++++ b/drivers/xen/xenctrl/main.c
+@@ -0,0 +1,62 @@
++/******************************************************************************
++ *
++ * main.c
++ *
++ * Xen userspace control interfaces
++ *
++ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/proc_fs.h>
++#include <linux/module.h>
++#include <asm/xen/hypervisor.h>
++
++static int __init xenctrl_init(void)
++{
++ struct proc_dir_entry *dir;
++
++ if (!is_running_on_xen())
++ return -ENODEV;
++
++ dir = proc_mkdir("xen", NULL);
++ if (!dir)
++ return -ENOMEM;
++
++ dir->owner = THIS_MODULE;
++
++ return 0;
++}
++
++static void __exit xenctrl_exit(void)
++{
++ remove_proc_entry("xen", NULL);
++}
++
++module_init(xenctrl_init);
++module_exit(xenctrl_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
+--
+1.5.4.1
+
linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch:
Index: linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
===================================================================
RCS file: linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
diff -N linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch 1 Apr 2008 10:38:07 -0000 1.3
@@ -0,0 +1,190 @@
+From 4303f417760f888d8afed5fd87aa76b3ec198a83 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Mon, 4 Feb 2008 09:16:51 +0000
+Subject: [PATCH] xen: Add /proc/xen/capabilities
+
+/proc/xen/capabilities is used by the xend init script
+to check whether it is running on Dom0.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/xen/xenctrl/Makefile | 1 +
+ drivers/xen/xenctrl/capabilities.c | 68 ++++++++++++++++++++++++++++++++++++
+ drivers/xen/xenctrl/main.c | 11 ++++++
+ drivers/xen/xenctrl/xenctrl.h | 39 ++++++++++++++++++++
+ 4 files changed, 119 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/capabilities.c
+ create mode 100644 drivers/xen/xenctrl/xenctrl.h
+
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+index 1f43a43..631f535 100644
+--- a/drivers/xen/xenctrl/Makefile
++++ b/drivers/xen/xenctrl/Makefile
+@@ -2,3 +2,4 @@ obj-$(CONFIG_XENCTRL) += xenctrl.o
+
+ xenctrl-objs =
+ xenctrl-objs += main.o
++xenctrl-objs += capabilities.o
+diff --git a/drivers/xen/xenctrl/capabilities.c b/drivers/xen/xenctrl/capabilities.c
+new file mode 100644
+index 0000000..1ff078a
+--- /dev/null
++++ b/drivers/xen/xenctrl/capabilities.c
+@@ -0,0 +1,68 @@
++/******************************************************************************
++ *
++ * capabilities.c
++ *
++ * /proc/xen/capabilities
++ *
++ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/proc_fs.h>
++#include <linux/module.h>
++#include <asm/xen/hypervisor.h>
++
++static int capabilities_read(char *page, char **start, off_t off,
++ int count, int *eof, void *data)
++{
++ int len = 0;
++ *page = 0;
++
++ if (is_initial_xendomain())
++ len = sprintf(page, "control_d\n");
++
++ *eof = 1;
++ return len;
++}
++
++int __init capabilities_create_proc_entry(void)
++{
++ struct proc_dir_entry *entry;
++
++ entry = create_proc_entry("xen/capabilities", 0400, NULL);
++ if (!entry)
++ return -ENOMEM;
++
++ entry->owner = THIS_MODULE;
++ entry->read_proc = capabilities_read;
++
++ return 0;
++}
++
++void __exit capabilities_remove_proc_entry(void)
++{
++ remove_proc_entry("xen/capabilities", NULL);
++}
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+index 2965ceb..0e42f7e 100644
+--- a/drivers/xen/xenctrl/main.c
++++ b/drivers/xen/xenctrl/main.c
+@@ -31,6 +31,8 @@
+ * IN THE SOFTWARE.
+ */
+
++#include "xenctrl.h"
++
+ #include <linux/proc_fs.h>
+ #include <linux/module.h>
+ #include <asm/xen/hypervisor.h>
+@@ -38,6 +40,7 @@
+ static int __init xenctrl_init(void)
+ {
+ struct proc_dir_entry *dir;
++ int ret;
+
+ if (!is_running_on_xen())
+ return -ENODEV;
+@@ -48,11 +51,19 @@ static int __init xenctrl_init(void)
+
+ dir->owner = THIS_MODULE;
+
++ ret = capabilities_create_proc_entry();
++ if (ret)
++ goto fail1;
++
+ return 0;
++
++ fail1: remove_proc_entry("xen", NULL);
++ return ret;
+ }
+
+ static void __exit xenctrl_exit(void)
+ {
++ capabilities_remove_proc_entry();
+ remove_proc_entry("xen", NULL);
+ }
+
+diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
+new file mode 100644
+index 0000000..7378dde
+--- /dev/null
++++ b/drivers/xen/xenctrl/xenctrl.h
+@@ -0,0 +1,39 @@
++/******************************************************************************
++ * xenctl.h
++ *
++ * Xen userspace control interfaces
++ *
++ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/init.h>
++
++/*
++ * capabilities.c
++ */
++int capabilities_create_proc_entry(void) __init;
++void capabilities_remove_proc_entry(void) __exit;
+--
+1.5.4.1
+
linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch:
Index: linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
===================================================================
RCS file: linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
diff -N linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch 1 Apr 2008 10:38:07 -0000 1.3
@@ -0,0 +1,285 @@
+From 6baf8f598c8d00216eb1ff03f3fba9706496e447 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Mon, 4 Feb 2008 08:24:57 +0000
+Subject: [PATCH] xen: Add /proc/xen/privcmd
+
+/proc/xen/privcmd is an ioctl() interface which allows
+userspace apps to invoke hypercalls.
+
+There should also be an ioctl (IOCTL_PRIVCMD_MMAP)
+which is used to map foreign pages into a processes
+address space, but we leave this unimplemented for
+now pending further work on foreign page support.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/xen/xenctrl/Makefile | 1 +
+ drivers/xen/xenctrl/main.c | 6 +++
+ drivers/xen/xenctrl/privcmd.c | 81 +++++++++++++++++++++++++++++++++++++++
+ drivers/xen/xenctrl/xenctrl.h | 6 +++
+ include/asm-x86/xen/hypercall.h | 28 +++++++++++++
+ include/xen/sys/privcmd.h | 79 ++++++++++++++++++++++++++++++++++++++
+ 6 files changed, 201 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/privcmd.c
+ create mode 100644 include/xen/sys/privcmd.h
+
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+index 631f535..8a706cb 100644
+--- a/drivers/xen/xenctrl/Makefile
++++ b/drivers/xen/xenctrl/Makefile
+@@ -3,3 +3,4 @@ obj-$(CONFIG_XENCTRL) += xenctrl.o
+ xenctrl-objs =
+ xenctrl-objs += main.o
+ xenctrl-objs += capabilities.o
++xenctrl-objs += privcmd.o
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+index 0e42f7e..d1fe6ef 100644
+--- a/drivers/xen/xenctrl/main.c
++++ b/drivers/xen/xenctrl/main.c
+@@ -55,14 +55,20 @@ static int __init xenctrl_init(void)
+ if (ret)
+ goto fail1;
+
++ ret = privcmd_create_proc_entry();
++ if (ret)
++ goto fail2;
++
+ return 0;
+
++ fail2: capabilities_remove_proc_entry();
+ fail1: remove_proc_entry("xen", NULL);
+ return ret;
+ }
+
+ static void __exit xenctrl_exit(void)
+ {
++ privcmd_remove_proc_entry();
+ capabilities_remove_proc_entry();
+ remove_proc_entry("xen", NULL);
+ }
+diff --git a/drivers/xen/xenctrl/privcmd.c b/drivers/xen/xenctrl/privcmd.c
+new file mode 100644
+index 0000000..58c4b83
+--- /dev/null
++++ b/drivers/xen/xenctrl/privcmd.c
+@@ -0,0 +1,81 @@
++/******************************************************************************
++ * privcmd.c
++ *
++ * Interface to privileged domain-0 commands.
++ *
++ * Copyright (c) 2002-2004, K A Fraser, B Dragovic
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/proc_fs.h>
++#include <linux/module.h>
++#include <linux/uaccess.h>
++#include <asm/xen/hypervisor.h>
++#include <xen/sys/privcmd.h>
++
++static long privcmd_ioctl(struct file *file, unsigned int cmd,
++ unsigned long arg)
++{
++ switch (cmd) {
++ case IOCTL_PRIVCMD_HYPERCALL: {
++ privcmd_hypercall_t cmd;
++
++ if (copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)))
++ return -EFAULT;
++
++ return privcmd_hypercall(&cmd);
++ }
++
++ case IOCTL_PRIVCMD_MMAP:
++ case IOCTL_PRIVCMD_MMAPBATCH:
++ printk(KERN_WARNING "IOCTL_PRIVCMD_MMAP ioctl not yet implemented\n");
++ default:
++ return -EINVAL;
++ }
++}
++
++static const struct file_operations privcmd_file_ops = {
++ .unlocked_ioctl = privcmd_ioctl,
++};
++
++int __init privcmd_create_proc_entry(void)
++{
++ static struct proc_dir_entry *entry;
++
++ entry = create_proc_entry("xen/privcmd", 0400, NULL);
++ if (!entry)
++ return -ENOMEM;
++
++ entry->owner = THIS_MODULE;
++ entry->proc_fops = &privcmd_file_ops;
++
++ return 0;
++}
++
++void __exit privcmd_remove_proc_entry(void)
++{
++ remove_proc_entry("xen/privcmd", NULL);
++}
+diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
+index 7378dde..a35209a 100644
+--- a/drivers/xen/xenctrl/xenctrl.h
++++ b/drivers/xen/xenctrl/xenctrl.h
+@@ -37,3 +37,9 @@
+ */
+ int capabilities_create_proc_entry(void) __init;
+ void capabilities_remove_proc_entry(void) __exit;
++
++/*
++ * privcmd.c
++ */
++int privcmd_create_proc_entry(void) __init;
++void privcmd_remove_proc_entry(void) __exit;
+diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
+index bc0ee7d..cd554ca 100644
+--- a/include/asm-x86/xen/hypercall.h
++++ b/include/asm-x86/xen/hypercall.h
+@@ -410,4 +410,32 @@ MULTI_stack_switch(struct multicall_entry *mcl,
+ mcl->args[1] = esp;
+ }
+
++#include <xen/sys/privcmd.h>
++
++static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
++{
++ int ret;
++
++ if (hypercall->op >= (PAGE_SIZE >> 5))
++ return -EINVAL;
++
++ __asm__ __volatile__ (
++ "pushl %%ebx; pushl %%ecx; pushl %%edx; "
++ "pushl %%esi; pushl %%edi; "
++ "movl 8(%%eax),%%ebx ;"
++ "movl 16(%%eax),%%ecx ;"
++ "movl 24(%%eax),%%edx ;"
++ "movl 32(%%eax),%%esi ;"
++ "movl 40(%%eax),%%edi ;"
++ "movl (%%eax),%%eax ;"
++ "shll $5,%%eax ;"
++ "addl $hypercall_page,%%eax ;"
++ "call *%%eax ;"
++ "popl %%edi; popl %%esi; popl %%edx; "
++ "popl %%ecx; popl %%ebx"
++ : "=a" (ret) : "0" (hypercall) : "memory" );
++
++ return ret;
++}
++
+ #endif /* __HYPERCALL_H__ */
+diff --git a/include/xen/sys/privcmd.h b/include/xen/sys/privcmd.h
+new file mode 100644
+index 0000000..9cfa9d7
+--- /dev/null
++++ b/include/xen/sys/privcmd.h
+@@ -0,0 +1,79 @@
++/******************************************************************************
++ * privcmd.h
++ *
++ * Interface to /proc/xen/privcmd.
++ *
++ * Copyright (c) 2003-2005, K A Fraser
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#ifndef __LINUX_PUBLIC_PRIVCMD_H__
++#define __LINUX_PUBLIC_PRIVCMD_H__
++
++#include <linux/types.h>
++
++#ifndef __user
++#define __user
++#endif
++
++typedef struct privcmd_hypercall
++{
++ __u64 op;
++ __u64 arg[5];
++} privcmd_hypercall_t;
++
++typedef struct privcmd_mmap_entry {
++ __u64 va;
++ __u64 mfn;
++ __u64 npages;
++} privcmd_mmap_entry_t;
++
++typedef struct privcmd_mmap {
++ int num;
++ domid_t dom; /* target domain */
++ privcmd_mmap_entry_t __user *entry;
++} privcmd_mmap_t;
++
++typedef struct privcmd_mmapbatch {
++ int num; /* number of pages to populate */
++ domid_t dom; /* target domain */
++ __u64 addr; /* virtual address */
++ ulong __user *arr; /* array of mfns - top nibble set on err */
++} privcmd_mmapbatch_t;
++
++/*
++ * @cmd: IOCTL_PRIVCMD_HYPERCALL
++ * @arg: &privcmd_hypercall_t
++ * Return: Value returned from execution of the specified hypercall.
++ */
++#define IOCTL_PRIVCMD_HYPERCALL \
++ _IOC(_IOC_NONE, 'P', 0, sizeof(privcmd_hypercall_t))
++#define IOCTL_PRIVCMD_MMAP \
++ _IOC(_IOC_NONE, 'P', 2, sizeof(privcmd_mmap_t))
++#define IOCTL_PRIVCMD_MMAPBATCH \
++ _IOC(_IOC_NONE, 'P', 3, sizeof(privcmd_mmapbatch_t))
++
++#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
+--
+1.5.4.1
+
linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch:
Index: linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
===================================================================
RCS file: linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
diff -N linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch 1 Apr 2008 10:38:07 -0000 1.3
@@ -0,0 +1,529 @@
+From 281e15a7f51ebd1e547199fd5583c1d68b3cf49b Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Mon, 4 Feb 2008 22:04:36 +0000
+Subject: [PATCH] xen: Add /proc/xen/xenbus
+
+This interface is used by userspace programs to talk to
+xenstored.
+
+Since xenstored makes itself available to Dom0 userspace
+via a socket this should only really be useful in Domu,
+but it turns out that Dom0 apps historically default
+to using /proc/xen/xenbus rather than the socket.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ drivers/xen/xenbus/xenbus_comms.h | 1 -
+ drivers/xen/xenbus/xenbus_probe.c | 2 +
+ drivers/xen/xenbus/xenbus_xs.c | 1 +
+ drivers/xen/xenctrl/Makefile | 1 +
+ drivers/xen/xenctrl/main.c | 6 +
+ drivers/xen/xenctrl/xenbus.c | 398 +++++++++++++++++++++++++++++++++++++
+ drivers/xen/xenctrl/xenctrl.h | 6 +
+ include/xen/xenbus.h | 2 +
+ 8 files changed, 416 insertions(+), 1 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/xenbus.c
+
+diff --git a/drivers/xen/xenbus/xenbus_comms.h b/drivers/xen/xenbus/xenbus_comms.h
+index c21db75..fcc9b29 100644
+--- a/drivers/xen/xenbus/xenbus_comms.h
++++ b/drivers/xen/xenbus/xenbus_comms.h
+@@ -41,6 +41,5 @@ int xb_data_to_read(void);
+ int xb_wait_for_data_to_read(void);
+ int xs_input_avail(void);
+ extern struct xenstore_domain_interface *xen_store_interface;
+-extern int xen_store_evtchn;
+
+ #endif /* _XENBUS_COMMS_H */
+diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
+index 57ceb53..c811581 100644
+--- a/drivers/xen/xenbus/xenbus_probe.c
++++ b/drivers/xen/xenbus/xenbus_probe.c
+@@ -56,6 +56,8 @@
+ #include "xenbus_probe.h"
+
+ int xen_store_evtchn;
++EXPORT_SYMBOL_GPL(xen_store_evtchn);
++
+ struct xenstore_domain_interface *xen_store_interface;
+ static unsigned long xen_store_mfn;
+
+diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
+index 227d53b..810e24a 100644
+--- a/drivers/xen/xenbus/xenbus_xs.c
++++ b/drivers/xen/xenbus/xenbus_xs.c
+@@ -184,6 +184,7 @@ void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg)
+
+ return ret;
+ }
++EXPORT_SYMBOL(xenbus_dev_request_and_reply);
+
+ /* Send message to xs, get kmalloc'ed reply. ERR_PTR() on error. */
+ static void *xs_talkv(struct xenbus_transaction t,
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+index 8a706cb..23dafa3 100644
+--- a/drivers/xen/xenctrl/Makefile
++++ b/drivers/xen/xenctrl/Makefile
+@@ -4,3 +4,4 @@ xenctrl-objs =
+ xenctrl-objs += main.o
+ xenctrl-objs += capabilities.o
+ xenctrl-objs += privcmd.o
++xenctrl-objs += xenbus.o
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+index d1fe6ef..b0cf61b 100644
+--- a/drivers/xen/xenctrl/main.c
++++ b/drivers/xen/xenctrl/main.c
+@@ -59,8 +59,13 @@ static int __init xenctrl_init(void)
+ if (ret)
+ goto fail2;
+
++ ret = xenbus_create_proc_entry();
++ if (ret)
++ goto fail3;
++
+ return 0;
+
++ fail3: privcmd_remove_proc_entry();
+ fail2: capabilities_remove_proc_entry();
+ fail1: remove_proc_entry("xen", NULL);
+ return ret;
+@@ -68,6 +73,7 @@ static int __init xenctrl_init(void)
+
+ static void __exit xenctrl_exit(void)
+ {
++ xenbus_remove_proc_entry();
+ privcmd_remove_proc_entry();
+ capabilities_remove_proc_entry();
+ remove_proc_entry("xen", NULL);
+diff --git a/drivers/xen/xenctrl/xenbus.c b/drivers/xen/xenctrl/xenbus.c
+new file mode 100644
+index 0000000..57d5501
+--- /dev/null
++++ b/drivers/xen/xenctrl/xenbus.c
+@@ -0,0 +1,398 @@
++/*
++ * xenbus.c
++ *
++ * /proc/xen/xenbus gives user-space access to the kernel's xenbus
++ * connection to xenstore.
++ *
++ * Copyright (c) 2005, Christian Limpach
++ * Copyright (c) 2005, Rusty Russell, IBM Corporation
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License version 2
++ * as published by the Free Software Foundation; or, when distributed
++ * separately from the Linux kernel or incorporated into other
++ * software packages, subject to the following license:
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this source file (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy, modify,
++ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ * IN THE SOFTWARE.
++ */
++
++#include <linux/proc_fs.h>
++#include <linux/module.h>
++#include <linux/uaccess.h>
++#include <linux/poll.h>
++
++#include <xen/xenbus.h>
++
++struct xenbus_dev_transaction {
++ struct list_head list;
++ struct xenbus_transaction handle;
++};
++
++struct read_buffer {
++ struct list_head list;
++ unsigned int cons;
++ unsigned int len;
++ char msg[];
++};
++
++struct xenbus_dev_data {
++ /* In-progress transaction. */
++ struct list_head transactions;
++
++ /* Active watches. */
++ struct list_head watches;
++
++ /* Partial request. */
++ unsigned int len;
++ union {
++ struct xsd_sockmsg msg;
++ char buffer[PAGE_SIZE];
++ } u;
++
++ /* Response queue. */
++ struct list_head read_buffers;
++ wait_queue_head_t read_waitq;
++
++ struct mutex reply_mutex;
++};
++
++static ssize_t xenbus_dev_read(struct file *filp,
++ char __user *ubuf,
++ size_t len, loff_t *ppos)
++{
++ struct xenbus_dev_data *u = filp->private_data;
++ struct read_buffer *rb;
++ int i, ret;
++
++ mutex_lock(&u->reply_mutex);
++ while (list_empty(&u->read_buffers)) {
++ mutex_unlock(&u->reply_mutex);
++ ret = wait_event_interruptible(u->read_waitq,
++ !list_empty(&u->read_buffers));
++ if (ret)
++ return ret;
++ mutex_lock(&u->reply_mutex);
++ }
++
++ rb = list_entry(u->read_buffers.next, struct read_buffer, list);
++ for (i = 0; i < len;) {
++ put_user(rb->msg[rb->cons], ubuf + i);
++ i++;
++ rb->cons++;
++ if (rb->cons == rb->len) {
++ list_del(&rb->list);
++ kfree(rb);
++ if (list_empty(&u->read_buffers))
++ break;
++ rb = list_entry(u->read_buffers.next,
++ struct read_buffer, list);
++ }
++ }
++ mutex_unlock(&u->reply_mutex);
++
++ return i;
++}
++
++static void queue_reply(struct xenbus_dev_data *u,
++ char *data, unsigned int len)
++{
++ struct read_buffer *rb;
++
++ if (len == 0)
++ return;
++
++ rb = kmalloc(sizeof(*rb) + len, GFP_KERNEL);
++ BUG_ON(rb == NULL);
++
++ rb->cons = 0;
++ rb->len = len;
++
++ memcpy(rb->msg, data, len);
++
++ list_add_tail(&rb->list, &u->read_buffers);
++
++ wake_up(&u->read_waitq);
++}
++
++struct watch_adapter
++{
++ struct list_head list;
++ struct xenbus_watch watch;
++ struct xenbus_dev_data *dev_data;
++ char *token;
++};
++
++static void free_watch_adapter(struct watch_adapter *watch)
++{
++ kfree(watch->watch.node);
++ kfree(watch->token);
++ kfree(watch);
++}
++
++static void watch_fired(struct xenbus_watch *watch,
++ const char **vec,
++ unsigned int len)
++{
++ struct watch_adapter *adap =
++ container_of(watch, struct watch_adapter, watch);
++ struct xsd_sockmsg hdr;
++ const char *path, *token;
++ int path_len, tok_len, body_len;
++
++ path = vec[XS_WATCH_PATH];
++ token = adap->token;
++
++ path_len = strlen(path) + 1;
++ tok_len = strlen(token) + 1;
++ body_len = path_len + tok_len;
++
++ hdr.type = XS_WATCH_EVENT;
++ hdr.len = body_len;
++
++ mutex_lock(&adap->dev_data->reply_mutex);
++ queue_reply(adap->dev_data, (char *)&hdr, sizeof(hdr));
++ queue_reply(adap->dev_data, (char *)path, path_len);
++ queue_reply(adap->dev_data, (char *)token, tok_len);
++ mutex_unlock(&adap->dev_data->reply_mutex);
++}
++
++static LIST_HEAD(watch_list);
++
++static ssize_t xenbus_dev_write(struct file *filp,
++ const char __user *ubuf,
++ size_t len, loff_t *ppos)
++{
++ struct xenbus_dev_data *u = filp->private_data;
++ struct xenbus_dev_transaction *trans = NULL;
++ uint32_t msg_type;
++ void *reply;
++ char *path, *token;
++ struct watch_adapter *watch, *tmp_watch;
++ int err, rc = len;
++
++ if ((len + u->len) > sizeof(u->u.buffer)) {
++ rc = -EINVAL;
++ goto out;
++ }
++
++ if (copy_from_user(u->u.buffer + u->len, ubuf, len) != 0) {
++ rc = -EFAULT;
++ goto out;
++ }
++
++ u->len += len;
++ if ((u->len < sizeof(u->u.msg)) ||
++ (u->len < (sizeof(u->u.msg) + u->u.msg.len)))
++ return rc;
++
++ msg_type = u->u.msg.type;
++
++ switch (msg_type) {
++ case XS_TRANSACTION_START:
++ case XS_TRANSACTION_END:
++ case XS_DIRECTORY:
++ case XS_READ:
++ case XS_GET_PERMS:
++ case XS_RELEASE:
++ case XS_GET_DOMAIN_PATH:
++ case XS_WRITE:
++ case XS_MKDIR:
++ case XS_RM:
++ case XS_SET_PERMS:
++ if (msg_type == XS_TRANSACTION_START) {
++ trans = kmalloc(sizeof(*trans), GFP_KERNEL);
++ if (!trans) {
++ rc = -ENOMEM;
++ goto out;
++ }
++ }
++
++ reply = xenbus_dev_request_and_reply(&u->u.msg);
++ if (IS_ERR(reply)) {
++ kfree(trans);
++ rc = PTR_ERR(reply);
++ goto out;
++ }
++
++ if (msg_type == XS_TRANSACTION_START) {
++ trans->handle.id = simple_strtoul(reply, NULL, 0);
++ list_add(&trans->list, &u->transactions);
++ } else if (msg_type == XS_TRANSACTION_END) {
++ list_for_each_entry(trans, &u->transactions, list)
++ if (trans->handle.id == u->u.msg.tx_id)
++ break;
++ BUG_ON(&trans->list == &u->transactions);
++ list_del(&trans->list);
++ kfree(trans);
++ }
++ mutex_lock(&u->reply_mutex);
++ queue_reply(u, (char *)&u->u.msg, sizeof(u->u.msg));
++ queue_reply(u, (char *)reply, u->u.msg.len);
++ mutex_unlock(&u->reply_mutex);
++ kfree(reply);
++ break;
++
++ case XS_WATCH:
++ case XS_UNWATCH: {
++ static const char *XS_RESP = "OK";
++ struct xsd_sockmsg hdr;
++
++ path = u->u.buffer + sizeof(u->u.msg);
++ token = memchr(path, 0, u->u.msg.len);
++ if (token == NULL) {
++ rc = -EILSEQ;
++ goto out;
++ }
++ token++;
++
++ if (msg_type == XS_WATCH) {
++ watch = kmalloc(sizeof(*watch), GFP_KERNEL);
++ watch->watch.node = kmalloc(strlen(path)+1,
++ GFP_KERNEL);
++ strcpy((char *)watch->watch.node, path);
++ watch->watch.callback = watch_fired;
++ watch->token = kmalloc(strlen(token)+1, GFP_KERNEL);
++ strcpy(watch->token, token);
++ watch->dev_data = u;
++
++ err = register_xenbus_watch(&watch->watch);
++ if (err) {
++ free_watch_adapter(watch);
++ rc = err;
++ goto out;
++ }
++
++ list_add(&watch->list, &u->watches);
++ } else {
++ list_for_each_entry_safe(watch, tmp_watch,
++ &u->watches, list) {
++ if (!strcmp(watch->token, token) &&
++ !strcmp(watch->watch.node, path))
++ {
++ unregister_xenbus_watch(&watch->watch);
++ list_del(&watch->list);
++ free_watch_adapter(watch);
++ break;
++ }
++ }
++ }
++
++ hdr.type = msg_type;
++ hdr.len = strlen(XS_RESP) + 1;
++ mutex_lock(&u->reply_mutex);
++ queue_reply(u, (char *)&hdr, sizeof(hdr));
++ queue_reply(u, (char *)XS_RESP, hdr.len);
++ mutex_unlock(&u->reply_mutex);
++ break;
++ }
++
++ default:
++ rc = -EINVAL;
++ break;
++ }
++
++ out:
++ u->len = 0;
++ return rc;
++}
++
++static int xenbus_dev_open(struct inode *inode, struct file *filp)
++{
++ struct xenbus_dev_data *u;
++
++ if (xen_store_evtchn == 0)
++ return -ENOENT;
++
++ nonseekable_open(inode, filp);
++
++ u = kzalloc(sizeof(*u), GFP_KERNEL);
++ if (u == NULL)
++ return -ENOMEM;
++
++ INIT_LIST_HEAD(&u->transactions);
++ INIT_LIST_HEAD(&u->watches);
++ INIT_LIST_HEAD(&u->read_buffers);
++ init_waitqueue_head(&u->read_waitq);
++
++ mutex_init(&u->reply_mutex);
++
++ filp->private_data = u;
++
++ return 0;
++}
++
++static int xenbus_dev_release(struct inode *inode, struct file *filp)
++{
++ struct xenbus_dev_data *u = filp->private_data;
++ struct xenbus_dev_transaction *trans, *tmp;
++ struct watch_adapter *watch, *tmp_watch;
++
++ list_for_each_entry_safe(trans, tmp, &u->transactions, list) {
++ xenbus_transaction_end(trans->handle, 1);
++ list_del(&trans->list);
++ kfree(trans);
++ }
++
++ list_for_each_entry_safe(watch, tmp_watch, &u->watches, list) {
++ unregister_xenbus_watch(&watch->watch);
++ list_del(&watch->list);
++ free_watch_adapter(watch);
++ }
++
++ kfree(u);
++
++ return 0;
++}
++
++static unsigned int xenbus_dev_poll(struct file *file, poll_table *wait)
++{
++ struct xenbus_dev_data *u = file->private_data;
++
++ poll_wait(file, &u->read_waitq, wait);
++ if (!list_empty(&u->read_buffers))
++ return POLLIN | POLLRDNORM;
++ return 0;
++}
++
++static const struct file_operations xenbus_dev_file_ops = {
++ .read = xenbus_dev_read,
++ .write = xenbus_dev_write,
++ .open = xenbus_dev_open,
++ .release = xenbus_dev_release,
++ .poll = xenbus_dev_poll,
++};
++
++int __init xenbus_create_proc_entry(void)
++{
++ struct proc_dir_entry *entry;
++
++ entry = create_proc_entry("xen/xenbus", 0400, NULL);
++ if (!entry)
++ return -ENOMEM;
++
++ entry->owner = THIS_MODULE;
++ entry->proc_fops = &xenbus_dev_file_ops;
++
++ return 0;
++}
++
++void __exit xenbus_remove_proc_entry(void)
++{
++ remove_proc_entry("xen/xenbus", NULL);
++}
+diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
+index a35209a..e585c4b 100644
+--- a/drivers/xen/xenctrl/xenctrl.h
++++ b/drivers/xen/xenctrl/xenctrl.h
+@@ -43,3 +43,9 @@ void capabilities_remove_proc_entry(void) __exit;
+ */
+ int privcmd_create_proc_entry(void) __init;
+ void privcmd_remove_proc_entry(void) __exit;
++
++/*
++ * xenbus.c
++ */
++int xenbus_create_proc_entry(void) __init;
++void xenbus_remove_proc_entry(void) __exit;
+diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
+index 6369d89..a3fef9d 100644
+--- a/include/xen/xenbus.h
++++ b/include/xen/xenbus.h
+@@ -232,4 +232,6 @@ const char *xenbus_strstate(enum xenbus_state state);
+ int xenbus_dev_is_online(struct xenbus_device *dev);
+ int xenbus_frontend_closed(struct xenbus_device *dev);
+
++extern int xen_store_evtchn;
++
+ #endif /* _XEN_XENBUS_H */
+--
+1.5.4.1
+
linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch:
Index: linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
===================================================================
RCS file: linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
diff -N linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch 1 Apr 2008 10:38:07 -0000 1.3
@@ -0,0 +1,479 @@
+From 97f74781644be0af74aedcd86f064c508c2db9c3 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Thu, 7 Feb 2008 15:32:28 +0000
+Subject: [PATCH] xen: Add Xen's /sys/hypervisor interface
+
+Hook up Xen's /sys/hypervisor interface:
+
+ /sys/hypervisor/
+ -> type
+ -> uuid
+ -> compilation
+ -> compile_date
+ -> compiled_by
+ -> compiler
+ -> properties
+ -> capabilities
+ -> changeset
+ -> pagesize
+ -> virtual_start
+ -> writable_pt
+ -> version
+ -> extra
+ -> major
+ -> minor
+
+Note: the hypervisor subsys hook requires that
+SYS_HYPERVISOR is selected to enabled it, which in
+turns means that the subsys will be registered by
+a pv-ops kernel with Xen support, even on bare
+metal. This hook needs to be changed to be runtime
+enabled.
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ arch/x86/xen/Kconfig | 3 +-
+ drivers/xen/xenctrl/Makefile | 1 +
+ drivers/xen/xenctrl/main.c | 6 +
+ drivers/xen/xenctrl/sysfs.c | 349 +++++++++++++++++++++++++++++++++++++++
+ drivers/xen/xenctrl/xenctrl.h | 6 +
+ include/xen/interface/version.h | 6 +
+ 6 files changed, 370 insertions(+), 1 deletions(-)
+ create mode 100644 drivers/xen/xenctrl/sysfs.c
+
+diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
+index 4723bc1..ff6a56a 100644
+--- a/arch/x86/xen/Kconfig
++++ b/arch/x86/xen/Kconfig
+@@ -14,7 +14,8 @@ config XEN
+
+ config XENCTRL
+ tristate "Xen's user space control interfaces"
+- depends on XEN && PROC_FS
++ depends on XEN && PROC_FS && SYSFS
+ default y if XEN
++ select SYS_HYPERVISOR
+ help
+ This is the /proc/xen interface used by Xen's libxc.
+diff --git a/drivers/xen/xenctrl/Makefile b/drivers/xen/xenctrl/Makefile
+index 23dafa3..e126e76 100644
+--- a/drivers/xen/xenctrl/Makefile
++++ b/drivers/xen/xenctrl/Makefile
+@@ -5,3 +5,4 @@ xenctrl-objs += main.o
+ xenctrl-objs += capabilities.o
+ xenctrl-objs += privcmd.o
+ xenctrl-objs += xenbus.o
++xenctrl-objs += sysfs.o
+diff --git a/drivers/xen/xenctrl/main.c b/drivers/xen/xenctrl/main.c
+index b0cf61b..87d0dba 100644
+--- a/drivers/xen/xenctrl/main.c
++++ b/drivers/xen/xenctrl/main.c
+@@ -63,8 +63,13 @@ static int __init xenctrl_init(void)
+ if (ret)
+ goto fail3;
+
++ ret = sys_hypervisor_init();
++ if (ret)
++ goto fail4;
++
+ return 0;
+
++ fail4: xenbus_remove_proc_entry();
+ fail3: privcmd_remove_proc_entry();
+ fail2: capabilities_remove_proc_entry();
+ fail1: remove_proc_entry("xen", NULL);
+@@ -73,6 +78,7 @@ static int __init xenctrl_init(void)
+
+ static void __exit xenctrl_exit(void)
+ {
++ sys_hypervisor_exit();
+ xenbus_remove_proc_entry();
+ privcmd_remove_proc_entry();
+ capabilities_remove_proc_entry();
+diff --git a/drivers/xen/xenctrl/sysfs.c b/drivers/xen/xenctrl/sysfs.c
+new file mode 100644
+index 0000000..8cbf4d6
+--- /dev/null
++++ b/drivers/xen/xenctrl/sysfs.c
+@@ -0,0 +1,349 @@
++/*
++ * copyright (c) 2006 IBM Corporation
++ * Authored by: Mike D. Day <ncmike at us.ibm.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include <linux/kobject.h>
++#include <linux/sysfs.h>
++#include <linux/err.h>
++#include <asm/xen/hypervisor.h>
++#include <xen/xenbus.h>
++#include "xenctrl.h"
++
++#define HYPERVISOR_ATTR_RO(_name) \
++static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
++
++#define HYPERVISOR_ATTR_RW(_name) \
++static struct kobj_attribute _name##_attr = \
++ __ATTR(_name, 0644, _name##_show, _name##_store)
++
++static ssize_t type_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ return sprintf(buffer, "xen\n");
++}
++
++HYPERVISOR_ATTR_RO(type);
++
++static int __init xen_sysfs_type_init(void)
++{
++ return sysfs_create_file(hypervisor_kobj, &type_attr.attr);
++}
++
++static void xen_sysfs_type_destroy(void)
++{
++ sysfs_remove_file(hypervisor_kobj, &type_attr.attr);
++}
++
++static ssize_t major_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ int version;
++
++ version = HYPERVISOR_xen_version(XENVER_version, NULL);
++ if (!version)
++ return -ENODEV;
++
++ return sprintf(buffer, "%d\n", version >> 16);
++}
++
++HYPERVISOR_ATTR_RO(major);
++
++static ssize_t minor_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ int version;
++
++ version = HYPERVISOR_xen_version(XENVER_version, NULL);
++ if (!version)
++ return -ENODEV;
++
++ return sprintf(buffer, "%d\n", version & 0xff);
++}
++
++HYPERVISOR_ATTR_RO(minor);
++
++static ssize_t extra_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ int ret;
++ struct xen_extraversion extra;
++
++ ret = HYPERVISOR_xen_version(XENVER_extraversion, &extra);
++ if (ret)
++ return ret;
++
++ return sprintf(buffer, "%s\n", extra.extraversion);
++}
++
++HYPERVISOR_ATTR_RO(extra);
++
++static struct attribute *version_attrs[] = {
++ &major_attr.attr,
++ &minor_attr.attr,
++ &extra_attr.attr,
++ NULL
++};
++
++static struct attribute_group version_group = {
++ .name = "version",
++ .attrs = version_attrs,
++};
++
++static int __init xen_sysfs_version_init(void)
++{
++ return sysfs_create_group(hypervisor_kobj, &version_group);
++}
++
++static void xen_sysfs_version_destroy(void)
++{
++ sysfs_remove_group(hypervisor_kobj, &version_group);
++}
++
++static ssize_t uuid_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ char *vm, *val;
++ int ret;
++
++ vm = xenbus_read(XBT_NIL, "vm", "", NULL);
++ if (IS_ERR(vm))
++ return PTR_ERR(vm);
++
++ val = xenbus_read(XBT_NIL, vm, "uuid", NULL);
++ if (IS_ERR(val)) {
++ ret = PTR_ERR(val);
++ goto out;
++ }
++
++ ret = sprintf(buffer, "%s\n", val);
++
++ kfree(val);
++out: kfree(vm);
++
++ return ret;
++}
++
++HYPERVISOR_ATTR_RO(uuid);
++
++static int __init xen_sysfs_uuid_init(void)
++{
++ return sysfs_create_file(hypervisor_kobj, &uuid_attr.attr);
++}
++
++static void xen_sysfs_uuid_destroy(void)
++{
++ sysfs_remove_file(hypervisor_kobj, &uuid_attr.attr);
++}
++
++static ssize_t compiler_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ struct xen_compile_info info;
++ int ret;
++
++ ret = HYPERVISOR_xen_version(XENVER_compile_info, &info);
++ if (ret)
++ return ret;
++
++ return sprintf(buffer, "%s\n", info.compiler);
++}
++
++HYPERVISOR_ATTR_RO(compiler);
++
++static ssize_t compiled_by_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ struct xen_compile_info info;
++ int ret;
++
++ ret = HYPERVISOR_xen_version(XENVER_compile_info, &info);
++ if (ret)
++ return ret;
++
++ return sprintf(buffer, "%s\n", info.compile_by);
++}
++
++HYPERVISOR_ATTR_RO(compiled_by);
++
++static ssize_t compile_date_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ struct xen_compile_info info;
++ int ret;
++
++ ret = HYPERVISOR_xen_version(XENVER_compile_info, &info);
++ if (ret)
++ return ret;
++
++ return sprintf(buffer, "%s\n", info.compile_date);
++}
++
++HYPERVISOR_ATTR_RO(compile_date);
++
++static struct attribute *xen_compile_attrs[] = {
++ &compiler_attr.attr,
++ &compiled_by_attr.attr,
++ &compile_date_attr.attr,
++ NULL
++};
++
++static struct attribute_group xen_compilation_group = {
++ .name = "compilation",
++ .attrs = xen_compile_attrs,
++};
++
++static int __init xen_compilation_init(void)
++{
++ return sysfs_create_group(hypervisor_kobj,
++ &xen_compilation_group);
++}
++
++static void xen_compilation_destroy(void)
++{
++ sysfs_remove_group(hypervisor_kobj,
++ &xen_compilation_group);
++}
++
++static ssize_t capabilities_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ struct xen_capabilities_info *caps;
++ int ret;
++
++ caps = kmalloc(sizeof(struct xen_capabilities_info), GFP_KERNEL);
++ if (!caps)
++ return -ENOMEM;
++
++ ret = HYPERVISOR_xen_version(XENVER_capabilities, caps);
++ if (ret)
++ goto out;
++
++ ret = sprintf(buffer, "%s\n", caps->info);
++
++out: kfree(caps);
++
++ return ret;
++}
++
++HYPERVISOR_ATTR_RO(capabilities);
++
++static ssize_t changeset_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ struct xen_changeset_info cset;
++ int ret;
++
++ ret = HYPERVISOR_xen_version(XENVER_changeset, &cset);
++ if (ret)
++ return ret;
++
++ return sprintf(buffer, "%s\n", cset.info);
++}
++
++HYPERVISOR_ATTR_RO(changeset);
++
++static ssize_t virtual_start_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ struct xen_platform_parameters parms;
++ int ret;
++
++ ret = HYPERVISOR_xen_version(XENVER_platform_parameters, &parms);
++ if (ret)
++ return ret;
++
++ return sprintf(buffer, "%lx\n", parms.virt_start);
++}
++
++HYPERVISOR_ATTR_RO(virtual_start);
++
++static ssize_t pagesize_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ int ret;
++
++ ret = HYPERVISOR_xen_version(XENVER_pagesize, NULL);
++ if (ret < 0)
++ return ret;
++
++ return sprintf(buffer, "%x\n", ret);
++}
++
++HYPERVISOR_ATTR_RO(pagesize);
++
++static ssize_t writable_pt_show(struct kobject *kobj, struct kobj_attribute *attr, char *buffer)
++{
++ struct xen_feature_info info;
++ int ret;
++
++ info.submap_idx = XENFEAT_writable_page_tables;
++
++ ret = HYPERVISOR_xen_version(XENVER_get_features, &info);
++ if (ret)
++ return ret;
++
++ return sprintf(buffer, "%d\n", info.submap);
++}
++
++HYPERVISOR_ATTR_RO(writable_pt);
++
++static struct attribute *xen_properties_attrs[] = {
++ &capabilities_attr.attr,
++ &changeset_attr.attr,
++ &virtual_start_attr.attr,
++ &pagesize_attr.attr,
++ &writable_pt_attr.attr,
++ NULL
++};
++
++static struct attribute_group xen_properties_group = {
++ .name = "properties",
++ .attrs = xen_properties_attrs,
++};
++
++static int __init xen_properties_init(void)
++{
++ return sysfs_create_group(hypervisor_kobj,
++ &xen_properties_group);
++}
++
++static void xen_properties_destroy(void)
++{
++ sysfs_remove_group(hypervisor_kobj, &xen_properties_group);
++}
++
++int __init sys_hypervisor_init(void)
++{
++ int ret;
++
++ if (!is_running_on_xen())
++ return -ENODEV;
++
++ ret = xen_sysfs_type_init();
++ if (ret)
++ goto out;
++ ret = xen_sysfs_version_init();
++ if (ret)
++ goto version_out;
++ ret = xen_compilation_init();
++ if (ret)
++ goto comp_out;
++ ret = xen_sysfs_uuid_init();
++ if (ret)
++ goto uuid_out;
++ ret = xen_properties_init();
++ if (!ret)
++ goto out;
++
++ xen_sysfs_uuid_destroy();
++uuid_out:
++ xen_compilation_destroy();
++comp_out:
++ xen_sysfs_version_destroy();
++version_out:
++ xen_sysfs_type_destroy();
++out:
++ return ret;
++}
++
++void __exit sys_hypervisor_exit(void)
++{
++ xen_properties_destroy();
++ xen_compilation_destroy();
++ xen_sysfs_uuid_destroy();
++ xen_sysfs_version_destroy();
++ xen_sysfs_type_destroy();
++}
+diff --git a/drivers/xen/xenctrl/xenctrl.h b/drivers/xen/xenctrl/xenctrl.h
+index e585c4b..1afbdfb 100644
+--- a/drivers/xen/xenctrl/xenctrl.h
++++ b/drivers/xen/xenctrl/xenctrl.h
+@@ -49,3 +49,9 @@ void privcmd_remove_proc_entry(void) __exit;
+ */
+ int xenbus_create_proc_entry(void) __init;
+ void xenbus_remove_proc_entry(void) __exit;
++
++/*
++ * sysfs.c
++ */
++int sys_hypervisor_init(void) __init;
++void sys_hypervisor_exit(void) __exit;
+diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
+index 453235e..dd58cf5 100644
+--- a/include/xen/interface/version.h
++++ b/include/xen/interface/version.h
+@@ -57,4 +57,10 @@ struct xen_feature_info {
+ /* Declares the features reported by XENVER_get_features. */
+ #include "features.h"
+
++/* arg == NULL; returns host memory page size. */
++#define XENVER_pagesize 7
++
++/* arg == xen_domain_handle_t. */
++#define XENVER_guest_handle 8
++
+ #endif /* __XEN_PUBLIC_VERSION_H__ */
+--
+1.5.4.1
+
linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch:
Index: linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
===================================================================
RCS file: linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
diff -N linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch 1 Apr 2008 10:38:07 -0000 1.3
@@ -0,0 +1,79 @@
+From a750b42db7d287c4931bb8fd3572f3c5cebc5497 Mon Sep 17 00:00:00 2001
+From: Stephen Tweedie <sct at redhat.com>
+Date: Wed, 21 Nov 2007 18:40:31 +0000
+Subject: [PATCH] xen debug: Add xprintk to log directly via hypercall
+
+For early debugging, it is useful to have a way of doing debugging output
+direct to the hypervisor without having to rely on console being fully
+initialised.
+
+Signed-off-by: Stephen Tweedie <sct at redhat.com>
+---
+ arch/x86/xen/enlighten.c | 32 ++++++++++++++++++++++++++++++++
+ include/xen/hvc-console.h | 1 +
+ 2 files changed, 33 insertions(+), 0 deletions(-)
+
+diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
+index 75760a7..bc9a009 100644
+--- a/arch/x86/xen/enlighten.c
++++ b/arch/x86/xen/enlighten.c
+@@ -32,6 +32,7 @@
+ #include <xen/interface/sched.h>
+ #include <xen/features.h>
+ #include <xen/page.h>
++#include <xen/hvc-console.h>
+
+ #include <asm/paravirt.h>
+ #include <asm/page.h>
+@@ -142,6 +143,37 @@ static void __init xen_banner(void)
+ printk(KERN_INFO "Hypervisor signature: %s\n", xen_start_info->magic);
+ }
+
++static void kcons_write_dom0(const char *s, unsigned int count)
++{
++ int rc;
++
++ while ((count > 0) &&
++ ((rc = HYPERVISOR_console_io(
++ CONSOLEIO_write, count, (char *)s)) > 0)) {
++ count -= rc;
++ s += rc;
++ }
++}
++
++
++/*** Useful function for console debugging -- goes straight to Xen. ***/
++asmlinkage int xprintk(const char *fmt, ...)
++{
++ va_list args;
++ int printk_len;
++ static char printk_buf[1024];
++
++ /* Emit the output into the temporary buffer */
++ va_start(args, fmt);
++ printk_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args);
++ va_end(args);
++
++ /* Send the processed output directly to Xen. */
++ kcons_write_dom0(printk_buf, printk_len);
++
++ return 0;
++}
++
+ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
+ unsigned int *cx, unsigned int *dx)
+ {
+diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h
+index 21c0ecf..cb7a3c9 100644
+--- a/include/xen/hvc-console.h
++++ b/include/xen/hvc-console.h
+@@ -2,5 +2,6 @@
+ #define XEN_HVC_CONSOLE_H
+
+ extern struct console xenboot_console;
++extern asmlinkage int xprintk(const char *fmt, ...);
+
+ #endif /* XEN_HVC_CONSOLE_H */
+--
+1.5.4.1
+
linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch:
Index: linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
===================================================================
RCS file: linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
diff -N linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch 1 Apr 2008 10:38:07 -0000 1.4
@@ -0,0 +1,58 @@
+From b50f268c17ea1835c761aff20a23c0d34ce73a43 Mon Sep 17 00:00:00 2001
+From: Mark McLoughlin <markmc at redhat.com>
+Date: Thu, 6 Mar 2008 11:10:59 +0000
+Subject: [PATCH] xen x86_64: Add 64 bit version of privcmd_hypercall()
+
+Signed-off-by: Mark McLoughlin <markmc at redhat.com>
+---
+ include/asm-x86/xen/hypercall.h | 28 ++++++++++++++++++++++++++++
+ 1 files changed, 28 insertions(+), 0 deletions(-)
+
+diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
+index cd554ca..b0c518c 100644
+--- a/include/asm-x86/xen/hypercall.h
++++ b/include/asm-x86/xen/hypercall.h
+@@ -412,6 +412,7 @@ MULTI_stack_switch(struct multicall_entry *mcl,
+
+ #include <xen/sys/privcmd.h>
+
++#ifdef CONFIG_X86_32
+ static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
+ {
+ int ret;
+@@ -437,5 +438,32 @@ static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
+
+ return ret;
+ }
++#else /* CONFIG_X86_32 */
++static inline int privcmd_hypercall(privcmd_hypercall_t *hypercall)
++{
++ int ret;
++ long ign1, ign2, ign3;
++
++ if (hypercall->op >= (PAGE_SIZE >> 5))
++ return -EINVAL;
++
++ __asm__ __volatile__ (
++ "movq %8,%%r10; movq %9,%%r8;"
++ "shll $5,%%eax ;"
++ "addq $hypercall_page,%%rax ;"
++ "call *%%rax"
++ : "=a" (ret), "=D" (ign1),
++ "=S" (ign2), "=d" (ign3)
++ : "0" ((unsigned int)hypercall->op),
++ "1" (hypercall->arg[0]),
++ "2" (hypercall->arg[1]),
++ "3" (hypercall->arg[2]),
++ "g" (hypercall->arg[3]),
++ "g" (hypercall->arg[4])
++ : "r8", "r10", "memory" );
++
++ return ret;
++}
++#endif /* CONFIG_X86_32 */
+
+ #endif /* __HYPERCALL_H__ */
+--
+1.5.4.1
+
linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch:
--- NEW FILE linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch ---
>From 24b23b3a992388dcaa3a08361f0dab15b7385802 Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Tue, 25 Mar 2008 11:56:43 +0000
Subject: [PATCH] xen x86_64: Only define load_user_cs_desc() on 32 bit
load_user_cs_desc() is only used on 32 bit, so only
define it in that case.
Fixes compile failure in native_load_user_cs_desc()
since mm_context_t->user_cs is only available on
32 bit.
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
arch/x86/kernel/paravirt.c | 2 ++
arch/x86/xen/enlighten.c | 4 ++++
include/asm-x86/desc.h | 4 ++++
include/asm-x86/paravirt.h | 4 ++++
4 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index d59db07..c845947 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -331,7 +331,9 @@ struct pv_cpu_ops pv_cpu_ops = {
.read_tscp = native_read_tscp,
.load_tr_desc = native_load_tr_desc,
.set_ldt = native_set_ldt,
+#ifdef CONFIG_X86_32
.load_user_cs_desc = native_load_user_cs_desc,
+#endif
.load_gdt = native_load_gdt,
.load_idt = native_load_idt,
.store_gdt = native_store_gdt,
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index bc9a009..5c91ae7 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -322,6 +322,7 @@ static void xen_set_ldt(const void *addr, unsigned entries)
xen_mc_issue(PARAVIRT_LAZY_CPU);
}
+#ifdef CONFIG_X86_32
static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
{
void *gdt;
@@ -337,6 +338,7 @@ static inline void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
HYPERVISOR_update_descriptor(mgdt.maddr, descriptor);
}
+#endif
static void xen_load_gdt(const struct desc_ptr *dtr)
{
@@ -1046,7 +1048,9 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
.load_tr_desc = paravirt_nop,
.set_ldt = xen_set_ldt,
+#ifdef CONFIG_X86_32
.load_user_cs_desc = xen_load_user_cs_desc,
+#endif
.load_gdt = xen_load_gdt,
.load_idt = xen_load_idt,
.load_tls = xen_load_tls,
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index ec3a84a..9b280be 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -95,7 +95,9 @@ static inline int desc_empty(const void *ptr)
#define load_TLS(t, cpu) native_load_tls(t, cpu)
#define set_ldt native_set_ldt
+#ifdef CONFIG_X86_32
#define load_user_cs_desc native_load_user_cs_desc
+#endif
#define write_ldt_entry(dt, entry, desc) \
native_write_ldt_entry(dt, entry, desc)
@@ -362,10 +364,12 @@ static inline void set_user_cs(struct desc_struct *desc, unsigned long limit)
desc->b = (limit & 0xf0000) | 0x00c0fb00;
}
+#ifdef CONFIG_X86_32
static inline void native_load_user_cs_desc(int cpu, struct mm_struct *mm)
{
get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS] = mm->context.user_cs;
}
+#endif
#ifdef CONFIG_X86_32
extern void arch_add_exec_range(struct mm_struct *mm, unsigned long limit);
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index ff8d218..7d7070a 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -113,7 +113,9 @@ struct pv_cpu_ops {
void (*store_gdt)(struct desc_ptr *);
void (*store_idt)(struct desc_ptr *);
void (*set_ldt)(const void *desc, unsigned entries);
+#ifdef CONFIG_X86_32
void (*load_user_cs_desc)(int cpu, struct mm_struct *mm);
+#endif
unsigned long (*store_tr)(void);
void (*load_tls)(struct thread_struct *t, unsigned int cpu);
void (*write_ldt_entry)(struct desc_struct *ldt, int entrynum,
@@ -755,11 +757,13 @@ static inline void set_ldt(const void *addr, unsigned entries)
{
PVOP_VCALL2(pv_cpu_ops.set_ldt, addr, entries);
}
+#ifdef CONFIG_X86_32
static inline void load_user_cs_desc(unsigned int cpu,
struct mm_struct *mm)
{
PVOP_VCALL2(pv_cpu_ops.load_user_cs_desc, cpu, mm);
}
+#endif
static inline void store_gdt(struct desc_ptr *dtr)
{
PVOP_VCALL1(pv_cpu_ops.store_gdt, dtr);
--
1.5.4.1
linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch:
--- NEW FILE linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch ---
>From 71e0f3287bad1bc651fd2ea450fef451663a0edd Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 28 Feb 2008 12:16:04 -0300
Subject: [PATCH] xen x86_64: Initial x86_64 support for Xen paravirt_ops
Taken from the xen-64-2008-03-07 tag
Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Signed-off-by: Mark McLoughlin <markmc at redhat.com>
---
arch/x86/Kconfig | 3 +-
arch/x86/kernel/acpi/boot.c | 4 +-
arch/x86/kernel/apic_32.c | 4 +-
arch/x86/kernel/apic_64.c | 2 +-
arch/x86/kernel/asm-offsets_64.c | 15 +
arch/x86/kernel/early_printk.c | 5 +-
arch/x86/kernel/efi_64.c | 4 +-
arch/x86/kernel/entry_32.S | 83 +-----
arch/x86/kernel/entry_64.S | 72 ++++-
arch/x86/kernel/genapic_64.c | 12 +
arch/x86/kernel/head64.c | 4 +
arch/x86/kernel/head_64.S | 23 ++
arch/x86/kernel/hpet.c | 4 +-
arch/x86/kernel/io_apic_64.c | 2 +-
arch/x86/kernel/irq_64.c | 5 +
arch/x86/kernel/mpparse_32.c | 4 +-
arch/x86/kernel/mpparse_64.c | 4 +-
arch/x86/kernel/paravirt.c | 3 +
arch/x86/kernel/process_64.c | 9 +
arch/x86/kernel/setup64.c | 5 +
arch/x86/kernel/setup_64.c | 41 +++-
arch/x86/kernel/smpboot_64.c | 4 +-
arch/x86/kernel/vsyscall_64.c | 31 ++-
arch/x86/mach-visws/traps.c | 10 +-
arch/x86/mm/init_32.c | 2 +-
arch/x86/mm/init_64.c | 558 ++++++++++++++++++++++++++++++++--
arch/x86/mm/ioremap.c | 4 +-
arch/x86/mm/pgtable_32.c | 25 ++-
arch/x86/pci/mmconfig_32.c | 2 +-
arch/x86/vdso/vdso32-setup.c | 6 +-
arch/x86/xen/Kconfig | 1 -
arch/x86/xen/Makefile | 6 +
arch/x86/xen/enlighten.c | 301 +++++++++++++------
arch/x86/xen/entry.S | 5 +
arch/x86/xen/entry_32.S | 81 +++++
arch/x86/xen/entry_64.S | 68 ++++
arch/x86/xen/events.c | 13 +-
arch/x86/xen/genapic.c | 190 ++++++++++++
arch/x86/xen/init.h | 20 ++
arch/x86/xen/init_32.c | 3 +
arch/x86/xen/init_64.c | 181 +++++++++++
arch/x86/xen/mmu.c | 417 ++++++++++++++++++-------
arch/x86/xen/mmu.h | 47 ++--
arch/x86/xen/multicalls.c | 9 +-
arch/x86/xen/setup.c | 22 ++
arch/x86/xen/smp.c | 16 +
arch/x86/xen/xen-asm.S | 224 +++-----------
arch/x86/xen/xen-asm_32.S | 184 +++++++++++
arch/x86/xen/xen-asm_64.S | 75 +++++
arch/x86/xen/xen-head.S | 21 +-
arch/x86/xen/xen-ops.h | 11 +
drivers/acpi/thermal.c | 5 +
drivers/char/hvc_xen.c | 6 +
drivers/ieee1394/init_ohci1394_dma.c | 2 +-
drivers/serial/8250_early.c | 2 +-
include/asm-x86/asm-hack.h | 27 ++
include/asm-x86/cmpxchg_64.h | 36 +++
include/asm-x86/desc_defs.h | 4 +
include/asm-x86/fixmap_32.h | 22 +-
include/asm-x86/fixmap_64.h | 31 ++-
include/asm-x86/mmu_context_64.h | 6 +-
include/asm-x86/page_64.h | 2 +-
include/asm-x86/paravirt.h | 46 ++-
include/asm-x86/percpu.h | 32 ++
include/asm-x86/pgalloc_64.h | 69 ++++-
include/asm-x86/pgtable.h | 15 +-
include/asm-x86/pgtable_64.h | 3 +-
include/asm-x86/proto.h | 1 +
include/asm-x86/smp_64.h | 3 +
include/asm-x86/system.h | 3 +-
include/asm-x86/xen/hypercall.h | 205 ++++++++++---
include/asm-x86/xen/hypervisor.h | 3 -
include/asm-x86/xen/interface.h | 35 ++-
include/linux/dmi.h | 1 +
include/linux/elfnote.h | 2 +-
include/xen/events.h | 2 +
include/xen/interface/elfnote.h | 16 +
include/xen/page.h | 34 ++-
init/main.c | 10 +
mm/slab.c | 8 +-
80 files changed, 2803 insertions(+), 673 deletions(-)
create mode 100644 arch/x86/xen/entry.S
create mode 100644 arch/x86/xen/entry_32.S
create mode 100644 arch/x86/xen/entry_64.S
create mode 100644 arch/x86/xen/genapic.c
create mode 100644 arch/x86/xen/init.h
create mode 100644 arch/x86/xen/init_32.c
create mode 100644 arch/x86/xen/init_64.c
create mode 100644 arch/x86/xen/xen-asm_32.S
create mode 100644 arch/x86/xen/xen-asm_64.S
create mode 100644 include/asm-x86/asm-hack.h
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6c70fed..f18418d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -89,7 +89,7 @@ config ARCH_MAY_HAVE_PC_FDC
def_bool y
config DMI
- def_bool y
+ def_bool !XEN
config RWSEM_GENERIC_SPINLOCK
def_bool !X86_XADD
@@ -327,6 +327,7 @@ config X86_RDC321X
config X86_VSMP
bool "Support for ScaleMP vSMP"
+ depends on !XEN
depends on X86_64 && PCI
help
Support for ScaleMP vSMP systems. Say 'Y' here if this kernel is
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 2cdc9de..cfc79ac 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -141,7 +141,7 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size)
offset = phys & (PAGE_SIZE - 1);
mapped_size = PAGE_SIZE - offset;
- set_fixmap(FIX_ACPI_END, phys);
+ set_fixmap_ma(FIX_ACPI_END, phys);
base = fix_to_virt(FIX_ACPI_END);
/*
@@ -152,7 +152,7 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size)
if (--idx < FIX_ACPI_BEGIN)
return NULL; /* cannot handle this */
phys += PAGE_SIZE;
- set_fixmap(idx, phys);
+ set_fixmap_ma(idx, phys);
mapped_size += PAGE_SIZE;
}
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index 35a568e..40fc1b3 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -1138,7 +1138,7 @@ void __init init_apic_mappings(void)
} else
apic_phys = mp_lapic_addr;
- set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
+ set_fixmap_ma_nocache(FIX_APIC_BASE, apic_phys);
printk(KERN_DEBUG "mapped APIC to %08lx (%08lx)\n", APIC_BASE,
apic_phys);
@@ -1172,7 +1172,7 @@ fake_ioapic_page:
alloc_bootmem_pages(PAGE_SIZE);
ioapic_phys = __pa(ioapic_phys);
}
- set_fixmap_nocache(idx, ioapic_phys);
+ set_fixmap_ma_nocache(idx, ioapic_phys);
printk(KERN_DEBUG "mapped IOAPIC to %08lx (%08lx)\n",
__fix_to_virt(idx), ioapic_phys);
idx++;
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index d8d03e0..a611520 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -877,7 +877,7 @@ void __init init_apic_mappings(void)
} else
apic_phys = mp_lapic_addr;
- set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
+ set_fixmap_ma_nocache(FIX_APIC_BASE, apic_phys);
apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n",
APIC_BASE, apic_phys);
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 494e1e0..d0fabfd 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -25,6 +25,8 @@
#define OFFSET(sym, str, mem) \
DEFINE(sym, offsetof(struct str, mem))
+#include <xen/interface/xen.h>
+
#define __NO_STUBS 1
#undef __SYSCALL
#undef _ASM_X86_64_UNISTD_H_
@@ -92,6 +94,13 @@ int main(void)
offsetof (struct rt_sigframe32, uc.uc_mcontext));
BLANK();
#endif
+
+#ifdef CONFIG_XEN
[...5580 lines suppressed...]
-#define ELFNOTE(name, type, desc) \
+#define ELFNOTE(name, type, desc...) \
ELFNOTE_START(name, type, "") \
desc ; \
ELFNOTE_END
diff --git a/include/xen/events.h b/include/xen/events.h
index 2bde54d..c18d2bf 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -3,6 +3,8 @@
#include <linux/interrupt.h>
+#include <asm/xen/interface.h>
+#include <xen/interface/xen.h>
#include <xen/interface/event_channel.h>
#include <asm/xen/hypercall.h>
diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h
index a64d3df..ee5501d 100644
--- a/include/xen/interface/elfnote.h
+++ b/include/xen/interface/elfnote.h
@@ -120,6 +120,22 @@
*/
#define XEN_ELFNOTE_BSD_SYMTAB 11
+/*
+ * The lowest address the hypervisor hole can begin at (numeric).
+ *
+ * This must not be set higher than HYPERVISOR_VIRT_START. Its presence
+ * also indicates to the hypervisor that the kernel can deal with the
+ * hole starting at a higher address.
+ */
+#define XEN_ELFNOTE_HV_START_LOW 12
+
+/*
+ * List of maddr_t-sized mask/value pairs describing how to recognize
+ * (non-present) L1 page table entries carrying valid MFNs (numeric).
+ */
+#define XEN_ELFNOTE_L1_MFN_VALID 13
+
+
#endif /* __XEN_PUBLIC_ELFNOTE_H__ */
/*
diff --git a/include/xen/page.h b/include/xen/page.h
index 031ef22..158fb60 100644
--- a/include/xen/page.h
+++ b/include/xen/page.h
@@ -8,6 +8,10 @@
#include <xen/features.h>
+#include <asm/xen/interface.h>
+
+#include <xen/hvc-console.h>
+
#ifdef CONFIG_X86_PAE
/* Xen machine address */
typedef struct xmaddr {
@@ -70,6 +74,8 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
#endif
pfn = 0;
+ //xprintk("mfn_to_pfn(%lx):\n", mfn);
+
/*
* The array access can fail (e.g., device space beyond end of RAM).
* In such cases it doesn't matter what we return (we return garbage),
@@ -77,6 +83,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
*/
__get_user(pfn, &machine_to_phys_mapping[mfn]);
+ //xprintk("mfn_to_pfn(%lx) = %lx\n", mfn, pfn);
return pfn;
}
@@ -143,34 +150,29 @@ static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
static inline pte_t mfn_pte(unsigned long page_nr, pgprot_t pgprot)
{
- pte_t pte;
-
- pte.pte_high = (page_nr >> (32 - PAGE_SHIFT)) |
- (pgprot_val(pgprot) >> 32);
- pte.pte_high &= (__supported_pte_mask >> 32);
- pte.pte_low = ((page_nr << PAGE_SHIFT) | pgprot_val(pgprot));
- pte.pte_low &= __supported_pte_mask;
-
- return pte;
+ pteval_t val;
+
+ val = (page_nr << PAGE_SHIFT) | pgprot_val(pgprot);
+ val &= __supported_pte_mask;
+ return native_make_pte(val);
}
-static inline unsigned long long pte_val_ma(pte_t x)
+static inline pteval_t pte_val_ma(pte_t x)
{
- return x.pte;
+ return native_pte_val(x);
}
-#define pmd_val_ma(v) ((v).pmd)
-#define pud_val_ma(v) ((v).pgd.pgd)
-#define __pte_ma(x) ((pte_t) { .pte = (x) })
+#define __pte_ma(x) (native_make_pte(x))
#define __pmd_ma(x) ((pmd_t) { (x) } )
#else /* !X86_PAE */
-#define pte_mfn(_pte) ((_pte).pte_low >> PAGE_SHIFT)
+#define pte_mfn(_pte) ((native_pte_val(_pte) & __PHYSICAL_MASK) >> PAGE_SHIFT)
#define mfn_pte(pfn, prot) __pte_ma(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
#define pte_val_ma(x) ((x).pte)
-#define pmd_val_ma(v) ((v).pud.pgd.pgd)
#define __pte_ma(x) ((pte_t) { (x) } )
#endif /* CONFIG_X86_PAE */
#define pgd_val_ma(x) ((x).pgd)
+#define pmd_val_ma(x) (native_pmd_val((x)))
+#define pud_val_ma(x) (native_pud_val((x)))
xmaddr_t arbitrary_virt_to_machine(unsigned long address);
diff --git a/init/main.c b/init/main.c
index 530b36f..9341b4c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -584,17 +584,25 @@ asmlinkage void __init start_kernel(void)
rcu_init();
init_IRQ();
pidhash_init();
+ printk("init_timers:\n");
init_timers();
hrtimers_init();
softirq_init();
+ printk("timekeeping:\n");
timekeeping_init();
+ printk("time:\n");
time_init();
+ printk("profile:\n");
profile_init();
+ printk("irqs_disabled:\n");
if (!irqs_disabled())
printk("start_kernel(): bug: interrupts were enabled early\n");
+ printk("early_boot_irqs_on:\n");
early_boot_irqs_on();
+ printk("local_irq_enable:\n");
local_irq_enable();
+ printk("console_init:\n");
/*
* HACK ALERT! This is early. We're enabling the console before
* we've done PCI setups etc, and console_init() must be aware of
@@ -631,7 +639,9 @@ asmlinkage void __init start_kernel(void)
numa_policy_init();
if (late_time_init)
late_time_init();
+ printk("calibrate_delay:\n");
calibrate_delay();
+ printk("pidmap_init:\n");
pidmap_init();
pgtable_cache_init();
prio_tree_init();
diff --git a/mm/slab.c b/mm/slab.c
index ed27eb8..d434cc3 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3201,6 +3201,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
STATS_INC_ALLOCHIT(cachep);
ac->touched = 1;
objp = ac->entry[--ac->avail];
+ if (!objp)
+ printk("really weird: avail objp for cache %s is null\n", cachep->name);
} else {
STATS_INC_ALLOCMISS(cachep);
objp = cache_alloc_refill(cachep, flags);
@@ -3463,8 +3465,10 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller)
unsigned long save_flags;
void *objp;
- if (should_failslab(cachep, flags))
+ if (should_failslab(cachep, flags)) {
+ printk("cache %s should fail\n", cachep->name);
return NULL;
+ }
cache_alloc_debugcheck_before(cachep, flags);
local_irq_save(save_flags);
@@ -3476,6 +3480,8 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, void *caller)
if (unlikely((flags & __GFP_ZERO) && objp))
memset(objp, 0, obj_size(cachep));
+ if (!objp)
+ printk("allocation from cache %s failed!!!\n", cachep->name);
return objp;
}
--
1.5.4.1
--- NEW FILE patch-2.6.25-rc7-git6.bz2.sign ---
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: See http://www.kernel.org/signature.html for info
iD8DBQBH8I0iyGugalF9Dw4RAhRZAJwOpd7iZ2lz/ejNy9G+Vjza+8UT6wCfeMKn
AXzSXS0xVpH9AVRkRDMrDRE=
=L9G2
-----END PGP SIGNATURE-----
--- NEW FILE patch-2.6.25-rc7.bz2.sign ---
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: See http://www.kernel.org/signature.html for info
iD8DBQBH6bUByGugalF9Dw4RAiTzAJ94B313u9CkQ/8m0zS4kIljlipJQACfSS9k
zPxzabJGk0ZBv+ppscEod78=
=wb38
-----END PGP SIGNATURE-----
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/.cvsignore,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- .cvsignore 6 Mar 2008 13:59:25 -0000 1.12
+++ .cvsignore 1 Apr 2008 10:38:06 -0000 1.13
@@ -4,5 +4,6 @@
temp-*
kernel-2.6.24
linux-2.6.24.tar.bz2
-patch-2.6.25-rc4.bz2
+patch-2.6.25-rc7.bz2
+patch-2.6.25-rc7-git6.bz2
xen-3.2.0.tar.gz
Index: .gitignore
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/.gitignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .gitignore 6 Mar 2008 13:59:25 -0000 1.2
+++ .gitignore 1 Apr 2008 10:38:06 -0000 1.3
@@ -4,5 +4,7 @@
temp-*
kernel-2.6.24
linux-2.6.24.tar.bz2
-patch-2.6.25-rc4.bz2
+patch-2.6.25-rc7.bz2
+patch-2.6.25-rc7-git6.bz2
xen-3.2.0.tar.gz
+
Index: Makefile
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile 25 Mar 2008 12:37:23 -0000 1.6
+++ Makefile 1 Apr 2008 10:38:06 -0000 1.7
@@ -32,6 +32,9 @@
include $(MAKEFILE_COMMON)
include Makefile.config
+extremedebug:
+ @perl -pi -e 's/# CONFIG_DEBUG_PAGEALLOC is not set/CONFIG_DEBUG_PAGEALLOC=y/' config-nodebug
+
debug:
@perl -pi -e 's/# CONFIG_SLUB_DEBUG_ON is not set/CONFIG_SLUB_DEBUG_ON=y/' config-nodebug
@perl -pi -e 's/# CONFIG_LOCK_STAT is not set/CONFIG_LOCK_STAT=y/' config-nodebug
@@ -46,6 +49,8 @@
@perl -pi -e 's/# CONFIG_DEBUG_SPINLOCK is not set/CONFIG_DEBUG_SPINLOCK=y/' config-nodebug
@perl -pi -e 's/# CONFIG_DEBUG_VM is not set/CONFIG_DEBUG_VM=y/' config-nodebug
@perl -pi -e 's/# CONFIG_DEBUG_SLEEP_IN_IRQ is not set/CONFIG_DEBUG_SLEEP_IN_IRQ=y/' config-nodebug
+ @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-debug
+ @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-nodebug
@perl -pi -e 's/# CONFIG_FAULT_INJECTION is not set/CONFIG_FAULT_INJECTION=y/' config-nodebug
@perl -pi -e 's/# CONFIG_FAILSLAB is not set/CONFIG_FAILSLAB=y/' config-nodebug
@perl -pi -e 's/# CONFIG_FAIL_PAGE_ALLOC is not set/CONFIG_FAIL_PAGE_ALLOC=y/' config-nodebug
@@ -54,6 +59,7 @@
@perl -pi -e 's/# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set/CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y/' config-nodebug
@perl -pi -e 's/# CONFIG_DEBUG_SG is not set/CONFIG_DEBUG_SG=y/' config-nodebug
@perl -pi -e 's/# CONFIG_EXT4DEV_FS is not set/CONFIG_EXT4DEV_FS=m/' config-generic
+ @perl -pi -e 's/# CONFIG_USB_DEBUG is not set/CONFIG_USB_DEBUG=y/' config-generic
@perl -pi -e 's/^%define debugbuildsenabled 1/%define debugbuildsenabled 0/' kernel.spec
@@ -69,6 +75,7 @@
@perl -pi -e 's/CONFIG_DEBUG_LOCK_ALLOC=y/# CONFIG_DEBUG_LOCK_ALLOC is not set/' config-nodebug
@perl -pi -e 's/CONFIG_PROVE_LOCKING=y/# CONFIG_PROVE_LOCKING is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DEBUG_SPINLOCK=y/# CONFIG_DEBUG_SPINLOCK is not set/' config-nodebug
+ @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-debug
@perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DEBUG_VM=y/# CONFIG_DEBUG_VM is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DEBUG_SLEEP_IN_IRQ=y/# CONFIG_DEBUG_SLEEP_IN_IRQ is not set/' config-nodebug
@@ -80,6 +87,7 @@
@perl -pi -e 's/CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y/# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DEBUG_SG=y/# CONFIG_DEBUG_SG is not set/' config-nodebug
@perl -pi -e 's/CONFIG_EXT4DEV_FS=m/# CONFIG_EXT4DEV_FS is not set/' config-generic
+ @perl -pi -e 's/CONFIG_USB_DEBUG=y/# CONFIG_USB_DEBUG is not set/' config-generic
@perl -pi -e 's/^%define debugbuildsenabled 0/%define debugbuildsenabled 1/' kernel.spec
Index: config-debug
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-debug,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-debug 6 Mar 2008 13:59:25 -0000 1.3
+++ config-debug 1 Apr 2008 10:38:06 -0000 1.4
@@ -29,4 +29,6 @@
CONFIG_DEBUG_SG=y
-CONFIG_DEBUG_PAGEALLOC=y
+# CONFIG_DEBUG_PAGEALLOC is not set
+
+CONFIG_USB_DEBUG=y
Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-generic,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-generic 6 Mar 2008 13:59:25 -0000 1.3
+++ config-generic 1 Apr 2008 10:38:06 -0000 1.4
@@ -63,7 +63,7 @@
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_KMOD=y
#
@@ -79,7 +79,7 @@
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_HOTPLUG_PCI_PCIE=m
CONFIG_HOTPLUG_PCI_FAKE=m
-# CONFIG_PCI_LEGACY is not set
+CONFIG_PCI_LEGACY=y
CONFIG_ISA=y
# CONFIG_EISA is not set
@@ -643,6 +643,8 @@
CONFIG_FIREWIRE=m
CONFIG_FIREWIRE_OHCI=m
CONFIG_FIREWIRE_SBP2=m
+CONFIG_FIREWIRE_OHCI_DEBUG=y
+# CONFIG_FIREWIRE_OHCI_REMOTE_DMA is not set
#
# IEEE 1394 (FireWire) support
@@ -1250,6 +1252,7 @@
CONFIG_MAC80211_RC_DEFAULT="pid"
CONFIG_MAC80211_RC_PID=y
CONFIG_MAC80211_RC_SIMPLE=y
+CONFIG_MAC80211_MESH=y
CONFIG_MAC80211_LEDS=y
CONFIG_MAC80211_DEBUGFS=y
# CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT is not set
@@ -1297,16 +1300,20 @@
CONFIG_LIBERTAS_CS=m
CONFIG_LIBERTAS_SDIO=m
CONFIG_LIBERTAS_DEBUG=y
+CONFIG_IWLWIFI_LEDS=y
CONFIG_IWL4965=m
-CONFIG_IWL4965_DEBUG=y
+CONFIG_IWLWIFI_DEBUG=y
+CONFIG_IWLWIFI_DEBUGFS=y
CONFIG_IWL4965_SENSITIVITY=y
CONFIG_IWL4965_SPECTRUM_MEASUREMENT=y
CONFIG_IWL4965_QOS=y
CONFIG_IWL4965_HT=y
+CONFIG_IWL4965_LEDS=y
CONFIG_IWL3945=m
CONFIG_IWL3945_DEBUG=y
CONFIG_IWL3945_SPECTRUM_MEASUREMENT=y
CONFIG_IWL3945_QOS=y
+CONFIG_IWL3945_LEDS=y
CONFIG_NORTEL_HERMES=m
CONFIG_P54_COMMON=m
CONFIG_P54_USB=m
@@ -2267,7 +2274,7 @@
# CONFIG_FB_ASILIANT is not set
CONFIG_FB_CIRRUS=m
# CONFIG_FB_CYBER2000 is not set
-CONFIG_FB_CYBLA=m
+# CONFIG_FB_CYBLA is not set
# CONFIG_FB_GEODE is not set
# CONFIG_FB_HECUBA is not set
# CONFIG_FB_HGA is not set
@@ -2428,7 +2435,7 @@
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
CONFIG_SND_HDA_POWER_SAVE=y
-CONFIG_SND_HDA_POWER_SAVE_DEFAULT=5
+CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
CONFIG_SND_HDSPM=m
CONFIG_SND_HIFIER=m
CONFIG_SND_ICE1712=m
@@ -2483,7 +2490,6 @@
#
CONFIG_USB=y
CONFIG_USB_SUPPORT=y
-# CONFIG_USB_DEBUG is not set
# DEPRECATED: See bug 362221. Fix udev.
# CONFIG_USB_DEVICE_CLASS is not set
@@ -2897,7 +2903,6 @@
CONFIG_CIFS_POSIX=y
CONFIG_CIFS_WEAK_PW_HASH=y
# CONFIG_CIFS_DEBUG2 is not set
-CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_NCP_FS=m
CONFIG_NCPFS_PACKET_SIGNING=y
@@ -3029,7 +3034,7 @@
# CONFIG_DEBUG_RODATA_TEST is not set
# CONFIG_DEBUG_NX_TEST is not set
-# CONFIG_DEBUG_BOOT_PARAMS is not set
+CONFIG_DEBUG_BOOT_PARAMS=y
#
# Security options
@@ -3141,6 +3146,10 @@
CONFIG_SCHED_DEBUG=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_CGROUP_SCHED=y
+# CONFIG_CGROUP_MEM_RES_CTLR is not set
CONFIG_CPUSETS=y
CONFIG_CGROUPS=y
@@ -3354,7 +3363,7 @@
CONFIG_DMA_ENGINE=y
CONFIG_NET_DMA=y
-# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_UNUSED_SYMBOLS=y
CONFIG_UTRACE=y
CONFIG_PTRACE=y
@@ -3454,15 +3463,8 @@
# CONFIG_BLK_DEV_XIP is not set
CONFIG_MEMSTICK=m
CONFIG_MEMSTICK_DEBUG=y
-
# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
CONFIG_MSPRO_BLOCK=m
CONFIG_MEMSTICK_TIFM_MS=m
+CONFIG_MEMSTICK_JMICRON_38X=m
-CONFIG_GROUP_SCHED=y
-CONFIG_FAIR_GROUP_SCHED=y
-# CONFIG_RT_GROUP_SCHED is not set
-CONFIG_CGROUP_SCHED=y
-# CONFIG_CGROUP_MEM_RES_CTLR is not set
-
-# CONFIG_FIREWIRE_OHCI_REMOTE_DMA is not set
Index: config-nodebug
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-nodebug,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-nodebug 6 Mar 2008 13:59:25 -0000 1.3
+++ config-nodebug 1 Apr 2008 10:38:06 -0000 1.4
@@ -28,4 +28,6 @@
CONFIG_DEBUG_SG=y
-CONFIG_DEBUG_PAGEALLOC=y
+# CONFIG_DEBUG_PAGEALLOC is not set
+
+CONFIG_USB_DEBUG=y
Index: config-powerpc-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-powerpc-generic,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-powerpc-generic 6 Mar 2008 13:59:25 -0000 1.3
+++ config-powerpc-generic 1 Apr 2008 10:38:06 -0000 1.4
@@ -76,7 +76,7 @@
CONFIG_SND_AOA_SOUNDBUS_I2S=m
CONFIG_XMON=y
-CONFIG_XMON_DEFAULT=y
+# CONFIG_XMON_DEFAULT is not set
CONFIG_XMON_DISASSEMBLY=y
CONFIG_BOOTX_TEXT=y
@@ -205,7 +205,6 @@
CONFIG_AXON_RAM=m
CONFIG_OPROFILE_CELL=y
-# CONFIG_PPC_MPC52xx is not set
CONFIG_SUSPEND_FREEZER=y
# CONFIG_IDEPCI_PCIBUS_ORDER is not set
CONFIG_PATA_PLATFORM=m
Index: config-powerpc32-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-powerpc32-generic,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-powerpc32-generic 6 Mar 2008 13:59:25 -0000 1.3
+++ config-powerpc32-generic 1 Apr 2008 10:38:06 -0000 1.4
@@ -9,7 +9,14 @@
CONFIG_PPC_MULTIPLATFORM=y
CONFIG_PPC_CHRP=y
CONFIG_PPC_PMAC=y
-# CONFIG_PPC_PREP is not set
+CONFIG_PPC_MPC52xx=y
+CONFIG_PPC_PREP=y
+
+# CONFIG_PPC_MPC5200_SIMPLE is not set
+CONFIG_SATA_FSL=m
+CONFIG_GIANFAR=m
+CONFIG_GFAR_NAPI=y
+CONFIG_USB_EHCI_FSL=y
CONFIG_PMAC_APM_EMU=y
CONFIG_PMAC_BACKLIGHT=y
Index: config-powerpc64
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-powerpc64,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-powerpc64 6 Mar 2008 13:59:25 -0000 1.3
+++ config-powerpc64 1 Apr 2008 10:38:06 -0000 1.4
@@ -1,5 +1,6 @@
CONFIG_WINDFARM_PM81=y
CONFIG_WINDFARM_PM91=y
+CONFIG_WINDFARM_PM121=y
CONFIG_PPC_PMAC64=y
CONFIG_PPC_MAPLE=y
CONFIG_PPC_SYSTEMSIM=y
Index: config-sparc64-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-sparc64-generic,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-sparc64-generic 6 Mar 2008 13:59:25 -0000 1.3
+++ config-sparc64-generic 1 Apr 2008 10:38:06 -0000 1.4
@@ -1,7 +1,12 @@
CONFIG_SPARC=y
CONFIG_SPARC64=y
CONFIG_SECCOMP=y
+CONFIG_HZ_100=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
CONFIG_CPU_FREQ_DEBUG=y
@@ -18,8 +23,6 @@
CONFIG_US2E_FREQ=m
CONFIG_SUN_LDOMS=y
-# CONFIG_NO_HZ is not set
-# CONFIG_HIGH_RES_TIMERS is not set
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
# CONFIG_CRASH is not set
@@ -44,13 +47,29 @@
CONFIG_WATCHDOG_CP1XXX=m
CONFIG_WATCHDOG_RIO=m
# CONFIG_CMDLINE_BOOL is not set
-CONFIG_FB_BW2=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_PARPORT is not set
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_LIRC_PVR150 is not set
+# CONFIG_LIRC_PARALLEL is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_VOODOO3 is not set
+CONFIG_I2C_ALI1535=m
+# CONFIG_VGASTATE is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BW2 is not set
CONFIG_FB_CG3=y
CONFIG_FB_CG6=y
# CONFIG_FB_RIVA is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
CONFIG_FB_ATY=y
+# CONFIG_FB_S3 is not set
+# CONFIG_FB_SAVAGE is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_3DFX is not set
@@ -65,6 +84,13 @@
# CONFIG_FB_LEO is not set
CONFIG_FB_XVR500=y
CONFIG_FB_XVR2500=y
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_KYRO is not set
+
# CONFIG_DRM_NOUVEAU is not set
# CONFIG_MDA_CONSOLE is not set
# CONFIG_PROM_CONSOLE is not set
@@ -74,10 +100,12 @@
# CONFIG_FONT_7x14 is not set
# CONFIG_FONT_10x18 is not set
# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_SUN12x22 is not set
# CONFIG_FONT_PEARL_8x8 is not set
# CONFIG_FONT_ACORN_8x8 is not set
CONFIG_FONT_SUN8x16=y
CONFIG_FONT_SUN12x22=y
+# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_SERIAL_8250 is not set
CONFIG_SERIAL_SUNZILOG=y
CONFIG_SERIAL_SUNZILOG_CONSOLE=y
@@ -130,9 +158,9 @@
# CONFIG_INPUT_PCSPKR is not set
CONFIG_INPUT_SPARCSPKR=m
# CONFIG_SOUND_PRIME is not set
-CONFIG_SND_SUN_AMD7930=m
+# CONFIG_SND_SUN_AMD7930 is not set
CONFIG_SND_SUN_CS4231=m
-CONFIG_SND_SUN_DBRI=m
+# CONFIG_SND_SUN_DBRI is not set
CONFIG_PARPORT_SUNBPP=m
CONFIG_LOGO_SUN_CLUT224=y
CONFIG_SUN_BPP=m
@@ -143,11 +171,13 @@
# CONFIG_VIDEO_STRADIS is not set
# CONFIG_IEEE1394_SBP2 is not set
# CONFIG_USB_NET2280 is not set
-# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_DCFLUSH is not set
# CONFIG_DEBUG_BOOTMEM is not set
-# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_LOCKDEP is not set
# CONFIG_STACK_DEBUG is not set
CONFIG_SPARSEMEM_VMEMMAP=y
Index: config-x86_64-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/config-x86_64-generic,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- config-x86_64-generic 6 Mar 2008 13:59:25 -0000 1.3
+++ config-x86_64-generic 1 Apr 2008 10:38:06 -0000 1.4
@@ -152,7 +152,7 @@
CONFIG_I2C_AMD8111=m
CONFIG_I2C_I801=m
# CONFIG_I2C_I810 is not set
-# CONFIG_I2C_PIIX4 is not set
+CONFIG_I2C_PIIX4=m
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
CONFIG_I2C_SIS96X=m
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/kernel.spec,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- kernel.spec 25 Mar 2008 12:37:23 -0000 1.20
+++ kernel.spec 1 Apr 2008 10:38:06 -0000 1.21
@@ -43,9 +43,9 @@
# The next upstream release sublevel (base_sublevel+1)
%define upstream_sublevel %(expr %{base_sublevel} + 1)
# The rc snapshot level
-%define rcrev 4
+%define rcrev 7
# The git snapshot level
-%define gitrev 0
+%define gitrev 6
# Set rpm version accordingly
%define rpmversion 2.6.%{upstream_sublevel}
%endif
@@ -142,7 +142,7 @@
%define xen_target vmlinuz
%define xen_image arch/x86/boot/vmlinuz
-%define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE}
+%define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE}.%{_target_cpu}
%define hdrarch %_target_cpu
%if 0%{!?nopatches:1}
@@ -255,7 +255,7 @@
# no need to build headers again for these arches,
# they can just use i386 and ppc64 headers
-%ifarch i586 i686 ppc64iseries
+%ifarch i586 i686 ppc64iseries
%define with_headers 0
%endif
@@ -422,7 +422,7 @@
# Packages that need to be installed before the kernel is, because the %post
# scripts use them.
#
-%define kernel_prereq fileutils, module-init-tools, initscripts >= 8.11.1-1, mkinitrd >= 6.0.30-1
+%define kernel_prereq fileutils, module-init-tools, initscripts >= 8.11.1-1, mkinitrd >= 6.0.39-1
#
# This macro does requires, provides, conflicts, obsoletes for a kernel package.
@@ -432,9 +432,11 @@
#
%define kernel_reqprovconf \
Provides: kernel = %{rpmversion}-%{pkg_release}\
-Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1}\
+Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:.%{1}}\
Provides: kernel-drm = 4.3.0\
Provides: kernel-drm-nouveau = 10\
+Provides: kernel-modeset = 1\
+Provides: kernel-uname-r = %{KVERREL}%{?1:.%{1}}\
Requires(pre): %{kernel_prereq}\
Conflicts: %{kernel_dot_org_conflicts}\
Conflicts: %{package_conflicts}\
@@ -471,6 +473,9 @@
BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar
BuildRequires: bzip2, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk
BuildRequires: gcc >= 3.4.2, binutils >= 2.12, redhat-rpm-config
+%if %{with_doc}
+BuildRequires: xmlto
+%endif
%if %{with_sparse}
BuildRequires: sparse >= 0.4.1
%endif
@@ -567,40 +572,30 @@
# we always need nonintconfig, even for -vanilla kernels
Patch06: linux-2.6-build-nonintconfig.patch
+# we also need compile fixes for -vanilla
+Patch07: linux-2.6-compile-fixes.patch
+Patch08: linux-2.6-compile-fix-gcc-43.patch
+
%if !%{nopatches}
Patch10: linux-2.6-hotfixes.patch
-Patch21: linux-2.6-utrace-tracehook.patch
-Patch22: linux-2.6-utrace-tracehook-ia64.patch
-Patch23: linux-2.6-utrace-tracehook-sparc64.patch
-Patch24: linux-2.6-utrace-tracehook-s390.patch
-Patch25: linux-2.6-utrace-tracehook-um.patch
-Patch26: linux-2.6-utrace-tracehook-avr32.patch
-Patch27: linux-2.6-utrace-regset.patch
-Patch28: linux-2.6-utrace-regset-ia64.patch
-Patch29: linux-2.6-utrace-regset-sparc64.patch
-Patch30: linux-2.6-utrace-regset-s390.patch
-Patch31: linux-2.6-utrace-regset-avr32.patch
-Patch32: linux-2.6-utrace-core.patch
-Patch33: linux-2.6-utrace-ptrace-compat.patch
-Patch34: linux-2.6-utrace-ptrace-compat-ia64.patch
-Patch35: linux-2.6-utrace-ptrace-compat-sparc64.patch
-Patch36: linux-2.6-utrace-ptrace-compat-s390.patch
-Patch37: linux-2.6-utrace-ptrace-compat-avr32.patch
+Patch21: linux-2.6-utrace.patch
Patch41: linux-2.6-sysrq-c.patch
Patch42: linux-2.6-x86-tune-generic.patch
Patch75: linux-2.6-x86-debug-boot.patch
-Patch80: linux-2.6-ia32-syscall-restart.patch
-
Patch123: linux-2.6-ppc-rtc.patch
Patch140: linux-2.6-ps3-ehci-iso.patch
Patch141: linux-2.6-ps3-storage-alias.patch
Patch142: linux-2.6-ps3-legacy-bootloader-hack.patch
Patch143: linux-2.6-g5-therm-shutdown.patch
Patch144: linux-2.6-vio-modalias.patch
+Patch145: linux-2.6-windfarm-pm121.patch
+Patch146: linux-2.6-windfarm-pm121-fix.patch
+Patch147: linux-2.6-imac-transparent-bridge.patch
+Patch148: linux-2.6-powerpc-zImage-32MiB.patch
Patch160: linux-2.6-execshield.patch
Patch250: linux-2.6-debug-sizeof-structs.patch
@@ -608,41 +603,44 @@
Patch270: linux-2.6-debug-taint-vm.patch
Patch280: linux-2.6-debug-spinlock-taint.patch
Patch330: linux-2.6-debug-no-quiet.patch
+Patch340: linux-2.6-debug-vm-would-have-oomkilled.patch
Patch350: linux-2.6-devmem.patch
Patch370: linux-2.6-crash-driver.patch
Patch400: linux-2.6-scsi-cpqarray-set-master.patch
Patch402: linux-2.6-scsi-mpt-vmware-fix.patch
+Patch410: linux-2.6-alsa-kill-annoying-messages.patch
Patch420: linux-2.6-squashfs.patch
Patch430: linux-2.6-net-silence-noisy-printks.patch
Patch450: linux-2.6-input-kill-stupid-messages.patch
+Patch451: linux-2.6-input-macbook-appletouch.patch
Patch460: linux-2.6-serial-460800.patch
Patch510: linux-2.6-silence-noise.patch
Patch570: linux-2.6-selinux-mprotect-checks.patch
+Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
Patch610: linux-2.6-defaults-fat-utf8.patch
Patch660: linux-2.6-libata-ali-atapi-dma.patch
Patch670: linux-2.6-ata-quirk.patch
Patch680: linux-2.6-wireless.patch
Patch681: linux-2.6-wireless-pending.patch
-Patch682: linux-2.6-wireless-pending-too.patch
Patch690: linux-2.6-at76.patch
-Patch820: linux-2.6-compile-fixes.patch
-Patch821: linux-2.6-compile-fix-gcc-43.patch
Patch1101: linux-2.6-default-mmf_dump_elf_headers.patch
Patch1400: linux-2.6-smarter-relatime.patch
Patch1515: linux-2.6-lirc.patch
# nouveau + drm fixes
Patch1801: linux-2.6-drm-git-mm.patch
-Patch1802: linux-2.6-ppc32-ucmpdi2.patch
Patch1803: nouveau-drm.patch
-Patch1804: linux-2.6-drm-git-mm-revert-nopfn.patch
-Patch1805: linux-2.6-drm-git-i915-remove-priv-access.patch
+Patch1806: linux-2.6-drm-i915-modeset.patch
+Patch1807: linux-2.6-drm-radeon-fix-oops.patch
# kludge to make ich9 e1000 work
Patch2000: linux-2.6-e1000-ich9.patch
+# Make Eee disk faster.
+Patch2010: linux-2.6-sata-eeepc-faster.patch
+
# atl2 network driver
Patch2020: linux-2.6-netdev-atl2.patch
@@ -655,6 +653,8 @@
# make USB EHCI driver respect "nousb" parameter
Patch2300: linux-2.6-usb-ehci-hcd-respect-nousb.patch
+# Fix HID usage descriptor on MS wireless desktop receiver
+Patch2301: linux-2.6-ms-wireless-receiver.patch
# acpi hotkey driver for asus eeepc
Patch2350: linux-2.6-acpi-eeepc-hotkey.patch
@@ -664,32 +664,27 @@
Patch2501: linux-2.6-ppc-use-libgcc.patch
-Patch2503: linux-2.6-virtio_blk-fix-sysfs-bits.patch
-
-### HACK ###
-Patch2502: linux-2.6-blkcipher-depend-on-chainiv.patch
-
# kernel-xen patches start
Patch5000: linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch
Patch5001: linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch
Patch5002: linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch
-Patch5003: linux-2.6-xen-0004-xen-Make-hvc0-the-preferred-console-in-domU.patch
+Patch5003: linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch
Patch5004: linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch
-Patch5005: linux-2.6-xen-0006-fbdev-Make-deferred-I-O-work-as-advertized.patch
-Patch5006: linux-2.6-xen-0007-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
-Patch5007: linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch
-Patch5008: linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch
-Patch5009: linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
-Patch5010: linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch
-Patch5011: linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch
-Patch5012: linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch
-Patch5013: linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch
-Patch5014: linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch
-Patch5015: linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch
-Patch5016: linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
-Patch5017: linux-2.6-xen-0018-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
-Patch5018: linux-2.6-xen-0019-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
-Patch5019: linux-2.6-xen-0020-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
+Patch5005: linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
+Patch5006: linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
+Patch5007: linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
+Patch5008: linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
+Patch5009: linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
+Patch5010: linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
+Patch5011: linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
+Patch5012: linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
+Patch5013: linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
+Patch5014: linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
+Patch5015: linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
+Patch5016: linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
+Patch5017: linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
+Patch5018: linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
+
# kernel-xen patches end
# Xen hypervisor patches (20000+)
@@ -705,7 +700,7 @@
%endif
-BuildRoot: %{_tmppath}/%{mainpkgname}-%{KVERREL}-root-%{_target_cpu}
+BuildRoot: %{_tmppath}/%{mainpkgname}-%{KVERREL}-root
%description
The kernel package contains the Linux kernel (vmlinuz), the core of any
@@ -748,7 +743,7 @@
%package -n %{mainpkgname}-debuginfo-common
Summary: Kernel source files used by %{mainpkgname}-debuginfo packages
Group: Development/Debug
-Provides: %{mainpkgname}-debuginfo-common-%{_target_cpu} = %{KVERREL}
+Provides: %{mainpkgname}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
%description -n %{mainpkgname}-debuginfo-common
This package is required by %{mainpkgname}-debuginfo subpackages.
It provides the kernel source files common to all builds.
@@ -762,13 +757,13 @@
%package -n %{variantbase}-%{?1:%{1}-}debuginfo\
Summary: Debug information for package %{variantbase}%{?1:-%{1}}\
Group: Development/Debug\
-Requires: %{mainpkgname}-debuginfo-common-%{_target_cpu} = %{KVERREL}\
-Provides: %{variantbase}%{?1:-%{1}}-debuginfo-%{_target_cpu} = %{KVERREL}\
+Requires: %{variantbase}-debuginfo-common-%{_target_cpu} = %{version}-%{release}\
+Provides: %{variantbase}%{?1:-%{1}}-debuginfo-%{_target_cpu} = %{version}-%{release}\
AutoReqProv: no\
%description -n %{variantbase}%{?1:-%{1}}-debuginfo\
This package provides debug information for package %{variantbase}%{?1:-%{1}}.\
This is required to use SystemTap with %{variantbase}%{?1:-%{1}}-%{KVERREL}.\
-%{expand:%%global debuginfo_args %{?debuginfo_args} -p '/.*/%%{KVERREL}%{?1:-?%{1}}(-%%{_target_cpu})?/.*|/.*%%{KVERREL}%{?1}(\.debug)?' -o debuginfo%{?1}.list}\
+%{expand:%%global debuginfo_args %{?debuginfo_args} -p '/.*/%%{KVERREL}%{?1:\.%{1}}/.*|/.*%%{KVERREL}%{?1:\.%{1}}(\.debug)?' -o debuginfo%{?1}.list}\
%{nil}
#
@@ -779,9 +774,10 @@
%package -n %{variantbase}-%{?1:%{1}-}devel\
Summary: Development package for building kernel modules to match the %{?2:%{2} }kernel\
Group: System Environment/Kernel\
-Provides: kernel%{?1:-%{1}}-devel-%{_target_cpu} = %{rpmversion}-%{release}\
-Provides: kernel-devel-%{_target_cpu} = %{rpmversion}-%{release}%{?1}\
-Provides: kernel-devel = %{rpmversion}-%{release}%{?1}\
+Provides: kernel%{?1:-%{1}}-devel-%{_target_cpu} = %{version}-%{release}\
+Provides: kernel-devel-%{_target_cpu} = %{version}-%{release}%{?1:.%{1}}\
+Provides: kernel-devel = %{version}-%{release}%{?1:.%{1}}\
+Provides: kernel-devel-uname-r = %{KVERREL}%{?1:.%{1}}\
AutoReqProv: no\
Requires(pre): /usr/bin/find\
%description -n %{variantbase}%{?1:-%{1}}-devel\
@@ -1039,35 +1035,23 @@
# builds (as used in the buildsystem).
ApplyPatch linux-2.6-build-nonintconfig.patch
+#
+# misc small stuff to make things compile
+#
+C=$(wc -l $RPM_SOURCE_DIR/linux-2.6-compile-fixes.patch | awk '{print $1}')
+if [ "$C" -gt 10 ]; then
+ApplyPatch linux-2.6-compile-fixes.patch
+fi
+
+# build with gcc43
+ApplyPatch linux-2.6-compile-fix-gcc-43.patch
+
%if !%{nopatches}
ApplyPatch linux-2.6-hotfixes.patch
# Roland's utrace ptrace replacement.
-# Main patch includes i386, x86_64, powerpc.
-#ApplyPatch linux-2.6-utrace-tracehook.patch
-# Additional arch work by other contributors.
-#ApplyPatch linux-2.6-utrace-tracehook-ia64.patch
-#ApplyPatch linux-2.6-utrace-tracehook-sparc64.patch
-#ApplyPatch linux-2.6-utrace-tracehook-s390.patch
-#ApplyPatch linux-2.6-utrace-tracehook-um.patch
-#ApplyPatch linux-2.6-utrace-tracehook-avr32.patch
-# Main patch includes i386, x86_64, powerpc.
-#ApplyPatch linux-2.6-utrace-regset.patch
-# Additional arch work by other contributors.
-#ApplyPatch linux-2.6-utrace-regset-ia64.patch
-#ApplyPatch linux-2.6-utrace-regset-sparc64.patch
-#ApplyPatch linux-2.6-utrace-regset-s390.patch
-#ApplyPatch linux-2.6-utrace-regset-avr32.patch
-# Core patch has no machine dependencies.
-#ApplyPatch linux-2.6-utrace-core.patch
-# Main patch includes i386, x86_64, powerpc.
-#ApplyPatch linux-2.6-utrace-ptrace-compat.patch
-# Additional arch work by other contributors.
-#ApplyPatch linux-2.6-utrace-ptrace-compat-ia64.patch
-#ApplyPatch linux-2.6-utrace-ptrace-compat-sparc64.patch
-#ApplyPatch linux-2.6-utrace-ptrace-compat-s390.patch
-#ApplyPatch linux-2.6-utrace-ptrace-compat-avr32.patch
+ApplyPatch linux-2.6-utrace.patch
# enable sysrq-c on all kernels, not only kexec
ApplyPatch linux-2.6-sysrq-c.patch
@@ -1077,8 +1061,6 @@
# Compile 686 kernels tuned for Pentium4.
ApplyPatch linux-2.6-x86-tune-generic.patch
-ApplyPatch linux-2.6-ia32-syscall-restart.patch
-
#
# PowerPC
#
@@ -1088,6 +1070,8 @@
### NOT (YET) UPSTREAM:
# The EHCI ISO patch isn't yet upstream but is needed to fix reboot
ApplyPatch linux-2.6-ps3-ehci-iso.patch
+# Fixes some wireless optical mice
+ApplyPatch linux-2.6-ms-wireless-receiver.patch
# The storage alias patch is Fedora-local, and allows the old 'ps3_storage'
# module name to work on upgrades. Otherwise, I believe mkinitrd will fail
# to pull the module in,
@@ -1098,6 +1082,13 @@
ApplyPatch linux-2.6-g5-therm-shutdown.patch
# Provide modalias in sysfs for vio devices
ApplyPatch linux-2.6-vio-modalias.patch
+# Fan support on iMac G5 iSight
+ApplyPatch linux-2.6-windfarm-pm121.patch
+ApplyPatch linux-2.6-windfarm-pm121-fix.patch
+# Work around PCIe bridge setup on iSight
+ApplyPatch linux-2.6-imac-transparent-bridge.patch
+# Link zImage at 32MiB (for POWER machines, Efika)
+ApplyPatch linux-2.6-powerpc-zImage-32MiB.patch
#
# Exec shield
@@ -1123,6 +1114,7 @@
%if !%{debugbuildsenabled}
ApplyPatch linux-2.6-debug-no-quiet.patch
%endif
+ApplyPatch linux-2.6-debug-vm-would-have-oomkilled.patch
#
# Make /dev/mem a need-to-know function
@@ -1144,6 +1136,7 @@
# ALSA
#
+ApplyPatch linux-2.6-alsa-kill-annoying-messages.patch
# Filesystem patches.
# Squashfs
@@ -1156,6 +1149,8 @@
# Misc fixes
# The input layer spews crap no-one cares about.
ApplyPatch linux-2.6-input-kill-stupid-messages.patch
+ApplyPatch linux-2.6-input-macbook-appletouch.patch
+
# Allow to use 480600 baud on 16C950 UARTs
ApplyPatch linux-2.6-serial-460800.patch
# Silence some useless messages that still get printed with 'quiet'
@@ -1163,6 +1158,8 @@
# Fix the SELinux mprotect checks on executable mappings
ApplyPatch linux-2.6-selinux-mprotect-checks.patch
+# Fix SELinux for sparc
+ApplyPatch linux-2.6-sparc-selinux-mprotect-checks.patch
# Changes to upstream defaults.
# Use UTF-8 by default on VFAT.
@@ -1174,11 +1171,9 @@
ApplyPatch linux-2.6-ata-quirk.patch
# wireless patches headed for 2.6.25
-#ApplyPatch linux-2.6-wireless.patch
+ApplyPatch linux-2.6-wireless.patch
# wireless patches headed for 2.6.26
ApplyPatch linux-2.6-wireless-pending.patch
-# temporary backport of some later wireless patches
-ApplyPatch linux-2.6-wireless-pending-too.patch
# Add misc wireless bits from upstream wireless tree
ApplyPatch linux-2.6-at76.patch
@@ -1186,18 +1181,6 @@
# implement smarter atime updates support.
ApplyPatch linux-2.6-smarter-relatime.patch
-#
-# misc small stuff to make things compile
-#
-
-C=$(wc -l $RPM_SOURCE_DIR/linux-2.6-compile-fixes.patch | awk '{print $1}')
-if [ "$C" -gt 10 ]; then
-ApplyPatch linux-2.6-compile-fixes.patch
-fi
-
-# build with gcc43
-ApplyPatch linux-2.6-compile-fix-gcc-43.patch
-
# build id related enhancements
ApplyPatch linux-2.6-default-mmf_dump_elf_headers.patch
@@ -1205,14 +1188,16 @@
ApplyPatch linux-2.6-lirc.patch
ApplyPatch linux-2.6-e1000-ich9.patch
+
+ApplyPatch linux-2.6-sata-eeepc-faster.patch
+
ApplyPatch linux-2.6-netdev-atl2.patch
# Nouveau DRM + drm fixes
ApplyPatch linux-2.6-drm-git-mm.patch
-ApplyPatch linux-2.6-ppc32-ucmpdi2.patch
ApplyPatch nouveau-drm.patch
-ApplyPatch linux-2.6-drm-git-mm-revert-nopfn.patch
-ApplyPatch linux-2.6-drm-git-i915-remove-priv-access.patch
+ApplyPatch linux-2.6-drm-i915-modeset.patch
+ApplyPatch linux-2.6-drm-radeon-fix-oops.patch
# ext4dev stable patch queue, slated for 2.6.25
#ApplyPatch linux-2.6-ext4-stable-queue.patch
@@ -1229,34 +1214,29 @@
ApplyPatch linux-2.6-ppc-use-libgcc.patch
-ApplyPatch linux-2.6-virtio_blk-fix-sysfs-bits.patch
-
-ApplyPatch linux-2.6-blkcipher-depend-on-chainiv.patch
-
# ---------- below all scheduled for 2.6.24 -----------------
# kernel-xen apply start
ApplyPatch linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch
ApplyPatch linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch
ApplyPatch linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch
-ApplyPatch linux-2.6-xen-0004-xen-Make-hvc0-the-preferred-console-in-domU.patch
+ApplyPatch linux-2.6-xen-0004-xen-Do-not-pin-unpin-PMD-pages.patch
ApplyPatch linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch
-ApplyPatch linux-2.6-xen-0006-fbdev-Make-deferred-I-O-work-as-advertized.patch
-ApplyPatch linux-2.6-xen-0007-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
-ApplyPatch linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch
-ApplyPatch linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch
-ApplyPatch linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
-ApplyPatch linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch
-ApplyPatch linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch
-ApplyPatch linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch
-ApplyPatch linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch
-ApplyPatch linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch
-ApplyPatch linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch
-ApplyPatch linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
+ApplyPatch linux-2.6-xen-0006-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch
+ApplyPatch linux-2.6-xen-0007-xen-Module-autoprobing-support-for-frontend-drivers.patch
+ApplyPatch linux-2.6-xen-0008-xen-Add-compatibility-aliases-for-frontend-drivers.patch
+ApplyPatch linux-2.6-xen-0009-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch
+ApplyPatch linux-2.6-xen-0010-xen-Add-a-vmlinuz-target.patch
+ApplyPatch linux-2.6-xen-0011-xen-Add-empty-xenctrl-module.patch
+ApplyPatch linux-2.6-xen-0012-xen-Add-proc-xen-capabilities.patch
+ApplyPatch linux-2.6-xen-0013-xen-Add-proc-xen-privcmd.patch
+ApplyPatch linux-2.6-xen-0014-xen-Add-proc-xen-xenbus.patch
+ApplyPatch linux-2.6-xen-0015-xen-Add-Xen-s-sys-hypervisor-interface.patch
+ApplyPatch linux-2.6-xen-0016-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch
+ApplyPatch linux-2.6-xen-0017-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
+ApplyPatch linux-2.6-xen-0018-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
%ifarch x86_64
-ApplyPatch linux-2.6-xen-0018-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
-ApplyPatch linux-2.6-xen-0019-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch
-ApplyPatch linux-2.6-xen-0020-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch
+ApplyPatch linux-2.6-xen-0019-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch
%endif
# kernel-xen apply end
@@ -1295,7 +1275,7 @@
echo "# $Arch" > configs/$i
cat .config >> configs/$i
done
-# end of kernel config
+# end of kernel config
%endif
# get rid of unwanted files resulting from patch fuzz
@@ -1352,15 +1332,8 @@
InstallName=${4:-vmlinuz}
# Pick the right config file for the kernel we're building
- if [ -n "$Flavour" ] ; then
- Config=kernel-%{version}-%{_target_cpu}-$Flavour.config
- DevelDir=/usr/src/kernels/%{KVERREL}-$Flavour-%{_target_cpu}
- DevelLink=/usr/src/kernels/%{KVERREL}$Flavour-%{_target_cpu}
- else
- Config=kernel-%{version}-%{_target_cpu}.config
- DevelDir=/usr/src/kernels/%{KVERREL}-%{_target_cpu}
- DevelLink=
- fi
+ Config=kernel-%{version}-%{_target_cpu}${Flavour:+-${Flavour}}.config
+ DevelDir=/usr/src/kernels/%{KVERREL}${Flavour:+.${Flavour}}
# When the bootable image is just the ELF kernel, strip it.
# We already copy the unstripped file into the debuginfo package.
@@ -1370,11 +1343,11 @@
CopyKernel=cp
fi
- KernelVer=%{version}-%{release}$Flavour
- echo BUILDING A KERNEL FOR $Flavour %{_target_cpu}...
+ KernelVer=%{version}-%{release}.%{_target_cpu}${Flavour:+.${Flavour}}
+ echo BUILDING A KERNEL FOR ${Flavour} %{_target_cpu}...
# make sure EXTRAVERSION says what we want it to say
- perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{?stablerev}-%{release}$Flavour/" Makefile
+ perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{?stablerev}-%{release}.%{_target_cpu}${Flavour:+.${Flavour}}/" Makefile
# if pre-rc1 devel kernel, must fix up SUBLEVEL for our versioning scheme
%if !0%{?rcrev}
@@ -1532,7 +1505,6 @@
mkdir -p $RPM_BUILD_ROOT/usr/src/kernels
mv $RPM_BUILD_ROOT/lib/modules/$KernelVer/build $RPM_BUILD_ROOT/$DevelDir
ln -sf ../../..$DevelDir $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
- [ -z "$DevelLink" ] || ln -sf `basename $DevelDir` $RPM_BUILD_ROOT/$DevelLink
}
###
@@ -1637,6 +1609,11 @@
chmod -R a+r *
# copy the source over
tar cf - Documentation | tar xf - -C $RPM_BUILD_ROOT/usr/share/doc/kernel-doc-%{kversion}
+
+# Make man pages for the kernel API.
+make mandocs
+mkdir -p $RPM_BUILD_ROOT/usr/share/man/man9
+mv Documentation/DocBook/man/*.9.gz $RPM_BUILD_ROOT/usr/share/man/man9
%endif
%if %{with_headers}
@@ -1691,13 +1668,22 @@
fi\
if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ]\
then\
- (cd /usr/src/kernels/%{KVERREL}-%{?1:%{1}-}%{_target_cpu} &&\
+ (cd /usr/src/kernels/%{KVERREL}%{?1:.%{1}} &&\
/usr/bin/find . -type f | while read f; do\
- hardlink -c /usr/src/kernels/*.fc*-*/$f $f\
+ hardlink -c /usr/src/kernels/*.fc*.*/$f $f\
done)\
fi\
%{nil}
+# This macro defines a %%posttrans script for a kernel package.
+# %%kernel_variant_posttrans [-v <subpackage>] [-s <s> -r <r>] <mkinitrd-args>
+# More text can follow to go at the end of this variant's %%post.
+#
+%define kernel_variant_posttrans(s:r:v:) \
+%{expand:%%posttrans %{?-v*}}\
+/sbin/new-kernel-pkg --package kernel%{?-v:-%{-v*}} --rpmposttrans %{KVERREL}%{?-v:.%{-v*}} || exit $?\
+%{nil}
+
#
# This macro defines a %%post script for a kernel package and its devel package.
# %%kernel_variant_post [-v <subpackage>] [-s <s> -r <r>] <mkinitrd-args>
@@ -1705,13 +1691,14 @@
#
%define kernel_variant_post(s:r:v:) \
%{expand:%%kernel_devel_post %{?-v*}}\
-%{expand:%%post -n %{variantbase}%{?-v:-%{-v*}}}\
+%{expand:%%kernel_variant_posttrans -n %{variantbase}%{?-v*}}\
+%{expand:%%post -n %{variantbase}%{?-v*}}\
%{-s:\
if [ `uname -i` == "x86_64" -o `uname -i` == "i386" ] &&\
[ -f /etc/sysconfig/kernel ]; then\
/bin/sed -i -e 's/^DEFAULTKERNEL=%{-s*}$/DEFAULTKERNEL=%{-r*}/' /etc/sysconfig/kernel || exit $?\
fi}\
-/sbin/new-kernel-pkg --package kernel%{?-v:-%{-v*}} --mkinitrd --depmod --install %{*} %{KVERREL}%{?-v*} || exit $?\
+/sbin/new-kernel-pkg --package kernel%{?-v:-%{-v*}} --mkinitrd --depmod --install %{*} %{KVERREL}%{?-v:.%{-v*}} || exit $?\
#if [ -x /sbin/weak-modules ]\
#then\
# /sbin/weak-modules --add-kernel %{KVERREL}%{?-v*} || exit $?\
@@ -1789,6 +1776,7 @@
%{_datadir}/doc/kernel-doc-%{kversion}/Documentation/*
%dir %{_datadir}/doc/kernel-doc-%{kversion}/Documentation
%dir %{_datadir}/doc/kernel-doc-%{kversion}
+%{_datadir}/man/man9/*
%endif
# This is %{image_install_path} on an arch where that includes ELF files,
@@ -1804,30 +1792,30 @@
%if %{1}\
%{expand:%%files -n %{variantbase}%{?2:-%{2}}}\
%defattr(-,root,root)\
-/%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2}\
-/boot/System.map-%{KVERREL}%{?2}\
-#/boot/symvers-%{KVERREL}%{?2}.gz\
-/boot/config-%{KVERREL}%{?2}\
+/%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\
+/boot/System.map-%{KVERREL}%{?2:.%{2}}\
+#/boot/symvers-%{KVERREL}%{?2:.%{2}}.gz\
+/boot/config-%{KVERREL}%{?2:.%{2}}\
%{?-a:%{-a*}}\
-%dir /lib/modules/%{KVERREL}%{?2}\
-/lib/modules/%{KVERREL}%{?2}/kernel\
-/lib/modules/%{KVERREL}%{?2}/build\
-/lib/modules/%{KVERREL}%{?2}/source\
-/lib/modules/%{KVERREL}%{?2}/extra\
-/lib/modules/%{KVERREL}%{?2}/updates\
-/lib/modules/%{KVERREL}%{?2}/weak-updates\
+%dir /lib/modules/%{KVERREL}%{?2:.%{2}}\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/kernel\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/build\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/source\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/extra\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/updates\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/weak-updates\
%ifarch %{vdso_arches}\
-/lib/modules/%{KVERREL}%{?2}/vdso\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/vdso\
%endif\
-/lib/modules/%{KVERREL}%{?2}/modules.block\
-/lib/modules/%{KVERREL}%{?2}/modules.networking\
-/lib/modules/%{KVERREL}%{?2}/modules.order\
-%ghost /boot/initrd-%{KVERREL}%{?2}.img\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/modules.block\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/modules.networking\
+/lib/modules/%{KVERREL}%{?2:.%{2}}/modules.order\
+%ghost /boot/initrd-%{KVERREL}%{?2:.%{2}}.img\
%{?-e:%{-e*}}\
%{expand:%%files -n %{variantbase}-%{?2:%{2}-}devel}\
%defattr(-,root,root)\
-%verify(not mtime) /usr/src/kernels/%{KVERREL}%{?2:-%{2}}-%{_target_cpu}\
-/usr/src/kernels/%{KVERREL}%{?2}-%{_target_cpu}\
+%verify(not mtime) /usr/src/kernels/%{KVERREL}%{?2:.%{2}}\
+/usr/src/kernels/%{KVERREL}%{?2:.%{2}}\
%if %{with_debuginfo}\
%ifnarch noarch\
%if %{fancy_debuginfo}\
@@ -1838,10 +1826,10 @@
%defattr(-,root,root)\
%if !%{fancy_debuginfo}\
%if "%{elf_image_install_path}" != ""\
-%{debuginfodir}/%{elf_image_install_path}/*-%{KVERREL}%{?2}.debug\
+%{debuginfodir}/%{elf_image_install_path}/*-%{KVERREL}%{?2:.%{2}}.debug\
%endif\
-%{debuginfodir}/lib/modules/%{KVERREL}%{?2}\
-%{debuginfodir}/usr/src/kernels/%{KVERREL}%{?2:-%{2}}-%{_target_cpu}\
+%{debuginfodir}/lib/modules/%{KVERREL}%{?2:.%{2}}\
+%{debuginfodir}/usr/src/kernels/%{KVERREL}%{?2:.%{2}}\
%endif\
%endif\
%endif\
@@ -1858,6 +1846,11 @@
%kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}xen.conf %{with_xen} xen
%changelog
+* Tue Apr 1 2008 Mark McLoughlin <markmc at redhat.com>
+- Update to kernel-2_6_25-0_182_rc7_git6_fc9
+- Fix oops when dlclose()ing some prelink libs (#436453)
+- Drop the patch to make hvc0 the preferred console (#437706, #434761)
+
* Tue Mar 25 2008 Mark McLoughlin <markmc at redhat.com>
- Re-enable execshield (bug #434759)
linux-2.6-compile-fix-gcc-43.patch:
Index: linux-2.6-compile-fix-gcc-43.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-compile-fix-gcc-43.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-compile-fix-gcc-43.patch 6 Mar 2008 13:59:25 -0000 1.2
+++ linux-2.6-compile-fix-gcc-43.patch 1 Apr 2008 10:38:06 -0000 1.3
@@ -1,14 +1,3 @@
---- linux-2.6.24.noarch.orig/include/linux/time.h
-+++ linux-2.6.24.noarch/include/linux/time.h
-@@ -169,7 +169,7 @@ extern struct timeval ns_to_timeval(cons
- * @a: pointer to timespec to be incremented
- * @ns: unsigned nanoseconds value to be added
- */
--static inline void timespec_add_ns(struct timespec *a, u64 ns)
-+static inline void timespec_add_ns(struct timespec *a, volatile u64 ns)
- {
- ns += a->tv_nsec;
- while(unlikely(ns >= NSEC_PER_SEC)) {
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -30,6 +30,15 @@
linux-2.6-drm-git-mm.patch:
Index: linux-2.6-drm-git-mm.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-drm-git-mm.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-drm-git-mm.patch 6 Mar 2008 13:59:25 -0000 1.2
+++ linux-2.6-drm-git-mm.patch 1 Apr 2008 10:38:06 -0000 1.3
@@ -1,4 +1,4 @@
-commit 9ad1ccf9cff8aa911d965c94b83187b50c459d43
+commit 60abdfdecf0163fb3da7dc152c7d22179029badd
Author: Xiang, Haihao <haihao.xiang at intel.com>
Date: Fri Feb 29 12:07:01 2008 +1000
@@ -6,7 +6,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit aa0e20c041614319ff66a40c5f70a9f7eae01fbc
+commit f6f86ba80ca643b826a48d0a811e5dd644c7349e
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Fri Feb 29 12:05:48 2008 +1000
@@ -20,7 +20,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 9c005b094ecada32e04e0b9ebdcfe3ab47fe86b7
+commit f50888eab3d965aedbd27ec512a40db465e8b4d9
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Fri Feb 29 11:53:45 2008 +1000
@@ -30,7 +30,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 35c64f7d95512505400849241605d26b9a9801b4
+commit 64c84bc78cf57bf5b028cda9d9dc09431aabff4b
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Fri Feb 29 11:49:39 2008 +1000
@@ -41,7 +41,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit ae0806d80764d8ae63e74a5d7e3921a532d61d14
+commit 9ad34ad2452af7780ddad11c1157cd24ef42f471
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Fri Feb 29 11:41:36 2008 +1000
@@ -53,7 +53,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit e3d3d4c7421a2277be24254524f56e17419c1449
+commit 2f620305d4f7b28e9403d34caecafc639bea69ed
Author: Kristian Høgsberg <krh at redhat.com>
Date: Fri Feb 29 11:38:20 2008 +1000
@@ -63,7 +63,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit e1a98c2e5dd333becd47e188cf66093e1a86f41b
+commit b45d673ed96c158d37bb476dd0f92246427b1541
Author: Kristian Høgsberg <krh at redhat.com>
Date: Fri Feb 29 11:35:21 2008 +1000
@@ -71,7 +71,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 70a1de5ac59b59cb8f7c1d08ce455374785bca05
+commit 0d543148472264c8ad2ccbd145f953c3412a7396
Author: Kristian Høgsberg <krh at redhat.com>
Date: Fri Feb 29 11:31:08 2008 +1000
@@ -79,7 +79,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 047243f9c142c599d1ab82991a5a0a8dd0170bb8
+commit f7890c94ebabe07b3f7365526045c741dc4d3d8b
Author: Kristian Høgsberg <krh at redhat.com>
Date: Fri Feb 29 11:30:26 2008 +1000
@@ -87,7 +87,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit b57dde526e116f14a5697b5c0d9697493baa2d5d
+commit 28cd0c8c93179e272d76f327efffcf719ef85846
Author: Kristian Høgsberg <krh at redhat.com>
Date: Fri Feb 29 11:29:42 2008 +1000
@@ -95,7 +95,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 3cb77dd7f3974fc64de6ec3859c970b9b9ddd1fc
+commit f68e6c81fe11cf44a7b5db1ae7b3bc854f6d2e3e
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Fri Feb 29 11:27:30 2008 +1000
@@ -106,7 +106,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 0f066ed26802ff65965f7b29346cec98921c2b29
+commit 3fdbfb6b0a7c3f839424e768cd3bf137d8993bf6
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Fri Feb 29 11:02:23 2008 +1000
@@ -114,7 +114,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit e927ccfe2905d680b4217fc6af17c9c1ff86ebef
+commit 3ffa46ff70b9e3128e4f297f05a0b48e8656588c
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Fri Feb 29 10:57:18 2008 +1000
@@ -124,7 +124,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit ae0bdbd7e1d02e978323640256125f8a5391510a
+commit d049bd7aa94ab159227d214b17da9aa6f5114b7e
Author: Nick Piggin <npiggin at suse.de>
Date: Thu Feb 7 16:29:15 2008 +1000
@@ -136,7 +136,7 @@
Signed-off-by: Nick Piggin <npiggin at suse.de>
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 29403da6adea71d155a4c3ad0923cd7c86f0bf9e
+commit f35f0fbc2dd85a4c0865ef0dcb6724c7b863a94c
Author: Dave Airlie <airlied at redhat.com>
Date: Thu Feb 7 16:21:57 2008 +1000
@@ -144,7 +144,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit b691c8da4038e0e01fb3beaa06bf21468c8dd0f0
+commit adb114cd5ebd47beb4b6108e51c266a6aa118840
Author: Dave Airlie <airlied at redhat.com>
Date: Fri Jan 25 11:36:39 2008 +1000
@@ -156,7 +156,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 222a41948d2a1f454c7f978f3c3f18dc25061216
+commit 472d4dc9ecc22480dcd99e96d77e47fec0e99f1c
Author: Dave Airlie <airlied at redhat.com>
Date: Fri Jan 25 11:05:59 2008 +1000
@@ -164,7 +164,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 046fd35ec86a5744b6a1073e47fd7fea1ab0c553
+commit de12324c869d2d5d6918c5e5c5752ded2e188492
Author: Kyle McMartin <kyle at mcmartin.ca>
Date: Thu Jan 24 16:48:24 2008 +1000
@@ -178,7 +178,7 @@
Signed-off-by: Kyle McMartin <kmcmartin at redhat.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 9f32218d9b003af5206d9e0c280a2bcff19ee125
+commit 88bf3e11fdde2d8b7deeb80e088a32aed697e9a8
Author: Eric Anholt <eric at anholt.net>
Date: Thu Jan 24 16:47:28 2008 +1000
@@ -186,7 +186,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 9149865182a2edf9e62ad290bbe93521f1c00372
+commit e880b462be59edb1b66dbfe783faffc4872cfe75
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Thu Jan 24 16:44:25 2008 +1000
@@ -197,7 +197,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit f930fcb409db57172f7743d80cea9c6eb5bedfc4
+commit 4b432f39f3f0ad3015637b194aa7e09c82f7e2e6
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:42:46 2008 +1000
@@ -214,7 +214,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit ba1f054949cf2e71e80031fcbf8676db6d118b63
+commit 9c2cbb2b75df47338337549a39feddfb8dcbc2e5
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:41:36 2008 +1000
@@ -230,7 +230,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit f386dcbb2d8d6b2410ebfe733d82c615c41c2a25
+commit 84908108167c7f32a3dd9f456412acf9d03e8a2d
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:40:25 2008 +1000
@@ -246,7 +246,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 6e14fdc7ddb806e64e65ced441e925cd64603bd5
+commit d44fc71ba887c9b1b6d11328c2afea9bae92795c
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:39:42 2008 +1000
@@ -259,7 +259,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 7733096f48ad73ddb566b858d879fe0c49e48732
+commit fef882379805e96c5396f0d82be8b8ab6e4b2f31
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:36:31 2008 +1000
@@ -271,7 +271,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit f953d51ccca1d8ce00eec8dbcac86491f23805bb
+commit cb08438f1177f93133df1d5da15afe1a0823f727
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:35:31 2008 +1000
@@ -281,7 +281,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit ca6d9673159712446a996c5810656fcb50a9cde4
+commit 9bd633fbcb38301c7e29d20cbedb6f92010422e3
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:34:54 2008 +1000
@@ -291,7 +291,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 94626068d3d5f8df61e1df79abfabd828041ca80
+commit f754d61e9cb5c9281414b40e8f73b955d0e3f598
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:34:16 2008 +1000
@@ -303,7 +303,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 3f8b8605ad27546b80b4a55d5451f7cd3726df01
+commit b43f3a2f2ac075dbfc7ef05634253d9c9a532285
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:33:23 2008 +1000
@@ -316,7 +316,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit d2a2f35ac08ab9945c3bce188ccb37e528958524
+commit 22f59a4634d6ad29c496a6e27292a617911fa8a9
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:32:43 2008 +1000
@@ -328,7 +328,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 239158065c661384bae3c4488f569006515276c7
+commit 15203a8ea1398b694d4e9e91ac8d30e2779c06a2
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:31:45 2008 +1000
@@ -342,7 +342,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 82ce6ced892adc8d990703edc30921bc9bbb6622
+commit 712419b3f4af8beee699ac1292987da17a9b9638
Author: Alan Hourihane <alanh at tungstengraphics.com>
Date: Thu Jan 24 16:29:48 2008 +1000
@@ -350,7 +350,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 9bf3dda2f4f6ca700fa255d4c4bdc2177f3f4ad4
+commit ccfeb3b197432f6a2be58a3c954ee6cd5ecb955f
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:28:38 2008 +1000
@@ -358,7 +358,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 34b894463c7b2020acf44515beda22af01deff0a
+commit 6050439d75dd8f52a4a9f42303a9c2ca04706732
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:26:40 2008 +1000
@@ -369,7 +369,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 64a5aa5d78c355b64da51eb34e66190b23323441
+commit 993e85860b508c84d70731de0c92d90e50bf9ad0
Author: Keith Packard <keithp at keithp.com>
Date: Thu Jan 24 16:25:57 2008 +1000
@@ -405,7 +405,7 @@
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 5144432916c0f1babe5da083dd97e1e039371c15
+commit 3ee5bdaa04fc5659b9d4acf4347f635e90705e1a
Author: Márton Németh <nm127 at freemail.hu>
Date: Thu Jan 24 15:58:57 2008 +1000
@@ -419,7 +419,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 6bdb74a590379e0b13863412acbce728ae231b74
+commit ce234d84fc7763c290649df183ec2fc116896881
Author: Zou Nan hai <nanhai.zou at intel.com>
Date: Wed Jan 23 15:54:04 2008 +1000
@@ -429,7 +429,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 066a9afac5b7a15dc0301e63be2846ee0be69b2d
+commit 26a23b582644d942dbac23cd60e4df29cf503800
Author: Jiri Slaby <jirislaby at gmail.com>
Date: Thu Nov 29 09:57:16 2007 +1000
@@ -443,7 +443,7 @@
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 8a3a6cc3d4e868756749899a0d7362ec96304c1a
+commit 46e99b6890f2098f536523ee14465f2887ea502b
Author: Dave Airlie <airlied at linux.ie>
Date: Thu Nov 22 18:57:08 2007 +1000
@@ -453,13 +453,13 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 48db3c1e351529afd10a9aa7497dd3e06b9b23a6
+commit 6a94f6c5d6b0746f809d6dd088f9c8176529e36b
Author: Dave Airlie <airlied at linux.ie>
Date: Thu Nov 22 18:53:36 2007 +1000
drm/i915: add some missing pieces of ttm superioctl
-commit 29161ed6a3f019e27bc86ccb196549fe41a4f084
+commit a5ae627994b782afcae2917c5f2a4b44b0ff0725
Author: Michel Dänzer <michel at tungstengraphics.com>
Date: Thu Nov 22 14:49:12 2007 +1000
@@ -480,7 +480,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit c5dccf2bc096f85f29beb9e0790d21666327abac
+commit 09e15fcf1d2cb0af9f096155a2d5c1b5313883b1
Author: Zou Nan hai <nanhai.zou at intel.com>
Date: Thu Nov 22 14:28:52 2007 +1000
@@ -491,7 +491,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 50d29afe5aeda1041d01e7072ba818cd92204b71
+commit 89b968bb31affaa1397c40bfc2de3aa7ab4c07eb
Author: Thomas Hellstrom <thomas -at- tungstengraphics.com>
Date: Thu Nov 22 13:30:34 2007 +1000
@@ -503,7 +503,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 6f97bf6cd57b9c2de0385febd174713ce0362456
+commit 830f778956475a51d4c15d817214b7907be0297a
Author: Jerome Glisse <glisse at freedesktop.org>
Date: Thu Nov 22 13:18:53 2007 +1000
@@ -514,7 +514,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit dd53ed406397c08dae0fc7e4c5c8e50fa9c4b1c6
+commit ba371808980b8f88871bf135274ade602456a5e2
Author: Dave Airlie <airlied at linux.ie>
Date: Mon Nov 5 16:59:20 2007 +1000
@@ -522,7 +522,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 38a6b4fc63e21563f1aa1af752db38f6306060f0
+commit c0da9794080ce8e4f58031dd43c15d4d5b4d75e7
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Mon Nov 5 16:53:59 2007 +1000
@@ -533,7 +533,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 701dc84a06bd0859845c78dae1ed9cbff2d45909
+commit bca8bcf0153c1f088919f36639be2da8c873a707
Author: Dave Airlie <airlied at linux.ie>
Date: Mon Nov 5 16:39:19 2007 +1000
@@ -544,7 +544,7 @@
Signed-off-by: Thomas Hellstrom <thomas -at- tungstengraphics.com>
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit c5357c3d267db8705c2388f1dcd97e0a93dba4b7
+commit 2fcd80bd79a4ff34881ad88683d86678c392eed8
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Mon Nov 5 14:54:31 2007 +1000
@@ -559,7 +559,7 @@
Signed-off-by: Thomas Hellstrom <thomas -at- tungstengraphics.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>
-commit 7ff17c73a623935b0f834a299fc11185fe565942
+commit 90731086d29563c602a5d6580546c815810aacd8
Author: Dave Airlie <airlied at linux.ie>
Date: Mon Nov 5 14:13:19 2007 +1000
@@ -576,7 +576,7 @@
Signed-off-by: Thomas Hellstrom <thomas -at- tunsgtengraphics.com>
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit b60bff9208be6f1ca9c37c5e674bed298fb4a281
+commit dc95859b8d3636ec002786bc6676ed2ffe999bb8
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Mon Nov 5 13:51:07 2007 +1000
@@ -587,7 +587,7 @@
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit 53c0684d7dd7e83a00bbd398a33d9f3b8bb6a9a5
+commit 774c9d3f7dfb0f5db1f82d96dce3efbe6d73bc57
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Mon Nov 5 13:45:22 2007 +1000
@@ -600,7 +600,7 @@
Signed-off-by: Thomas Hellstrom <thomas -at- tungstengraphics.com>
Signed-off-by: Dave Airlie <airlied at linux.ie>
-commit ab3c9c6e912324697a67c849abbba8942c460fb0
+commit 7d6bff6369efece0f637dfc905f901e924927067
Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
Date: Mon Nov 5 13:21:19 2007 +1000
@@ -643,21 +643,18 @@
sis-objs := sis_drv.o sis_mm.o
savage-objs := savage_drv.o savage_bci.o savage_state.o
diff --git a/drivers/char/drm/ati_pcigart.c b/drivers/char/drm/ati_pcigart.c
-index d352dbb..617abab 100644
+index 141f4df..c52ba6e 100644
--- a/drivers/char/drm/ati_pcigart.c
+++ b/drivers/char/drm/ati_pcigart.c
-@@ -45,9 +45,8 @@ static void *drm_ati_alloc_pcigart_table(int order)
-
- address = __get_free_pages(GFP_KERNEL | __GFP_COMP,
- order);
-- if (address == 0UL) {
-+ if (address == 0UL)
- return NULL;
-- }
-
- page = virt_to_page(address);
+@@ -43,7 +43,6 @@ static int drm_ati_alloc_pcigart_table(struct drm_device *dev,
+ gart_info->table_mask);
+ if (gart_info->table_handle == NULL)
+ return -ENOMEM;
+-
+ return 0;
+ }
-@@ -197,7 +196,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
+@@ -151,7 +150,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
page_base = (u32) entry->busaddr[i];
for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
@@ -666,7 +663,7 @@
case DRM_ATI_GART_IGP:
*pci_gart = cpu_to_le32((page_base) | 0xc);
break;
-@@ -222,7 +221,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
+@@ -182,7 +181,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
mb();
#endif
@@ -1042,18 +1039,18 @@
* Device specific ioctls should only be in their respective headers
* The device specific ioctl range is from 0x40 to 0x99.
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
-index a6789f2..bd41621 100644
+index 8ea9dd1..c6df504 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
-@@ -55,6 +55,7 @@
- #include <linux/jiffies.h>
+@@ -56,6 +56,7 @@
#include <linux/smp_lock.h> /* For (un)lock_kernel */
+ #include <linux/dma-mapping.h>
#include <linux/mm.h>
+#include <linux/pagemap.h>
#include <linux/cdev.h>
#include <linux/mutex.h>
#if defined(__alpha__) || defined(__powerpc__)
-@@ -66,6 +67,7 @@
+@@ -67,6 +68,7 @@
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
@@ -1061,7 +1058,7 @@
#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
#include <linux/types.h>
#include <linux/agp_backend.h>
-@@ -144,9 +146,22 @@ struct drm_device;
+@@ -145,9 +147,22 @@ struct drm_device;
#define DRM_MEM_CTXLIST 21
#define DRM_MEM_MM 22
#define DRM_MEM_HASHTAB 23
@@ -1084,7 +1081,7 @@
/*@}*/
-@@ -374,6 +389,12 @@ struct drm_buf_entry {
+@@ -375,6 +390,12 @@ struct drm_buf_entry {
struct drm_freelist freelist;
};
@@ -1097,7 +1094,7 @@
/** File private data */
struct drm_file {
int authenticated;
-@@ -387,6 +408,14 @@ struct drm_file {
+@@ -388,6 +409,14 @@ struct drm_file {
struct drm_head *head;
int remove_auth_on_close;
unsigned long lock_count;
@@ -1112,7 +1109,7 @@
struct file *filp;
void *driver_priv;
};
-@@ -518,6 +547,7 @@ struct drm_map_list {
+@@ -519,6 +548,7 @@ struct drm_map_list {
struct drm_hash_item hash;
struct drm_map *map; /**< mapping */
uint64_t user_token;
@@ -1120,7 +1117,7 @@
};
typedef struct drm_map drm_local_map_t;
-@@ -555,6 +585,8 @@ struct drm_ati_pcigart_info {
+@@ -558,6 +588,8 @@ struct drm_ati_pcigart_info {
int table_size;
};
@@ -1129,7 +1126,7 @@
/**
* DRM driver structure. This structure represent the common code for
* a family of cards. There will one drm_device for each card present
-@@ -612,6 +644,9 @@ struct drm_driver {
+@@ -615,6 +647,9 @@ struct drm_driver {
void (*set_version) (struct drm_device *dev,
struct drm_set_version *sv);
@@ -1139,7 +1136,7 @@
int major;
int minor;
int patchlevel;
-@@ -687,6 +722,10 @@ struct drm_device {
+@@ -690,6 +725,10 @@ struct drm_device {
struct list_head maplist; /**< Linked list of regions */
int map_count; /**< Number of mappable regions */
struct drm_open_hash map_hash; /**< User token hash table for maps */
@@ -1150,7 +1147,7 @@
/** \name Context handle management */
/*@{ */
-@@ -763,6 +802,9 @@ struct drm_device {
+@@ -766,6 +805,9 @@ struct drm_device {
unsigned int agp_buffer_token;
struct drm_head primary; /**< primary screen head */
@@ -1160,7 +1157,7 @@
/** \name Drawable information */
/*@{ */
spinlock_t drw_lock;
-@@ -770,6 +812,15 @@ struct drm_device {
+@@ -773,6 +815,15 @@ struct drm_device {
/*@} */
};
@@ -1176,7 +1173,7 @@
static __inline__ int drm_core_check_feature(struct drm_device *dev,
int feature)
{
-@@ -866,6 +917,15 @@ extern int drm_free_agp(DRM_AGP_MEM * handle, int pages);
+@@ -869,6 +920,15 @@ extern int drm_free_agp(DRM_AGP_MEM * handle, int pages);
extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
extern int drm_unbind_agp(DRM_AGP_MEM * handle);
@@ -1192,7 +1189,7 @@
/* Misc. IOCTL support (drm_ioctl.h) */
extern int drm_irq_by_busid(struct drm_device *dev, void *data,
struct drm_file *file_priv);
-@@ -1023,7 +1083,8 @@ extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size
+@@ -1026,7 +1086,8 @@ extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size
extern int drm_agp_free_memory(DRM_AGP_MEM * handle);
extern int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start);
extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle);
@@ -1202,7 +1199,7 @@
/* Stub support (drm_stub.h) */
extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
struct drm_driver *driver);
-@@ -1147,6 +1208,39 @@ extern void drm_free(void *pt, size_t size, int area);
+@@ -1150,6 +1211,39 @@ extern void drm_free(void *pt, size_t size, int area);
extern void *drm_calloc(size_t nmemb, size_t size, int area);
#endif
@@ -6194,7 +6191,7 @@
+ return ret;
+}
diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c
-index 3992f73..a5920dc 100644
+index f09d4b5..ff2ca94 100644
--- a/drivers/char/drm/drm_fops.c
+++ b/drivers/char/drm/drm_fops.c
@@ -147,11 +147,18 @@ int drm_open(struct inode *inode, struct file *filp)
@@ -6289,7 +6286,7 @@
/**
* Release file.
*
-@@ -347,7 +395,7 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -348,7 +396,7 @@ int drm_release(struct inode *inode, struct file *filp)
if (drm_i_have_hw_lock(dev, file_priv)) {
dev->driver->reclaim_buffers_locked(dev, file_priv);
} else {
@@ -6298,16 +6295,7 @@
int locked = 0;
drm_idlelock_take(&dev->lock);
-@@ -356,7 +404,7 @@ int drm_release(struct inode *inode, struct file *filp)
- * Wait for a while.
- */
-
-- do{
-+ do {
- spin_lock(&dev->lock.spinlock);
- locked = dev->lock.idle_has_lock;
- spin_unlock(&dev->lock.spinlock);
-@@ -422,6 +470,7 @@ int drm_release(struct inode *inode, struct file *filp)
+@@ -425,6 +473,7 @@ int drm_release(struct inode *inode, struct file *filp)
mutex_unlock(&dev->ctxlist_mutex);
mutex_lock(&dev->struct_mutex);
@@ -6351,10 +6339,10 @@
}
diff --git a/drivers/char/drm/drm_lock.c b/drivers/char/drm/drm_lock.c
-index bea2a7d..316ab73 100644
+index 12dcdd1..1342e9d 100644
--- a/drivers/char/drm/drm_lock.c
+++ b/drivers/char/drm/drm_lock.c
-@@ -175,7 +175,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
+@@ -176,7 +176,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
if (dev->driver->kernel_context_switch_unlock)
dev->driver->kernel_context_switch_unlock(dev);
else {
@@ -7673,10 +7661,10 @@
*
* \param buf output buffer.
diff --git a/drivers/char/drm/drm_scatter.c b/drivers/char/drm/drm_scatter.c
-index 26d8f67..56c6eaa 100644
+index b2b0f3d..3b31040 100644
--- a/drivers/char/drm/drm_scatter.c
+++ b/drivers/char/drm/drm_scatter.c
-@@ -179,7 +179,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)
+@@ -188,7 +188,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)
return 0;
@@ -8213,7 +8201,7 @@
+}
+EXPORT_SYMBOL(drm_ttm_bind);
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
-index 3d65c4d..6184b98 100644
+index 945df72..77576e3 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -40,6 +40,10 @@
@@ -8227,7 +8215,7 @@
static pgprot_t drm_io_prot(uint32_t map_type, struct vm_area_struct *vma)
{
-@@ -214,7 +218,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
+@@ -225,7 +229,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
found_maps++;
if (pt->vma == vma) {
list_del(&pt->head);
@@ -8236,7 +8224,7 @@
}
}
-@@ -256,6 +260,9 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
+@@ -267,6 +271,9 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
dmah.size = map->size;
__drm_pci_free(dev, &dmah);
break;
@@ -8246,7 +8234,7 @@
}
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
}
-@@ -398,7 +405,7 @@ static void drm_vm_open_locked(struct vm_area_struct *vma)
+@@ -409,7 +416,7 @@ static void drm_vm_open_locked(struct vm_area_struct *vma)
vma->vm_start, vma->vm_end - vma->vm_start);
atomic_inc(&dev->vma_count);
@@ -8255,7 +8243,7 @@
if (vma_entry) {
vma_entry->vma = vma;
vma_entry->pid = current->pid;
-@@ -438,7 +445,7 @@ static void drm_vm_close(struct vm_area_struct *vma)
+@@ -449,7 +456,7 @@ static void drm_vm_close(struct vm_area_struct *vma)
list_for_each_entry_safe(pt, temp, &dev->vmalist, head) {
if (pt->vma == vma) {
list_del(&pt->head);
@@ -8264,7 +8252,7 @@
break;
}
}
-@@ -637,6 +644,8 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
+@@ -647,6 +654,8 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
vma->vm_private_data = (void *)map;
vma->vm_flags |= VM_RESERVED;
break;
@@ -8273,7 +8261,7 @@
default:
return -EINVAL; /* This should never happen. */
}
-@@ -661,3 +670,186 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
+@@ -671,3 +680,186 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
return ret;
}
EXPORT_SYMBOL(drm_mmap);
@@ -8662,7 +8650,7 @@
+ DRM_MEMORYBARRIER();
+}
diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c
-index e9d6663..d2b7d3f 100644
+index a043bb1..eed33f7 100644
--- a/drivers/char/drm/i915_dma.c
+++ b/drivers/char/drm/i915_dma.c
@@ -36,7 +36,7 @@
@@ -9031,9 +9019,8 @@
- return 0;
+ dev_priv->sarea_priv->pf_current_page &= ~(0x3 << shift);
+ dev_priv->sarea_priv->pf_current_page |= next_page << shift;
- }
-
--static int i915_quiescent(struct drm_device * dev)
++}
++
+void i915_dispatch_flip(struct drm_device *dev, int planes, int sync)
+{
+ drm_i915_private_t *dev_priv = dev->dev_private;
@@ -9052,8 +9039,9 @@
+ i915_emit_breadcrumb(dev);
+ if (unlikely(!sync && ((dev_priv->counter & 0xFF) == 0)))
+ drm_fence_flush_old(dev, 0, dev_priv->counter);
-+}
-+
+ }
+
+-static int i915_quiescent(struct drm_device * dev)
+static int i915_quiescent(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -9490,7 +9478,7 @@
+ uint32_t fence_flags,
+ struct drm_fence_arg *fence_arg,
+ struct drm_fence_object **fence_p)
- {
++{
+ struct drm_device *dev = file_priv->head->dev;
+ int ret;
+ struct drm_fence_object *fence;
@@ -9670,7 +9658,7 @@
+}
+
+static int i915_flip_bufs(struct drm_device *dev, void *data, struct drm_file *file_priv)
-+{
+ {
+ drm_i915_flip_t *param = data;
+
DRM_DEBUG("%s\n", __FUNCTION__);
@@ -9765,7 +9753,7 @@
static int i915_set_status_page(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
-@@ -800,17 +1582,33 @@ int i915_driver_unload(struct drm_device *dev)
+@@ -800,20 +1582,35 @@ int i915_driver_unload(struct drm_device *dev)
return 0;
}
@@ -9774,6 +9762,9 @@
{
drm_i915_private_t *dev_priv = dev->dev_private;
+ if (!dev_priv)
+ return;
+-
+ if (drm_getsarea(dev) && dev_priv->sarea_priv)
+ i915_do_cleanup_pageflip(dev);
if (dev_priv->agp_heap)
@@ -9801,7 +9792,7 @@
{
drm_i915_private_t *dev_priv = dev->dev_private;
i915_mem_release(dev, file_priv, dev_priv->agp_heap);
-@@ -833,7 +1631,9 @@ struct drm_ioctl_desc i915_ioctls[] = {
+@@ -836,7 +1633,9 @@ struct drm_ioctl_desc i915_ioctls[] = {
DRM_IOCTL_DEF(DRM_I915_SET_VBLANK_PIPE, i915_vblank_pipe_set, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY ),
DRM_IOCTL_DEF(DRM_I915_GET_VBLANK_PIPE, i915_vblank_pipe_get, DRM_AUTH ),
DRM_IOCTL_DEF(DRM_I915_VBLANK_SWAP, i915_vblank_swap, DRM_AUTH),
@@ -9811,7 +9802,7 @@
};
int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
-@@ -849,7 +1649,13 @@ int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
+@@ -852,7 +1651,13 @@ int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
* \returns
* A value of 1 is always retured to indictate every i9x5 is AGP.
*/
@@ -10031,7 +10022,7 @@
+
#endif /* _I915_DRM_H_ */
diff --git a/drivers/char/drm/i915_drv.c b/drivers/char/drm/i915_drv.c
-index 4048f39..bd25a15 100644
+index b2b451d..415b1cf 100644
--- a/drivers/char/drm/i915_drv.c
+++ b/drivers/char/drm/i915_drv.c
@@ -37,6 +37,25 @@
@@ -10060,7 +10051,7 @@
enum pipe {
PIPE_A = 0,
-@@ -536,6 +555,7 @@ static struct drm_driver driver = {
+@@ -537,6 +556,7 @@ static struct drm_driver driver = {
DRIVER_IRQ_VBL2,
.load = i915_driver_load,
.unload = i915_driver_unload,
@@ -10068,7 +10059,7 @@
.lastclose = i915_driver_lastclose,
.preclose = i915_driver_preclose,
.suspend = i915_suspend,
-@@ -568,7 +588,8 @@ static struct drm_driver driver = {
+@@ -569,7 +589,8 @@ static struct drm_driver driver = {
.name = DRIVER_NAME,
.id_table = pciidlist,
},
linux-2.6-firewire-git-pending.patch:
Index: linux-2.6-firewire-git-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-firewire-git-pending.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-firewire-git-pending.patch 6 Mar 2008 13:59:25 -0000 1.2
+++ linux-2.6-firewire-git-pending.patch 1 Apr 2008 10:38:06 -0000 1.3
@@ -3,485 +3,843 @@
# tree, which we think we're going to want...
#
-read_bus_info_block() is repeatedly called by workqueue jobs.
-These will step on each others toes eventually if there are multiple
-workqueue threads, and we end up with corrupt config ROM images.
+
+Increase reconnect management orb timeout.
+
+Signed-off-by: Jarod Wilson <jwilson at redhat.com>
+
+---
+
+ drivers/firewire/fw-sbp2.c | 15 +++++++++++++--
+ 1 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
+index d6d62c6..da315cf 100644
+--- a/drivers/firewire/fw-sbp2.c
++++ b/drivers/firewire/fw-sbp2.c
+@@ -170,6 +170,7 @@ struct sbp2_target {
+ */
+ #define SBP2_MIN_LOGIN_ORB_TIMEOUT 5000U /* Timeout in ms */
+ #define SBP2_MAX_LOGIN_ORB_TIMEOUT 40000U /* Timeout in ms */
++#define SBP2_MAX_RECONNECT_ORB_TIMEOUT 10000U /* Timeout in ms */
+ #define SBP2_ORB_TIMEOUT 2000U /* Timeout in ms */
+ #define SBP2_ORB_NULL 0x80000000
+ #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
+@@ -538,14 +539,24 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
+ orb->request.status_fifo.low =
+ cpu_to_be32(lu->address_handler.offset);
+
+- if (function == SBP2_LOGIN_REQUEST) {
++ switch (function) {
++
++ case SBP2_LOGIN_REQUEST:
+ /* Ask for 2^2 == 4 seconds reconnect grace period */
+ orb->request.misc |= cpu_to_be32(
+ MANAGEMENT_ORB_RECONNECT(2) |
+ MANAGEMENT_ORB_EXCLUSIVE(sbp2_param_exclusive_login));
+ timeout = lu->tgt->mgt_orb_timeout;
+- } else {
++ break;
++
++ case SBP2_RECONNECT_REQUEST:
++ timeout = min(SBP2_MAX_RECONNECT_ORB_TIMEOUT,
++ lu->tgt->mgt_orb_timeout);
++ break;
++
++ default:
+ timeout = SBP2_ORB_TIMEOUT;
++ break;
+ }
+
+ init_completion(&orb->done);
+
+
+
+Adds a goofy routine to dump the configuration ROM as far as it could be
+read, if fw-core failed to get it all.
Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
---
- drivers/firewire/fw-device.c | 41 +++++++++++++++++++++++------------
- 1 file changed, 27 insertions(+), 14 deletions(-)
+
+We may want to reduce it to printing
+ - any encountered Extended ROM keys,
+ - the number of quadlets that were successfully read
+ (in the last attempt, or in the most successfull attempt?),
+ - the return code of the last attempt
+before submitting to mainline.
+
+ drivers/firewire/fw-device.c | 126 ++++++++++++++++++++++-------------
+ drivers/firewire/fw-device.h | 1
+ 2 files changed, 82 insertions(+), 45 deletions(-)
Index: linux/drivers/firewire/fw-device.c
===================================================================
--- linux.orig/drivers/firewire/fw-device.c
+++ linux/drivers/firewire/fw-device.c
-@@ -400,6 +400,9 @@ read_rom(struct fw_device *device, int g
+@@ -18,6 +18,7 @@
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
++#include <linux/bitops.h>
+ #include <linux/module.h>
+ #include <linux/wait.h>
+ #include <linux/errno.h>
+@@ -422,8 +423,12 @@ read_rom(struct fw_device *device, int g
return callback_data.rcode;
}
-+#define READ_BIB_ROM_SIZE 256
-+#define READ_BIB_STACK_SIZE 16
-+
+-#define READ_BIB_ROM_SIZE 256
+-#define READ_BIB_STACK_SIZE 16
++#define MAX_CONFIG_ROM_SIZE ((CSR_CONFIG_ROM_END - CSR_CONFIG_ROM) / 4)
++
++struct config_rom_image {
++ u32 rom[MAX_CONFIG_ROM_SIZE];
++ DECLARE_BITMAP(read, MAX_CONFIG_ROM_SIZE);
++};
+
/*
* Read the bus info block, perform a speed probe, and read all of the rest of
- * the config ROM. We do all this with a cached bus generation. If the bus
-@@ -409,16 +412,23 @@ read_rom(struct fw_device *device, int g
+@@ -432,35 +437,36 @@ read_rom(struct fw_device *device, int g
+ * It's better to start all over in this case because the node from which we
+ * are reading the ROM may have changed the ROM during the reset.
*/
- static int read_bus_info_block(struct fw_device *device, int generation)
+-static int read_bus_info_block(struct fw_device *device, int generation)
++static int read_bus_info_block(struct fw_device *device, int generation,
++ struct config_rom_image *rom_img)
{
-- static u32 rom[256];
-- u32 stack[16], sp, key;
-- int i, end, length;
-+ u32 *rom, *stack;
-+ u32 sp, key;
-+ int i, end, length, ret = -1;
-+
-+ rom = kmalloc(sizeof(*rom) * READ_BIB_ROM_SIZE +
-+ sizeof(*stack) * READ_BIB_STACK_SIZE, GFP_KERNEL);
-+ if (rom == NULL)
-+ return -ENOMEM;
-+
-+ stack = &rom[READ_BIB_ROM_SIZE];
+- u32 *rom, *stack, *old_rom, *new_rom;
++ u32 *rom, *old_rom, *new_rom;
++ u32 stack[16];
+ u32 sp, key;
+- int i, end, length, ret = -1;
++ int i, end, length, ret;
+
+- rom = kmalloc(sizeof(*rom) * READ_BIB_ROM_SIZE +
+- sizeof(*stack) * READ_BIB_STACK_SIZE, GFP_KERNEL);
+- if (rom == NULL)
++ if (rom_img == NULL)
+ return -ENOMEM;
+-
+- stack = &rom[READ_BIB_ROM_SIZE];
++ rom = rom_img->rom;
device->max_speed = SCODE_100;
/* First read the bus info block. */
for (i = 0; i < 5; i++) {
- if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE)
-- return -1;
-+ goto out;
+- if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE)
+- goto out;
++ ret = read_rom(device, generation, i, &rom[i]);
++ if (ret != RCODE_COMPLETE)
++ return ret;
++ __set_bit(i, rom_img->read);
/*
* As per IEEE1212 7.2, during power-up, devices can
* reply with a 0 for the first quadlet of the config
-@@ -428,7 +438,7 @@ static int read_bus_info_block(struct fw
+- * rom to indicate that they are booting (for example,
++ * ROM to indicate that they are booting (for example,
+ * if the firmware is on the disk of a external
+ * harddisk). In that case we just fail, and the
* retry mechanism will try again later.
*/
if (i == 0 && rom[i] == 0)
-- return -1;
-+ goto out;
+- goto out;
++ return -EAGAIN;
}
device->max_speed = device->node->max_speed;
-@@ -478,26 +488,26 @@ static int read_bus_info_block(struct fw
+@@ -484,15 +490,17 @@ static int read_bus_info_block(struct fw
+ device->max_speed = device->card->link_speed;
+
+ while (device->max_speed > SCODE_100) {
+- if (read_rom(device, generation, 0, &dummy) ==
+- RCODE_COMPLETE)
++ ret = read_rom(device, generation, 0, &dummy);
++ if (ret == RCODE_COMPLETE)
+ break;
++ if (ret == RCODE_GENERATION)
++ return ret;
+ device->max_speed--;
+ }
+ }
+
+ /*
+- * Now parse the config rom. The config rom is a recursive
++ * Now parse the config ROM. The config ROM is a recursive
+ * directory structure so we parse it using a stack of
+ * references to the blocks that make up the structure. We
+ * push a reference to the root directory on the stack to
+@@ -504,44 +512,49 @@ static int read_bus_info_block(struct fw
+ while (sp > 0) {
+ /*
+ * Pop the next block reference of the stack. The
+- * lower 24 bits is the offset into the config rom,
++ * lower 24 bits is the offset into the config ROM,
+ * the upper 8 bits are the type of the reference the
+ * block.
*/
key = stack[--sp];
i = key & 0xffffff;
-- if (i >= ARRAY_SIZE(rom))
-+ if (i >= READ_BIB_ROM_SIZE)
+- if (i >= READ_BIB_ROM_SIZE)
++ if (i >= MAX_CONFIG_ROM_SIZE) {
/*
* The reference points outside the standard
- * config rom area, something's fishy.
+- * config rom area, something's fishy.
++ * config ROM area.
*/
-- return -1;
-+ goto out;
-
+- goto out;
+-
++ if (key >> 24 == (CSR_EXTENDED_ROM | CSR_LEAF))
++ fw_error("Extended ROM not supported\n");
++ return -EINVAL;
++ }
/* Read header quadlet for the block to get the length. */
- if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE)
-- return -1;
-+ goto out;
+- if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE)
+- goto out;
++ ret = read_rom(device, generation, i, &rom[i]);
++ if (ret != RCODE_COMPLETE)
++ return ret;
++ __set_bit(i, rom_img->read);
end = i + (rom[i] >> 16) + 1;
i++;
-- if (end > ARRAY_SIZE(rom))
-+ if (end > READ_BIB_ROM_SIZE)
+- if (end > READ_BIB_ROM_SIZE)
++ if (end > MAX_CONFIG_ROM_SIZE) {
/*
* This block extends outside standard config
* area (and the array we're reading it
* into). That's broken, so ignore this
* device.
*/
-- return -1;
-+ goto out;
-
+- goto out;
+-
++ return -EINVAL;
++ }
/*
* Now read in the block. If this is a directory
-@@ -507,9 +517,9 @@ static int read_bus_info_block(struct fw
+ * block, check the entries as we read them to see if
+ * it references another block, and push it in that case.
+ */
while (i < end) {
- if (read_rom(device, generation, i, &rom[i]) !=
- RCODE_COMPLETE)
-- return -1;
-+ goto out;
+- if (read_rom(device, generation, i, &rom[i]) !=
+- RCODE_COMPLETE)
+- goto out;
++ ret = read_rom(device, generation, i, &rom[i]);
++ if (ret != RCODE_COMPLETE)
++ return ret;
++ __set_bit(i, rom_img->read);
if ((key >> 30) == 3 && (rom[i] >> 30) > 1 &&
-- sp < ARRAY_SIZE(stack))
-+ sp < READ_BIB_STACK_SIZE)
+- sp < READ_BIB_STACK_SIZE)
++ sp < ARRAY_SIZE(stack))
stack[sp++] = i + rom[i];
i++;
}
-@@ -519,11 +529,14 @@ static int read_bus_info_block(struct fw
+@@ -552,7 +565,7 @@ static int read_bus_info_block(struct fw
+ old_rom = device->config_rom;
+ new_rom = kmemdup(rom, length * 4, GFP_KERNEL);
+ if (new_rom == NULL)
+- goto out;
++ return -ENOMEM;
- device->config_rom = kmalloc(length * 4, GFP_KERNEL);
- if (device->config_rom == NULL)
-- return -1;
-+ goto out;
- memcpy(device->config_rom, rom, length * 4);
- device->config_rom_length = length;
-+ ret = 0;
-+ out:
-+ kfree(rom);
+ down_write(&fw_device_rwsem);
+ device->config_rom = new_rom;
+@@ -560,14 +573,25 @@ static int read_bus_info_block(struct fw
+ up_write(&fw_device_rwsem);
+
+ kfree(old_rom);
+- ret = 0;
+ device->cmc = rom[2] & 1 << 30;
+- out:
+- kfree(rom);
-- return 0;
-+ return ret;
+- return ret;
++ return 0;
++}
++
++static void dump_config_rom(struct config_rom_image *rom_img)
++{
++ int i;
++
++ if (rom_img == NULL || !test_bit(0, rom_img->read))
++ return;
++
++ fw_notify("config ROM read so far:\n");
++ for_each_bit(i, rom_img->read, MAX_CONFIG_ROM_SIZE)
++ printk(KERN_NOTICE "%x: %08x\n",
++ CSR_CONFIG_ROM + i * 4, rom_img->rom[i]);
}
++
static void fw_unit_release(struct device *dev)
-
---
-Stefan Richter
--=====-==--- --== ---=-
-http://arcgraph.de/sr/
-
-
-When a device changes its configuration ROM, it announces this with a
-bus reset. firewire-core has to check which node initiated a bus reset
-and whether any unit directories went away or were added on this node.
-
-Tested with an IOI FWB-IDE01AB which has its link-on bit set if bus
-power is available but does not respond to ROM read requests if self
-power is off. This implements
- - recognition of the units if self power is switched on after fw-core
- gave up the initial attempt to read the config ROM,
- - shutdown of the units when self power is switched off.
-
-Also tested with a second PC running Linux/ieee1394. When the eth1394
-driver is inserted and removed on that node, fw-core now notices the
-addition and removal of the IPv4 unit on the ieee1394 node.
-
-Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
----
-
-Applies after "firewire: replace static ROM cache by allocated cache".
-
- drivers/firewire/fw-cdev.c | 18 ++--
- drivers/firewire/fw-device.c | 147 ++++++++++++++++++++++++++++++---
- drivers/firewire/fw-topology.c | 3
- drivers/firewire/fw-topology.h | 11 +-
- 4 files changed, 158 insertions(+), 21 deletions(-)
-
-Index: linux/drivers/firewire/fw-cdev.c
-===================================================================
---- linux.orig/drivers/firewire/fw-cdev.c
-+++ linux/drivers/firewire/fw-cdev.c
-@@ -32,6 +32,7 @@
- #include <linux/idr.h>
- #include <linux/compat.h>
- #include <linux/firewire-cdev.h>
-+#include <asm/semaphore.h>
- #include <asm/system.h>
- #include <asm/uaccess.h>
- #include "fw-transaction.h"
-@@ -269,20 +270,25 @@ static int ioctl_get_info(struct client
{
- struct fw_cdev_get_info *get_info = buffer;
- struct fw_cdev_event_bus_reset bus_reset;
-+ struct fw_device *device = client->device;
-+ unsigned long ret = 0;
-
- client->version = get_info->version;
- get_info->version = FW_CDEV_VERSION;
-
-+ down(&device->device.sem);
- if (get_info->rom != 0) {
- void __user *uptr = u64_to_uptr(get_info->rom);
- size_t want = get_info->rom_length;
-- size_t have = client->device->config_rom_length * 4;
-+ size_t have;
-
-- if (copy_to_user(uptr, client->device->config_rom,
-- min(want, have)))
-- return -EFAULT;
-+ have = device->config_rom_length * 4;
-+ ret = copy_to_user(uptr, device->config_rom, min(want, have));
- }
-- get_info->rom_length = client->device->config_rom_length * 4;
-+ get_info->rom_length = device->config_rom_length * 4;
-+ up(&device->device.sem);
-+ if (ret != 0)
-+ return -EFAULT;
-
- client->bus_reset_closure = get_info->bus_reset_closure;
- if (get_info->bus_reset != 0) {
-@@ -293,7 +299,7 @@ static int ioctl_get_info(struct client
- return -EFAULT;
+ struct fw_unit *unit = fw_unit(dev);
+@@ -697,27 +721,32 @@ static void fw_device_init(struct work_s
+ {
+ struct fw_device *device =
+ container_of(work, struct fw_device, work.work);
++ struct config_rom_image *rom_img;
+ int minor, err;
+
++ rom_img = kzalloc(sizeof(*rom_img), GFP_KERNEL);
++
+ /*
+ * All failure paths here set node->data to NULL, so that we
+ * don't try to do device_for_each_child() on a kfree()'d
+ * device.
+ */
+
+- if (read_bus_info_block(device, device->generation) < 0) {
++ err = read_bus_info_block(device, device->generation, rom_img);
++ if (err) {
+ if (device->config_rom_retries < MAX_RETRIES &&
+ atomic_read(&device->state) == FW_DEVICE_INITIALIZING) {
+ device->config_rom_retries++;
+ schedule_delayed_work(&device->work, RETRY_DELAY);
+ } else {
+- fw_notify("giving up on config rom for node id %x\n",
+- device->node_id);
++ fw_notify("giving up on config ROM for node id %x "
++ "(returned %d)\n", device->node_id, err);
++ dump_config_rom(rom_img);
+ if (device->node == device->card->root_node)
+ schedule_delayed_work(&device->card->work, 0);
+ fw_device_release(&device->device);
+ }
+- return;
++ goto out;
}
-- get_info->card = client->device->card->index;
-+ get_info->card = device->card->index;
+ err = -ENOMEM;
+@@ -786,7 +815,7 @@ static void fw_device_init(struct work_s
+ if (device->node == device->card->root_node)
+ schedule_delayed_work(&device->card->work, 0);
- return 0;
- }
-Index: linux/drivers/firewire/fw-device.c
-===================================================================
---- linux.orig/drivers/firewire/fw-device.c
-+++ linux/drivers/firewire/fw-device.c
-@@ -26,6 +26,7 @@
- #include <linux/delay.h>
- #include <linux/idr.h>
- #include <linux/rwsem.h>
-+#include <linux/string.h>
- #include <asm/semaphore.h>
- #include <asm/system.h>
- #include <linux/ctype.h>
-@@ -160,9 +161,9 @@ static void fw_device_release(struct dev
- * Take the card lock so we don't set this to NULL while a
- * FW_NODE_UPDATED callback is being handled.
- */
-- spin_lock_irqsave(&device->card->lock, flags);
-+ spin_lock_irqsave(&card->lock, flags);
- device->node->data = NULL;
-- spin_unlock_irqrestore(&device->card->lock, flags);
-+ spin_unlock_irqrestore(&card->lock, flags);
-
- fw_node_put(device->node);
- kfree(device->config_rom);
-@@ -337,10 +338,14 @@ static ssize_t
- config_rom_show(struct device *dev, struct device_attribute *attr, char *buf)
- {
- struct fw_device *device = fw_device(dev);
-+ size_t length;
+- return;
++ goto out;
-- memcpy(buf, device->config_rom, device->config_rom_length * 4);
-+ down(&dev->sem);
-+ length = device->config_rom_length * 4;
-+ memcpy(buf, device->config_rom, length);
-+ up(&dev->sem);
+ error_with_cdev:
+ down_write(&fw_device_rwsem);
+@@ -796,6 +825,8 @@ static void fw_device_init(struct work_s
+ fw_device_put(device); /* fw_device_idr's reference */
-- return device->config_rom_length * 4;
-+ return length;
+ put_device(&device->device); /* our reference */
++ out:
++ kfree(rom_img);
}
- static ssize_t
-@@ -412,7 +417,7 @@ read_rom(struct fw_device *device, int g
- */
- static int read_bus_info_block(struct fw_device *device, int generation)
- {
-- u32 *rom, *stack;
-+ u32 *rom, *stack, *old_rom, *new_rom;
- u32 sp, key;
- int i, end, length, ret = -1;
-
-@@ -527,11 +532,18 @@ static int read_bus_info_block(struct fw
- length = i;
- }
+ static int update_unit(struct device *dev, void *data)
+@@ -854,6 +885,7 @@ static void fw_device_refresh(struct wor
+ container_of(work, struct fw_device, work.work);
+ struct fw_card *card = device->card;
+ int node_id = device->node_id;
++ struct config_rom_image *rom_img = NULL;
+
+ switch (reread_bus_info_block(device, device->generation)) {
+ case REREAD_BIB_ERROR:
+@@ -890,13 +922,15 @@ static void fw_device_refresh(struct wor
+ */
+ device_for_each_child(&device->device, NULL, shutdown_unit);
-- device->config_rom = kmalloc(length * 4, GFP_KERNEL);
-- if (device->config_rom == NULL)
-+ old_rom = device->config_rom;
-+ new_rom = kmemdup(rom, length * 4, GFP_KERNEL);
-+ if (new_rom == NULL)
- goto out;
-- memcpy(device->config_rom, rom, length * 4);
+- if (read_bus_info_block(device, device->generation) < 0) {
++ rom_img = kzalloc(sizeof(*rom_img), GFP_KERNEL);
+
-+ /* serialize with readers via sysfs or ioctl */
-+ down(&device->device.sem);
-+ device->config_rom = new_rom;
- device->config_rom_length = length;
-+ up(&device->device.sem);
-+
-+ kfree(old_rom);
- ret = 0;
- out:
- kfree(rom);
-@@ -724,7 +736,7 @@ static void fw_device_init(struct work_s
- if (atomic_cmpxchg(&device->state,
- FW_DEVICE_INITIALIZING,
- FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) {
-- fw_device_shutdown(&device->work.work);
-+ fw_device_shutdown(work);
- } else {
- if (device->config_rom_retries)
- fw_notify("created device %s: GUID %08x%08x, S%d00, "
-@@ -738,6 +750,7 @@ static void fw_device_init(struct work_s
- device->device.bus_id,
- device->config_rom[3], device->config_rom[4],
- 1 << device->max_speed);
-+ device->config_rom_retries = 0;
++ if (read_bus_info_block(device, device->generation, rom_img) != 0) {
+ if (device->config_rom_retries < MAX_RETRIES &&
+ atomic_read(&device->state) == FW_DEVICE_INITIALIZING) {
+ device->config_rom_retries++;
+ schedule_delayed_work(&device->work, RETRY_DELAY);
+
+- return;
++ goto out;
+ }
+ goto give_up;
}
+@@ -910,16 +944,18 @@ static void fw_device_refresh(struct wor
- /*
-@@ -784,6 +797,104 @@ static void fw_device_update(struct work
- device_for_each_child(&device->device, NULL, update_unit);
+ fw_notify("refreshed device %s\n", device->device.bus_id);
+ device->config_rom_retries = 0;
+- goto out;
++ goto out_bm;
+
+ give_up:
+ fw_notify("giving up on refresh of device %s\n", device->device.bus_id);
+ gone:
+ atomic_set(&device->state, FW_DEVICE_SHUTDOWN);
+ fw_device_shutdown(work);
+- out:
++ out_bm:
+ if (node_id == card->root_node->node_id)
+ schedule_delayed_work(&card->work, 0);
++ out:
++ kfree(rom_img);
}
-+enum {
-+ REREAD_BIB_ERROR,
-+ REREAD_BIB_GONE,
-+ REREAD_BIB_UNCHANGED,
-+ REREAD_BIB_CHANGED,
-+};
+ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
+Index: linux/drivers/firewire/fw-device.h
+===================================================================
+--- linux.orig/drivers/firewire/fw-device.h
++++ linux/drivers/firewire/fw-device.h
+@@ -142,6 +142,7 @@ static inline void fw_unit_put(struct fw
+ #define CSR_DEPENDENT_INFO 0x14
+ #define CSR_MODEL 0x17
+ #define CSR_INSTANCE 0x18
++#define CSR_EXTENDED_ROM 0x1b
+ #define CSR_DIRECTORY_ID 0x20
+
+ struct fw_csr_iterator {
+
+--
+Stefan Richter
+-=====-==--- --== -=---
+http://arcgraph.de/sr/
+
+
+
+Date: Thu, 20 Mar 2008 22:04:36 +0100 (CET)
+From: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Subject: [PATCH] firewire: debug interrupt events
+To: linux1394-devel at lists.sourceforge.net
+cc: linux-kernel at vger.kernel.org,
+ Jarod Wilson <jwilson at redhat.com>
+
+This adds debug printks for asynchronous transmission and reception and
+for self ID reception. They can be enabled at module load time, and at
+runtime via /sys/module/firewire_ohci/parameters/debug.
+
+Signed-off-by: Jarod Wilson <jwilson at redhat.com>
+
+Also added: Logging of interrupt event codes and of cancelled AT
+packets.
+
+The code now depends on a Kconfig variable. This makes it easier to
+build firewire-ohci without the feature or to make it an option in the
+future. The variable is currently hidden and always on.
+
+This feature inflates firewire-ohci.ko by 7 kB = 27% on x86-64 and by
+4 kB = 23% on i686.
+
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+---
+ drivers/firewire/Kconfig | 5 +
+ drivers/firewire/fw-ohci.c | 182 +++++++++++++++++++++++++++++++++++++
+ 2 files changed, 187 insertions(+)
+
+Index: linux/drivers/firewire/Kconfig
+===================================================================
+--- linux.orig/drivers/firewire/Kconfig
++++ linux/drivers/firewire/Kconfig
+@@ -54,6 +54,11 @@ config FIREWIRE_OHCI
+ directive, use "install modulename /bin/true" for the modules to be
+ blacklisted.
+
++config FIREWIRE_OHCI_DEBUG
++ bool
++ depends on FIREWIRE_OHCI
++ default y
++
+ config FIREWIRE_SBP2
+ tristate "Support for storage devices (SBP-2 protocol driver)"
+ depends on FIREWIRE && SCSI
+Index: linux/drivers/firewire/fw-ohci.c
+===================================================================
+--- linux.orig/drivers/firewire/fw-ohci.c
++++ linux/drivers/firewire/fw-ohci.c
+@@ -27,6 +27,7 @@
+ #include <linux/kernel.h>
+ #include <linux/mm.h>
+ #include <linux/module.h>
++#include <linux/moduleparam.h>
+ #include <linux/pci.h>
+ #include <linux/spinlock.h>
+
+@@ -237,6 +238,179 @@ static inline struct fw_ohci *fw_ohci(st
+
+ static char ohci_driver_name[] = KBUILD_MODNAME;
+
++#ifdef CONFIG_FIREWIRE_OHCI_DEBUG
++
++#define OHCI_PARAM_DEBUG_IRQS 1
++#define OHCI_PARAM_DEBUG_SELFIDS 2
++#define OHCI_PARAM_DEBUG_AT_AR 4
++
++static int param_debug;
++module_param_named(debug, param_debug, int, 0644);
++MODULE_PARM_DESC(debug, "Verbose logging (default = 0"
++ ", IRQs = " __stringify(OHCI_PARAM_DEBUG_IRQS)
++ ", self-IDs = " __stringify(OHCI_PARAM_DEBUG_SELFIDS)
++ ", AT/AR events = " __stringify(OHCI_PARAM_DEBUG_AT_AR)
++ ", or a combination, or all = -1)");
+
-+/* Reread and compare bus info block and header of root directory */
-+static int reread_bus_info_block(struct fw_device *device, int generation)
++static void log_irqs(u32 evt)
+{
-+ u32 q;
-+ int i;
-+
-+ for (i = 0; i < 6; i++) {
-+ if (read_rom(device, generation, i, &q) != RCODE_COMPLETE)
-+ return REREAD_BIB_ERROR;
++ if (likely(!(param_debug & OHCI_PARAM_DEBUG_IRQS)))
++ return;
+
-+ if (i == 0 && q == 0)
-+ return REREAD_BIB_GONE;
++ printk(KERN_DEBUG KBUILD_MODNAME ": IRQ %08x%s%s%s%s%s%s%s%s%s%s%s\n",
++ evt,
++ evt & OHCI1394_selfIDComplete ? " selfID" : "",
++ evt & OHCI1394_RQPkt ? " AR_req" : "",
++ evt & OHCI1394_RSPkt ? " AR_resp" : "",
++ evt & OHCI1394_reqTxComplete ? " AT_req" : "",
++ evt & OHCI1394_respTxComplete ? " AT_resp" : "",
++ evt & OHCI1394_isochRx ? " IR" : "",
++ evt & OHCI1394_isochTx ? " IT" : "",
++ evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "",
++ evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "",
++ evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "",
++ evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt |
++ OHCI1394_RSPkt | OHCI1394_reqTxComplete |
++ OHCI1394_respTxComplete | OHCI1394_isochRx |
++ OHCI1394_isochTx | OHCI1394_postedWriteErr |
++ OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds)
++ ? " ?" : "");
++}
+
-+ if (i > device->config_rom_length || q != device->config_rom[i])
-+ return REREAD_BIB_CHANGED;
-+ }
++static const char *speed[] = {
++ [0] = "S100", [1] = "S200", [2] = "S400", [3] = "beta",
++};
++static const char *power[] = {
++ [0] = "+0W", [1] = "+15W", [2] = "+30W", [3] = "+45W",
++ [4] = "-3W", [5] = " ?W", [6] = "-3..-6W", [7] = "-3..-10W",
++};
++static const char port[] = { '.', '-', 'p', 'c', };
+
-+ return REREAD_BIB_UNCHANGED;
++static char _p(u32 *s, int shift)
++{
++ return port[*s >> shift & 3];
+}
+
-+static void fw_device_refresh(struct work_struct *work)
++static void log_selfids(int generation, int self_id_count, u32 *s)
+{
-+ struct fw_device *device =
-+ container_of(work, struct fw_device, work.work);
-+ struct fw_card *card = device->card;
-+ int node_id = device->node_id;
-+
-+ switch (reread_bus_info_block(device, device->generation)) {
-+ case REREAD_BIB_ERROR:
-+ if (device->config_rom_retries < MAX_RETRIES / 2 &&
-+ atomic_read(&device->state) == FW_DEVICE_INITIALIZING) {
-+ device->config_rom_retries++;
-+ schedule_delayed_work(&device->work, RETRY_DELAY / 2);
++ if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS)))
++ return;
+
-+ return;
-+ }
-+ goto give_up;
++ printk(KERN_DEBUG KBUILD_MODNAME ": %d selfIDs, generation %d\n",
++ self_id_count, generation);
+
-+ case REREAD_BIB_GONE:
-+ goto gone;
++ for (; self_id_count--; ++s)
++ if ((*s & 1 << 23) == 0)
++ printk(KERN_DEBUG "selfID 0: %08x, phy %d [%c%c%c] "
++ "%s gc=%d %s %s%s%s\n",
++ *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2),
++ speed[*s >> 14 & 3], *s >> 16 & 63,
++ power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "",
++ *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : "");
++ else
++ printk(KERN_DEBUG "selfID n: %08x, phy %d "
++ "[%c%c%c%c%c%c%c%c]\n",
++ *s, *s >> 24 & 63,
++ _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10),
++ _p(s, 8), _p(s, 6), _p(s, 4), _p(s, 2));
++}
+
-+ case REREAD_BIB_UNCHANGED:
-+ if (atomic_cmpxchg(&device->state,
-+ FW_DEVICE_INITIALIZING,
-+ FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
-+ goto gone;
++static const char *evts[] = {
++ [0x00] = "evt_no_status", [0x01] = "-reserved-",
++ [0x02] = "evt_long_packet", [0x03] = "evt_missing_ack",
++ [0x04] = "evt_underrun", [0x05] = "evt_overrun",
++ [0x06] = "evt_descriptor_read", [0x07] = "evt_data_read",
++ [0x08] = "evt_data_write", [0x09] = "evt_bus_reset",
++ [0x0a] = "evt_timeout", [0x0b] = "evt_tcode_err",
++ [0x0c] = "-reserved-", [0x0d] = "-reserved-",
++ [0x0e] = "evt_unknown", [0x0f] = "evt_flushed",
++ [0x10] = "-reserved-", [0x11] = "ack_complete",
++ [0x12] = "ack_pending ", [0x13] = "-reserved-",
++ [0x14] = "ack_busy_X", [0x15] = "ack_busy_A",
++ [0x16] = "ack_busy_B", [0x17] = "-reserved-",
++ [0x18] = "-reserved-", [0x19] = "-reserved-",
++ [0x1a] = "-reserved-", [0x1b] = "ack_tardy",
++ [0x1c] = "-reserved-", [0x1d] = "ack_data_error",
++ [0x1e] = "ack_type_error", [0x1f] = "-reserved-",
++ [0x20] = "pending/cancelled",
++};
++static const char *tcodes[] = {
++ [0x0] = "QW req", [0x1] = "BW req",
++ [0x2] = "W resp", [0x3] = "-reserved-",
++ [0x4] = "QR req", [0x5] = "BR req",
++ [0x6] = "QR resp", [0x7] = "BR resp",
++ [0x8] = "cycle start", [0x9] = "Lk req",
++ [0xa] = "async stream packet", [0xb] = "Lk resp",
++ [0xc] = "-reserved-", [0xd] = "-reserved-",
++ [0xe] = "link internal", [0xf] = "-reserved-",
++};
++static const char *phys[] = {
++ [0x0] = "phy config packet", [0x1] = "link-on packet",
++ [0x2] = "self-id packet", [0x3] = "-reserved-",
++};
+
-+ fw_device_update(work);
-+ device->config_rom_retries = 0;
++static void log_ar_at_event(char dir, int speed, u32 *header, int evt)
++{
++ int tcode = header[0] >> 4 & 0xf;
++ char specific[12];
+
++ if (likely(!(param_debug & OHCI_PARAM_DEBUG_AT_AR)))
+ return;
-+ }
+
-+ /*
-+ * Something changed. We keep things simple and don't investigate
-+ * further. We just destroy all previous units and create new ones.
-+ */
-+ device_for_each_child(&device->device, NULL, shutdown_unit);
-+
-+ if (read_bus_info_block(device, device->generation) < 0) {
-+ if (device->config_rom_retries < MAX_RETRIES &&
-+ atomic_read(&device->state) == FW_DEVICE_INITIALIZING) {
-+ device->config_rom_retries++;
-+ schedule_delayed_work(&device->work, RETRY_DELAY);
++ if (unlikely(evt >= ARRAY_SIZE(evts)))
++ evt = 0x1f;
+
-+ return;
-+ }
-+ goto give_up;
++ if (header[0] == ~header[1]) {
++ printk(KERN_DEBUG "A%c %s, %s, %08x\n",
++ dir, evts[evt], phys[header[0] >> 30 & 0x3],
++ header[0]);
++ return;
+ }
+
-+ create_units(device);
++ switch (tcode) {
++ case 0x0: case 0x6: case 0x8:
++ snprintf(specific, sizeof(specific), " = %08x",
++ be32_to_cpu((__force __be32)header[3]));
++ break;
++ case 0x1: case 0x5: case 0x7: case 0x9: case 0xb:
++ snprintf(specific, sizeof(specific), " %x,%x",
++ header[3] >> 16, header[3] & 0xffff);
++ break;
++ default:
++ specific[0] = '\0';
++ }
+
-+ if (atomic_cmpxchg(&device->state,
-+ FW_DEVICE_INITIALIZING,
-+ FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
-+ goto gone;
++ switch (tcode) {
++ case 0xe: case 0xa:
++ printk(KERN_DEBUG "A%c %s, %s\n",
++ dir, evts[evt], tcodes[tcode]);
++ break;
++ case 0x0: case 0x1: case 0x4: case 0x5: case 0x9:
++ printk(KERN_DEBUG "A%c spd %x tl %02x, "
++ "%04x -> %04x, %s, "
++ "%s, %04x%08x%s\n",
++ dir, speed, header[0] >> 10 & 0x3f,
++ header[1] >> 16, header[0] >> 16, evts[evt],
++ tcodes[tcode], header[1] & 0xffff, header[2], specific);
++ break;
++ default:
++ printk(KERN_DEBUG "A%c spd %x tl %02x, "
++ "%04x -> %04x, %s, "
++ "%s%s\n",
++ dir, speed, header[0] >> 10 & 0x3f,
++ header[1] >> 16, header[0] >> 16, evts[evt],
++ tcodes[tcode], specific);
++ }
++}
+
-+ fw_notify("refreshed device %s\n", device->device.bus_id);
-+ device->config_rom_retries = 0;
-+ goto out;
++#else
+
-+ give_up:
-+ fw_notify("giving up on refresh of device %s\n", device->device.bus_id);
-+ gone:
-+ atomic_set(&device->state, FW_DEVICE_SHUTDOWN);
-+ fw_device_shutdown(work);
-+ out:
-+ if (node_id == card->root_node->node_id)
-+ schedule_delayed_work(&card->work, 0);
-+}
++#define log_irqs(evt)
++#define log_selfids(generation, self_id_count, sid)
++#define log_ar_at_event(dir, speed, header, evt)
+
- void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
++#endif /* CONFIG_FIREWIRE_OHCI_DEBUG */
++
+ static inline void reg_write(const struct fw_ohci *ohci, int offset, u32 data)
{
- struct fw_device *device;
-@@ -793,7 +904,7 @@ void fw_node_event(struct fw_card *card,
- case FW_NODE_LINK_ON:
- if (!node->link_on)
- break;
--
-+ create:
- device = kzalloc(sizeof(*device), GFP_ATOMIC);
- if (device == NULL)
- break;
-@@ -832,6 +943,22 @@ void fw_node_event(struct fw_card *card,
- schedule_delayed_work(&device->work, INITIAL_DELAY);
- break;
-
-+ case FW_NODE_INITIATED_RESET:
-+ device = node->data;
-+ if (device == NULL)
-+ goto create;
-+
-+ device->node_id = node->node_id;
-+ smp_wmb(); /* update node_id before generation */
-+ device->generation = card->generation;
-+ if (atomic_cmpxchg(&device->state,
-+ FW_DEVICE_RUNNING,
-+ FW_DEVICE_INITIALIZING) == FW_DEVICE_RUNNING) {
-+ PREPARE_DELAYED_WORK(&device->work, fw_device_refresh);
-+ schedule_delayed_work(&device->work, INITIAL_DELAY);
-+ }
-+ break;
+ writel(data, ohci->registers + offset);
+@@ -368,6 +542,8 @@ static __le32 *handle_ar_packet(struct a
+ p.timestamp = status & 0xffff;
+ p.generation = ohci->request_generation;
+
++ log_ar_at_event('R', p.speed, p.header, status >> 16 & 0x1f);
+
- case FW_NODE_UPDATED:
- if (!node->link_on || node->data == NULL)
- break;
-Index: linux/drivers/firewire/fw-topology.c
-===================================================================
---- linux.orig/drivers/firewire/fw-topology.c
-+++ linux/drivers/firewire/fw-topology.c
-@@ -107,6 +107,7 @@ static struct fw_node *fw_node_create(u3
- node->node_id = LOCAL_BUS | SELF_ID_PHY_ID(sid);
- node->link_on = SELF_ID_LINK_ON(sid);
- node->phy_speed = SELF_ID_PHY_SPEED(sid);
-+ node->initiated_reset = SELF_ID_PHY_INITIATOR(sid);
- node->port_count = port_count;
-
- atomic_set(&node->ref_count, 1);
-@@ -430,6 +431,8 @@ update_tree(struct fw_card *card, struct
- event = FW_NODE_LINK_OFF;
- else if (!node0->link_on && node1->link_on)
- event = FW_NODE_LINK_ON;
-+ else if (node1->initiated_reset && node1->link_on)
-+ event = FW_NODE_INITIATED_RESET;
- else
- event = FW_NODE_UPDATED;
+ /*
+ * The OHCI bus reset handler synthesizes a phy packet with
+ * the new generation number when a bus reset happens (see
+@@ -816,6 +992,8 @@ static int handle_at_packet(struct conte
+ evt = le16_to_cpu(last->transfer_status) & 0x1f;
+ packet->timestamp = le16_to_cpu(last->res_count);
+
++ log_ar_at_event('T', packet->speed, packet->header, evt);
++
+ switch (evt) {
+ case OHCI1394_evt_timeout:
+ /* Async response transmit timed out. */
+@@ -1117,6 +1295,8 @@ static void bus_reset_tasklet(unsigned l
+ dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
+ free_rom, free_rom_bus);
+
++ log_selfids(generation, self_id_count, ohci->self_id_buffer);
++
+ fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation,
+ self_id_count, ohci->self_id_buffer);
+ }
+@@ -1133,6 +1313,7 @@ static irqreturn_t irq_handler(int irq,
+ return IRQ_NONE;
+
+ reg_write(ohci, OHCI1394_IntEventClear, event);
++ log_irqs(event);
-Index: linux/drivers/firewire/fw-topology.h
+ if (event & OHCI1394_selfIDComplete)
+ tasklet_schedule(&ohci->bus_reset_tasklet);
+@@ -1435,6 +1616,7 @@ static int ohci_cancel_packet(struct fw_
+ if (packet->ack != 0)
+ goto out;
+
++ log_ar_at_event('T', packet->speed, packet->header, 0x20);
+ driver_data->packet = NULL;
+ packet->ack = RCODE_CANCELLED;
+ packet->callback(packet, &ohci->card, packet->ack);
+
+--
+Stefan Richter
+-=====-==--- --== =-=--
+http://arcgraph.de/sr/
+
+
+Date: Thu, 20 Mar 2008 23:48:23 +0100 (CET)
+From: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Subject: [PATCH] firewire: wait until PHY configuration packet was transmitted
+To: linux1394-devel at lists.sourceforge.net
+cc: linux-kernel at vger.kernel.org,
+ Jarod Wilson <jwilson at redhat.com>
+
+We now exit fw_send_phy_config /after/ the PHY config packet has been
+transmitted, instead of before. A subsequent fw_core_initiate_bus_reset
+will therefore not overlap with the transmission. This is meant to make
+the send PHY config packet + reset bus routine more deterministic.
+
+Signed-off-by: Stefan Richter <stefanr at s5r6.in-berlin.de>
+Signed-off-by: Jarod Wilson <jwilson at redhat.com>
+---
+ drivers/firewire/fw-transaction.c | 49 ++++++++++++++----------------
+ 1 file changed, 24 insertions(+), 25 deletions(-)
+
+Index: linux/drivers/firewire/fw-transaction.c
===================================================================
---- linux.orig/drivers/firewire/fw-topology.h
-+++ linux/drivers/firewire/fw-topology.h
-@@ -20,11 +20,12 @@
- #define __fw_topology_h
-
- enum {
-- FW_NODE_CREATED = 0x00,
-- FW_NODE_UPDATED = 0x01,
-- FW_NODE_DESTROYED = 0x02,
-- FW_NODE_LINK_ON = 0x03,
-- FW_NODE_LINK_OFF = 0x04,
-+ FW_NODE_CREATED,
-+ FW_NODE_UPDATED,
-+ FW_NODE_DESTROYED,
-+ FW_NODE_LINK_ON,
-+ FW_NODE_LINK_OFF,
-+ FW_NODE_INITIATED_RESET,
- };
+--- linux.orig/drivers/firewire/fw-transaction.c
++++ linux/drivers/firewire/fw-transaction.c
+@@ -18,6 +18,7 @@
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
++#include <linux/completion.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/init.h>
+@@ -294,42 +295,40 @@ fw_send_request(struct fw_card *card, st
+ }
+ EXPORT_SYMBOL(fw_send_request);
+
++struct fw_phy_packet {
++ struct fw_packet packet;
++ struct completion done;
++};
++
+ static void
+ transmit_phy_packet_callback(struct fw_packet *packet,
+ struct fw_card *card, int status)
+ {
+- kfree(packet);
+-}
+-
+-static void send_phy_packet(struct fw_card *card, u32 data, int generation)
+-{
+- struct fw_packet *packet;
++ struct fw_phy_packet *p =
++ container_of(packet, struct fw_phy_packet, packet);
+
+- packet = kzalloc(sizeof(*packet), GFP_ATOMIC);
+- if (packet == NULL)
+- return;
+-
+- packet->header[0] = data;
+- packet->header[1] = ~data;
+- packet->header_length = 8;
+- packet->payload_length = 0;
+- packet->speed = SCODE_100;
+- packet->generation = generation;
+- packet->callback = transmit_phy_packet_callback;
+-
+- card->driver->send_request(card, packet);
++ complete(&p->done);
+ }
+
+ void fw_send_phy_config(struct fw_card *card,
+ int node_id, int generation, int gap_count)
+ {
+- u32 q;
+-
+- q = PHY_IDENTIFIER(PHY_PACKET_CONFIG) |
+- PHY_CONFIG_ROOT_ID(node_id) |
+- PHY_CONFIG_GAP_COUNT(gap_count);
++ struct fw_phy_packet p;
++ u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG) |
++ PHY_CONFIG_ROOT_ID(node_id) |
++ PHY_CONFIG_GAP_COUNT(gap_count);
++
++ p.packet.header[0] = data;
++ p.packet.header[1] = ~data;
++ p.packet.header_length = 8;
++ p.packet.payload_length = 0;
++ p.packet.speed = SCODE_100;
++ p.packet.generation = generation;
++ p.packet.callback = transmit_phy_packet_callback;
++ init_completion(&p.done);
+
+- send_phy_packet(card, q, generation);
++ card->driver->send_request(card, &p.packet);
++ wait_for_completion(&p.done);
+ }
- struct fw_node {
+ void fw_flush_transactions(struct fw_card *card)
--
Stefan Richter
--=====-==--- --== ---==
+-=====-==--- --== =-=--
http://arcgraph.de/sr/
+There's a minor memory leak in firewire-ohci's ar_context_tasklet(), in that
+we're not freeing up some of the memory we use for each ar_buffer, due to a
+moving pointer. The problem has been there for a while, but didn't start
+to be noticed until we were doing a coherent allocation for the ar_buffer --
+meaning we have a smaller pool of memory to work with now, so the problem
+crops up sooner. The manifestation of this comes after doing a bunch of I/O to
+a firewire disk, which eventually stalls, and this starts spewing to the
+console:
+
+PCI-DMA: Out of IOMMU space for 53248 bytes at device 0000:04:09.0
+
+The device there is one of my FireWire controllers trying to do I/O. The host
+is a fairly new rev. opteron.
+
+Just need to make sure we're freeing the correct memory range is pass through
+ar_context_tasklet to fix it. Probably something we ought to sneak into 2.6.25
+if its still doable...
+
+Signed-off-by: Jarod Wilson <jwilson at redhat.com>
+---
+
+ drivers/firewire/fw-ohci.c | 9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
+index 8ff9059..e1d50f7 100644
+--- a/drivers/firewire/fw-ohci.c
++++ b/drivers/firewire/fw-ohci.c
+@@ -579,7 +579,8 @@ static void ar_context_tasklet(unsigned long data)
+
+ if (d->res_count == 0) {
+ size_t size, rest, offset;
+- dma_addr_t buffer_bus;
++ dma_addr_t start_bus;
++ void *start;
+
+ /*
+ * This descriptor is finished and we may have a
+@@ -588,9 +589,9 @@ static void ar_context_tasklet(unsigned long data)
+ */
+
+ offset = offsetof(struct ar_buffer, data);
+- buffer_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
++ start = buffer = ab;
++ start_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
+
+- buffer = ab;
+ ab = ab->next;
+ d = &ab->descriptor;
+ size = buffer + PAGE_SIZE - ctx->pointer;
+@@ -605,7 +606,7 @@ static void ar_context_tasklet(unsigned long data)
+ buffer = handle_ar_packet(ctx, buffer);
+
+ dma_free_coherent(ohci->card.device, PAGE_SIZE,
+- buffer, buffer_bus);
++ start, start_bus);
+ ar_context_add_page(ctx);
+ } else {
+ buffer = ctx->pointer;
linux-2.6-firewire-git-update.patch:
Index: linux-2.6-firewire-git-update.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-firewire-git-update.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-firewire-git-update.patch 6 Mar 2008 13:59:25 -0000 1.2
+++ linux-2.6-firewire-git-update.patch 1 Apr 2008 10:38:06 -0000 1.3
@@ -1,21 +1,28 @@
-git diff in linux1394-git tree vs. 2.6.25-rc3-git4, 03/03/2008
+git diff in linux1394-2.6.git vs. v2.6.25-rc6, March 17, 2008.
- Documentation/debugging-via-ohci1394.txt | 13 ++-
- drivers/firewire/fw-card.c | 38 ----------
- drivers/firewire/fw-device.h | 27 ++++---
- drivers/firewire/fw-ohci.c | 114 +++++++++++++++++++++-------
- drivers/firewire/fw-sbp2.c | 120 ++++++++++++------------------
- drivers/firewire/fw-transaction.c | 2 +-
- drivers/firewire/fw-transaction.h | 10 +--
+ Documentation/debugging-via-ohci1394.txt | 13 +-
+ drivers/firewire/fw-card.c | 40 +-----
+ drivers/firewire/fw-cdev.c | 13 +-
+ drivers/firewire/fw-device.c | 263 ++++++++++++++++++++++++------
+ drivers/firewire/fw-device.h | 38 +++-
+ drivers/firewire/fw-ohci.c | 114 +++++++-------
+ drivers/firewire/fw-sbp2.c | 150 ++++++++---------
+ drivers/firewire/fw-topology.c | 3 +
+ drivers/firewire/fw-topology.h | 11 +-
+ drivers/firewire/fw-transaction.c | 11 +-
+ drivers/firewire/fw-transaction.h | 6 -
drivers/ieee1394/csr.c | 6 +-
drivers/ieee1394/dv1394.c | 3 +-
+ drivers/ieee1394/highlevel.c | 6 +-
+ drivers/ieee1394/ieee1394_core.c | 2 +-
drivers/ieee1394/nodemgr.c | 6 +-
- drivers/ieee1394/ohci1394.c | 109 ++++++++++++---------------
+ drivers/ieee1394/ohci1394.c | 111 ++++++-------
+ drivers/ieee1394/pcilynx.c | 12 +-
drivers/ieee1394/raw1394.c | 1 -
- drivers/ieee1394/sbp2.c | 7 +-
+ drivers/ieee1394/sbp2.c | 11 +-
drivers/ieee1394/video1394.c | 3 +-
- lib/Kconfig.debug | 10 +++
- 15 files changed, 233 insertions(+), 236 deletions(-)
+ lib/Kconfig.debug | 10 +
+ 22 files changed, 487 insertions(+), 346 deletions(-)
diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt
index c360d4e..371ba27 100644
@@ -42,9 +49,18 @@
To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu:
Provide code for enabling DMA over FireWire early on boot) and pass the
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
-index a034627..140b34d 100644
+index a034627..7e4012d 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
+@@ -331,7 +331,7 @@ fw_card_bm_work(struct work_struct *work)
+ */
+ spin_unlock_irqrestore(&card->lock, flags);
+ goto out;
+- } else if (root_device->config_rom[2] & BIB_CMC) {
++ } else if (root_device->cmc) {
+ /*
+ * FIXME: I suppose we should set the cmstr bit in the
+ * STATE_CLEAR register of this node, as described in
@@ -398,7 +398,6 @@ fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
{
static atomic_t index = ATOMIC_INIT(-1);
@@ -107,11 +123,569 @@
int
fw_core_initiate_bus_reset(struct fw_card *card, int short_reset)
{
+diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
+index 46bc197..4a54192 100644
+--- a/drivers/firewire/fw-cdev.c
++++ b/drivers/firewire/fw-cdev.c
+@@ -269,21 +269,28 @@ static int ioctl_get_info(struct client *client, void *buffer)
+ {
+ struct fw_cdev_get_info *get_info = buffer;
+ struct fw_cdev_event_bus_reset bus_reset;
++ unsigned long ret = 0;
+
+ client->version = get_info->version;
+ get_info->version = FW_CDEV_VERSION;
+
++ down_read(&fw_device_rwsem);
++
+ if (get_info->rom != 0) {
+ void __user *uptr = u64_to_uptr(get_info->rom);
+ size_t want = get_info->rom_length;
+ size_t have = client->device->config_rom_length * 4;
+
+- if (copy_to_user(uptr, client->device->config_rom,
+- min(want, have)))
+- return -EFAULT;
++ ret = copy_to_user(uptr, client->device->config_rom,
++ min(want, have));
+ }
+ get_info->rom_length = client->device->config_rom_length * 4;
+
++ up_read(&fw_device_rwsem);
++
++ if (ret != 0)
++ return -EFAULT;
++
+ client->bus_reset_closure = get_info->bus_reset_closure;
+ if (get_info->bus_reset != 0) {
+ void __user *uptr = u64_to_uptr(get_info->bus_reset);
+diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
+index 870125a..f559c63 100644
+--- a/drivers/firewire/fw-device.c
++++ b/drivers/firewire/fw-device.c
+@@ -25,7 +25,7 @@
+ #include <linux/device.h>
+ #include <linux/delay.h>
+ #include <linux/idr.h>
+-#include <linux/rwsem.h>
++#include <linux/string.h>
+ #include <asm/semaphore.h>
+ #include <asm/system.h>
+ #include <linux/ctype.h>
+@@ -160,9 +160,9 @@ static void fw_device_release(struct device *dev)
+ * Take the card lock so we don't set this to NULL while a
+ * FW_NODE_UPDATED callback is being handled.
+ */
+- spin_lock_irqsave(&device->card->lock, flags);
++ spin_lock_irqsave(&card->lock, flags);
+ device->node->data = NULL;
+- spin_unlock_irqrestore(&device->card->lock, flags);
++ spin_unlock_irqrestore(&card->lock, flags);
+
+ fw_node_put(device->node);
+ kfree(device->config_rom);
+@@ -195,7 +195,9 @@ show_immediate(struct device *dev, struct device_attribute *dattr, char *buf)
+ container_of(dattr, struct config_rom_attribute, attr);
+ struct fw_csr_iterator ci;
+ u32 *dir;
+- int key, value;
++ int key, value, ret = -ENOENT;
++
++ down_read(&fw_device_rwsem);
+
+ if (is_fw_unit(dev))
+ dir = fw_unit(dev)->directory;
+@@ -204,11 +206,15 @@ show_immediate(struct device *dev, struct device_attribute *dattr, char *buf)
+
+ fw_csr_iterator_init(&ci, dir);
+ while (fw_csr_iterator_next(&ci, &key, &value))
+- if (attr->key == key)
+- return snprintf(buf, buf ? PAGE_SIZE : 0,
+- "0x%06x\n", value);
++ if (attr->key == key) {
++ ret = snprintf(buf, buf ? PAGE_SIZE : 0,
++ "0x%06x\n", value);
++ break;
++ }
++
++ up_read(&fw_device_rwsem);
+
+- return -ENOENT;
++ return ret;
+ }
+
+ #define IMMEDIATE_ATTR(name, key) \
+@@ -221,9 +227,11 @@ show_text_leaf(struct device *dev, struct device_attribute *dattr, char *buf)
+ container_of(dattr, struct config_rom_attribute, attr);
+ struct fw_csr_iterator ci;
+ u32 *dir, *block = NULL, *p, *end;
+- int length, key, value, last_key = 0;
++ int length, key, value, last_key = 0, ret = -ENOENT;
+ char *b;
+
++ down_read(&fw_device_rwsem);
++
+ if (is_fw_unit(dev))
+ dir = fw_unit(dev)->directory;
+ else
+@@ -238,18 +246,20 @@ show_text_leaf(struct device *dev, struct device_attribute *dattr, char *buf)
+ }
+
+ if (block == NULL)
+- return -ENOENT;
++ goto out;
+
+ length = min(block[0] >> 16, 256U);
+ if (length < 3)
+- return -ENOENT;
++ goto out;
+
+ if (block[1] != 0 || block[2] != 0)
+ /* Unknown encoding. */
+- return -ENOENT;
++ goto out;
+
+- if (buf == NULL)
+- return length * 4;
++ if (buf == NULL) {
++ ret = length * 4;
++ goto out;
++ }
+
+ b = buf;
+ end = &block[length + 1];
+@@ -259,8 +269,11 @@ show_text_leaf(struct device *dev, struct device_attribute *dattr, char *buf)
+ /* Strip trailing whitespace and add newline. */
+ while (b--, (isspace(*b) || *b == '\0') && b > buf);
+ strcpy(b + 1, "\n");
++ ret = b + 2 - buf;
++ out:
++ up_read(&fw_device_rwsem);
+
+- return b + 2 - buf;
++ return ret;
+ }
+
+ #define TEXT_LEAF_ATTR(name, key) \
+@@ -337,19 +350,28 @@ static ssize_t
+ config_rom_show(struct device *dev, struct device_attribute *attr, char *buf)
+ {
+ struct fw_device *device = fw_device(dev);
++ size_t length;
+
+- memcpy(buf, device->config_rom, device->config_rom_length * 4);
++ down_read(&fw_device_rwsem);
++ length = device->config_rom_length * 4;
++ memcpy(buf, device->config_rom, length);
++ up_read(&fw_device_rwsem);
+
+- return device->config_rom_length * 4;
++ return length;
+ }
+
+ static ssize_t
+ guid_show(struct device *dev, struct device_attribute *attr, char *buf)
+ {
+ struct fw_device *device = fw_device(dev);
++ int ret;
++
++ down_read(&fw_device_rwsem);
++ ret = snprintf(buf, PAGE_SIZE, "0x%08x%08x\n",
++ device->config_rom[3], device->config_rom[4]);
++ up_read(&fw_device_rwsem);
+
+- return snprintf(buf, PAGE_SIZE, "0x%08x%08x\n",
+- device->config_rom[3], device->config_rom[4]);
++ return ret;
+ }
+
+ static struct device_attribute fw_device_attributes[] = {
+@@ -388,7 +410,7 @@ read_rom(struct fw_device *device, int generation, int index, u32 *data)
+
+ init_completion(&callback_data.done);
+
+- offset = 0xfffff0000400ULL + index * 4;
++ offset = (CSR_REGISTER_BASE | CSR_CONFIG_ROM) + index * 4;
+ fw_send_request(device->card, &t, TCODE_READ_QUADLET_REQUEST,
+ device->node_id, generation, device->max_speed,
+ offset, NULL, 4, complete_transaction, &callback_data);
+@@ -400,6 +422,9 @@ read_rom(struct fw_device *device, int generation, int index, u32 *data)
+ return callback_data.rcode;
+ }
+
++#define READ_BIB_ROM_SIZE 256
++#define READ_BIB_STACK_SIZE 16
++
+ /*
+ * Read the bus info block, perform a speed probe, and read all of the rest of
+ * the config ROM. We do all this with a cached bus generation. If the bus
+@@ -409,16 +434,23 @@ read_rom(struct fw_device *device, int generation, int index, u32 *data)
+ */
+ static int read_bus_info_block(struct fw_device *device, int generation)
+ {
+- static u32 rom[256];
+- u32 stack[16], sp, key;
+- int i, end, length;
++ u32 *rom, *stack, *old_rom, *new_rom;
++ u32 sp, key;
++ int i, end, length, ret = -1;
++
++ rom = kmalloc(sizeof(*rom) * READ_BIB_ROM_SIZE +
++ sizeof(*stack) * READ_BIB_STACK_SIZE, GFP_KERNEL);
++ if (rom == NULL)
++ return -ENOMEM;
++
++ stack = &rom[READ_BIB_ROM_SIZE];
+
+ device->max_speed = SCODE_100;
+
+ /* First read the bus info block. */
+ for (i = 0; i < 5; i++) {
+ if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE)
+- return -1;
++ goto out;
+ /*
+ * As per IEEE1212 7.2, during power-up, devices can
+ * reply with a 0 for the first quadlet of the config
+@@ -428,7 +460,7 @@ static int read_bus_info_block(struct fw_device *device, int generation)
+ * retry mechanism will try again later.
+ */
+ if (i == 0 && rom[i] == 0)
+- return -1;
++ goto out;
+ }
+
+ device->max_speed = device->node->max_speed;
+@@ -478,26 +510,26 @@ static int read_bus_info_block(struct fw_device *device, int generation)
+ */
+ key = stack[--sp];
+ i = key & 0xffffff;
+- if (i >= ARRAY_SIZE(rom))
++ if (i >= READ_BIB_ROM_SIZE)
+ /*
+ * The reference points outside the standard
+ * config rom area, something's fishy.
+ */
+- return -1;
++ goto out;
+
+ /* Read header quadlet for the block to get the length. */
+ if (read_rom(device, generation, i, &rom[i]) != RCODE_COMPLETE)
+- return -1;
++ goto out;
+ end = i + (rom[i] >> 16) + 1;
+ i++;
+- if (end > ARRAY_SIZE(rom))
++ if (end > READ_BIB_ROM_SIZE)
+ /*
+ * This block extends outside standard config
+ * area (and the array we're reading it
+ * into). That's broken, so ignore this
+ * device.
+ */
+- return -1;
++ goto out;
+
+ /*
+ * Now read in the block. If this is a directory
+@@ -507,9 +539,9 @@ static int read_bus_info_block(struct fw_device *device, int generation)
+ while (i < end) {
+ if (read_rom(device, generation, i, &rom[i]) !=
+ RCODE_COMPLETE)
+- return -1;
++ goto out;
+ if ((key >> 30) == 3 && (rom[i] >> 30) > 1 &&
+- sp < ARRAY_SIZE(stack))
++ sp < READ_BIB_STACK_SIZE)
+ stack[sp++] = i + rom[i];
+ i++;
+ }
+@@ -517,13 +549,23 @@ static int read_bus_info_block(struct fw_device *device, int generation)
+ length = i;
+ }
+
+- device->config_rom = kmalloc(length * 4, GFP_KERNEL);
+- if (device->config_rom == NULL)
+- return -1;
+- memcpy(device->config_rom, rom, length * 4);
++ old_rom = device->config_rom;
++ new_rom = kmemdup(rom, length * 4, GFP_KERNEL);
++ if (new_rom == NULL)
++ goto out;
++
++ down_write(&fw_device_rwsem);
++ device->config_rom = new_rom;
+ device->config_rom_length = length;
++ up_write(&fw_device_rwsem);
+
+- return 0;
++ kfree(old_rom);
++ ret = 0;
++ device->cmc = rom[2] & 1 << 30;
++ out:
++ kfree(rom);
++
++ return ret;
+ }
+
+ static void fw_unit_release(struct device *dev)
+@@ -592,7 +634,14 @@ static int shutdown_unit(struct device *device, void *data)
+ return 0;
+ }
+
+-static DECLARE_RWSEM(idr_rwsem);
++/*
++ * fw_device_rwsem acts as dual purpose mutex:
++ * - serializes accesses to fw_device_idr,
++ * - serializes accesses to fw_device.config_rom/.config_rom_length and
++ * fw_unit.directory, unless those accesses happen at safe occasions
++ */
++DECLARE_RWSEM(fw_device_rwsem);
++
+ static DEFINE_IDR(fw_device_idr);
+ int fw_cdev_major;
+
+@@ -600,11 +649,11 @@ struct fw_device *fw_device_get_by_devt(dev_t devt)
+ {
+ struct fw_device *device;
+
+- down_read(&idr_rwsem);
++ down_read(&fw_device_rwsem);
+ device = idr_find(&fw_device_idr, MINOR(devt));
+ if (device)
+ fw_device_get(device);
+- up_read(&idr_rwsem);
++ up_read(&fw_device_rwsem);
+
+ return device;
+ }
+@@ -619,9 +668,9 @@ static void fw_device_shutdown(struct work_struct *work)
+ device_for_each_child(&device->device, NULL, shutdown_unit);
+ device_unregister(&device->device);
+
+- down_write(&idr_rwsem);
++ down_write(&fw_device_rwsem);
+ idr_remove(&fw_device_idr, minor);
+- up_write(&idr_rwsem);
++ up_write(&fw_device_rwsem);
+ fw_device_put(device);
+ }
+
+@@ -674,10 +723,10 @@ static void fw_device_init(struct work_struct *work)
+ err = -ENOMEM;
+
+ fw_device_get(device);
+- down_write(&idr_rwsem);
++ down_write(&fw_device_rwsem);
+ if (idr_pre_get(&fw_device_idr, GFP_KERNEL))
+ err = idr_get_new(&fw_device_idr, device, &minor);
+- up_write(&idr_rwsem);
++ up_write(&fw_device_rwsem);
+
+ if (err < 0)
+ goto error;
+@@ -711,7 +760,7 @@ static void fw_device_init(struct work_struct *work)
+ if (atomic_cmpxchg(&device->state,
+ FW_DEVICE_INITIALIZING,
+ FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) {
+- fw_device_shutdown(&device->work.work);
++ fw_device_shutdown(work);
+ } else {
+ if (device->config_rom_retries)
+ fw_notify("created device %s: GUID %08x%08x, S%d00, "
+@@ -725,6 +774,7 @@ static void fw_device_init(struct work_struct *work)
+ device->device.bus_id,
+ device->config_rom[3], device->config_rom[4],
+ 1 << device->max_speed);
++ device->config_rom_retries = 0;
+ }
+
+ /*
+@@ -739,9 +789,9 @@ static void fw_device_init(struct work_struct *work)
+ return;
+
+ error_with_cdev:
+- down_write(&idr_rwsem);
++ down_write(&fw_device_rwsem);
+ idr_remove(&fw_device_idr, minor);
+- up_write(&idr_rwsem);
++ up_write(&fw_device_rwsem);
+ error:
+ fw_device_put(device); /* fw_device_idr's reference */
+
+@@ -771,6 +821,107 @@ static void fw_device_update(struct work_struct *work)
+ device_for_each_child(&device->device, NULL, update_unit);
+ }
+
++enum {
++ REREAD_BIB_ERROR,
++ REREAD_BIB_GONE,
++ REREAD_BIB_UNCHANGED,
++ REREAD_BIB_CHANGED,
++};
++
++/* Reread and compare bus info block and header of root directory */
++static int reread_bus_info_block(struct fw_device *device, int generation)
++{
++ u32 q;
++ int i;
++
++ for (i = 0; i < 6; i++) {
++ if (read_rom(device, generation, i, &q) != RCODE_COMPLETE)
++ return REREAD_BIB_ERROR;
++
++ if (i == 0 && q == 0)
++ return REREAD_BIB_GONE;
++
++ if (i > device->config_rom_length || q != device->config_rom[i])
++ return REREAD_BIB_CHANGED;
++ }
++
++ return REREAD_BIB_UNCHANGED;
++}
++
++static void fw_device_refresh(struct work_struct *work)
++{
++ struct fw_device *device =
++ container_of(work, struct fw_device, work.work);
++ struct fw_card *card = device->card;
++ int node_id = device->node_id;
++
++ switch (reread_bus_info_block(device, device->generation)) {
++ case REREAD_BIB_ERROR:
++ if (device->config_rom_retries < MAX_RETRIES / 2 &&
++ atomic_read(&device->state) == FW_DEVICE_INITIALIZING) {
++ device->config_rom_retries++;
++ schedule_delayed_work(&device->work, RETRY_DELAY / 2);
++
++ return;
++ }
++ goto give_up;
++
++ case REREAD_BIB_GONE:
++ goto gone;
++
++ case REREAD_BIB_UNCHANGED:
++ if (atomic_cmpxchg(&device->state,
++ FW_DEVICE_INITIALIZING,
++ FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
++ goto gone;
++
++ fw_device_update(work);
++ device->config_rom_retries = 0;
++
++ return;
++
++ case REREAD_BIB_CHANGED:
++ break;
++ }
++
++ /*
++ * Something changed. We keep things simple and don't investigate
++ * further. We just destroy all previous units and create new ones.
++ */
++ device_for_each_child(&device->device, NULL, shutdown_unit);
++
++ if (read_bus_info_block(device, device->generation) < 0) {
++ if (device->config_rom_retries < MAX_RETRIES &&
++ atomic_read(&device->state) == FW_DEVICE_INITIALIZING) {
++ device->config_rom_retries++;
++ schedule_delayed_work(&device->work, RETRY_DELAY);
++
++ return;
++ }
++ goto give_up;
++ }
++
++ create_units(device);
++
++ if (atomic_cmpxchg(&device->state,
++ FW_DEVICE_INITIALIZING,
++ FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
++ goto gone;
++
++ fw_notify("refreshed device %s\n", device->device.bus_id);
++ device->config_rom_retries = 0;
++ goto out;
++
++ give_up:
++ fw_notify("giving up on refresh of device %s\n", device->device.bus_id);
++ gone:
++ atomic_set(&device->state, FW_DEVICE_SHUTDOWN);
++ fw_device_shutdown(work);
++ out:
++ if (node_id == card->root_node->node_id)
++ schedule_delayed_work(&card->work, 0);
++}
++
+ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
+ {
+ struct fw_device *device;
+@@ -780,7 +931,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
+ case FW_NODE_LINK_ON:
+ if (!node->link_on)
+ break;
+-
++ create:
+ device = kzalloc(sizeof(*device), GFP_ATOMIC);
+ if (device == NULL)
+ break;
+@@ -819,6 +970,22 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
+ schedule_delayed_work(&device->work, INITIAL_DELAY);
+ break;
+
++ case FW_NODE_INITIATED_RESET:
++ device = node->data;
++ if (device == NULL)
++ goto create;
++
++ device->node_id = node->node_id;
++ smp_wmb(); /* update node_id before generation */
++ device->generation = card->generation;
++ if (atomic_cmpxchg(&device->state,
++ FW_DEVICE_RUNNING,
++ FW_DEVICE_INITIALIZING) == FW_DEVICE_RUNNING) {
++ PREPARE_DELAYED_WORK(&device->work, fw_device_refresh);
++ schedule_delayed_work(&device->work, INITIAL_DELAY);
++ }
++ break;
++
+ case FW_NODE_UPDATED:
+ if (!node->link_on || node->data == NULL)
+ break;
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
-index 78ecd39..0d771fd 100644
+index 78ecd39..5f131f5 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
-@@ -64,28 +64,24 @@ struct fw_device {
+@@ -21,6 +21,7 @@
+
+ #include <linux/fs.h>
+ #include <linux/cdev.h>
++#include <linux/rwsem.h>
+ #include <asm/atomic.h>
+
+ enum fw_device_state {
+@@ -46,6 +47,11 @@ struct fw_attribute_group {
+ * fw_device.node_id is guaranteed to be current too.
+ *
+ * The same applies to fw_device.card->node_id vs. fw_device.generation.
++ *
++ * fw_device.config_rom and fw_device.config_rom_length may be accessed during
++ * the lifetime of any fw_unit belonging to the fw_device, before device_del()
++ * was called on the last fw_unit. Alternatively, they may be accessed while
++ * holding fw_device_rwsem.
+ */
+ struct fw_device {
+ atomic_t state;
+@@ -53,6 +59,7 @@ struct fw_device {
+ int node_id;
+ int generation;
+ unsigned max_speed;
++ bool cmc;
+ struct fw_card *card;
+ struct device device;
+ struct list_head link;
+@@ -64,28 +71,24 @@ struct fw_device {
struct fw_attribute_group attribute_group;
};
@@ -144,7 +718,19 @@
{
put_device(&device->device);
}
-@@ -104,12 +100,23 @@ struct fw_unit {
+@@ -96,20 +99,35 @@ int fw_device_enable_phys_dma(struct fw_device *device);
+ void fw_device_cdev_update(struct fw_device *device);
+ void fw_device_cdev_remove(struct fw_device *device);
+
++extern struct rw_semaphore fw_device_rwsem;
+ extern int fw_cdev_major;
+
++/*
++ * fw_unit.directory must not be accessed after device_del(&fw_unit.device).
++ */
+ struct fw_unit {
+ struct device device;
+ u32 *directory;
struct fw_attribute_group attribute_group;
};
@@ -171,117 +757,19 @@
#define CSR_LEAF 0x80
#define CSR_DIRECTORY 0xc0
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
-index 7ebad3c..28ea78c 100644
+index 996d61f..0f02b8d 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
-@@ -33,6 +33,10 @@
- #include <asm/page.h>
- #include <asm/system.h>
-
-+#ifdef CONFIG_PPC_PMAC
-+#include <asm/pmac_feature.h>
-+#endif
-+
- #include "fw-ohci.h"
- #include "fw-transaction.h"
-
-@@ -175,6 +179,7 @@ struct fw_ohci {
+@@ -177,7 +177,7 @@ struct fw_ohci {
+ struct tasklet_struct bus_reset_tasklet;
+ int node_id;
int generation;
- int request_generation;
+- int request_generation;
++ int request_generation; /* for timestamping incoming requests */
u32 bus_seconds;
-+ bool old_uninorth;
-
- /*
- * Spinlock for accessing fw_ohci data. Never call out of
-@@ -311,15 +316,22 @@ static int ar_context_add_page(struct ar_context *ctx)
- return 0;
- }
+ bool old_uninorth;
-+#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
-+#define cond_le32_to_cpu(v) \
-+ (ohci->old_uninorth ? (__force __u32)(v) : le32_to_cpu(v))
-+#else
-+#define cond_le32_to_cpu(v) le32_to_cpu(v)
-+#endif
-+
- static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
- {
- struct fw_ohci *ohci = ctx->ohci;
- struct fw_packet p;
- u32 status, length, tcode;
-
-- p.header[0] = le32_to_cpu(buffer[0]);
-- p.header[1] = le32_to_cpu(buffer[1]);
-- p.header[2] = le32_to_cpu(buffer[2]);
-+ p.header[0] = cond_le32_to_cpu(buffer[0]);
-+ p.header[1] = cond_le32_to_cpu(buffer[1]);
-+ p.header[2] = cond_le32_to_cpu(buffer[2]);
-
- tcode = (p.header[0] >> 4) & 0x0f;
- switch (tcode) {
-@@ -331,7 +343,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
- break;
-
- case TCODE_READ_BLOCK_REQUEST :
-- p.header[3] = le32_to_cpu(buffer[3]);
-+ p.header[3] = cond_le32_to_cpu(buffer[3]);
- p.header_length = 16;
- p.payload_length = 0;
- break;
-@@ -340,7 +352,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
- case TCODE_READ_BLOCK_RESPONSE:
- case TCODE_LOCK_REQUEST:
- case TCODE_LOCK_RESPONSE:
-- p.header[3] = le32_to_cpu(buffer[3]);
-+ p.header[3] = cond_le32_to_cpu(buffer[3]);
- p.header_length = 16;
- p.payload_length = p.header[3] >> 16;
- break;
-@@ -357,7 +369,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
-
- /* FIXME: What to do about evt_* errors? */
- length = (p.header_length + p.payload_length + 3) / 4;
-- status = le32_to_cpu(buffer[length]);
-+ status = cond_le32_to_cpu(buffer[length]);
-
- p.ack = ((status >> 16) & 0x1f) - 16;
- p.speed = (status >> 21) & 0x7;
-@@ -375,7 +387,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
- */
-
- if (p.ack + 16 == 0x09)
-- ohci->request_generation = (buffer[2] >> 16) & 0xff;
-+ ohci->request_generation = (p.header[2] >> 16) & 0xff;
- else if (ctx == &ohci->ar_request_ctx)
- fw_core_handle_request(&ohci->card, &p);
- else
-@@ -532,7 +544,7 @@ static int
- context_add_buffer(struct context *ctx)
- {
- struct descriptor_buffer *desc;
-- dma_addr_t bus_addr;
-+ dma_addr_t uninitialized_var(bus_addr);
- int offset;
-
- /*
-@@ -1022,13 +1034,14 @@ static void bus_reset_tasklet(unsigned long data)
- */
-
- self_id_count = (reg_read(ohci, OHCI1394_SelfIDCount) >> 3) & 0x3ff;
-- generation = (le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
-+ generation = (cond_le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
- rmb();
-
- for (i = 1, j = 0; j < self_id_count; i += 2, j++) {
- if (ohci->self_id_cpu[i] != ~ohci->self_id_cpu[i + 1])
- fw_error("inconsistent self IDs\n");
-- ohci->self_id_buffer[j] = le32_to_cpu(ohci->self_id_cpu[i]);
-+ ohci->self_id_buffer[j] =
-+ cond_le32_to_cpu(ohci->self_id_cpu[i]);
- }
- rmb();
-
-@@ -1091,6 +1104,11 @@ static void bus_reset_tasklet(unsigned long data)
+@@ -1096,6 +1096,11 @@ static void bus_reset_tasklet(unsigned long data)
reg_write(ohci, OHCI1394_ConfigROMhdr, ohci->next_header);
}
@@ -293,16 +781,7 @@
spin_unlock_irqrestore(&ohci->lock, flags);
if (free_rom)
-@@ -1316,7 +1334,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
- unsigned long flags;
- int retval = -EBUSY;
- __be32 *next_config_rom;
-- dma_addr_t next_config_rom_bus;
-+ dma_addr_t uninitialized_var(next_config_rom_bus);
-
- ohci = fw_ohci(card);
-
-@@ -1429,6 +1447,9 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
+@@ -1434,6 +1439,9 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
static int
ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
{
@@ -312,7 +791,7 @@
struct fw_ohci *ohci = fw_ohci(card);
unsigned long flags;
int n, retval = 0;
-@@ -1460,6 +1481,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
+@@ -1465,6 +1473,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
out:
spin_unlock_irqrestore(&ohci->lock, flags);
return retval;
@@ -320,39 +799,30 @@
}
static u64
-@@ -1487,7 +1509,7 @@ static int handle_ir_dualbuffer_packet(struct context *context,
- void *p, *end;
- int i;
-
-- if (db->first_res_count > 0 && db->second_res_count > 0) {
-+ if (db->first_res_count != 0 && db->second_res_count != 0) {
- if (ctx->excess_bytes <= le16_to_cpu(db->second_req_count)) {
- /* This descriptor isn't done yet, stop iteration. */
- return 0;
-@@ -1513,7 +1535,7 @@ static int handle_ir_dualbuffer_packet(struct context *context,
- memcpy(ctx->header + i + 4, p + 8, ctx->base.header_size - 4);
- i += ctx->base.header_size;
- ctx->excess_bytes +=
-- (le32_to_cpu(*(u32 *)(p + 4)) >> 16) & 0xffff;
-+ (le32_to_cpu(*(__le32 *)(p + 4)) >> 16) & 0xffff;
- p += ctx->base.header_size + 4;
- }
- ctx->header_length = i;
-@@ -2039,6 +2061,35 @@ static const struct fw_card_driver ohci_driver = {
+@@ -2044,17 +2053,9 @@ static const struct fw_card_driver ohci_driver = {
.stop_iso = ohci_stop_iso,
};
-+#ifdef CONFIG_PPC_PMAC
+-static int __devinit
+-pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+-{
+- struct fw_ohci *ohci;
+- u32 bus_options, max_receive, link_speed;
+- u64 guid;
+- int err;
+- size_t size;
+-
+ #ifdef CONFIG_PPC_PMAC
+- /* Necessary on some machines if fw-ohci was loaded/ unloaded before */
+static void ohci_pmac_on(struct pci_dev *dev)
+{
-+ if (machine_is(powermac)) {
-+ struct device_node *ofn = pci_device_to_OF_node(dev);
-+
-+ if (ofn) {
-+ pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 1);
-+ pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
-+ }
-+ }
+ if (machine_is(powermac)) {
+ struct device_node *ofn = pci_device_to_OF_node(dev);
+
+@@ -2063,8 +2064,35 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+ pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
+ }
+ }
+}
+
+static void ohci_pmac_off(struct pci_dev *dev)
@@ -369,21 +839,23 @@
+#else
+#define ohci_pmac_on(dev)
+#define ohci_pmac_off(dev)
-+#endif /* CONFIG_PPC_PMAC */
-+
- static int __devinit
- pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
- {
-@@ -2048,6 +2099,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
- int err;
- size_t size;
+ #endif /* CONFIG_PPC_PMAC */
++static int __devinit
++pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
++{
++ struct fw_ohci *ohci;
++ u32 bus_options, max_receive, link_speed;
++ u64 guid;
++ int err;
++ size_t size;
++
+ ohci_pmac_on(dev);
+
ohci = kzalloc(sizeof(*ohci), GFP_KERNEL);
if (ohci == NULL) {
fw_error("Could not malloc fw_ohci data.\n");
-@@ -2059,13 +2112,17 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+@@ -2076,7 +2104,7 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
err = pci_enable_device(dev);
if (err) {
fw_error("Failed to enable OHCI hardware.\n");
@@ -392,17 +864,7 @@
}
pci_set_master(dev);
- pci_write_config_dword(dev, OHCI1394_PCI_HCI_Control, 0);
- pci_set_drvdata(dev, ohci);
-
-+#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
-+ ohci->old_uninorth = dev->vendor == PCI_VENDOR_ID_APPLE &&
-+ dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW;
-+#endif
- spin_lock_init(&ohci->lock);
-
- tasklet_init(&ohci->bus_reset_tasklet,
-@@ -2151,8 +2208,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+@@ -2172,8 +2200,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
pci_release_region(dev, 0);
fail_disable:
pci_disable_device(dev);
@@ -413,13 +875,26 @@
return err;
}
-@@ -2180,39 +2237,42 @@ static void pci_remove(struct pci_dev *dev)
+@@ -2201,72 +2229,42 @@ static void pci_remove(struct pci_dev *dev)
pci_iounmap(dev, ohci->registers);
pci_release_region(dev, 0);
pci_disable_device(dev);
- fw_card_put(&ohci->card);
-+ ohci_pmac_off(dev);
+-
+-#ifdef CONFIG_PPC_PMAC
+- /* On UniNorth, power down the cable and turn off the chip clock
+- * to save power on laptops */
+- if (machine_is(powermac)) {
+- struct device_node *ofn = pci_device_to_OF_node(dev);
+-
+- if (ofn) {
+- pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
+- pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 0);
+- }
+- }
+-#endif /* CONFIG_PPC_PMAC */
+ kfree(&ohci->card);
++ ohci_pmac_off(dev);
fw_notify("Removed fw-ohci device.\n");
}
@@ -445,6 +920,16 @@
+ err = pci_set_power_state(dev, pci_choose_state(dev, state));
if (err)
fw_error("pci_set_power_state failed with %d\n", err);
+-
+-/* PowerMac suspend code comes last */
+-#ifdef CONFIG_PPC_PMAC
+- if (machine_is(powermac)) {
+- struct device_node *ofn = pci_device_to_OF_node(pdev);
+-
+- if (ofn)
+- pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
+- }
+-#endif /* CONFIG_PPC_PMAC */
+ ohci_pmac_off(dev);
return 0;
@@ -457,6 +942,16 @@
+ struct fw_ohci *ohci = pci_get_drvdata(dev);
int err;
+-/* PowerMac resume code comes first */
+-#ifdef CONFIG_PPC_PMAC
+- if (machine_is(powermac)) {
+- struct device_node *ofn = pci_device_to_OF_node(pdev);
+-
+- if (ofn)
+- pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
+- }
+-#endif /* CONFIG_PPC_PMAC */
+-
- pci_set_power_state(pdev, PCI_D0);
- pci_restore_state(pdev);
- err = pci_enable_device(pdev);
@@ -468,20 +963,31 @@
fw_error("pci_enable_device failed\n");
return err;
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
-index 03069a4..d6d62c6 100644
+index 62b4e47..2a99937 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
-@@ -174,9 +174,6 @@ struct sbp2_target {
+@@ -153,6 +153,7 @@ struct sbp2_target {
+ struct list_head lu_list;
+
+ u64 management_agent_address;
++ u64 guid;
+ int directory_id;
+ int node_id;
+ int address_high;
+@@ -173,10 +174,8 @@ struct sbp2_target {
+ #define SBP2_ORB_TIMEOUT 2000U /* Timeout in ms */
#define SBP2_ORB_NULL 0x80000000
#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
-
+-#define SBP2_RETRY_LIMIT 0xf /* 15 retries */
+-
-#define SBP2_DIRECTION_TO_MEDIA 0x0
-#define SBP2_DIRECTION_FROM_MEDIA 0x1
--
++#define SBP2_RETRY_LIMIT 0xf /* 15 retries */
++#define SBP2_CYCLE_LIMIT (0xc8 << 12) /* 200 125us cycles */
+
/* Unit directory keys */
#define SBP2_CSR_UNIT_CHARACTERISTICS 0x3a
- #define SBP2_CSR_FIRMWARE_REVISION 0x3c
-@@ -223,8 +220,8 @@ struct sbp2_status {
+@@ -224,8 +223,8 @@ struct sbp2_status {
};
struct sbp2_pointer {
@@ -492,7 +998,7 @@
};
struct sbp2_orb {
-@@ -252,8 +249,8 @@ struct sbp2_management_orb {
+@@ -253,8 +252,8 @@ struct sbp2_management_orb {
struct {
struct sbp2_pointer password;
struct sbp2_pointer response;
@@ -503,7 +1009,7 @@
struct sbp2_pointer status_fifo;
} request;
__be32 response[4];
-@@ -262,20 +259,17 @@ struct sbp2_management_orb {
+@@ -263,20 +262,17 @@ struct sbp2_management_orb {
struct sbp2_status status;
};
@@ -527,7 +1033,7 @@
#define COMMAND_ORB_REQUEST_FORMAT(v) ((v) << 29)
#define COMMAND_ORB_NOTIFY ((1) << 31)
-@@ -284,7 +278,7 @@ struct sbp2_command_orb {
+@@ -285,7 +281,7 @@ struct sbp2_command_orb {
struct {
struct sbp2_pointer next;
struct sbp2_pointer data_descriptor;
@@ -536,7 +1042,7 @@
u8 command_block[12];
} request;
struct scsi_cmnd *cmd;
-@@ -453,8 +447,7 @@ sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu,
+@@ -459,8 +455,7 @@ sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu,
unsigned long flags;
orb->pointer.high = 0;
@@ -546,7 +1052,7 @@
spin_lock_irqsave(&device->card->lock, flags);
list_add_tail(&orb->link, &lu->orb_list);
-@@ -530,31 +523,31 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
+@@ -536,31 +531,31 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
if (dma_mapping_error(orb->response_bus))
goto fail_mapping_response;
@@ -590,7 +1096,7 @@
init_completion(&orb->done);
orb->base.callback = complete_management_orb;
-@@ -599,8 +592,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
+@@ -605,8 +600,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
sizeof(orb->response), DMA_FROM_DEVICE);
fail_mapping_response:
if (response)
@@ -600,7 +1106,7 @@
kref_put(&orb->base.kref, free_orb);
return retval;
-@@ -695,10 +687,8 @@ static void sbp2_conditionally_block(struct sbp2_logical_unit *lu)
+@@ -701,10 +695,8 @@ static void sbp2_conditionally_block(struct sbp2_logical_unit *lu)
if (!tgt->dont_block && !lu->blocked &&
lu->generation != card->generation) {
lu->blocked = true;
@@ -612,7 +1118,7 @@
}
spin_unlock_irqrestore(&card->lock, flags);
}
-@@ -725,10 +715,8 @@ static void sbp2_conditionally_unblock(struct sbp2_logical_unit *lu)
+@@ -731,10 +723,8 @@ static void sbp2_conditionally_unblock(struct sbp2_logical_unit *lu)
}
spin_unlock_irqrestore(&card->lock, flags);
@@ -624,7 +1130,7 @@
}
/*
-@@ -790,7 +778,7 @@ static void sbp2_release_target(struct kref *kref)
+@@ -796,7 +786,7 @@ static void sbp2_release_target(struct kref *kref)
scsi_remove_host(shost);
fw_notify("released %s\n", tgt->bus_id);
@@ -633,7 +1139,40 @@
scsi_host_put(shost);
fw_device_put(device);
}
-@@ -855,11 +843,10 @@ static void sbp2_login(struct work_struct *work)
+@@ -825,6 +815,22 @@ complete_set_busy_timeout(struct fw_card *card, int rcode,
+ complete(done);
+ }
+
++/*
++ * Write retransmit retry values into the BUSY_TIMEOUT register.
++ * - The single-phase retry protocol is supported by all SBP-2 devices, but the
++ * default retry_limit value is 0 (i.e. never retry transmission). We write a
++ * saner value after logging into the device.
++ * - The dual-phase retry protocol is optional to implement, and if not
++ * supported, writes to the dual-phase portion of the register will be
++ * ignored. We try to write the original 1394-1995 default here.
++ * - In the case of devices that are also SBP-3-compliant, all writes are
++ * ignored, as the register is read-only, but contains single-phase retry of
++ * 15, which is what we're trying to set for all SBP-2 device anyway, so this
++ * write attempt is safe and yields more consistent behavior for all devices.
++ *
++ * See section 8.3.2.3.5 of the 1394-1995 spec, section 6.2 of the SBP-2 spec,
++ * and section 6.4 of the SBP-3 spec for further details.
++ */
+ static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
+ {
+ struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+@@ -832,8 +838,7 @@ static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
+ struct fw_transaction t;
+ static __be32 busy_timeout;
+
+- /* FIXME: we should try to set dual-phase cycle_limit too */
+- busy_timeout = cpu_to_be32(SBP2_RETRY_LIMIT);
++ busy_timeout = cpu_to_be32(SBP2_CYCLE_LIMIT | SBP2_RETRY_LIMIT);
+
+ fw_send_request(device->card, &t, TCODE_WRITE_QUADLET_REQUEST,
+ lu->tgt->node_id, lu->generation, device->max_speed,
+@@ -885,11 +890,10 @@ static void sbp2_login(struct work_struct *work)
tgt->address_high = local_node_id << 16;
sbp2_set_generation(lu, generation);
@@ -648,7 +1187,15 @@
fw_notify("%s: logged in to LUN %04x (%d retries)\n",
tgt->bus_id, lu->lun, lu->retries);
-@@ -1091,6 +1078,7 @@ static int sbp2_probe(struct device *dev)
+@@ -1111,6 +1115,7 @@ static int sbp2_probe(struct device *dev)
+ kref_init(&tgt->kref);
+ INIT_LIST_HEAD(&tgt->lu_list);
+ tgt->bus_id = unit->device.bus_id;
++ tgt->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4];
+
+ if (fw_device_enable_phys_dma(device) < 0)
+ goto fail_shost_put;
+@@ -1119,6 +1124,7 @@ static int sbp2_probe(struct device *dev)
goto fail_shost_put;
fw_device_get(device);
@@ -656,7 +1203,7 @@
/* Initialize to values that won't match anything in our table. */
firmware_revision = 0xff000000;
-@@ -1106,8 +1094,6 @@ static int sbp2_probe(struct device *dev)
+@@ -1134,8 +1140,6 @@ static int sbp2_probe(struct device *dev)
sbp2_init_workarounds(tgt, model, firmware_revision);
@@ -665,7 +1212,7 @@
/* Do the login in a workqueue so we can easily reschedule retries. */
list_for_each_entry(lu, &tgt->lu_list, link)
sbp2_queue_work(lu, 0);
-@@ -1339,9 +1325,12 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
+@@ -1367,9 +1371,12 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
* tables.
*/
if (count == 1 && sg_dma_len(sg) < SBP2_MAX_SG_ELEMENT_LENGTH) {
@@ -681,7 +1228,7 @@
return 0;
}
-@@ -1362,16 +1351,14 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
+@@ -1390,16 +1397,14 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
goto fail_page_table;
}
l = min(sg_len, SBP2_MAX_SG_ELEMENT_LENGTH);
@@ -700,7 +1247,7 @@
orb->page_table_bus =
dma_map_single(device->card->device, orb->page_table,
sizeof(orb->page_table), DMA_TO_DEVICE);
-@@ -1385,11 +1372,10 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
+@@ -1413,11 +1418,10 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
* initiator (i.e. us), but data_descriptor can refer to data
* on other nodes so we need to put our ID in descriptor.high.
*/
@@ -716,7 +1263,7 @@
return 0;
-@@ -1435,8 +1421,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
+@@ -1463,8 +1467,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
orb->done = done;
orb->cmd = cmd;
@@ -726,7 +1273,7 @@
/*
* At speed 100 we can do 512 bytes per packet, at speed 200,
* 1024 bytes per packet etc. The SBP-2 max_payload field
-@@ -1445,25 +1430,17 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
+@@ -1473,25 +1476,17 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
*/
max_payload = min(device->max_speed + 7,
device->card->max_receive - 1);
@@ -755,7 +1302,7 @@
memcpy(orb->request.command_block, cmd->cmnd, COMMAND_SIZE(*cmd->cmnd));
orb->base.callback = complete_command_orb;
-@@ -1491,11 +1468,8 @@ static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
+@@ -1519,11 +1514,8 @@ static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
sdev->allow_restart = 1;
@@ -769,40 +1316,116 @@
if (lu->tgt->workarounds & SBP2_WORKAROUND_INQUIRY_36)
sdev->inquiry_len = 36;
+@@ -1581,16 +1573,14 @@ sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr,
+ {
+ struct scsi_device *sdev = to_scsi_device(dev);
+ struct sbp2_logical_unit *lu;
+- struct fw_device *device;
+
+ if (!sdev)
+ return 0;
+
+ lu = sdev->hostdata;
+- device = fw_device(lu->tgt->unit->device.parent);
+
+- return sprintf(buf, "%08x%08x:%06x:%04x\n",
+- device->config_rom[3], device->config_rom[4],
++ return sprintf(buf, "%016llx:%06x:%04x\n",
++ (unsigned long long)lu->tgt->guid,
+ lu->tgt->directory_id, lu->lun);
+ }
+
+diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
+index d2c7a3d..ebdec4c 100644
+--- a/drivers/firewire/fw-topology.c
++++ b/drivers/firewire/fw-topology.c
+@@ -108,6 +108,7 @@ static struct fw_node *fw_node_create(u32 sid, int port_count, int color)
+ node->node_id = LOCAL_BUS | SELF_ID_PHY_ID(sid);
+ node->link_on = SELF_ID_LINK_ON(sid);
+ node->phy_speed = SELF_ID_PHY_SPEED(sid);
++ node->initiated_reset = SELF_ID_PHY_INITIATOR(sid);
+ node->port_count = port_count;
+
+ atomic_set(&node->ref_count, 1);
+@@ -431,6 +432,8 @@ update_tree(struct fw_card *card, struct fw_node *root)
+ event = FW_NODE_LINK_OFF;
+ else if (!node0->link_on && node1->link_on)
+ event = FW_NODE_LINK_ON;
++ else if (node1->initiated_reset && node1->link_on)
++ event = FW_NODE_INITIATED_RESET;
+ else
+ event = FW_NODE_UPDATED;
+
+diff --git a/drivers/firewire/fw-topology.h b/drivers/firewire/fw-topology.h
+index cedc1ec..addb9f8 100644
+--- a/drivers/firewire/fw-topology.h
++++ b/drivers/firewire/fw-topology.h
+@@ -20,11 +20,12 @@
+ #define __fw_topology_h
+
+ enum {
+- FW_NODE_CREATED = 0x00,
+- FW_NODE_UPDATED = 0x01,
+- FW_NODE_DESTROYED = 0x02,
+- FW_NODE_LINK_ON = 0x03,
+- FW_NODE_LINK_OFF = 0x04,
++ FW_NODE_CREATED,
++ FW_NODE_UPDATED,
++ FW_NODE_DESTROYED,
++ FW_NODE_LINK_ON,
++ FW_NODE_LINK_OFF,
++ FW_NODE_INITIATED_RESET,
+ };
+
+ struct fw_node {
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
-index 7fcc59d..99529e5 100644
+index 99529e5..e550535 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
-@@ -751,7 +751,7 @@ handle_topology_map(struct fw_card *card, struct fw_request *request,
- void *payload, size_t length, void *callback_data)
+@@ -396,7 +396,8 @@ const struct fw_address_region fw_high_memory_region =
+ const struct fw_address_region fw_private_region =
+ { .start = 0xffffe0000000ULL, .end = 0xfffff0000000ULL, };
+ const struct fw_address_region fw_csr_region =
+- { .start = 0xfffff0000000ULL, .end = 0xfffff0000800ULL, };
++ { .start = CSR_REGISTER_BASE,
++ .end = CSR_REGISTER_BASE | CSR_CONFIG_ROM_END, };
+ const struct fw_address_region fw_unit_space_region =
+ { .start = 0xfffff0000900ULL, .end = 0x1000000000000ULL, };
+ EXPORT_SYMBOL(fw_low_memory_region);
+@@ -741,7 +742,8 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
+ EXPORT_SYMBOL(fw_core_handle_response);
+
+ static const struct fw_address_region topology_map_region =
+- { .start = 0xfffff0001000ull, .end = 0xfffff0001400ull, };
++ { .start = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP,
++ .end = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP_END, };
+
+ static void
+ handle_topology_map(struct fw_card *card, struct fw_request *request,
+@@ -779,7 +781,8 @@ static struct fw_address_handler topology_map = {
+ };
+
+ static const struct fw_address_region registers_region =
+- { .start = 0xfffff0000000ull, .end = 0xfffff0000400ull, };
++ { .start = CSR_REGISTER_BASE,
++ .end = CSR_REGISTER_BASE | CSR_CONFIG_ROM, };
+
+ static void
+ handle_registers(struct fw_card *card, struct fw_request *request,
+@@ -788,7 +791,7 @@ handle_registers(struct fw_card *card, struct fw_request *request,
+ unsigned long long offset,
+ void *payload, size_t length, void *callback_data)
{
- int i, start, end;
-- u32 *map;
-+ __be32 *map;
+- int reg = offset - CSR_REGISTER_BASE;
++ int reg = offset & ~CSR_REGISTER_BASE;
+ unsigned long long bus_time;
+ __be32 *data = payload;
- if (!TCODE_IS_READ_REQUEST(tcode)) {
- fw_send_response(card, request, RCODE_TYPE_ERROR);
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
-index 09cb728..1a22a23 100644
+index a43bb22..8d1987f 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
-@@ -86,12 +86,12 @@
- static inline void
- fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
- {
-- u32 *dst = _dst;
-- u32 *src = _src;
-+ u32 *dst = _dst;
-+ __be32 *src = _src;
- int i;
-
- for (i = 0; i < size / 4; i++)
-- dst[i] = cpu_to_be32(src[i]);
-+ dst[i] = be32_to_cpu(src[i]);
- }
-
- static inline void
-@@ -221,7 +221,6 @@ struct fw_card {
+@@ -221,12 +221,9 @@ struct fw_card {
const struct fw_card_driver *driver;
struct device *device;
atomic_t device_count;
@@ -810,7 +1433,12 @@
int node_id;
int generation;
-@@ -263,9 +262,6 @@ struct fw_card {
+- /* This is the generation used for timestamping incoming requests. */
+- int request_generation;
+ int current_tlabel, tlabel_mask;
+ struct list_head transaction_list;
+ struct timer_list flush_timer;
+@@ -263,9 +260,6 @@ struct fw_card {
int bm_generation;
};
@@ -858,6 +1486,50 @@
};
+diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c
+index b642546..fa2bfec 100644
+--- a/drivers/ieee1394/highlevel.c
++++ b/drivers/ieee1394/highlevel.c
+@@ -339,7 +339,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
+ if ((alignment & 3) || (alignment > 0x800000000000ULL) ||
+ (hweight64(alignment) != 1)) {
+ HPSB_ERR("%s called with invalid alignment: 0x%048llx",
+- __FUNCTION__, (unsigned long long)alignment);
++ __func__, (unsigned long long)alignment);
+ return retval;
+ }
+
+@@ -354,7 +354,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
+ if (((start|end) & ~align_mask) || (start >= end) ||
+ (end > CSR1212_ALL_SPACE_END)) {
+ HPSB_ERR("%s called with invalid addresses "
+- "(start = %012Lx end = %012Lx)", __FUNCTION__,
++ "(start = %012Lx end = %012Lx)", __func__,
+ (unsigned long long)start,(unsigned long long)end);
+ return retval;
+ }
+@@ -422,7 +422,7 @@ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
+
+ if (((start|end) & 3) || (start >= end) ||
+ (end > CSR1212_ALL_SPACE_END)) {
+- HPSB_ERR("%s called with invalid addresses", __FUNCTION__);
++ HPSB_ERR("%s called with invalid addresses", __func__);
+ return 0;
+ }
+
+diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
+index 36c747b..942bf1f 100644
+--- a/drivers/ieee1394/ieee1394_core.c
++++ b/drivers/ieee1394/ieee1394_core.c
+@@ -242,7 +242,7 @@ int hpsb_bus_reset(struct hpsb_host *host)
+ {
+ if (host->in_bus_reset) {
+ HPSB_NOTICE("%s called while bus reset already in progress",
+- __FUNCTION__);
++ __func__);
+ return 1;
+ }
+
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 511e432..70afa37 100644
--- a/drivers/ieee1394/nodemgr.c
@@ -876,9 +1548,18 @@
id->vendor_id != ud->vendor_id)
continue;
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
-index 969de2a..29b8910 100644
+index 969de2a..0808bae 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
+@@ -708,7 +708,7 @@ static void insert_packet(struct ti_ohci *ohci,
+ /* FIXME: do something about it */
+ PRINT(KERN_ERR,
+ "%s: packet data addr: %p size %Zd bytes "
+- "cross page boundary", __FUNCTION__,
++ "cross page boundary", __func__,
+ packet->data, packet->data_size);
+ }
+ #endif
@@ -2993,15 +2993,9 @@ do { \
return err; \
} while (0)
@@ -1080,6 +1761,62 @@
if (err) {
PRINT(KERN_ERR, "pci_enable_device failed with %d", err);
return err;
+diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c
+index 8af01ab..9c35e0d 100644
+--- a/drivers/ieee1394/pcilynx.c
++++ b/drivers/ieee1394/pcilynx.c
+@@ -226,7 +226,7 @@ static int get_phy_reg(struct ti_lynx *lynx, int addr)
+ if (addr > 15) {
+ PRINT(KERN_ERR, lynx->id,
+ "%s: PHY register address %d out of range",
+- __FUNCTION__, addr);
++ __func__, addr);
+ return -1;
+ }
+
+@@ -238,7 +238,7 @@ static int get_phy_reg(struct ti_lynx *lynx, int addr)
+
+ if (i > 10000) {
+ PRINT(KERN_ERR, lynx->id, "%s: runaway loop, aborting",
+- __FUNCTION__);
++ __func__);
+ retval = -1;
+ break;
+ }
+@@ -261,13 +261,13 @@ static int set_phy_reg(struct ti_lynx *lynx, int addr, int val)
+
+ if (addr > 15) {
+ PRINT(KERN_ERR, lynx->id,
+- "%s: PHY register address %d out of range", __FUNCTION__, addr);
++ "%s: PHY register address %d out of range", __func__, addr);
+ return -1;
+ }
+
+ if (val > 0xff) {
+ PRINT(KERN_ERR, lynx->id,
+- "%s: PHY register value %d out of range", __FUNCTION__, val);
++ "%s: PHY register value %d out of range", __func__, val);
+ return -1;
+ }
+
+@@ -287,7 +287,7 @@ static int sel_phy_reg_page(struct ti_lynx *lynx, int page)
+
+ if (page > 7) {
+ PRINT(KERN_ERR, lynx->id,
+- "%s: PHY page %d out of range", __FUNCTION__, page);
++ "%s: PHY page %d out of range", __func__, page);
+ return -1;
+ }
+
+@@ -309,7 +309,7 @@ static int sel_phy_reg_port(struct ti_lynx *lynx, int port)
+
+ if (port > 15) {
+ PRINT(KERN_ERR, lynx->id,
+- "%s: PHY port %d out of range", __FUNCTION__, port);
++ "%s: PHY port %d out of range", __func__, port);
+ return -1;
+ }
+
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index 37e7e10..3634785 100644
--- a/drivers/ieee1394/raw1394.c
@@ -1093,10 +1830,28 @@
/******************************************************************************/
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
-index 9e2b196..29e6663 100644
+index f53f72d..16b9d0a 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
-@@ -1980,11 +1980,8 @@ static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
+@@ -615,7 +615,7 @@ static struct sbp2_command_info *sbp2util_allocate_command_orb(
+ cmd->Current_SCpnt = Current_SCpnt;
+ list_add_tail(&cmd->list, &lu->cmd_orb_inuse);
+ } else
+- SBP2_ERR("%s: no orbs available", __FUNCTION__);
++ SBP2_ERR("%s: no orbs available", __func__);
+ spin_unlock_irqrestore(&lu->cmd_orb_lock, flags);
+ return cmd;
+ }
+@@ -1294,7 +1294,7 @@ static int sbp2_set_busy_timeout(struct sbp2_lu *lu)
+
+ data = cpu_to_be32(SBP2_BUSY_TIMEOUT_VALUE);
+ if (hpsb_node_write(lu->ne, SBP2_BUSY_TIMEOUT_ADDRESS, &data, 4))
+- SBP2_ERR("%s error", __FUNCTION__);
++ SBP2_ERR("%s error", __func__);
+ return 0;
+ }
+
+@@ -1985,11 +1985,8 @@ static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
lu->sdev = sdev;
sdev->allow_restart = 1;
linux-2.6-wireless-pending.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.2 -r 1.3 linux-2.6-wireless-pending.patch
Index: linux-2.6-wireless-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-wireless-pending.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-wireless-pending.patch 6 Mar 2008 13:59:26 -0000 1.2
+++ linux-2.6-wireless-pending.patch 1 Apr 2008 10:38:06 -0000 1.3
@@ -1,20080 +1,71648 @@
-commit e4861829072c61883114c64a3af61f305a789ff0
-Author: Johannes Berg <johannes at sipsolutions.net>
-Date: Wed Feb 27 13:39:00 2008 +0100
+commit e5225b397308f9eea86327293b73dc88068e0179
+Author: Holger Schurig <hs4233 at mail.mn-solutions.de>
+Date: Wed Mar 26 10:04:44 2008 +0100
- mac80211: fix key replacing, hw accel
+ libertas: reduce debug output
- Even though I thought about it a lot and had also tested it, some
- of my recent changes in the key code broke replacing keys, making
- the kernel oops because a key is removed from a list while not on
- it.
+ This patch tries to make dmesg logs between different runs easier
+ to compare by
- This patch fixes that using the list as an indication whether or
- not the key is on it (an empty list means it's not on any list.)
+ * removing the jiffies (use CONFIG_PRINTK_TIME if you need
+ timing)
+ * remove the line numbers, they change with each applied patch
- Also, this patch fixes hw accel enabling, the check for not doing
- hw accel when the interface is down was lost and is restored by
- this.
+ It also changes the deprecated __FUNCTION__ to __func__ to make
+ checkpatch.pl happy.
- Additionally, move adding the key to the list into the function
- __ieee80211_key_replace() for more consistency.
+ Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
+ Acked-by: Dan Williams <dcbw at redhat.com>
+ Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 056cdd599d004e36de64c925b8a13f6676451360
+Author: Johannes Berg <johannes at sipsolutions.net>
+Date: Wed Mar 26 23:21:47 2008 +0100
+
+ mac80211: reorder fields to make some structures smaller
+
+ This patch reorders some fields in various structures to have
+ less padding within the structures, making them smaller. It
+ doesn't yet make any type adjustments, but often size_t is used
+ for example for IE lengths which is total overkill since size_t
+ will be 8 bytes long on 64-bit yet the length can at most fill
+ a u8.
Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
-commit db4d1169d0b893bfb7923b6526748fe2c5a7373f
-Author: Johannes Berg <johannes at sipsolutions.net>
-Date: Mon Feb 25 16:27:45 2008 +0100
+commit 8dd62822ddbf6a9314e9b92a3816c04490c91293
+Author: John W. Linville <linville at tuxdriver.com>
+Date: Wed Mar 26 15:21:33 2008 -0400
- mac80211: split ieee80211_key_alloc/free
+ prism54: correct thinko in "prism54: Convert stats_sem in a mutex"
- In order to RCU-ify sta_info, we need to be able to allocate
- a key without linking it to an sdata/sta structure (because
- allocation cannot be done in an rcu critical section). This
- patch splits up ieee80211_key_alloc() and updates all users
- appropriately.
+ mutex_trylock has different return code semantics than down_trylock...
- While at it, this patch fixes a number of race conditions
- such as finally making key replacement atomic, unfortunately
- at the expense of more complex code.
+ Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit cee24a3e580f1062c8bb8b1692b95014d882bc7d
+Author: Ron Rindjunsky <ron.rindjunsky at intel.com>
+Date: Wed Mar 26 20:36:03 2008 +0200
+
+ mac80211: A-MPDU MLME use dynamic allocation
- Note that this patch documents /existing/ bugs with sta info
- and key interaction, there is currently a race condition
- when a sta info is freed without holding the RTNL. This will
- finally be fixed by a followup patch.
+ This patch alters the A-MPDU MLME in sta_info to use dynamic allocation,
+ thus drastically improving memory usage - from a constant ~2 Kbyte in
+ the previous (static) allocation to a lower limit of ~200 Byte and an upper
+ limit of ~2 Kbyte.
- Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+ Signed-off-by: Ron Rindjunsky <ron.rindjunsky at intel.com>
+ Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
-commit 6f48422a29714ed92f6136d9e7d3ff39c75607d7
+commit 6c507cd0400cb51dd2ee251c1b8756b9375a1128
Author: Johannes Berg <johannes at sipsolutions.net>
-Date: Mon Feb 25 16:27:44 2008 +0100
+Date: Wed Mar 26 14:14:55 2008 +0100
- mac80211: remove STA infos last_ack stuff
+ cfg80211: don't export ieee80211_get_channel
- These things aren't used and the only possible use is within
- rate control algorithms, however those can, if they need it,
- keep track of it in their private data. last_ack_ms isn't
- even updated so completely useless.
+ This patch makes ieee80211_get_channel a static inline defined in
+ cfg80211's header file which simply calls __ieee80211_get_channel
+ to avoid symbol clashes with the ieee80211 code.
+
+ The problem was pointed out by David Miller, thanks!
Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+ Cc: David Miller <davem at davemloft.net>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
-commit e6a5ddf20886206caf1c4a2431f6ff01198ab0f7
-Author: Johannes Berg <johannes at sipsolutions.net>
-Date: Mon Feb 25 16:27:42 2008 +0100
+commit 7d5796118353cd45e9e301fdf3ff99fdec5390e9
+Author: Holger Schurig <hs4233 at mail.mn-solutions.de>
+Date: Wed Mar 26 13:26:55 2008 +0100
- mac80211: safely free beacon in ieee80211_if_reinit
+ libertas: the compact flash driver is no longer experimental
- If ieee80211_if_reinit() is called from ieee80211_unregister_hw()
- then it is possible that the driver will still request a beacon
- (it is allowed to until ieee80211_unregister_hw() has returned.)
- This means we need to use an RCU-protected write to the beacon
- information even in this function.
+ Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
+ Acked-by: Dan Williams <dcbw at redhat.com>
+ Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 62436138c83f221943c1f5d9cff41305d3d26ac4
+Author: Holger Schurig <hs4233 at mail.mn-solutions.de>
+Date: Wed Mar 26 09:57:45 2008 +0100
+
+ libertas: remove CMD_802_11_PWR_CFG
- Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+ This has nowhere been used. Note: in the firmware manual this was
+ documented as CMD_802_11_PA_CFG. If we ever need it, we can/should
+ re-implement it as a direct command.
+
+ Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
+ Acked-by: Dan Williams <dcbw at redhat.com>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
-commit 2485f7105f20f85c2dbebc67be6b2cb97175fa7e
-Author: Johannes Berg <johannes at sipsolutions.net>
-Date: Mon Feb 25 16:27:41 2008 +0100
+commit c2b310a73b62f074b0019b940417cafbdbafde41
+Author: Holger Schurig <hs4233 at mail.mn-solutions.de>
+Date: Wed Mar 26 09:57:14 2008 +0100
- mac80211: clarify use of TX status/RX callbacks
+ libertas: kill useless #define LBS_MONITOR_OFF 0
- This patch clarifies the use of the irqsafe vs. non-irq-safe
- functions and their respective locking requirements.
+ Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
+ Acked-by: Dan Williams <dcbw at redhat.com>
+ Signed-off-by: John W. Linville <linville at tuxdriver.com>
+
+commit 69dc5d9da5c499c23db7b80217023403da103816
+Author: Tomas Winkler <tomas.winkler at intel.com>
+Date: Tue Mar 25 16:33:41 2008 -0700
+
+ iwlwifi: iwl_priv - clean up in types of members
- Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
+ This patch fix types of is_open and iw_mode members
+ of iwl_priv sturct
+
+ Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
+ Signed-off-by: Reinette Chatre <reinette.chatre at intel.com>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
-commit 38c07b430b50172b803fe4c7f76cba580ba9931f
-Author: Pavel Roskin <proski at gnu.org>
-Date: Tue Feb 26 17:59:14 2008 -0500
+commit 0472f887e0689fff2dce82c01d40698432965b5a
+Author: Emmanuel Grumbach <emmanuel.grumbach at intel.com>
+Date: Tue Mar 25 16:33:40 2008 -0700
- ath5k: fix all endian issues reported by sparse
+ iwlwifi: allow a default callback for ASYNC host commands
- Changes-licensed-under: ISC
[...102990 lines suppressed...]
++!Finclude/net/mac80211.h ieee80211_rts_get
++!Finclude/net/mac80211.h ieee80211_rts_duration
++!Finclude/net/mac80211.h ieee80211_ctstoself_get
++!Finclude/net/mac80211.h ieee80211_ctstoself_duration
++!Finclude/net/mac80211.h ieee80211_generic_frame_duration
++!Finclude/net/mac80211.h ieee80211_get_hdrlen_from_skb
++!Finclude/net/mac80211.h ieee80211_get_hdrlen
++!Finclude/net/mac80211.h ieee80211_wake_queue
++!Finclude/net/mac80211.h ieee80211_stop_queue
++!Finclude/net/mac80211.h ieee80211_start_queues
++!Finclude/net/mac80211.h ieee80211_stop_queues
++!Finclude/net/mac80211.h ieee80211_wake_queues
++ </sect1>
++ </chapter>
++
++ <chapter id="filters">
++ <title>Frame filtering</title>
++!Pinclude/net/mac80211.h Frame filtering
++!Finclude/net/mac80211.h ieee80211_filter_flags
++ </chapter>
++ </part>
++
++ <part id="advanced">
++ <title>Advanced driver interface</title>
++ <partintro>
++ <para>
++ Information contained within this part of the book is
++ of interest only for advanced interaction of mac80211
++ with drivers to exploit more hardware capabilities and
++ improve performance.
++ </para>
++ </partintro>
++
++ <chapter id="hardware-crypto-offload">
++ <title>Hardware crypto acceleration</title>
++!Pinclude/net/mac80211.h Hardware crypto acceleration
++<!-- intentionally multiple !F lines to get proper order -->
++!Finclude/net/mac80211.h set_key_cmd
++!Finclude/net/mac80211.h ieee80211_key_conf
++!Finclude/net/mac80211.h ieee80211_key_alg
++!Finclude/net/mac80211.h ieee80211_key_flags
++ </chapter>
++
++ <chapter id="qos">
++ <title>Multiple queues and QoS support</title>
++ <para>TBD</para>
++!Finclude/net/mac80211.h ieee80211_tx_queue_params
++!Finclude/net/mac80211.h ieee80211_tx_queue_stats_data
++!Finclude/net/mac80211.h ieee80211_tx_queue
++ </chapter>
++
++ <chapter id="AP">
++ <title>Access point mode support</title>
++ <para>TBD</para>
++ <para>Some parts of the if_conf should be discussed here instead</para>
++ <para>
++ Insert notes about VLAN interfaces with hw crypto here or
++ in the hw crypto chapter.
++ </para>
++!Finclude/net/mac80211.h ieee80211_get_buffered_bc
++!Finclude/net/mac80211.h ieee80211_beacon_get
++ </chapter>
++
++ <chapter id="multi-iface">
++ <title>Supporting multiple virtual interfaces</title>
++ <para>TBD</para>
++ <para>
++ Note: WDS with identical MAC address should almost always be OK
++ </para>
++ <para>
++ Insert notes about having multiple virtual interfaces with
++ different MAC addresses here, note which configurations are
++ supported by mac80211, add notes about supporting hw crypto
++ with it.
++ </para>
++ </chapter>
++
++ <chapter id="hardware-scan-offload">
++ <title>Hardware scan offload</title>
++ <para>TBD</para>
++!Finclude/net/mac80211.h ieee80211_scan_completed
++ </chapter>
++ </part>
++
++ <part id="rate-control">
++ <title>Rate control interface</title>
++ <partintro>
++ <para>TBD</para>
++ <para>
++ This part of the book describes the rate control algorithm
++ interface and how it relates to mac80211 and drivers.
++ </para>
++ </partintro>
++ <chapter id="dummy">
++ <title>dummy chapter</title>
++ <para>TBD</para>
++ </chapter>
++ </part>
++
++ <part id="internal">
++ <title>Internals</title>
++ <partintro>
++ <para>TBD</para>
++ <para>
++ This part of the book describes mac80211 internals.
++ </para>
++ </partintro>
++
++ <chapter id="key-handling">
++ <title>Key handling</title>
++ <sect1>
++ <title>Key handling basics</title>
++!Pnet/mac80211/key.c Key handling basics
++ </sect1>
++ <sect1>
++ <title>MORE TBD</title>
++ <para>TBD</para>
++ </sect1>
++ </chapter>
++
++ <chapter id="rx-processing">
++ <title>Receive processing</title>
++ <para>TBD</para>
++ </chapter>
++
++ <chapter id="tx-processing">
++ <title>Transmit processing</title>
++ <para>TBD</para>
++ </chapter>
++
++ <chapter id="sta-info">
++ <title>Station info handling</title>
++ <sect1>
++ <title>Programming information</title>
++!Fnet/mac80211/sta_info.h sta_info
++!Fnet/mac80211/sta_info.h ieee80211_sta_info_flags
++ </sect1>
++ <sect1>
++ <title>STA information lifetime rules</title>
++!Pnet/mac80211/sta_info.c STA information lifetime rules
++ </sect1>
++ </chapter>
++
++ <chapter id="synchronisation">
++ <title>Synchronisation</title>
++ <para>TBD</para>
++ <para>Locking, lots of RCU</para>
++ </chapter>
++ </part>
++</book>
+diff -up linux-2.6.24.noarch/Documentation/DocBook/Makefile.orig linux-2.6.24.noarch/Documentation/DocBook/Makefile
+--- linux-2.6.24.noarch/Documentation/DocBook/Makefile.orig 2008-03-28 11:53:57.000000000 -0400
++++ linux-2.6.24.noarch/Documentation/DocBook/Makefile 2008-03-28 11:55:11.000000000 -0400
+@@ -11,7 +11,8 @@ DOCBOOKS := wanbook.xml z8530book.xml mc
+ procfs-guide.xml writing_usb_driver.xml networking.xml \
+ kernel-api.xml filesystems.xml lsm.xml usb.xml \
+ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
+- genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml
++ genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
++ mac80211.xml
+
+ ###
+ # The build process is as follows (targets):
+diff -up linux-2.6.24.noarch/Documentation/feature-removal-schedule.txt.orig linux-2.6.24.noarch/Documentation/feature-removal-schedule.txt
+--- linux-2.6.24.noarch/Documentation/feature-removal-schedule.txt.orig 2008-03-28 10:30:27.000000000 -0400
++++ linux-2.6.24.noarch/Documentation/feature-removal-schedule.txt 2008-03-28 11:55:11.000000000 -0400
+@@ -230,33 +230,6 @@ Who: Jean Delvare <khali at linux-fr.org>
+
+ ---------------------------
+
+-What: bcm43xx wireless network driver
+-When: 2.6.26
+-Files: drivers/net/wireless/bcm43xx
+-Why: This driver's functionality has been replaced by the
+- mac80211-based b43 and b43legacy drivers.
+-Who: John W. Linville <linville at tuxdriver.com>
+-
+----------------------------
+-
+-What: ieee80211 softmac wireless networking component
+-When: 2.6.26 (or after removal of bcm43xx and port of zd1211rw to mac80211)
+-Files: net/ieee80211/softmac
+-Why: No in-kernel drivers will depend on it any longer.
+-Who: John W. Linville <linville at tuxdriver.com>
+-
+----------------------------
+-
+-What: rc80211-simple rate control algorithm for mac80211
+-When: 2.6.26
+-Files: net/mac80211/rc80211-simple.c
+-Why: This algorithm was provided for reference but always exhibited bad
+- responsiveness and performance and has some serious flaws. It has been
+- replaced by rc80211-pid.
+-Who: Stefano Brivio <stefano.brivio at polimi.it>
+-
+----------------------------
+-
+ What (Why):
+ - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files
+ (superseded by xt_TOS/xt_tos target & match)
linux-2.6-wireless.patch:
Index: linux-2.6-wireless.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-wireless.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- linux-2.6-wireless.patch 6 Mar 2008 13:59:26 -0000 1.3
+++ linux-2.6-wireless.patch 1 Apr 2008 10:38:07 -0000 1.4
@@ -1,391 +1,119 @@
-commit c256e05b7b30fab484deacb4f8cff59ce649c75e
-Author: Michael Buesch <mb at bu3sch.de>
-Date: Tue Mar 4 20:31:13 2008 +0100
+commit 3e05e6703fb663fb8a394615d16c3a93cbef001e
+Author: Ivo van Doorn <ivdoorn at gmail.com>
+Date: Thu Mar 27 17:15:24 2008 +0100
- b43legacy: Fix module init message
+ rt2x00: Ignore set_state(STATE_SLEEP) failure
- This fixes the module init message to tell that the legacy
- driver loaded. This makes it less confusing, in case both drivers are loaded.
+ Some hardware never seem to accept the "goto sleep" command, since the legacy
+ drivers don't have suspend and resume handlers the entire code for it was
+ basically a educated guess (based on the "enable radio" code).
+ This patch will only print a warning when the "goto sleep" command fails, and
+ just continues as usual. Perhaps that means the device will not reach a sleep
+ state and consumes more power then it should, but it is equally possible it
+ simply needs some seconds longer to sleep. Anyway, by making the command
+ non-fatal it will not block the rest of the suspend procedure.
- Signed-off-by: Michael Buesch <mb at bu3sch.de>
+ Signed-off-by: Ivo van Doorn <IvDoorn at gmail.com>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
-commit cdb2a9fe63575dd1eb82b724bbd0aa5e0dd89fa0
-Author: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
-Date: Tue Mar 4 20:05:27 2008 +0200
+commit 8def53bc1ff4686bd24b3c274a4871c9ae33c27c
+Author: Julia Lawall <julia at diku.dk>
+Date: Tue Mar 4 14:58:59 2008 -0800
- rndis_wlan: fix broken data copy
+ drivers/net/wireless/iwlwifi/iwl-4965.c: correct use of ! and &
- Replace broken code that attempted to copy 6 byte array to 64-bit
- integer. Due to missing cast to 64-bit integer, left shift operation
- were 32-bit and lead to bytes been copied over each other. New code
- uses simple memcpy, for greater readability and efficiency.
+ In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337, a bug was fixed that
+ involved converting !x & y to !(x & y). The code below shows the same
+ pattern, and thus should perhaps be fixed in the same way.
- Signed-off-by: Jussi Kivilinna <jussi.kivilinna at mbnet.fi>
- Signed-off-by: John W. Linville <linville at tuxdriver.com>
-
-commit 8a96df80b3ddb2410045a26ea19eeccb5f2d2d11
-Author: Sebastian Siewior <bigeasy at tglx.de>
-Date: Tue Mar 4 18:22:27 2008 +0100
-
- libertas: compare the current command with response
-
- instead of with itself.
+ This is not tested and clearly changes the semantics, so it is only
+ something to consider.
- Signed-off-by: Sebastian Siewior <bigeasy at linutronix.de>
- Signed-off-by: John W. Linville <linville at tuxdriver.com>
-
-commit 6305f498604df6c66bdb4cc533ce6332fa5ab61f
-Author: David Woodhouse <dwmw2 at infradead.org>
-Date: Mon Mar 3 12:20:12 2008 +0100
-
- libertas: fix sanity check on sequence number in command response
+ The semantic patch that makes this change is as follows:
+ (http://www.emn.fr/x-info/coccinelle/)
- Slightly more useful if we compare it against the sequence number of the
- command we have outstanding, rather than comparing the reply with itself.
+ // <smpl>
+ @@ expression E1,E2; @@
+ (
+ !E1 & !E2
+ |
+ - !E1 & E2
+ + !(E1 & E2)
+ )
+ // </smpl>
- Doh. Pointed out by Sebastian Siewior
-
- Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
- Acked-by: Dan Williams <dcbw at redhat.com>
+ Signed-off-by: Julia Lawall <julia at diku.dk>
+ Cc: Tomas Winkler <tomas.winkler at intel.com>
+ Cc: Guy Cohen <guy.cohen at intel.com>
+ Cc: Reinette Chatre <reinette.chatre at intel.com>
+ Cc: Zhu Yi <yi.zhu at intel.com>
+ Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
-commit c2f2d3a06f8b628d444cf4f396d6c6ddd47e1d1f
-Author: Johannes Berg <johannes at sipsolutions.net>
-Date: Fri Feb 29 23:28:25 2008 +0100
-
- p54: fix eeprom parser length sanity checks
-
- When I called p54_parse_eeprom() on a hand-coded structure
- I managed to make a small mistake with wrap->len which caused
- a segfault a few lines down when trying to read entry->len.
- This patch changes the validation code to avoid such problems.
-
- Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
- Tested-by: Florian Fainelli <florian.fainelli at telecomint.eu>
- Signed-off-by: John W. Linville <linville at tuxdriver.com>
+commit 9cef555bcc6a5a7c1a5bb7728fd96bc59fa1b96a
+Author: Holger Schurig <hs4233 at mail.mn-solutions.de>
+Date: Wed Mar 19 15:24:21 2008 +0100
-commit 8c28293f5514f64ba064bac7946aebeda4a663c6
-Author: Johannes Berg <johannes at sipsolutions.net>
-Date: Fri Feb 29 13:56:33 2008 +0100
-
- p54: fix EEPROM structure endianness
-
- Since the EEPROM structure is read from hardware, it is
- always little endian, annotate that in the struct and
- make sure to convert where applicable.
-
- Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
- Cc: Michael Wu <flamingice at sourmilk.net>
- Tested-by: Florian Fainelli <florian.fainelli at telecomint.eu>
- Signed-off-by: John W. Linville <linville at tuxdriver.com>
-
-commit dc63644b0ee3b447e879ef8e124657b40e9ea81c
-Author: Yoichi Yuasa <yoichi_yuasa at tripeaks.co.jp>
-Date: Fri Feb 29 11:09:31 2008 +0100
-
- ssb: Add pcibios_enable_device() return value check
-
- This patch has added pcibios_enable_device() return value check.
-
- Signed-off-by: Yoichi Yuasa <yoichi_yuasa at tripeaks.co.jp>
- Signed-off-by: Michael Buesch <mb at bu3sch.de>
- Signed-off-by: John W. Linville <linville at tuxdriver.com>
-
-commit 1d60ab0574fae362b1cca0ef52181ef75fd46832
-Author: Stefano Brivio <stefano.brivio at polimi.it>
-Date: Sun Mar 2 11:33:10 2008 +0100
-
- rc80211-pid: fix rate adjustment
-
- Merge rate_control_pid_shift_adjust() to rate_control_pid_adjust_rate()
- in order to make the learning algorithm aware of constraints on rates. Also
- add some comments and rename variables.
+ libertas: fix spinlock recursion bug
- This fixes a bug which prevented 802.11b/g non-AP STAs from working with
- 802.11b only AP STAs.
+ This fixes a bug detected by CONFIG_DEBUG_SPINLOCK:
- This patch was originally destined for 2.6.26, and is being backported
- to fix a user reported problem in post-2.6.24 kernels.
+ if_cs_get_int_status() is only called from lbs_thread(), via
+ priv->hw_get_int_status. However, lbs_thread() has already taken the
+ priv->driver_lock. So it's a fault to take the same lock again here.
- Signed-off-by: Stefano Brivio <stefano.brivio at polimi.it>
+ Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
+ Acked-by: Dan Williams <dcbw at redhat.com>
Signed-off-by: John W. Linville <linville at tuxdriver.com>
-diff -up linux-2.6.24.noarch/net/mac80211/rc80211_pid_algo.c.orig linux-2.6.24.noarch/net/mac80211/rc80211_pid_algo.c
---- linux-2.6.24.noarch/net/mac80211/rc80211_pid_algo.c.orig 2008-03-04 19:28:35.000000000 -0500
-+++ linux-2.6.24.noarch/net/mac80211/rc80211_pid_algo.c 2008-03-04 19:30:56.000000000 -0500
-@@ -2,7 +2,7 @@
- * Copyright 2002-2005, Instant802 Networks, Inc.
- * Copyright 2005, Devicescape Software, Inc.
- * Copyright 2007, Mattias Nissler <mattias.nissler at gmx.de>
-- * Copyright 2007, Stefano Brivio <stefano.brivio at polimi.it>
-+ * Copyright 2007-2008, Stefano Brivio <stefano.brivio at polimi.it>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
-@@ -63,72 +63,66 @@
- * RC_PID_ARITH_SHIFT.
- */
-
--
--/* Shift the adjustment so that we won't switch to a lower rate if it exhibited
-- * a worse failed frames behaviour and we'll choose the highest rate whose
-- * failed frames behaviour is not worse than the one of the original rate
-- * target. While at it, check that the adjustment is within the ranges. Then,
-- * provide the new rate index. */
--static int rate_control_pid_shift_adjust(struct rc_pid_rateinfo *r,
-- int adj, int cur, int l)
--{
-- int i, j, k, tmp;
--
-- j = r[cur].rev_index;
-- i = j + adj;
--
-- if (i < 0)
-- return r[0].index;
-- if (i >= l - 1)
-- return r[l - 1].index;
--
-- tmp = i;
--
-- if (adj < 0) {
-- for (k = j; k >= i; k--)
-- if (r[k].diff <= r[j].diff)
-- tmp = k;
-- } else {
-- for (k = i + 1; k + i < l; k++)
-- if (r[k].diff <= r[i].diff)
-- tmp = k;
-- }
--
-- return r[tmp].index;
--}
--
-+/* Adjust the rate while ensuring that we won't switch to a lower rate if it
-+ * exhibited a worse failed frames behaviour and we'll choose the highest rate
-+ * whose failed frames behaviour is not worse than the one of the original rate
-+ * target. While at it, check that the new rate is valid. */
- static void rate_control_pid_adjust_rate(struct ieee80211_local *local,
- struct sta_info *sta, int adj,
- struct rc_pid_rateinfo *rinfo)
- {
- struct ieee80211_sub_if_data *sdata;
- struct ieee80211_hw_mode *mode;
-- int newidx;
-- int maxrate;
-- int back = (adj > 0) ? 1 : -1;
-+ int cur_sorted, new_sorted, probe, tmp, n_bitrates;
-+ int cur = sta->txrate;
-
- sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
-
- mode = local->oper_hw_mode;
-- maxrate = sdata->bss ? sdata->bss->max_ratectrl_rateidx : -1;
-+ n_bitrates = mode->num_rates;
-
-- newidx = rate_control_pid_shift_adjust(rinfo, adj, sta->txrate,
-- mode->num_rates);
-+ /* Map passed arguments to sorted values. */
-+ cur_sorted = rinfo[cur].rev_index;
-+ new_sorted = cur_sorted + adj;
-+
-+ /* Check limits. */
-+ if (new_sorted < 0)
-+ new_sorted = rinfo[0].rev_index;
-+ else if (new_sorted >= n_bitrates)
-+ new_sorted = rinfo[n_bitrates - 1].rev_index;
-
-- while (newidx != sta->txrate) {
-- if (rate_supported(sta, mode, newidx) &&
-- (maxrate < 0 || newidx <= maxrate)) {
-- sta->txrate = newidx;
-- break;
-- }
-+ tmp = new_sorted;
-
-- newidx += back;
-+ if (adj < 0) {
-+ /* Ensure that the rate decrease isn't disadvantageous. */
-+ for (probe = cur_sorted; probe >= new_sorted; probe--)
-+ if (rinfo[probe].diff <= rinfo[cur_sorted].diff &&
-+ rate_supported(sta, mode, rinfo[probe].index))
-+ tmp = probe;
-+ } else {
-+ /* Look for rate increase with zero (or below) cost. */
-+ for (probe = new_sorted + 1; probe < n_bitrates; probe++)
-+ if (rinfo[probe].diff <= rinfo[new_sorted].diff &&
-+ rate_supported(sta, mode, rinfo[probe].index))
-+ tmp = probe;
+diff -up linux-2.6.24.noarch/drivers/net/wireless/libertas/if_cs.c.orig linux-2.6.24.noarch/drivers/net/wireless/libertas/if_cs.c
+--- linux-2.6.24.noarch/drivers/net/wireless/libertas/if_cs.c.orig 2008-03-28 12:22:08.000000000 -0400
++++ linux-2.6.24.noarch/drivers/net/wireless/libertas/if_cs.c 2008-03-28 15:17:08.000000000 -0400
+@@ -677,9 +677,7 @@ sbi_get_int_status_exit:
+
+ /* Card has a command result for us */
+ if (*ireg & IF_CS_C_S_CMD_UPLD_RDY) {
+- spin_lock(&priv->driver_lock);
+ ret = if_cs_receive_cmdres(priv, priv->upld_buf, &priv->upld_len);
+- spin_unlock(&priv->driver_lock);
+ if (ret < 0)
+ lbs_pr_err("could not receive cmd from card\n");
}
-
-+ /* Fit the rate found to the nearest supported rate. */
-+ do {
-+ if (rate_supported(sta, mode, rinfo[tmp].index)) {
-+ sta->txrate = rinfo[tmp].index;
-+ break;
-+ }
-+ if (adj < 0)
-+ tmp--;
-+ else
-+ tmp++;
-+ } while (tmp < n_bitrates && tmp >= 0);
-+
- #ifdef CONFIG_MAC80211_DEBUGFS
- rate_control_pid_event_rate_change(
- &((struct rc_pid_sta_info *)sta->rate_ctrl_priv)->events,
-- newidx, mode->rates[newidx].rate);
-+ cur, mode->rates[cur].rate);
- #endif
- }
-
-diff -up linux-2.6.24.noarch/drivers/net/wireless/p54common.h.orig linux-2.6.24.noarch/drivers/net/wireless/p54common.h
---- linux-2.6.24.noarch/drivers/net/wireless/p54common.h.orig 2008-01-24 17:58:37.000000000 -0500
-+++ linux-2.6.24.noarch/drivers/net/wireless/p54common.h 2008-03-04 19:30:56.000000000 -0500
-@@ -53,10 +53,10 @@ struct pda_entry {
- } __attribute__ ((packed));
-
- struct eeprom_pda_wrap {
-- u32 magic;
-- u16 pad;
-- u16 len;
-- u32 arm_opcode;
-+ __le32 magic;
-+ __le16 pad;
-+ __le16 len;
-+ __le32 arm_opcode;
- u8 data[0];
- } __attribute__ ((packed));
-
-diff -up linux-2.6.24.noarch/drivers/net/wireless/p54common.c.orig linux-2.6.24.noarch/drivers/net/wireless/p54common.c
---- linux-2.6.24.noarch/drivers/net/wireless/p54common.c.orig 2008-03-04 19:28:31.000000000 -0500
-+++ linux-2.6.24.noarch/drivers/net/wireless/p54common.c 2008-03-04 19:30:56.000000000 -0500
-@@ -166,18 +166,23 @@ int p54_parse_eeprom(struct ieee80211_hw
- struct p54_common *priv = dev->priv;
- struct eeprom_pda_wrap *wrap = NULL;
- struct pda_entry *entry;
-- int i = 0;
- unsigned int data_len, entry_len;
- void *tmp;
- int err;
-+ u8 *end = (u8 *)eeprom + len;
-
- wrap = (struct eeprom_pda_wrap *) eeprom;
-- entry = (void *)wrap->data + wrap->len;
-- i += 2;
-- i += le16_to_cpu(entry->len)*2;
-- while (i < len) {
-+ entry = (void *)wrap->data + le16_to_cpu(wrap->len);
-+
-+ /* verify that at least the entry length/code fits */
-+ while ((u8 *)entry <= end - sizeof(*entry)) {
- entry_len = le16_to_cpu(entry->len);
- data_len = ((entry_len - 1) << 1);
-+
-+ /* abort if entry exceeds whole structure */
-+ if ((u8 *)entry + sizeof(*entry) + data_len > end)
-+ break;
-+
- switch (le16_to_cpu(entry->code)) {
- case PDR_MAC_ADDRESS:
- SET_IEEE80211_PERM_ADDR(dev, entry->data);
-@@ -249,13 +254,12 @@ int p54_parse_eeprom(struct ieee80211_hw
- priv->version = *(u8 *)(entry->data + 1);
- break;
- case PDR_END:
-- i = len;
-+ /* make it overrun */
-+ entry_len = len;
- break;
- }
-
- entry = (void *)entry + (entry_len + 1)*2;
-- i += 2;
-- i += entry_len*2;
- }
-
- if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) {
-diff -up linux-2.6.24.noarch/drivers/net/wireless/b43legacy/main.c.orig linux-2.6.24.noarch/drivers/net/wireless/b43legacy/main.c
---- linux-2.6.24.noarch/drivers/net/wireless/b43legacy/main.c.orig 2008-03-04 19:28:31.000000000 -0500
-+++ linux-2.6.24.noarch/drivers/net/wireless/b43legacy/main.c 2008-03-04 19:30:56.000000000 -0500
-@@ -3829,7 +3829,7 @@ static void b43legacy_print_driverinfo(v
- #ifdef CONFIG_B43LEGACY_DMA
- feat_dma = "D";
- #endif
-- printk(KERN_INFO "Broadcom 43xx driver loaded "
-+ printk(KERN_INFO "Broadcom 43xx-legacy driver loaded "
- "[ Features: %s%s%s%s%s, Firmware-ID: "
- B43legacy_SUPPORTED_FIRMWARE_ID " ]\n",
- feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma);
-diff -up linux-2.6.24.noarch/drivers/net/wireless/rndis_wlan.c.orig linux-2.6.24.noarch/drivers/net/wireless/rndis_wlan.c
---- linux-2.6.24.noarch/drivers/net/wireless/rndis_wlan.c.orig 2008-03-04 19:28:37.000000000 -0500
-+++ linux-2.6.24.noarch/drivers/net/wireless/rndis_wlan.c 2008-03-04 19:30:56.000000000 -0500
-@@ -260,7 +260,7 @@ struct NDIS_802_11_KEY {
- __le32 KeyLength;
- u8 Bssid[6];
- u8 Padding[6];
-- __le64 KeyRSC;
-+ u8 KeyRSC[8];
- u8 KeyMaterial[32];
- } __attribute__((packed));
-
-@@ -1508,7 +1508,7 @@ static int rndis_iw_set_encode_ext(struc
- struct usbnet *usbdev = dev->priv;
- struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
- struct NDIS_802_11_KEY ndis_key;
-- int i, keyidx, ret;
-+ int keyidx, ret;
- u8 *addr;
-
- keyidx = wrqu->encoding.flags & IW_ENCODE_INDEX;
-@@ -1543,9 +1543,7 @@ static int rndis_iw_set_encode_ext(struc
- ndis_key.KeyIndex = cpu_to_le32(keyidx);
-
- if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
-- for (i = 0; i < 6; i++)
-- ndis_key.KeyRSC |=
-- cpu_to_le64(ext->rx_seq[i] << (i * 8));
-+ memcpy(ndis_key.KeyRSC, ext->rx_seq, 6);
- ndis_key.KeyIndex |= cpu_to_le32(1 << 29);
+diff -up linux-2.6.24.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c.orig linux-2.6.24.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c
+--- linux-2.6.24.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c.orig 2008-03-28 12:22:07.000000000 -0400
++++ linux-2.6.24.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c 2008-03-28 15:17:08.000000000 -0400
+@@ -4589,7 +4589,7 @@ static u8 iwl4965_is_fat_tx_allowed(stru
+
+ if (sta_ht_inf) {
+ if ((!sta_ht_inf->ht_supported) ||
+- (!sta_ht_inf->cap & IEEE80211_HT_CAP_SUP_WIDTH))
++ (!(sta_ht_inf->cap & IEEE80211_HT_CAP_SUP_WIDTH)))
+ return 0;
}
-diff -up linux-2.6.24.noarch/drivers/net/wireless/libertas/cmdresp.c.orig linux-2.6.24.noarch/drivers/net/wireless/libertas/cmdresp.c
---- linux-2.6.24.noarch/drivers/net/wireless/libertas/cmdresp.c.orig 2008-03-04 19:28:31.000000000 -0500
-+++ linux-2.6.24.noarch/drivers/net/wireless/libertas/cmdresp.c 2008-03-04 19:30:56.000000000 -0500
-@@ -562,9 +562,7 @@ int lbs_process_rx_command(struct lbs_pr
- }
-
- resp = (void *)priv->upld_buf;
--
-- curcmd = le16_to_cpu(resp->command);
--
-+ curcmd = le16_to_cpu(priv->cur_cmd->cmdbuf->command);
- respcmd = le16_to_cpu(resp->command);
- result = le16_to_cpu(resp->result);
-
-@@ -572,9 +570,9 @@ int lbs_process_rx_command(struct lbs_pr
- respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies);
- lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", (void *) resp, priv->upld_len);
+diff -up linux-2.6.24.noarch/drivers/net/wireless/rt2x00/rt2x00dev.c.orig linux-2.6.24.noarch/drivers/net/wireless/rt2x00/rt2x00dev.c
+--- linux-2.6.24.noarch/drivers/net/wireless/rt2x00/rt2x00dev.c.orig 2008-03-28 12:22:08.000000000 -0400
++++ linux-2.6.24.noarch/drivers/net/wireless/rt2x00/rt2x00dev.c 2008-03-28 15:17:08.000000000 -0400
+@@ -1393,11 +1393,20 @@ int rt2x00lib_suspend(struct rt2x00_dev
+
+ exit:
+ /*
+- * Set device mode to sleep for power management.
++ * Set device mode to sleep for power management,
++ * on some hardware this call seems to consistently fail.
++ * From the specifications it is hard to tell why it fails,
++ * and if this is a "bad thing".
++ * Overall it is safe to just ignore the failure and
++ * continue suspending. The only downside is that the
++ * device will not be in optimal power save mode, but with
++ * the radio and the other components already disabled the
++ * device is as good as disabled.
+ */
+ retval = rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_SLEEP);
+ if (retval)
+- return retval;
++ WARNING(rt2x00dev, "Device failed to enter sleep state, "
++ "continue suspending.\n");
-- if (resp->seqnum != resp->seqnum) {
-+ if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
- lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
-- le16_to_cpu(resp->seqnum), le16_to_cpu(resp->seqnum));
-+ le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
- spin_unlock_irqrestore(&priv->driver_lock, flags);
- ret = -1;
- goto done;
-diff -up linux-2.6.24.noarch/drivers/ssb/driver_pcicore.c.orig linux-2.6.24.noarch/drivers/ssb/driver_pcicore.c
---- linux-2.6.24.noarch/drivers/ssb/driver_pcicore.c.orig 2008-03-04 19:28:37.000000000 -0500
-+++ linux-2.6.24.noarch/drivers/ssb/driver_pcicore.c 2008-03-04 19:30:56.000000000 -0500
-@@ -111,7 +111,10 @@ static void __init ssb_fixup_pcibridge(s
-
- /* Enable PCI bridge bus mastering and memory space */
- pci_set_master(dev);
-- pcibios_enable_device(dev, ~0);
-+ if (pcibios_enable_device(dev, ~0) < 0) {
-+ ssb_printk(KERN_ERR "PCI: SSB bridge enable failed\n");
-+ return;
-+ }
-
- /* Enable PCI bridge BAR1 prefetch and burst */
- pci_write_config_dword(dev, SSB_BAR1_CONTROL, 3);
+ return 0;
+ }
linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch:
Index: linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch 25 Mar 2008 10:49:00 -0000 1.1
+++ linux-2.6-xen-0001-squashfs-Fix-build-without-CONFIG_SMP.patch 1 Apr 2008 10:38:07 -0000 1.2
@@ -1,4 +1,4 @@
-From 9f1956a96db70970723ec983771988d70cb8286d Mon Sep 17 00:00:00 2001
+From d457f50be47bb436a599002edc3b4e30cf2c14bc Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc at redhat.com>
Date: Wed, 5 Mar 2008 12:50:50 +0000
Subject: [PATCH] squashfs: Fix build without CONFIG_SMP
linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch:
Index: linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch 25 Mar 2008 10:49:00 -0000 1.1
+++ linux-2.6-xen-0002-xen-execshield-Add-xen-specific-load_user_cs_desc.patch 1 Apr 2008 10:38:07 -0000 1.2
@@ -1,4 +1,4 @@
-From bfbd59d692de3fd904957de3d66047dd830e89f5 Mon Sep 17 00:00:00 2001
+From 9c0cd1ce681ec0d72901800b84f36aeebbe52bd0 Mon Sep 17 00:00:00 2001
From: Stephen Tweedie <sct at redhat.com>
Date: Tue, 11 Mar 2008 18:05:30 +0000
Subject: [PATCH] xen execshield: Add xen-specific load_user_cs_desc()
@@ -30,10 +30,10 @@
.load_idt = native_load_idt,
.store_gdt = native_store_gdt,
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
-index 8b9ee27..e9a84f6 100644
+index de4e6f0..f32795f 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
-@@ -289,6 +289,22 @@ static void xen_set_ldt(const void *addr, unsigned entries)
+@@ -290,6 +290,22 @@ static void xen_set_ldt(const void *addr, unsigned entries)
xen_mc_issue(PARAVIRT_LAZY_CPU);
}
@@ -56,7 +56,7 @@
static void xen_load_gdt(const struct desc_ptr *dtr)
{
unsigned long *frames;
-@@ -974,6 +990,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
+@@ -985,6 +1001,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
.load_tr_desc = paravirt_nop,
.set_ldt = xen_set_ldt,
linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch:
Index: linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch 25 Mar 2008 10:49:00 -0000 1.1
+++ linux-2.6-xen-0003-xen-execshield-fix-endless-GPF-fault-loop.patch 1 Apr 2008 10:38:07 -0000 1.2
@@ -1,4 +1,4 @@
-From ec424a24c665e0177e74a2a3a68af50f5e73e68c Mon Sep 17 00:00:00 2001
+From 8e103bc888701246a9f561818c34b1e0962748f6 Mon Sep 17 00:00:00 2001
From: Stephen Tweedie <sct at redhat.com>
Date: Tue, 11 Mar 2008 18:07:31 +0000
Subject: [PATCH] xen execshield: fix endless GPF fault loop
linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch:
Index: linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch 25 Mar 2008 10:49:00 -0000 1.2
+++ linux-2.6-xen-0005-xen-Make-xen-blkfront-write-its-protocol-ABI-to-xen.patch 1 Apr 2008 10:38:07 -0000 1.3
@@ -1,4 +1,4 @@
-From df43a93787049a8559b6d19e67231cb5e617cfa7 Mon Sep 17 00:00:00 2001
+From ee6b3c4793587143d2a88dbbcae7d6119c7d1248 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru at redhat.com>
Date: Mon, 25 Feb 2008 14:02:24 +0100
Subject: [PATCH] xen: Make xen-blkfront write its protocol ABI to xenstore
nouveau-drm.patch:
Index: nouveau-drm.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/nouveau-drm.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- nouveau-drm.patch 6 Mar 2008 13:59:26 -0000 1.3
+++ nouveau-drm.patch 1 Apr 2008 10:38:07 -0000 1.4
@@ -1,4 +1,4 @@
-From 97feb40c0d41369a3235a192b3db7d472e65bea8 Mon Sep 17 00:00:00 2001
+From 2e677c51e2e77e78695eda61b52704144a490bec Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Fri, 29 Feb 2008 15:58:37 +1000
Subject: [PATCH] nouveau: rebased master from git
@@ -138,10 +138,10 @@
obj-$(CONFIG_DRM_SAVAGE)+= savage.o
obj-$(CONFIG_DRM_VIA) +=via.o
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
-index bd41621..a437ac2 100644
+index c6df504..7fb3a2f 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
-@@ -1030,7 +1030,8 @@ extern unsigned long drm_get_resource_start(struct drm_device *dev,
+@@ -1033,7 +1033,8 @@ extern unsigned long drm_get_resource_start(struct drm_device *dev,
unsigned int resource);
extern unsigned long drm_get_resource_len(struct drm_device *dev,
unsigned int resource);
@@ -151,7 +151,7 @@
/* DMA support (drm_dma.h) */
extern int drm_dma_setup(struct drm_device *dev);
extern void drm_dma_takedown(struct drm_device *dev);
-@@ -1042,6 +1043,7 @@ extern void drm_core_reclaim_buffers(struct drm_device *dev,
+@@ -1045,6 +1046,7 @@ extern void drm_core_reclaim_buffers(struct drm_device *dev,
extern int drm_control(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern irqreturn_t drm_irq_handler(DRM_IRQ_ARGS);
@@ -219,10 +219,10 @@
/**
* Uninstall the IRQ handler.
diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
-index 715b361..e2e73e5 100644
+index a6a499f..61a00f4 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
-@@ -411,3 +411,265 @@
+@@ -412,3 +412,265 @@
{0x8086, 0x2a12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x8086, 0x2a42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0, 0, 0}
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/sources,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- sources 6 Mar 2008 13:59:26 -0000 1.12
+++ sources 1 Apr 2008 10:38:07 -0000 1.13
@@ -1,3 +1,4 @@
3f23ad4b69d0a552042d1ed0f4399857 linux-2.6.24.tar.bz2
-a4cc0fd5bda60e498246b6d69c873895 patch-2.6.25-rc4.bz2
+942182dbe41b74c95bfa46fcba5ca8ec patch-2.6.25-rc7.bz2
+0c878963c9eecb8d841480414f12aaa8 patch-2.6.25-rc7-git6.bz2
4aa57328d0802a063fa67dfc063da30e xen-3.2.0.tar.gz
Index: upstream
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/upstream,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- upstream 6 Mar 2008 13:59:26 -0000 1.2
+++ upstream 1 Apr 2008 10:38:07 -0000 1.3
@@ -1,2 +1,3 @@
linux-2.6.24.tar.bz2
-patch-2.6.25-rc4.bz2
+patch-2.6.25-rc7.bz2
+patch-2.6.25-rc7-git6.bz2
--- linux-2.6-blkcipher-depend-on-chainiv.patch DELETED ---
--- linux-2.6-drm-git-i915-remove-priv-access.patch DELETED ---
--- linux-2.6-drm-git-mm-revert-nopfn.patch DELETED ---
--- linux-2.6-ia32-syscall-restart.patch DELETED ---
--- linux-2.6-ppc32-ucmpdi2.patch DELETED ---
--- linux-2.6-utrace-core.patch DELETED ---
--- linux-2.6-utrace-ptrace-compat-avr32.patch DELETED ---
--- linux-2.6-utrace-ptrace-compat-ia64.patch DELETED ---
--- linux-2.6-utrace-ptrace-compat-s390.patch DELETED ---
--- linux-2.6-utrace-ptrace-compat-sparc64.patch DELETED ---
--- linux-2.6-utrace-ptrace-compat.patch DELETED ---
--- linux-2.6-utrace-regset-avr32.patch DELETED ---
--- linux-2.6-utrace-regset-ia64.patch DELETED ---
--- linux-2.6-utrace-regset-s390.patch DELETED ---
--- linux-2.6-utrace-regset-sparc64.patch DELETED ---
--- linux-2.6-utrace-regset.patch DELETED ---
--- linux-2.6-utrace-tracehook-avr32.patch DELETED ---
--- linux-2.6-utrace-tracehook-ia64.patch DELETED ---
--- linux-2.6-utrace-tracehook-s390.patch DELETED ---
--- linux-2.6-utrace-tracehook-sparc64.patch DELETED ---
--- linux-2.6-utrace-tracehook-um.patch DELETED ---
--- linux-2.6-utrace-tracehook.patch DELETED ---
--- linux-2.6-virtio_blk-fix-sysfs-bits.patch DELETED ---
--- linux-2.6-wireless-pending-too.patch DELETED ---
--- linux-2.6-xen-0004-xen-Make-hvc0-the-preferred-console-in-domU.patch DELETED ---
--- linux-2.6-xen-0006-fbdev-Make-deferred-I-O-work-as-advertized.patch DELETED ---
--- linux-2.6-xen-0007-xen-pvfb-Para-virtual-framebuffer-keyboard-and-poi.patch DELETED ---
--- linux-2.6-xen-0008-xen-Module-autoprobing-support-for-frontend-drivers.patch DELETED ---
--- linux-2.6-xen-0009-xen-Add-compatibility-aliases-for-frontend-drivers.patch DELETED ---
--- linux-2.6-xen-0010-xen-blkfront-Delay-wait-for-block-devices-until-aft.patch DELETED ---
--- linux-2.6-xen-0011-xen-Add-a-vmlinuz-target.patch DELETED ---
--- linux-2.6-xen-0012-xen-Add-empty-xenctrl-module.patch DELETED ---
--- linux-2.6-xen-0013-xen-Add-proc-xen-capabilities.patch DELETED ---
--- linux-2.6-xen-0014-xen-Add-proc-xen-privcmd.patch DELETED ---
--- linux-2.6-xen-0015-xen-Add-proc-xen-xenbus.patch DELETED ---
--- linux-2.6-xen-0016-xen-Add-Xen-s-sys-hypervisor-interface.patch DELETED ---
--- linux-2.6-xen-0017-xen-debug-Add-xprintk-to-log-directly-via-hypercall.patch DELETED ---
--- linux-2.6-xen-0018-xen-x86_64-Initial-x86_64-support-for-Xen-paravirt_.patch DELETED ---
--- linux-2.6-xen-0019-xen-x86_64-Add-64-bit-version-of-privcmd_hypercall.patch DELETED ---
--- linux-2.6-xen-0020-xen-x86_64-Only-define-load_user_cs_desc-on-32-bi.patch DELETED ---
--- patch-2.6.25-rc4.bz2.sign DELETED ---
More information about the fedora-extras-commits
mailing list