Blackfin arch: after removing fs.h from mm.h, fix the broken on Blackfin arch

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d31c5ab147e0b17b9ec0daa5e4d1fc0bd6b19974
Commit: d31c5ab147e0b17b9ec0daa5e4d1fc0bd6b19974
Parent: ac07860264bd2b18834d3fa3be47032115524cea
Author: Bryan Wu [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:42 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:39 2007 -0700

Blackfin arch: after removing fs.h from mm.h, fix the broken on Blackfin 
arch

Cc: Alexey Dobriyan [EMAIL PROTECTED]
Signed-off-by: Bryan Wu [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/blackfin/kernel/init_task.c |1 +
 arch/blackfin/kernel/process.c   |2 ++
 arch/blackfin/kernel/sys_bfin.c  |1 +
 arch/blackfin/kernel/traps.c |1 +
 4 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/kernel/init_task.c b/arch/blackfin/kernel/init_task.c
index b45188f..673c860 100644
--- a/arch/blackfin/kernel/init_task.c
+++ b/arch/blackfin/kernel/init_task.c
@@ -31,6 +31,7 @@
 #include linux/module.h
 #include linux/init_task.h
 #include linux/mqueue.h
+#include linux/fs.h
 
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 5a51dd6..6a7aefe 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -33,6 +33,8 @@
 #include linux/user.h
 #include linux/a.out.h
 #include linux/uaccess.h
+#include linux/fs.h
+#include linux/err.h
 
 #include asm/blackfin.h
 #include asm/fixed_code.h
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c
index f5e1ae3..abcd148 100644
--- a/arch/blackfin/kernel/sys_bfin.c
+++ b/arch/blackfin/kernel/sys_bfin.c
@@ -37,6 +37,7 @@
 #include linux/syscalls.h
 #include linux/mman.h
 #include linux/file.h
+#include linux/fs.h
 #include linux/uaccess.h
 #include linux/ipc.h
 #include linux/unistd.h
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 8766bd6..792a841 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -31,6 +31,7 @@
 #include linux/interrupt.h
 #include linux/module.h
 #include linux/kallsyms.h
+#include linux/fs.h
 #include asm/traps.h
 #include asm/cacheflush.h
 #include asm/blackfin.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: fix HPET init race

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b291aa7a6564e859af144e1bd14ffa463519b198
Commit: b291aa7a6564e859af144e1bd14ffa463519b198
Parent: d31c5ab147e0b17b9ec0daa5e4d1fc0bd6b19974
Author: Robin Holt [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:43 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:39 2007 -0700

x86_64: fix HPET init race

I have had four seperate system lockups attributable to this exact problem
in two days of testing.  Instead of trying to handle all the weird end
cases and wrap, how about changing it to look for exactly what we appear
to want.

The following patch removes a couple races in setup_APIC_timer.  One occurs
when the HPET advances the COUNTER past the T0_CMP value between the time
the T0_CMP was originally read and when COUNTER is read.  This results in
a delay waiting for the counter to wrap.  The other results from the counter
wrapping.

This change takes a snapshot of T0_CMP at the beginning of the loop and
simply loops until T0_CMP has changed (a tick has happened).

later

I have one small concern about the patch.  I am not sure it meets the intent
as well as it should.  I think we are trying to match APIC timer interrupts 
up
with the hpet counter increment.  The event which appears to be disturbing
this loop in our test environment is the NMI watchdog.  What we believe has
been happening with the existing code is the setup_APIC_timer loop has read
the CMP value, and the NMI watchdog code fires for the first time.  This
results in a series of icache miss slowdowns and by the time we get back to
things it has wrapped.

I think this code is trying to get the CMP as close to the counter value as
possible.  If that is the intent, maybe we should really be testing against 
a
window around the CMP.  Something like COUNTER = CMP+/2.  It appears 
COUNTER
should get advanced every 89nSec (IIRC).  The above seems like an 
unreasonably
small window, but may be necessary.  Without documentation, I am not sure of
the original intent with this code.

In summary, this code fixes my boot hangs, but since I am not certain of the
intent of the existing code, I am not certain this has not introduced new 
bugs
or unexpected behaviors.

Signed-off-by: Robin Holt [EMAIL PROTECTED]
Acked-by: Andi Kleen [EMAIL PROTECTED]
Cc: Vojtech Pavlik [EMAIL PROTECTED]
Cc: Aaron Durbin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/apic.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index 900ff38..925758d 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -791,10 +791,8 @@ static void setup_APIC_timer(unsigned int clocks)
 
/* wait for irq slice */
if (hpet_address  hpet_use_timer) {
-   int trigger = hpet_readl(HPET_T0_CMP);
-   while (hpet_readl(HPET_COUNTER) = trigger)
-   /* do nothing */ ;
-   while (hpet_readl(HPET_COUNTER)   trigger)
+   u32 trigger = hpet_readl(HPET_T0_CMP);
+   while (hpet_readl(HPET_T0_CMP) == trigger)
/* do nothing */ ;
} else {
int c1, c2;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


direct-io: fix error-path crashes

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a648fa72161d1f6468dabd96c5d3c0db04f598a
Commit: 6a648fa72161d1f6468dabd96c5d3c0db04f598a
Parent: b291aa7a6564e859af144e1bd14ffa463519b198
Author: Badari Pulavarty [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:44 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

direct-io: fix error-path crashes

Need to initialize map_bh.b_state to zero.  Otherwise, in case of a faulty
user-buffer its possible to go into dio_zero_block() and submit a page by
mistake - since it checks for buffer_new().

http://marc.info/?l=linux-kernelm=118551339032528w=2

akpm: Linus had a (better) patch to just do a kzalloc() in there, but it got
lost.  Probably this version is better for -stable anwyay.

Signed-off-by: Badari Pulavarty [EMAIL PROTECTED]
Acked-by: Joe Jin [EMAIL PROTECTED]
Acked-by: Zach Brown [EMAIL PROTECTED]
Cc: gurudas pai [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/direct-io.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 52bb263..6874785 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -974,6 +974,7 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode 
*inode,
dio-get_block = get_block;
dio-end_io = end_io;
dio-map_bh.b_private = NULL;
+   dio-map_bh.b_state = 0;
dio-final_block_in_bio = -1;
dio-next_block_for_io = -1;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


stifb: detect cards in double buffer mode more reliably

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=04a3f959f691fd3eea42be37bc7a8cf32c1bd899
Commit: 04a3f959f691fd3eea42be37bc7a8cf32c1bd899
Parent: 6a648fa72161d1f6468dabd96c5d3c0db04f598a
Author: Helge Deller [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:45 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

stifb: detect cards in double buffer mode more reliably

Visualize-EG, Graffiti and A4450A graphics cards on PARISC can
be configured in double-buffer and standard mode, but the stifb
driver supports standard mode only.
This patch detects double-buffered cards more reliable.

It is a real bugfix for a very nasty problem for all parisc users which have
wrongly configured their graphic card.  The problem: The stifb graphics 
driver
will not detect that the card is wrongly configured and then nevertheless 
just
enables the graphics mode, which it shouldn't.  In the end, the user will 
see
no further updates / boot messages on the screen.

We had documented this problem already on our FAQ
(http://parisc-linux.org/faq/index.html#viseg Why do I get corrupted 
graphics
with my Vis-EG/Graffiti/A4450A card?) but people still run into this 
problem.
 So having this fix in as early as possible can help us.

Signed-off-by: Helge Deller [EMAIL PROTECTED]
Signed-off-by: Antonino Daplas [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Cc: Kyle McMartin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/stifb.c |   19 ---
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c
index c97709e..e7c8db2 100644
--- a/drivers/video/stifb.c
+++ b/drivers/video/stifb.c
@@ -1100,13 +1100,18 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref)
/* only supported cards are allowed */
switch (fb-id) {
case CRT_ID_VISUALIZE_EG:
-   /* look for a double buffering device like e.g. the 
-  INTERNAL_EG_DX1024 in the RDI precisionbook laptop
-  which won't work. The same device in non-double 
-  buffering mode returns INTERNAL_EG_X1024. */
-   if (strstr(sti-outptr.dev_name, EG_DX)) {
-  printk(KERN_WARNING 
-   stifb: ignoring '%s'. Disable double buffering in IPL 
menu.\n,
+   /* Visualize cards can run either in double buffer or
+ standard mode. Depending on the mode, the card reports
+ a different device name, e.g. INTERNAL_EG_DX1024 in double
+ buffer mode and INTERNAL_EG_X1024 in standard mode.
+ Since this driver only supports standard mode, we check
+ if the device name contains the string DX and tell the
+ user how to reconfigure the card. */
+   if (strstr(sti-outptr.dev_name, DX)) {
+  printk(KERN_WARNING WARNING: stifb framebuffer driver does 
not 
+   support '%s' in double-buffer mode.\n
+   KERN_WARNING WARNING: Please disable the double-buffer 
mode 
+   in IPL menu (the PARISC-BIOS).\n,
sti-outptr.dev_name);
   goto out_err0;
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fbcon: Kill compile warning

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4769a9a53b39f3b6a7e4d0b3c5e6b9598560818d
Commit: 4769a9a53b39f3b6a7e4d0b3c5e6b9598560818d
Parent: 04a3f959f691fd3eea42be37bc7a8cf32c1bd899
Author: Antonino A. Daplas [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:46 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

fbcon: Kill compile warning

Fix compile warning ('map_override unused') if fbcon is compiled as a module
and CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=n.

[EMAIL PROTECTED]: cleanup]
Signed-off-by: Antonino Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/console/fbcon.c |   14 +-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index decfdc8..e58c87b 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -127,8 +127,20 @@ static int last_fb_vc = MAX_NR_CONSOLES - 1;
 static int fbcon_is_default = 1; 
 static int fbcon_has_exited;
 static int primary_device = -1;
+
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY
 static int map_override;
 
+static inline void fbcon_map_override(void)
+{
+   map_override = 1;
+}
+#else
+static inline void fbcon_map_override(void)
+{
+}
+#endif /* CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY */
+
 /* font data */
 static char fontname[40];
 
@@ -506,7 +518,7 @@ static int __init fb_console_setup(char *this_opt)
(options[j++]-'0') % FB_MAX;
}
 
-   map_override = 1;
+   fbcon_map_override();
}
 
return 1;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pvr2fb: Fix oops when pseudo_palette is written

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9cd1c67434544b1d9a4fb4a4cdec15608167a233
Commit: 9cd1c67434544b1d9a4fb4a4cdec15608167a233
Parent: 4769a9a53b39f3b6a7e4d0b3c5e6b9598560818d
Author: Antonino A. Daplas [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:47 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

pvr2fb: Fix oops when pseudo_palette is written

Reported by: Adrian McMenamin [EMAIL PROTECTED]

This driver will oops when the pseudo_palette[] is written as u32 but not 
when
written as u16.  When written as u32, it corrupts the adjacent 'mmio_base'
field of struct pvr2fb_par.  Fix by using framebuffer_alloc()/release() to
allocate struct fb_info and struct pvr2fb_par, and create the 
pseudo_palette[]
as part of struct pvr2fb_par.

Signed-off-by: Antonino Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/pvr2fb.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index f930026..a72921b 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -143,6 +143,7 @@ static struct pvr2fb_par {
unsigned char is_lowres;/* Is horizontal pixel-doubling 
enabled? */
 
unsigned long mmio_base;/* MMIO base */
+   u32 palette[16];
 } *currentpar;
 
 static struct fb_info *fb_info;
@@ -790,7 +791,7 @@ static int __devinit pvr2fb_common_init(void)
fb_info-fbops  = pvr2fb_ops;
fb_info-fix= pvr2_fix;
fb_info-par= currentpar;
-   fb_info-pseudo_palette = (void *)(fb_info-par + 1);
+   fb_info-pseudo_palette = currentpar-palette;
fb_info-flags  = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
 
if (video_output == VO_VGA)
@@ -1082,14 +1083,15 @@ static int __init pvr2fb_init(void)
 #endif
size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * 
sizeof(u32);
 
-   fb_info = kzalloc(size, GFP_KERNEL);
+   fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par), NULL);
+
if (!fb_info) {
printk(KERN_ERR Failed to allocate memory for fb_info\n);
return -ENOMEM;
}
 
 
-   currentpar = (struct pvr2fb_par *)(fb_info + 1);
+   currentpar = fb_info-par;
 
for (i = 0; i  ARRAY_SIZE(board_driver); i++) {
struct pvr2_board *pvr_board = board_driver + i;
@@ -1102,7 +1104,7 @@ static int __init pvr2fb_init(void)
if (ret != 0) {
printk(KERN_ERR pvr2fb: Failed init of %s device\n,
pvr_board-name);
-   kfree(fb_info);
+   framebuffer_release(fb_info);
break;
}
}
@@ -1126,7 +1128,7 @@ static void __exit pvr2fb_exit(void)
 #endif
 
unregister_framebuffer(fb_info);
-   kfree(fb_info);
+   framebuffer_release(fb_info);
 }
 
 module_init(pvr2fb_init);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pvr2fb: Consolidated cleanup of pvr2fb.c

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=306c869c237a66fe85580f60558f105e3305d465
Commit: 306c869c237a66fe85580f60558f105e3305d465
Parent: 9cd1c67434544b1d9a4fb4a4cdec15608167a233
Author: Adrian McMenamin [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:48 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

pvr2fb: Consolidated cleanup of pvr2fb.c

- better handling of the pvr2 registers based on more up to date 
information.

Testing shows that it seems to work pretty well at 16bpp, 24bpp and 32bpp -
including proper rendering of the boot logo at all levels (previously this 
was
a bit broken even at 16bpp) and giving white against black text.  Really
detailed testing (eg with X11) requires support for the maple bus - which
isn't (currently - next project assuming this is okay) available, but I have
no reason to think this is broken.

Signed-off by: Adrian McMenamin [EMAIL PROTECTED]
Acked-by: Paul Mundt [EMAIL PROTECTED]
Signed-off-by: Antonino Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/pvr2fb.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index a72921b..7d6c298 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -94,6 +94,7 @@
 #define DISP_DIWCONF (DISP_BASE + 0xe8)
 #define DISP_DIWHSTRT (DISP_BASE + 0xec)
 #define DISP_DIWVSTRT (DISP_BASE + 0xf0)
+#define DISP_PIXDEPTH (DISP_BASE + 0x108)
 
 /* Pixel clocks, one for TV output, doubled for VGA output */
 #define TV_CLK 74239
@@ -600,6 +601,7 @@ static void pvr2_init_display(struct fb_info *info)
 
/* bits per pixel */
fb_writel(fb_readl(DISP_DIWMODE) | (--bytesperpixel  2), 
DISP_DIWMODE);
+   fb_writel(bytesperpixel  2, DISP_PIXDEPTH);
 
/* video enable, color sync, interlace,
 * hsync and vsync polarity (currently unused) */
@@ -808,6 +810,8 @@ static int __devinit pvr2fb_common_init(void)
 
if (register_framebuffer(fb_info)  0)
goto out_err;
+   /*Must write PIXDEPTH to register before anything is displayed - so 
force init */
+   pvr2_init_display(fb_info);
 
modememused = get_line_length(fb_info-var.xres_virtual,
  fb_info-var.bits_per_pixel);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pvr2fb: update Documentation/fb/pvr2fb.txt

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=acb73865328bd6211a1452f39a4f660d26658918
Commit: acb73865328bd6211a1452f39a4f660d26658918
Parent: 306c869c237a66fe85580f60558f105e3305d465
Author: Adrian McMenamin [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:48 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

pvr2fb: update Documentation/fb/pvr2fb.txt

The current version is very old and does not correctly specify how to
set the video mode.

Signed-off by: Adrian McMenamin [EMAIL PROTECTED]
Signed-off-by: Antonino Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/fb/pvr2fb.txt |   22 +-
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/Documentation/fb/pvr2fb.txt b/Documentation/fb/pvr2fb.txt
index 2bf6c23..36bdeff 100644
--- a/Documentation/fb/pvr2fb.txt
+++ b/Documentation/fb/pvr2fb.txt
@@ -9,14 +9,13 @@ one found in the Dreamcast.
 Advantages:
 
  * It provides a nice large console (128 cols + 48 lines with 1024x768)
-   without using tiny, unreadable fonts.
+   without using tiny, unreadable fonts (NOT on the Dreamcast)
  * You can run XF86_FBDev on top of /dev/fb0
  * Most important: boot logo :-)
 
 Disadvantages:
 
- * Driver is currently limited to the Dreamcast PowerVR 2 implementation
-   at the time of this writing.
+ * Driver is largely untested on non-Dreamcast systems.
 
 Configuration
 =
@@ -29,11 +28,16 @@ Accepted options:
 font:X- default font to use. All fonts are supported, including the
 SUN12x22 font which is very nice at high resolutions.
 
-mode:X- default video mode. The following video modes are supported:
-640x240-60, 640x480-60.

+mode:X- default video mode with format [xres]x[yres]-bpp@refresh rate
+The following video modes are supported:
+[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] The 
Dreamcast
+defaults to [EMAIL PROTECTED] At the time of writing the
+24bpp and 32bpp modes function poorly. Work to fix that is
+ongoing
+
 Note: the 640x240 mode is currently broken, and should not be
-used for any reason. It is only mentioned as a reference.
+used for any reason. It is only mentioned here as a reference.
 
 inverse   - invert colors on screen (for LCD displays)
 
@@ -52,10 +56,10 @@ output:X  - output type. This can be any of the following: 
pal, ntsc, and
 X11
 ===
 
-XF86_FBDev should work, in theory. At the time of this writing it is
-totally untested and may or may not even portray the beginnings of
-working. If you end up testing this, please let me know!
+XF86_FBDev has been shown to work on the Dreamcast in the past - though not yet
+on any 2.6 series kernel.
 
 --
 Paul Mundt [EMAIL PROTECTED]
+Updated by Adrian McMenamin [EMAIL PROTECTED]
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


matroxfb: rectify jitter (G450/G550)

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e798bd95b61918e653f3d28f9176237236f2d103
Commit: e798bd95b61918e653f3d28f9176237236f2d103
Parent: acb73865328bd6211a1452f39a4f660d26658918
Author: Paul A. Clarke [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:49 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

matroxfb: rectify jitter (G450/G550)

This builds upon my previous attempts to resolve some jitter problems seen
with the Matrox G450 and G550 -based cards, including odd disparities 
observed
between x86 and Power -based machines in a somewhat less hackish way 
(removing
the hacked ifdefs).

Apparently, preference should be given to use the DVI PLL when frequencies
permit, the Standard PLL otherwise.  The max pixel clock for the panellink
interface is extracted from the PInS information on the card and used as a
limit to determine which PLL to use.

Signed-off-by: Paul A. Clarke [EMAIL PROTECTED]
Acked-by: Petr Vandrovec [EMAIL PROTECTED]
Signed-off-by: Antonino Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/video/matrox/g450_pll.c |   23 +--
 drivers/video/matrox/matroxfb_DAC1064.h |   15 +++
 drivers/video/matrox/matroxfb_base.h|1 +
 drivers/video/matrox/matroxfb_misc.c|1 +
 4 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/drivers/video/matrox/g450_pll.c b/drivers/video/matrox/g450_pll.c
index 7c76e07..d42346e 100644
--- a/drivers/video/matrox/g450_pll.c
+++ b/drivers/video/matrox/g450_pll.c
@@ -331,16 +331,19 @@ static int __g450_setclk(WPMINFO unsigned int fout, 
unsigned int pll,
tmp |= M1064_XPIXCLKCTRL_PLL_UP;
}
matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp);
-#ifdef __powerpc__
-   /* This is necessary to avoid jitter on PowerPC
-* (OpenFirmware) systems, but apparently
-* introduces jitter, at least on a x86-64
-* using DVI.
-* A simple workaround is disable for non-PPC.
-*/
-   matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL, 0);
-#endif /* __powerpc__ */
-   matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, 
xpwrctrl);
+   /* DVI PLL preferred for frequencies up to
+  panel link max, standard PLL otherwise */
+   if (fout = MINFO-max_pixel_clock_panellink)
+   tmp = 0;
+   else tmp =
+   M1064_XDVICLKCTRL_DVIDATAPATHSEL |
+   M1064_XDVICLKCTRL_C1DVICLKSEL |
+   M1064_XDVICLKCTRL_C1DVICLKEN |
+   M1064_XDVICLKCTRL_DVILOOPCTL |
+   M1064_XDVICLKCTRL_P1LOOPBWDTCTL;
+   matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL,tmp);
+   matroxfb_DAC_out(PMINFO M1064_XPWRCTRL,
+xpwrctrl);
 
matroxfb_DAC_unlock_irqrestore(flags);
}
diff --git a/drivers/video/matrox/matroxfb_DAC1064.h 
b/drivers/video/matrox/matroxfb_DAC1064.h
index df39c31..7a98ce8 100644
--- a/drivers/video/matrox/matroxfb_DAC1064.h
+++ b/drivers/video/matrox/matroxfb_DAC1064.h
@@ -33,6 +33,21 @@ void DAC1064_global_restore(WPMINFO2);
 #define M1064_XCURCTRL_3COLOR  0x01/* transparent, 0, 1, 2 */
 #define M1064_XCURCTRL_XGA 0x02/* 0, 1, transparent, 
complement */
 #define M1064_XCURCTRL_XWIN0x03/* transparent, 
transparent, 0, 1 */
+   /* drive DVI by standard(0)/DVI(1) PLL */
+   /* if set(1), C?DVICLKEN and C?DVICLKSEL must be set(1) */
+#define  M1064_XDVICLKCTRL_DVIDATAPATHSEL   0x01
+   /* drive CRTC1 by standard(0)/DVI(1) PLL */
+#define  M1064_XDVICLKCTRL_C1DVICLKSEL  0x02
+   /* drive CRTC2 by standard(0)/DVI(1) PLL */
+#define  M1064_XDVICLKCTRL_C2DVICLKSEL  0x04
+   /* pixel clock allowed to(0)/blocked from(1) driving CRTC1 */
+#define  M1064_XDVICLKCTRL_C1DVICLKEN   0x08
+   /* DVI PLL loop filter bandwidth selection bits */
+#define  M1064_XDVICLKCTRL_DVILOOPCTL   0x30
+   /* CRTC2 pixel clock allowed to(0)/blocked from(1) driving CRTC2 */
+#define  M1064_XDVICLKCTRL_C2DVICLKEN   0x40
+   /* P1PLL loop filter bandwith selection */
+#define  

FRV: connect up fallocate

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=60c9834238482f805b1d9e4dc2a780405ddab80f
Commit: 60c9834238482f805b1d9e4dc2a780405ddab80f
Parent: e798bd95b61918e653f3d28f9176237236f2d103
Author: David Howells [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:50 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

FRV: connect up fallocate

Connect up the fallocate() system call.

Signed-off-by: David Howells [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/frv/kernel/entry.S  |1 +
 include/asm-frv/unistd.h |3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S
index 275673c..1e74f3c 100644
--- a/arch/frv/kernel/entry.S
+++ b/arch/frv/kernel/entry.S
@@ -1496,6 +1496,7 @@ sys_call_table:
.long sys_signalfd
.long sys_timerfd
.long sys_eventfd
+   .long sys_fallocate
 
 
 syscall_table_size = (. - sys_call_table)
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index 7306c71..cd84f17 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -330,10 +330,11 @@
 #define __NR_signalfd  321
 #define __NR_timerfd   322
 #define __NR_eventfd   323
+#define __NR_fallocate 324
 
 #ifdef __KERNEL__
 
-#define NR_syscalls 324
+#define NR_syscalls 325
 
 #define __ARCH_WANT_IPC_PARSE_VERSION
 /* #define __ARCH_WANT_OLD_READDIR */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


eCryptfs: fix lookup error for special files

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=202a21d6914369c1362f1ab50f0cbe92b9c38718
Commit: 202a21d6914369c1362f1ab50f0cbe92b9c38718
Parent: 60c9834238482f805b1d9e4dc2a780405ddab80f
Author: Ryusuke Konishi [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:51 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

eCryptfs: fix lookup error for special files

When ecryptfs_lookup() is called against special files, eCryptfs generates
the following errors because it tries to treat them like regular eCryptfs
files.

Error opening lower file for lower_dentry [0x810233a6f150], lower_mnt 
[0x810235bb4c80], and flags
[0x8000]
Error opening lower_file to read header region
Error attempting to read the [user.ecryptfs] xattr from the lower file; 
return value = [-95]
Valid metadata not found in header region or xattr region; treating file as 
unencrypted

For instance, the problem can be reproduced by the steps below.

  # mkdir /root/crypt /mnt/crypt
  # mount -t ecryptfs /root/crypt /mnt/crypt
  # mknod /mnt/crypt/c0 c 0 0
  # umount /mnt/crypt
  # mount -t ecryptfs /root/crypt /mnt/crypt
  # ls -l /mnt/crypt

This patch fixes it by adding a check similar to directories and
symlinks.

Signed-off-by: Ryusuke Konishi [EMAIL PROTECTED]
Acked-by: Michael Halcrow [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/ecryptfs/inode.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 0a50942..131954b 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -353,6 +353,10 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, 
struct dentry *dentry,
ecryptfs_printk(KERN_DEBUG, Is a symlink; returning\n);
goto out;
}
+   if (special_file(lower_inode-i_mode)) {
+   ecryptfs_printk(KERN_DEBUG, Is a special file; returning\n);
+   goto out;
+   }
if (!nd) {
ecryptfs_printk(KERN_DEBUG, We have a NULL nd, just leave
as we *think* we are about to unlink\n);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fix missing numa_zonelist_order sysctl

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8daec965e7035bbf8d364fe7585bffac7222b87a
Commit: 8daec965e7035bbf8d364fe7585bffac7222b87a
Parent: 202a21d6914369c1362f1ab50f0cbe92b9c38718
Author: Lee Schermerhorn [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:51 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

Fix missing numa_zonelist_order sysctl

Misplaced #endif is hiding the numa_zonelist_order sysctl when !SECURITY.

Signed-off-by: Lee Schermerhorn [EMAIL PROTECTED]
Cc: Mel Gorman [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/sysctl.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 79c891e..8bdb8c0 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1023,6 +1023,7 @@ static ctl_table vm_table[] = {
.mode   = 0644,
.proc_handler   = proc_doulongvec_minmax,
},
+#endif
 #ifdef CONFIG_NUMA
{
.ctl_name   = CTL_UNNUMBERED,
@@ -1034,7 +1035,6 @@ static ctl_table vm_table[] = {
.strategy   = sysctl_string,
},
 #endif
-#endif
 #if defined(CONFIG_X86_32) || \
(defined(CONFIG_SUPERH)  defined(CONFIG_VSYSCALL))
{
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


linux-audit list is subscribers-only

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9a0620779d3714abd63dfc28284f5fa2c1fc091
Commit: b9a0620779d3714abd63dfc28284f5fa2c1fc091
Parent: 76ceb2f90f6efb6d1f3d88f855428bff947a3483
Author: Gabriel C [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:56 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

linux-audit list is subscribers-only

Signed-off-by: Gabriel Craciunescu [EMAIL PROTECTED]
Cc: David Woodhouse [EMAIL PROTECTED]
Cc: Al Viro [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 MAINTAINERS |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e65e96a..ab48377 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -664,7 +664,7 @@ S:  Maintained
 AUDIT SUBSYSTEM
 P: David Woodhouse
 M: [EMAIL PROTECTED]
-L: [EMAIL PROTECTED]
+L: [EMAIL PROTECTED] (subscribers-only)
 W: http://people.redhat.com/sgrubb/audit/
 T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
 S: Maintained
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


eCryptfs: fix error handling in ecryptfs_init

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a75de1b3799f8933d6d2b64bdf31194368ec98ab
Commit: a75de1b3799f8933d6d2b64bdf31194368ec98ab
Parent: b9a0620779d3714abd63dfc28284f5fa2c1fc091
Author: Ryusuke Konishi [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:56 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

eCryptfs: fix error handling in ecryptfs_init

ecryptfs_init() exits without doing any cleanup jobs if
ecryptfs_init_messaging() fails.  In that case, eCryptfs leaves
sysfs entries, leaks memory, and causes an invalid page fault.
This patch fixes the problem.

Signed-off-by: Ryusuke Konishi [EMAIL PROTECTED]
Acked-by: Michael Halcrow [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/ecryptfs/main.c |   18 +-
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index e557a67..a984972 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -813,6 +813,15 @@ out:
return rc;
 }
 
+static void do_sysfs_unregistration(void)
+{
+   sysfs_remove_file(ecryptfs_subsys.kobj,
+ sysfs_attr_version.attr);
+   sysfs_remove_file(ecryptfs_subsys.kobj,
+ sysfs_attr_version_str.attr);
+   subsystem_unregister(ecryptfs_subsys);
+}
+
 static int __init ecryptfs_init(void)
 {
int rc;
@@ -851,6 +860,9 @@ static int __init ecryptfs_init(void)
if (rc) {
ecryptfs_printk(KERN_ERR, Failure occured while attempting to 
initialize the eCryptfs netlink socket\n);
+   do_sysfs_unregistration();
+   unregister_filesystem(ecryptfs_fs_type);
+   ecryptfs_free_kmem_caches();
}
 out:
return rc;
@@ -858,11 +870,7 @@ out:
 
 static void __exit ecryptfs_exit(void)
 {
-   sysfs_remove_file(ecryptfs_subsys.kobj,
- sysfs_attr_version.attr);
-   sysfs_remove_file(ecryptfs_subsys.kobj,
- sysfs_attr_version_str.attr);
-   subsystem_unregister(ecryptfs_subsys);
+   do_sysfs_unregistration();
ecryptfs_release_messaging(ecryptfs_transport);
unregister_filesystem(ecryptfs_fs_type);
ecryptfs_free_kmem_caches();
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Hibernation: do not try to mark invalid PFNs as nosave

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c5a69adff920ddf138c3ea9886574b195d9e3d52
Commit: c5a69adff920ddf138c3ea9886574b195d9e3d52
Parent: a75de1b3799f8933d6d2b64bdf31194368ec98ab
Author: Rafael J. Wysocki [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:57 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

Hibernation: do not try to mark invalid PFNs as nosave

On some systems some PFNs reported by the early initialization code as
'nosave' may be invalid.  If we try to set the corresponding bits in the
hibernation bitmap, BUG_ON() in memory_bm_find_bit() will be triggered and
the system won't be able to boot (cf.
https://bugzilla.novell.com/show_bug.cgi?id=296242).

Prevent this from happening by verifying if the 'nosave' PFNs are valid in
mark_nosave_pages().

Signed-off-by: Rafael J. Wysocki [EMAIL PROTECTED]
Acked-by: Pavel Machek [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/power/snapshot.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index a3b7854..a686590 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -709,7 +709,8 @@ static void mark_nosave_pages(struct memory_bitmap *bm)
region-end_pfn  PAGE_SHIFT);
 
for (pfn = region-start_pfn; pfn  region-end_pfn; pfn++)
-   memory_bm_set_bit(bm, pfn);
+   if (pfn_valid(pfn))
+   memory_bm_set_bit(bm, pfn);
}
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drivers/char/pcmcia/cm40x0_cs.c: fix release function call

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=925796e0ed6fe529770ba71454c58c8d4d8a5ac4
Commit: 925796e0ed6fe529770ba71454c58c8d4d8a5ac4
Parent: c5a69adff920ddf138c3ea9886574b195d9e3d52
Author: Daniel Ritz [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:58 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:40 2007 -0700

drivers/char/pcmcia/cm40x0_cs.c: fix release function call

cm4000_cs.c and cm4040_cs.c call the internal release function with
an argument of wrong type. this fixes bug #8485

Signed-off-by: Daniel Ritz [EMAIL PROTECTED]
Cc: Bill McConnaughey [EMAIL PROTECTED]
Cc: Natalie Protasevich [EMAIL PROTECTED]
Cc: Harald Welte [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/pcmcia/cm4000_cs.c |5 ++---
 drivers/char/pcmcia/cm4040_cs.c |2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index fee58e0..4177f6d 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -1629,7 +1629,7 @@ static int cmm_open(struct inode *inode, struct file 
*filp)
 {
struct cm4000_dev *dev;
struct pcmcia_device *link;
-   int rc, minor = iminor(inode);
+   int minor = iminor(inode);
 
if (minor = CM4000_MAX_DEV)
return -ENODEV;
@@ -1668,7 +1668,6 @@ static int cmm_open(struct inode *inode, struct file 
*filp)
start_monitor(dev);
 
link-open = 1; /* only one open per device */
-   rc = 0;
 
DEBUGP(2, dev, - cmm_open\n);
return nonseekable_open(inode, filp);
@@ -1824,7 +1823,7 @@ static int cm4000_resume(struct pcmcia_device *link)
 
 static void cm4000_release(struct pcmcia_device *link)
 {
-   cmm_cm4000_release(link-priv); /* delay release until device closed */
+   cmm_cm4000_release(link);   /* delay release until device closed */
pcmcia_disable_device(link);
 }
 
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index af88181..b24a3e7 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -599,7 +599,7 @@ cs_release:
 
 static void reader_release(struct pcmcia_device *link)
 {
-   cm4040_reader_release(link-priv);
+   cm4040_reader_release(link);
pcmcia_disable_device(link);
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Memory hotplug document

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6867c9310d5dab6897638a89c7e31addfcb22043
Commit: 6867c9310d5dab6897638a89c7e31addfcb22043
Parent: 925796e0ed6fe529770ba71454c58c8d4d8a5ac4
Author: Yasunori Goto [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:00:59 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

Memory hotplug document

This is add a document for memory hotplug to describe How to use and
Current status.

Signed-off-by: KAMEZAWA Hiroyuki [EMAIL PROTECTED]
Signed-off-by: Yasunori Goto [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/memory-hotplug.txt |  322 ++
 1 files changed, 322 insertions(+), 0 deletions(-)

diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt
new file mode 100644
index 000..5fbcc22
--- /dev/null
+++ b/Documentation/memory-hotplug.txt
@@ -0,0 +1,322 @@
+==
+Memory Hotplug
+==
+
+Last Updated: Jul 28 2007
+
+This document is about memory hotplug including how-to-use and current status.
+Because Memory Hotplug is still under development, contents of this text will
+be changed often.
+
+1. Introduction
+  1.1 purpose of memory hotplug
+  1.2. Phases of memory hotplug
+  1.3. Unit of Memory online/offline operation
+2. Kernel Configuration
+3. sysfs files for memory hotplug
+4. Physical memory hot-add phase
+  4.1 Hardware(Firmware) Support
+  4.2 Notify memory hot-add event by hand
+5. Logical Memory hot-add phase
+  5.1. State of memory
+  5.2. How to online memory
+6. Logical memory remove
+  6.1 Memory offline and ZONE_MOVABLE
+  6.2. How to offline memory
+7. Physical memory remove
+8. Future Work List
+
+Note(1): x86_64's has special implementation for memory hotplug.
+ This text does not describe it.
+Note(2): This text assumes that sysfs is mounted at /sys.
+
+
+---
+1. Introduction
+---
+
+1.1 purpose of memory hotplug
+
+Memory Hotplug allows users to increase/decrease the amount of memory.
+Generally, there are two purposes.
+
+(A) For changing the amount of memory.
+This is to allow a feature like capacity on demand.
+(B) For installing/removing DIMMs or NUMA-nodes physically.
+This is to exchange DIMMs/NUMA-nodes, reduce power consumption, etc.
+
+(A) is required by highly virtualized environments and (B) is required by
+hardware which supports memory power management.
+
+Linux memory hotplug is designed for both purpose.
+
+
+1.2. Phases of memory hotplug
+---
+There are 2 phases in Memory Hotplug.
+  1) Physical Memory Hotplug phase
+  2) Logical Memory Hotplug phase.
+
+The First phase is to communicate hardware/firmware and make/erase
+environment for hotplugged memory. Basically, this phase is necessary
+for the purpose (B), but this is good phase for communication between
+highly virtualized environments too.
+
+When memory is hotplugged, the kernel recognizes new memory, makes new memory
+management tables, and makes sysfs files for new memory's operation.
+
+If firmware supports notification of connection of new memory to OS,
+this phase is triggered automatically. ACPI can notify this event. If not,
+probe operation by system administration is used instead.
+(see Section 4.).
+
+Logical Memory Hotplug phase is to change memory state into
+avaiable/unavailable for users. Amount of memory from user's view is
+changed by this phase. The kernel makes all memory in it as free pages
+when a memory range is available.
+
+In this document, this phase is described as online/offline.
+
+Logical Memory Hotplug phase is triggred by write of sysfs file by system
+administrator. For the hot-add case, it must be executed after Physical Hotplug
+phase by hand.
+(However, if you writes udev's hotplug scripts for memory hotplug, these
+ phases can be execute in seamless way.)
+
+
+1.3. Unit of Memory online/offline operation
+
+Memory hotplug uses SPARSEMEM memory model. SPARSEMEM divides the whole memory
+into chunks of the same size. The chunk is called a section. The size of
+a section is architecture dependent. For example, power uses 16MiB, ia64 uses
+1GiB. The unit of online/offline operation is one section. (see Section 3.)
+
+To determine the size of sections, please read this file:
+
+/sys/devices/system/memory/block_size_bytes
+
+This file shows the size of sections in byte.
+
+---
+2. Kernel Configuration
+---
+To use memory hotplug feature, kernel must be compiled with following
+config options.
+
+- For all memory hotplug
+Memory model - Sparse Memory  (CONFIG_SPARSEMEM)
+Allow for memory hot-add   (CONFIG_MEMORY_HOTPLUG)
+
+- To enable memory removal, the followings are also necessary
+Allow for memory hot remove

kernel-parameters.txt : watchdog.txt should be wdt.txt

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8dfe9c21a890e0c1214b85d3d90a84187638bf5b
Commit: 8dfe9c21a890e0c1214b85d3d90a84187638bf5b
Parent: 6867c9310d5dab6897638a89c7e31addfcb22043
Author: Gabriel C [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:00 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

kernel-parameters.txt : watchdog.txt should be wdt.txt

Documentation/watchdog/watchdog.txt does not exist, it is 
Documentation/watchdog/wdt.txt

Signed-off-by: Gabriel Craciunescu [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/kernel-parameters.txt |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index efdb42f..a326487 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1922,7 +1922,7 @@ and is between 256 and 4096 characters. It is defined in 
the file
See header of drivers/scsi/wd7000.c.
 
wdt=[WDT] Watchdog
-   See Documentation/watchdog/watchdog.txt.
+   See Documentation/watchdog/wdt.txt.
 
xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks.
xd_geo= See header of drivers/block/xd.c.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


spi_mpc83xx: in QE mode, use sysclk/2

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e24a4d1ee337e3a67a502f3f19cdec3ffc45ad05
Commit: e24a4d1ee337e3a67a502f3f19cdec3ffc45ad05
Parent: 8dfe9c21a890e0c1214b85d3d90a84187638bf5b
Author: Anton Vorontsov [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:01 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

spi_mpc83xx: in QE mode, use sysclk/2

For MPC8349E input to the SPI Baud Rate Generator is SYSCLK, but it's
SYSCLK/2 for MPC8323E (SPI in QE).  Fix this, and remove confusion by
renaming the mpc83xx_spi-sysclk member as mpc83xx_spi-spibrg.

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/spi/spi_mpc83xx.c |   21 +
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 0c16a2b..fe69e94 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -86,7 +86,7 @@ struct mpc83xx_spi {
 
unsigned nsecs; /* (clock cycle time)/2 */
 
-   u32 sysclk;
+   u32 spibrg; /* SPIBRG input clock */
u32 rx_shift;   /* RX data reg shift when in qe mode */
u32 tx_shift;   /* TX data reg shift when in qe mode */
 
@@ -169,17 +169,18 @@ static void mpc83xx_spi_chipselect(struct spi_device 
*spi, int value)
 
regval |= SPMODE_LEN(len);
 
-   if ((mpc83xx_spi-sysclk / spi-max_speed_hz) = 64) {
-   u8 pm = mpc83xx_spi-sysclk / (spi-max_speed_hz * 64);
+   if ((mpc83xx_spi-spibrg / spi-max_speed_hz) = 64) {
+   u8 pm = mpc83xx_spi-spibrg / (spi-max_speed_hz * 64);
if (pm  0x0f) {
-   printk(KERN_WARNING MPC83xx SPI: SPICLK can't 
be less then a SYSCLK/1024!\n
-   Requested SPICLK is %d Hz. 
Will use %d Hz instead.\n,
-   spi-max_speed_hz, 
mpc83xx_spi-sysclk / 1024);
+   dev_err(spi-dev, Requested speed is too 
+   low: %d Hz. Will use %d Hz instead.\n,
+   spi-max_speed_hz,
+   mpc83xx_spi-spibrg / 1024);
pm = 0x0f;
}
regval |= SPMODE_PM(pm) | SPMODE_DIV16;
} else {
-   u8 pm = mpc83xx_spi-sysclk / (spi-max_speed_hz * 4);
+   u8 pm = mpc83xx_spi-spibrg / (spi-max_speed_hz * 4);
regval |= SPMODE_PM(pm);
}
 
@@ -429,13 +430,17 @@ static int __init mpc83xx_spi_probe(struct 
platform_device *dev)
mpc83xx_spi-bitbang.chipselect = mpc83xx_spi_chipselect;
mpc83xx_spi-bitbang.setup_transfer = mpc83xx_spi_setup_transfer;
mpc83xx_spi-bitbang.txrx_bufs = mpc83xx_spi_bufs;
-   mpc83xx_spi-sysclk = pdata-sysclk;
mpc83xx_spi-activate_cs = pdata-activate_cs;
mpc83xx_spi-deactivate_cs = pdata-deactivate_cs;
mpc83xx_spi-qe_mode = pdata-qe_mode;
mpc83xx_spi-get_rx = mpc83xx_spi_rx_buf_u8;
mpc83xx_spi-get_tx = mpc83xx_spi_tx_buf_u8;
 
+   if (mpc83xx_spi-qe_mode)
+   mpc83xx_spi-spibrg = pdata-sysclk / 2;
+   else
+   mpc83xx_spi-spibrg = pdata-sysclk;
+
mpc83xx_spi-rx_shift = 0;
mpc83xx_spi-tx_shift = 0;
if (mpc83xx_spi-qe_mode) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


spi_mpc83xx: fix prescale modulus calculation

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a44648b057f5331fe6c0e863dc693ed335490e7a
Commit: a44648b057f5331fe6c0e863dc693ed335490e7a
Parent: e24a4d1ee337e3a67a502f3f19cdec3ffc45ad05
Author: Anton Vorontsov [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:02 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

spi_mpc83xx: fix prescale modulus calculation

Long ago I've noticed (but didn't pay much attention) that
spi_mpc83xx using PM calculations that differs from what
specs describe. I.e.

u8 pm = mpc83xx_spi-spibrg / (spi-max_speed_hz * 4);

While specs says: The SPI baud rate generator clock source (either
system clock or system clock divided by 16, depending on DIV16 bit) is
divided by 4 * ([PM] + 1), a range from 4 to 64..

Thus  - 1 is missing in the spi_mpc83xx's formula.

Why nobody noticed that bug? Probably because sysclk usually less then
user expects, e.g. you expect 200 MHz, but real clock is 198 MHz,
and integer rounding helps when this formula is used.

Suppose it's SPI in QE, SYSCLK at 198 MHz, thus SPIBRG at 99MHz, 25 MHz
requested.

PM = (99MHz / ( 25 MHz * 4 )), PM == 0, output SPICLK will be 24.75 MHz

At lower frequencies this bug is more noticeable, though.

And this bug shows itself in all its beauty if SYSCLK is equal or a bit
more than you expect (200 MHz SYSCLK, 100 MHz SPIBRG):
PM = (100MHz / ( 25 MHz * 4 )), PM == 1, output SPICLK will be 12.625 MHz!

Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/spi/spi_mpc83xx.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index fe69e94..2adf856 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -148,6 +148,8 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, 
int value)
if (value == BITBANG_CS_ACTIVE) {
u32 regval = mpc83xx_spi_read_reg(mpc83xx_spi-base-mode);
u32 len = spi-bits_per_word;
+   u8 pm;
+
if (len == 32)
len = 0;
else
@@ -170,7 +172,7 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, 
int value)
regval |= SPMODE_LEN(len);
 
if ((mpc83xx_spi-spibrg / spi-max_speed_hz) = 64) {
-   u8 pm = mpc83xx_spi-spibrg / (spi-max_speed_hz * 64);
+   pm = mpc83xx_spi-spibrg / (spi-max_speed_hz * 64) - 1;
if (pm  0x0f) {
dev_err(spi-dev, Requested speed is too 
low: %d Hz. Will use %d Hz instead.\n,
@@ -180,7 +182,9 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, 
int value)
}
regval |= SPMODE_PM(pm) | SPMODE_DIV16;
} else {
-   u8 pm = mpc83xx_spi-spibrg / (spi-max_speed_hz * 4);
+   pm = mpc83xx_spi-spibrg / (spi-max_speed_hz * 4);
+   if (pm)
+   pm--;
regval |= SPMODE_PM(pm);
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


update checkpatch.pl to version 0.09

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=22f2a2ef9b468569cb34a7a056e54d56fdac0b9d
Commit: 22f2a2ef9b468569cb34a7a056e54d56fdac0b9d
Parent: a44648b057f5331fe6c0e863dc693ed335490e7a
Author: Andy Whitcroft [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:03 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

update checkpatch.pl to version 0.09

This version brings a number of new checks, and a number of bug
fixes.  Of note:

  - checks for spacing on round and square bracket combinations
  - loosening of the single statement brace checks, to allow
them when they contain comments or where other blocks in a
compound statement have them.
  - parks the multple declaration support
  - allows architecture defines in architecture specific headers

Andy Whitcroft (21):
  Version: 0.09
  loosen single statement brace checks
  fix up multiple declaration to avoid function arguments
  add some function space parenthesis check exceptions
  handle EXPORT_'s with parentheses in their names
  clean up some warnings in multi-line macro bracketing support
  park the multiple declaration checks
  make block brace checks count comments as a statement
  __volatile__ and __extension__ are not functions
  allow architecture specific defined within architecture includes
  check spacing on square brackets
  check spacing on parentheses
  ensure we apply checks to the part before start comment
  check #ifdef conditional spacing
  handle __init_refok and __must_check
  add noinline to inline checks
  prevent email addresses from tripping spacing checks
  handle typed initialiser spacing
  handle line contination as end of line
  add bool to the type matcher
  refine EXPORT_SYMBOL checks to handle pointers

Signed-off-by: Andy Whitcroft [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 scripts/checkpatch.pl |  102 ++---
 1 files changed, 71 insertions(+), 31 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 73751ab..dae7d30 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -9,7 +9,7 @@ use strict;
 my $P = $0;
 $P =~ [EMAIL PROTECTED]/@@g;
 
-my $V = '0.08';
+my $V = '0.09';
 
 use Getopt::Long qw(:config no_auto_abbrev);
 
@@ -311,7 +311,7 @@ sub process {
 
my $Ident   = qr{[A-Za-z\d_]+};
my $Storage = qr{extern|static};
-   my $Sparse  = qr{__user|__kernel|__force|__iomem};
+   my $Sparse  = 
qr{__user|__kernel|__force|__iomem|__must_check|__init_refok};
my $NonptrType  = qr{
\b
(?:const\s+)?
@@ -325,6 +325,7 @@ sub process {
unsigned|
float|
double|
+   bool|
long\s+int|
long\s+long|
long\s+long\s+int|
@@ -340,7 +341,8 @@ sub process {
  }x;
my $Type= qr{
\b$NonptrType\b
-   (?:\s*\*+\s*const|\s*\*+)?
+   (?:\s*\*+\s*const|\s*\*+|(?:\s*\[\s*\])+)?
+   (?:\s+$Sparse)*
  }x;
my $Declare = qr{(?:$Storage\s+)?$Type};
my $Attribute   = qr{const|__read_mostly|__init|__initdata|__meminit};
@@ -494,16 +496,15 @@ sub process {
ERROR(use tabs not spaces\n . $herevet);
}
 
-   #
-   # The rest of our checks refer specifically to C style
-   # only apply those _outside_ comments.
-   #
-   next if ($in_comment);
-
 # Remove comments from the line before processing.
-   $line =~ s@/\*.*\*/@@g;
-   $line =~ s@/\*.*@@;
-   $line =~ [EMAIL PROTECTED]/@@;
+   my $comment_edge = ($line =~ s@/\*.*\*/@@g) +
+  ($line =~ s@/\*.*@@) +
+  ($line =~ [EMAIL PROTECTED](.).*\*/@$1@);
+
+# The rest of our checks refer specifically to C style
+# only apply those _outside_ comments.  Only skip
+# lines in the middle of comments.
+   next if (!$comment_edge  $in_comment);
 
 # Standardise the strings and chars within the input to simplify matching.
$line = sanitise_line($line);
@@ -599,7 +600,7 @@ sub process {
if 

Documentation: sysrq, description of 'h' slightly inaccurate

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=09736bd36a19aa8c0630e626563e447213c372b5
Commit: 09736bd36a19aa8c0630e626563e447213c372b5
Parent: 22f2a2ef9b468569cb34a7a056e54d56fdac0b9d
Author: Jesper Juhl [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:04 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

Documentation: sysrq, description of 'h' slightly inaccurate

In Documentation/sysrq.txt, the description of 'h' says that any key not
listed *above* will generate help.  That's obviously not true since all the
keys listed below 'h' will do what they are described to do, not display 
help.
 So change the text so that it says that any key not listed in the table 
will
generate help, which is what really happens.

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/sysrq.txt |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt
index ba328f2..ef19142 100644
--- a/Documentation/sysrq.txt
+++ b/Documentation/sysrq.txt
@@ -1,6 +1,6 @@
 Linux Magic System Request Key Hacks
 Documentation for sysrq.c
-Last update: 2007-MAR-14
+Last update: 2007-AUG-04
 
 *  What is the magic SysRq key?
 ~~~
@@ -78,7 +78,7 @@ On all -  write a character to /proc/sysrq-trigger.  e.g.:
 'g'- Used by kgdb on ppc and sh platforms.
 
 'h' - Will display help (actually any other key than those listed
-  above will display help. but 'h' is easy to remember :-)
+  here will display help. but 'h' is easy to remember :-)
 
 'i' - Send a SIGKILL to all processes, except for init.
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


docs: note about select in kconfig-language.txt

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f8a745942b1b7f052cb76bb8a893d12cb6329c84
Commit: f8a745942b1b7f052cb76bb8a893d12cb6329c84
Parent: 09736bd36a19aa8c0630e626563e447213c372b5
Author: Jarek Poplawski [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:04 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

docs: note about select in kconfig-language.txt

A warning note from Sam Ravnborg about kconfig's select evilness,
dependencies and the future (slightly corrected).

Signed-off-by: Jarek Poplawski [EMAIL PROTECTED]
Cc: Sam Ravnborg [EMAIL PROTECTED]
Cc: Roman Zippel [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/kbuild/kconfig-language.txt |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Documentation/kbuild/kconfig-language.txt 
b/Documentation/kbuild/kconfig-language.txt
index 536d5bf..fe8b0c4 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -98,6 +98,15 @@ applicable everywhere (see syntax).
   times, the limit is set to the largest selection.
   Reverse dependencies can only be used with boolean or tristate
   symbols.
+  Note:
+   select is evil select will by brute force set a symbol
+   equal to 'y' without visiting the dependencies. So abusing
+   select you are able to select a symbol FOO even if FOO depends
+   on BAR that is not set. In general use select only for
+   non-visible symbols (no promts anywhere) and for symbols with
+   no dependencies. That will limit the usefulness but on the
+   other hand avoid the illegal configurations all over. kconfig
+   should one day warn about such things.
 
 - numerical ranges: range symbol symbol [if expr]
   This allows to limit the range of possible input values for int
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fix serial buffer memory leak

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=42fd552e8647316757ded0176466c41d17934dcf
Commit: 42fd552e8647316757ded0176466c41d17934dcf
Parent: f8a745942b1b7f052cb76bb8a893d12cb6329c84
Author: Alan Cox [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:05 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

fix serial buffer memory leak

Patch c5c34d4862e18ef07c1276d233507f540fb5a532 (tty: flush flip buffer on
ldisc input queue flush) introduces a race condition which can lead to 
memory
leaks.

The problem can be triggered when tcflush() is called when data are being
pushed to the line discipline driver by flush_to_ldisc().

flush_to_ldisc() releases tty-buf.lock when calling the line discipline
receive_buf function. At that poing tty_buffer_flush() kicks in and sets 
both
tty-buf.head and tty-buf.tail to NULL. When flush_to_ldisc() finishes, it
restores tty-buf.head but doesn't touch tty-buf.tail. This corrups the
buffer queue, and the next call to tty_buffer_request_room() will allocate a
new buffer and overwrite tty-buf.head. The previous buffer is then lost
forever without being released.

(Thanks to Laurent for the above text, for finding, disgnosing and reporting
the bug)

- Use tty-flags bits for the flush status.

- Wait for the flag to clear again before returning

- Fix the doc error noted

- Fix flush of empty queue leaving stale flushpending

[EMAIL PROTECTED]: cleanup]
Signed-off-by: Alan Cox [EMAIL PROTECTED]
Acked-by: Paul Fulghum [EMAIL PROTECTED]
Cc: Laurent Pinchart [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/tty_io.c |   56 +++-
 include/linux/tty.h   |2 +
 2 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index de37ebc..51ea93c 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -369,25 +369,54 @@ static void tty_buffer_free(struct tty_struct *tty, 
struct tty_buffer *b)
 }
 
 /**
- * tty_buffer_flush-   flush full tty buffers
+ * __tty_buffer_flush  -   flush full tty buffers
  * @tty: tty to flush
  *
- * flush all the buffers containing receive data
+ * flush all the buffers containing receive data. Caller must
+ * hold the buffer lock and must have ensured no parallel flush to
+ * ldisc is running.
  *
- * Locking: none
+ * Locking: Caller must hold tty-buf.lock
  */
 
-static void tty_buffer_flush(struct tty_struct *tty)
+static void __tty_buffer_flush(struct tty_struct *tty)
 {
struct tty_buffer *thead;
-   unsigned long flags;
 
-   spin_lock_irqsave(tty-buf.lock, flags);
while((thead = tty-buf.head) != NULL) {
tty-buf.head = thead-next;
tty_buffer_free(tty, thead);
}
tty-buf.tail = NULL;
+}
+
+/**
+ * tty_buffer_flush-   flush full tty buffers
+ * @tty: tty to flush
+ *
+ * flush all the buffers containing receive data. If the buffer is
+ * being processed by flush_to_ldisc then we defer the processing
+ * to that function
+ *
+ * Locking: none
+ */
+
+static void tty_buffer_flush(struct tty_struct *tty)
+{
+   unsigned long flags;
+   spin_lock_irqsave(tty-buf.lock, flags);
+
+   /* If the data is being pushed to the tty layer then we can't
+  process it here. Instead set a flag and the flush_to_ldisc
+  path will process the flush request before it exits */
+   if (test_bit(TTY_FLUSHING, tty-flags)) {
+   set_bit(TTY_FLUSHPENDING, tty-flags);
+   spin_unlock_irqrestore(tty-buf.lock, flags);
+   wait_event(tty-read_wait,
+   test_bit(TTY_FLUSHPENDING, tty-flags) == 0);
+   return;
+   } else
+   __tty_buffer_flush(tty);
spin_unlock_irqrestore(tty-buf.lock, flags);
 }
 
@@ -3594,6 +3623,7 @@ static void flush_to_ldisc(struct work_struct *work)
return;
 
spin_lock_irqsave(tty-buf.lock, flags);
+   set_bit(TTY_FLUSHING, tty-flags); /* So we know a flush is 
running */
head = tty-buf.head;
if (head != NULL) {
tty-buf.head = NULL;
@@ -3607,6 +3637,11 @@ static void flush_to_ldisc(struct work_struct *work)
tty_buffer_free(tty, tbuf);
continue;
}
+   /* Ldisc or user is trying to flush the buffers
+  we are feeding to the ldisc, stop feeding the
+  line discipline as we want to empty the queue */
+  

mtdchar build fix

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0c1eafdb063a3701eff24d21eb245e3b1d4ac7df
Commit: 0c1eafdb063a3701eff24d21eb245e3b1d4ac7df
Parent: 42fd552e8647316757ded0176466c41d17934dcf
Author: Andrew Morton [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:06 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

mtdchar build fix

sh:

drivers/mtd/mtdchar.c: In function `mtd_mmap':
drivers/mtd/mtdchar.c:817: error: dereferencing pointer to incomplete type
drivers/mtd/mtdchar.c:817: error: `VM_SHARED' undeclared (first use in this 
function)
drivers/mtd/mtdchar.c:817: error: (Each undeclared identifier is reported 
only once

Cc: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/mtd/mtdchar.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 8c86b80..d091b24 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -7,6 +7,7 @@
 
 #include linux/device.h
 #include linux/fs.h
+#include linux/mm.h
 #include linux/err.h
 #include linux/init.h
 #include linux/kernel.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


hex_dump: add missing const qualifiers

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eb9a9a56316f4fea98ee32873ccbf7098b7bd69b
Commit: eb9a9a56316f4fea98ee32873ccbf7098b7bd69b
Parent: 0c1eafdb063a3701eff24d21eb245e3b1d4ac7df
Author: Alan Stern [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:07 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

hex_dump: add missing const qualifiers

Add missing const qualifiers to the print_hex_dump_bytes() library 
routines.

(akpm: rumoured to fix some compile warning somewhere)

Signed-off-by: Alan Stern [EMAIL PROTECTED]
Cc: Artem Bityutskiy [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/kernel.h |2 +-
 lib/hexdump.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index b4f5b81..f592df7 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -226,7 +226,7 @@ extern void print_hex_dump(const char *level, const char 
*prefix_str,
int prefix_type, int rowsize, int groupsize,
const void *buf, size_t len, bool ascii);
 extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
-   void *buf, size_t len);
+   const void *buf, size_t len);
 #define hex_asc(x) 0123456789abcdef[x]
 
 #ifdef DEBUG
diff --git a/lib/hexdump.c b/lib/hexdump.c
index 16f2e29..bd5edae 100644
--- a/lib/hexdump.c
+++ b/lib/hexdump.c
@@ -189,7 +189,7 @@ EXPORT_SYMBOL(print_hex_dump);
  * rowsize of 16, groupsize of 1, and ASCII output included.
  */
 void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
-   void *buf, size_t len)
+   const void *buf, size_t len)
 {
print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, 16, 1,
buf, len, 1);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cris: drivers/cdrom/Kconfig no longer exists

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4a2a4da43995864786d59f5f0ebf42c0c1e2cdd1
Commit: 4a2a4da43995864786d59f5f0ebf42c0c1e2cdd1
Parent: 844add7abca0d10e9733fc16119e53cb4c1987b4
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:08 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

cris: drivers/cdrom/Kconfig no longer exists

scripts/kconfig/conf -d arch/cris/Kconfig
arch/cris/Kconfig:183: can't open file drivers/cdrom/Kconfig

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: Mikael Starvik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/cris/Kconfig |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 4b41248..6b4d026 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -180,8 +180,6 @@ source drivers/isdn/Kconfig
 
 source drivers/telephony/Kconfig
 
-source drivers/cdrom/Kconfig
-
 #
 # input before char - char/joystick depends on it. As does USB.
 #
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RCU: Remove prototype for nonexistent function synchronize_idle()

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=844add7abca0d10e9733fc16119e53cb4c1987b4
Commit: 844add7abca0d10e9733fc16119e53cb4c1987b4
Parent: eb9a9a56316f4fea98ee32873ccbf7098b7bd69b
Author: Josh Triplett [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:07 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:41 2007 -0700

RCU: Remove prototype for nonexistent function synchronize_idle()

synchronize_idle() sounds like an interesting function, but we don't
actually have it, so don't prototype it.  Introduced in commit
9b06e818985d139fd9e82c28297f7744e1b484e1, in 2005.

Signed-off-by: Josh Triplett [EMAIL PROTECTED]
Acked-by: Paul E. McKenney [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/rcupdate.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index c6b7485..fe17d7d 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -281,7 +281,6 @@ extern void FASTCALL(call_rcu(struct rcu_head *head,
 extern void FASTCALL(call_rcu_bh(struct rcu_head *head,
void (*func)(struct rcu_head *head)));
 extern void synchronize_rcu(void);
-void synchronize_idle(void);
 extern void rcu_barrier(void);
 
 #endif /* __KERNEL__ */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


spidev warning fix

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=96ddbf504a05502800e7cbeb4d08abbcc206c51c
Commit: 96ddbf504a05502800e7cbeb4d08abbcc206c51c
Parent: 4a2a4da43995864786d59f5f0ebf42c0c1e2cdd1
Author: David Brownell [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:09 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:42 2007 -0700

spidev warning fix

Git rid of warning: passing arg 2 of `access_ok' makes pointer from integer
without a cast reported on SH ...  most architectures use macros in that
test, SH uses inlined functions.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/spi/spidev.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 630f781..c55459c 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -183,7 +183,9 @@ static int spidev_message(struct spidev_data *spidev,
 
if (u_tmp-rx_buf) {
k_tmp-rx_buf = buf;
-   if (!access_ok(VERIFY_WRITE, u_tmp-rx_buf, u_tmp-len))
+   if (!access_ok(VERIFY_WRITE, (u8 __user *)
+   (ptrdiff_t) u_tmp-rx_buf,
+   u_tmp-len))
goto done;
}
if (u_tmp-tx_buf) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


timer: remove clockevents_unregister_notifier

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6ddfca9548d8ecc26096a30667423ba919109533
Commit: 6ddfca9548d8ecc26096a30667423ba919109533
Parent: 96ddbf504a05502800e7cbeb4d08abbcc206c51c
Author: Miao Xie [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:09 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:42 2007 -0700

timer: remove clockevents_unregister_notifier

I find a function(clockevents_unregister_notifier) which is not called by
anything in tree.

Signed-off-by: Miao Xie [EMAIL PROTECTED]
Acked-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/clockchips.h |1 -
 kernel/time/clockevents.c  |   10 --
 2 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index e0bd46e..def5a65 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -123,7 +123,6 @@ extern void clockevents_exchange_device(struct 
clock_event_device *old,
 extern void clockevents_set_mode(struct clock_event_device *dev,
 enum clock_event_mode mode);
 extern int clockevents_register_notifier(struct notifier_block *nb);
-extern void clockevents_unregister_notifier(struct notifier_block *nb);
 extern int clockevents_program_event(struct clock_event_device *dev,
 ktime_t expires, ktime_t now);
 
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 2ad1c37..41dd310 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -113,16 +113,6 @@ int clockevents_register_notifier(struct notifier_block 
*nb)
return ret;
 }
 
-/**
- * clockevents_unregister_notifier - unregister a clock events change listener
- */
-void clockevents_unregister_notifier(struct notifier_block *nb)
-{
-   spin_lock(clockevents_lock);
-   raw_notifier_chain_unregister(clockevents_chain, nb);
-   spin_unlock(clockevents_lock);
-}
-
 /*
  * Notify about a clock event change. Called with clockevents_lock
  * held.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fix compilation with gcc 4.2

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cd5bfea278987ebfe60f3ff92a01696b17c4f978
Commit: cd5bfea278987ebfe60f3ff92a01696b17c4f978
Parent: 6ddfca9548d8ecc26096a30667423ba919109533
Author: Peter Chubb [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:10 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:42 2007 -0700

fix compilation with gcc 4.2

gcc-4.2 is a lot more picky about its symbol handling.  EXPORT_SYMBOL no
longer works on symbols that are undefined or defined with static scope.

For example, with CONFIG_PROFILE off, I see:

  kernel/profile.c:206: error: __ksymtab_profile_event_unregister causes a 
section type conflict
  kernel/profile.c:205: error: __ksymtab_profile_event_register causes a 
section type conflict

This patch moves the EXPORTs inside the #ifdef CONFIG_PROFILE, so we
only try to export symbols that are defined.

Also, in kernel/kprobes.c there's an EXPORT_SYMBOL_GPL() for
jprobes_return, which if CONFIG_JPROBES is undefined is a static
inline and gives the same error.

And in drivers/acpi/resources/rsxface.c, there's an
ACPI_EXPORT_SYMBOPL() for a static symbol. If it's static, it's not
accessible from outside the compilation unit, so should bot be exported.

These three changes allow building a zx1_defconfig kernel with gcc 4.2
on IA64.

[EMAIL PROTECTED]: export jpobe_return properly]
Signed-off-by: Peter Chubb [EMAIL PROTECTED]
Cc: Prasanna S Panchamukhi [EMAIL PROTECTED]
Cc: Ananth N Mavinakayanahalli [EMAIL PROTECTED]
Cc: Anil S Keshavamurthy [EMAIL PROTECTED]
Cc: Luck, Tony [EMAIL PROTECTED]
Cc: Len Brown [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/acpi/resources/rsxface.c |2 --
 kernel/kprobes.c |5 +
 kernel/profile.c |4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c
index f63813a..4c3fd4c 100644
--- a/drivers/acpi/resources/rsxface.c
+++ b/drivers/acpi/resources/rsxface.c
@@ -474,8 +474,6 @@ acpi_rs_match_vendor_resource(struct acpi_resource 
*resource, void *context)
return (AE_CTRL_TERMINATE);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_rs_match_vendor_resource)
-
 
/***
  *
  * FUNCTION:acpi_walk_resources
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 3e9f513..4b8a449 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1063,6 +1063,11 @@ EXPORT_SYMBOL_GPL(register_kprobe);
 EXPORT_SYMBOL_GPL(unregister_kprobe);
 EXPORT_SYMBOL_GPL(register_jprobe);
 EXPORT_SYMBOL_GPL(unregister_jprobe);
+#ifdef CONFIG_KPROBES
 EXPORT_SYMBOL_GPL(jprobe_return);
+#endif
+
+#ifdef CONFIG_KPROBES
 EXPORT_SYMBOL_GPL(register_kretprobe);
 EXPORT_SYMBOL_GPL(unregister_kretprobe);
+#endif
diff --git a/kernel/profile.c b/kernel/profile.c
index 5b20fe9..cb1e37d 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -199,11 +199,11 @@ EXPORT_SYMBOL_GPL(register_timer_hook);
 EXPORT_SYMBOL_GPL(unregister_timer_hook);
 EXPORT_SYMBOL_GPL(task_handoff_register);
 EXPORT_SYMBOL_GPL(task_handoff_unregister);
+EXPORT_SYMBOL_GPL(profile_event_register);
+EXPORT_SYMBOL_GPL(profile_event_unregister);
 
 #endif /* CONFIG_PROFILING */
 
-EXPORT_SYMBOL_GPL(profile_event_register);
-EXPORT_SYMBOL_GPL(profile_event_unregister);
 
 #ifdef CONFIG_SMP
 /*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


lguest files should explicitly include asm/paravirt.h

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b1a47190a6000d0e75ee4ffa75f3f6b16dd60a0b
Commit: b1a47190a6000d0e75ee4ffa75f3f6b16dd60a0b
Parent: cd5bfea278987ebfe60f3ff92a01696b17c4f978
Author: Jes Sorensen [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:11 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:42 2007 -0700

lguest files should explicitly include asm/paravirt.h

Files using bits from paravirt.h should explicitly include it rather than
relying on it being pulled in by something else.

Signed-off-by: Jes Sorensen [EMAIL PROTECTED]
Cc: Rusty Russell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/hvc_lguest.c   |1 +
 drivers/lguest/lguest_bus.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/char/hvc_lguest.c b/drivers/char/hvc_lguest.c
index feeccba..3d6bd0b 100644
--- a/drivers/char/hvc_lguest.c
+++ b/drivers/char/hvc_lguest.c
@@ -35,6 +35,7 @@
 #include linux/err.h
 #include linux/init.h
 #include linux/lguest_bus.h
+#include asm/paravirt.h
 #include hvc_console.h
 
 /*D:340 This is our single console input buffer, with associated struct
diff --git a/drivers/lguest/lguest_bus.c b/drivers/lguest/lguest_bus.c
index 55a7940..9e7752c 100644
--- a/drivers/lguest/lguest_bus.c
+++ b/drivers/lguest/lguest_bus.c
@@ -5,6 +5,7 @@
 #include linux/bootmem.h
 #include linux/lguest_bus.h
 #include asm/io.h
+#include asm/paravirt.h
 
 static ssize_t type_show(struct device *_dev,
  struct device_attribute *attr, char *buf)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


alpha: -Werror fixes for sys_titan.c

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f6901e639800e745457b1dcd99c52647981438d7
Commit: f6901e639800e745457b1dcd99c52647981438d7
Parent: b1a47190a6000d0e75ee4ffa75f3f6b16dd60a0b
Author: Jay Estabrook [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:12 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:42 2007 -0700

alpha: -Werror fixes for sys_titan.c

This code corrects the usage of the request_irq() routine.

Signed-off-by: Jay Estabrook [EMAIL PROTECTED]
Signed-off-by: Ivan Kokshaysky [EMAIL PROTECTED]
Cc: Richard Henderson [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/alpha/kernel/sys_titan.c |   27 ---
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index 1d3c139..52c91cc 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -271,6 +271,19 @@ titan_dispatch_irqs(u64 mask)
  * Titan Family
  */
 static void __init
+titan_request_irq(unsigned int irq, irq_handler_t handler,
+ unsigned long irqflags, const char *devname,
+ void *dev_id)
+{
+   int err;
+   err = request_irq(irq, handler, irqflags, devname, dev_id);
+   if (err) {
+   printk(titan_request_irq for IRQ %d returned %d; ignoring\n,
+  irq, err);
+   }
+}
+
+static void __init
 titan_late_init(void)
 {
/*
@@ -278,15 +291,15 @@ titan_late_init(void)
 * all reported to the kernel as machine checks, so the handler
 * is a nop so it can be called to count the individual events.
 */
-   request_irq(63+16, titan_intr_nop, IRQF_DISABLED,
+   titan_request_irq(63+16, titan_intr_nop, IRQF_DISABLED,
CChip Error, NULL);
-   request_irq(62+16, titan_intr_nop, IRQF_DISABLED,
+   titan_request_irq(62+16, titan_intr_nop, IRQF_DISABLED,
PChip 0 H_Error, NULL);
-   request_irq(61+16, titan_intr_nop, IRQF_DISABLED,
+   titan_request_irq(61+16, titan_intr_nop, IRQF_DISABLED,
PChip 1 H_Error, NULL);
-   request_irq(60+16, titan_intr_nop, IRQF_DISABLED,
+   titan_request_irq(60+16, titan_intr_nop, IRQF_DISABLED,
PChip 0 C_Error, NULL);
-   request_irq(59+16, titan_intr_nop, IRQF_DISABLED,
+   titan_request_irq(59+16, titan_intr_nop, IRQF_DISABLED,
PChip 1 C_Error, NULL);
 
/* 
@@ -345,9 +358,9 @@ privateer_init_pci(void)
 * Hook a couple of extra err interrupts that the
 * common titan code won't.
 */
-   request_irq(53+16, titan_intr_nop, IRQF_DISABLED,
+   titan_request_irq(53+16, titan_intr_nop, IRQF_DISABLED,
NMI, NULL);
-   request_irq(50+16, titan_intr_nop, IRQF_DISABLED,
+   titan_request_irq(50+16, titan_intr_nop, IRQF_DISABLED,
Temperature Warning, NULL);
 
/*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


readahead: docbook fix

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f0b85c0cfdad8977d82fed88e846fc2245585d0e
Commit: f0b85c0cfdad8977d82fed88e846fc2245585d0e
Parent: f6901e639800e745457b1dcd99c52647981438d7
Author: Stephen Hemminger [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:16 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:42 2007 -0700

readahead: docbook fix

Minor docbook error since argument name in comment doesn't match function

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/filemap.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 6cf700d..49a6fe3 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -843,7 +843,7 @@ static void shrink_readahead_size_eio(struct file *filp,
 /**
  * do_generic_mapping_read - generic file read routine
  * @mapping:   address_space to be read
- * @ra:file's readahead state
+ * @_ra:   file's readahead state
  * @filp:  the file to read
  * @ppos:  current file position
  * @desc:  read_descriptor
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


finish i386 and x86-64 sysdata conversion

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=73c59afc65cfa50c3362b9ce1ec151a79c41dd8e
Commit: 73c59afc65cfa50c3362b9ce1ec151a79c41dd8e
Parent: f0b85c0cfdad8977d82fed88e846fc2245585d0e
Author: Muli Ben-Yehuda [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:19 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:42 2007 -0700

finish i386 and x86-64 sysdata conversion

This patch finishes the i386 and x86-64 -sysdata conversion and hopefully
also fixes Riku's and Andy's observed bugs.  It is based on Yinghai Lu's
and Andy Whitcroft's patches (thanks!) with some changes:

- introduce pci_scan_bus_with_sysdata() and use it instead of
  pci_scan_bus() where appropriate. pci_scan_bus_with_sysdata() will
  allocate the sysdata structure and then call pci_scan_bus().
- always allocate pci_sysdata dynamically. The whole point of this
  sysdata work is to make it easy to do root-bus specific things
  (e.g., support PCI domains and IOMMU's). I dislike using a default
  struct pci_sysdata in some places and a dynamically allocated
  pci_sysdata elsewhere - the potential for someone indavertantly
  changing the default structure is too high.
- this patch only makes the minimal changes necessary, i.e., the NUMA node 
is
  always initialized to -1. Patches to do the right thing with regards
  to the NUMA node can build on top of this (either add a 'node'
  parameter to pci_scan_bus_with_sysdata() or just update the node
  when it becomes known).

The patch was compile tested with various configurations (e.g., NUMAQ,
VISWS) and run-time tested on i386 and x86-64.  Unfortunately none of my
machines exhibited the bugs so caveat emptor.

Andy, could you please see if this fixes the NUMA issues you've seen?
Riku, does this fix pci=noacpi on your laptop?

Signed-off-by: Muli Ben-Yehuda [EMAIL PROTECTED]
Cc: Yinghai Lu [EMAIL PROTECTED]
Cc: Andi Kleen [EMAIL PROTECTED]
Cc: Chuck Ebbert [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Cc: Andy Whitcroft [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/pci/common.c   |   23 +++
 arch/i386/pci/fixup.c|6 +++---
 arch/i386/pci/irq.c  |5 +++--
 arch/i386/pci/legacy.c   |2 +-
 arch/i386/pci/numa.c |   15 +--
 arch/i386/pci/visws.c|4 ++--
 include/asm-i386/pci.h   |3 +++
 include/asm-x86_64/pci.h |2 ++
 8 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index 85503de..ebc6f3c 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -455,3 +455,26 @@ void pcibios_disable_device (struct pci_dev *dev)
if (!dev-msi_enabled  pcibios_disable_irq)
pcibios_disable_irq(dev);
 }
+
+struct pci_bus *pci_scan_bus_with_sysdata(int busno)
+{
+   struct pci_bus *bus = NULL;
+   struct pci_sysdata *sd;
+
+   /*
+* Allocate per-root-bus (not per bus) arch-specific data.
+* TODO: leak; this memory is never freed.
+* It's arguable whether it's worth the trouble to care.
+*/
+   sd = kzalloc(sizeof(*sd), GFP_KERNEL);
+   if (!sd) {
+   printk(KERN_ERR PCI: OOM, skipping PCI bus %02x\n, busno);
+   return NULL;
+   }
+   sd-node = -1;
+   bus = pci_scan_bus(busno, pci_root_ops, sd);
+   if (!bus)
+   kfree(sd);
+
+   return bus;
+}
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c
index e7306db..c82cbf4 100644
--- a/arch/i386/pci/fixup.c
+++ b/arch/i386/pci/fixup.c
@@ -25,9 +25,9 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d)
pci_read_config_byte(d, reg++, subb);
DBG(i450NX PXB %d: %02x/%02x/%02x\n, pxb, busno, suba, subb);
if (busno)
-   pci_scan_bus(busno, pci_root_ops, NULL);   /* Bus 
A */
+   pci_scan_bus_with_sysdata(busno);   /* Bus A */
if (suba  subb)
-   pci_scan_bus(suba+1, pci_root_ops, NULL);  /* Bus 
B */
+   pci_scan_bus_with_sysdata(suba+1);  /* Bus B */
}
pcibios_last_bus = -1;
 }
@@ -42,7 +42,7 @@ static void __devinit pci_fixup_i450gx(struct pci_dev *d)
u8 busno;
pci_read_config_byte(d, 0x4a, busno);
printk(KERN_INFO PCI: i440KX/GX host bridge %s: secondary bus %02x\n, 
pci_name(d), busno);
-   pci_scan_bus(busno, pci_root_ops, NULL);
+   pci_scan_bus_with_sysdata(busno);
pcibios_last_bus = -1;
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, 
pci_fixup_i450gx);
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c

changing include/asm-generic/pgtable.h for non-mmu

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9535239f6bc99f68e0cfae44505ad402b53ed24c
Commit: 9535239f6bc99f68e0cfae44505ad402b53ed24c
Parent: 73c59afc65cfa50c3362b9ce1ec151a79c41dd8e
Author: Greg Ungerer [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 13:01:20 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:47:42 2007 -0700

changing include/asm-generic/pgtable.h for non-mmu

There are some parts of include/asm-generic/pgtable.h that are relevant to
the non-mmu architectures.  To make it easier to include this from them I
would like to ifdef the relevant parts.

Without this there is a handful of functions that are referenced in here
that are not defined on many non-mmu architectures.  They could be defined
out of course, as an alternative approach.

Cc: David Howells [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-generic/pgtable.h |   73 +---
 1 files changed, 38 insertions(+), 35 deletions(-)

diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index f605e8d..5f0d797 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -2,6 +2,7 @@
 #define _ASM_GENERIC_PGTABLE_H
 
 #ifndef __ASSEMBLY__
+#ifdef CONFIG_MMU
 
 #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 /*
@@ -133,41 +134,6 @@ static inline void ptep_set_wrprotect(struct mm_struct 
*mm, unsigned long addres
 #endif
 
 /*
- * A facility to provide lazy MMU batching.  This allows PTE updates and
- * page invalidations to be delayed until a call to leave lazy MMU mode
- * is issued.  Some architectures may benefit from doing this, and it is
- * beneficial for both shadow and direct mode hypervisors, which may batch
- * the PTE updates which happen during this window.  Note that using this
- * interface requires that read hazards be removed from the code.  A read
- * hazard could result in the direct mode hypervisor case, since the actual
- * write to the page tables may not yet have taken place, so reads though
- * a raw PTE pointer after it has been modified are not guaranteed to be
- * up to date.  This mode can only be entered and left under the protection of
- * the page table locks for all page tables which may be modified.  In the UP
- * case, this is required so that preemption is disabled, and in the SMP case,
- * it must synchronize the delayed page table writes properly on other CPUs.
- */
-#ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
-#define arch_enter_lazy_mmu_mode() do {} while (0)
-#define arch_leave_lazy_mmu_mode() do {} while (0)
-#define arch_flush_lazy_mmu_mode() do {} while (0)
-#endif
-
-/*
- * A facility to provide batching of the reload of page tables with the
- * actual context switch code for paravirtualized guests.  By convention,
- * only one of the lazy modes (CPU, MMU) should be active at any given
- * time, entry should never be nested, and entry and exits should always
- * be paired.  This is for sanity of maintaining and reasoning about the
- * kernel code.
- */
-#ifndef __HAVE_ARCH_ENTER_LAZY_CPU_MODE
-#define arch_enter_lazy_cpu_mode() do {} while (0)
-#define arch_leave_lazy_cpu_mode() do {} while (0)
-#define arch_flush_lazy_cpu_mode() do {} while (0)
-#endif
-
-/*
  * When walking page tables, get the address of the next boundary,
  * or the end address of the range if that comes earlier.  Although no
  * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.
@@ -233,6 +199,43 @@ static inline int pmd_none_or_clear_bad(pmd_t *pmd)
}
return 0;
 }
+#endif /* CONFIG_MMU */
+
+/*
+ * A facility to provide lazy MMU batching.  This allows PTE updates and
+ * page invalidations to be delayed until a call to leave lazy MMU mode
+ * is issued.  Some architectures may benefit from doing this, and it is
+ * beneficial for both shadow and direct mode hypervisors, which may batch
+ * the PTE updates which happen during this window.  Note that using this
+ * interface requires that read hazards be removed from the code.  A read
+ * hazard could result in the direct mode hypervisor case, since the actual
+ * write to the page tables may not yet have taken place, so reads though
+ * a raw PTE pointer after it has been modified are not guaranteed to be
+ * up to date.  This mode can only be entered and left under the protection of
+ * the page table locks for all page tables which may be modified.  In the UP
+ * case, this is required so that preemption is disabled, and in the SMP case,
+ * it must synchronize the delayed page table writes properly on other CPUs.
+ */
+#ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
+#define arch_enter_lazy_mmu_mode() do {} while (0)
+#define arch_leave_lazy_mmu_mode() do {} while (0)
+#define arch_flush_lazy_mmu_mode() do {} while (0)
+#endif
+
+/*

x86: Work around mmio config space quirk on AMD Fam10h

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3320ad994afb2c44ad34b3b34c3c5cf0da297331
Commit: 3320ad994afb2c44ad34b3b34c3c5cf0da297331
Parent: 9535239f6bc99f68e0cfae44505ad402b53ed24c
Author: dean gaudet [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:30:59 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:12 2007 -0700

x86: Work around mmio config space quirk on AMD Fam10h

Some broken devices have been discovered to require %al/%ax/%eax registers
for MMIO config space accesses.  Modify mmconfig.c to use these registers
explicitly (rather than modify the global readb/writeb/etc inlines).

AK: also changed i386 to always use eax
AK: moved change to extended space probing to different patch
AK: reworked with inlines according to Linus' requirements.
AK: improve comments.

Signed-off-by: dean gaudet [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/pci/mmconfig.c   |   14 ++
 arch/i386/pci/pci.h|   43 +++
 arch/x86_64/pci/mmconfig.c |   12 ++--
 3 files changed, 55 insertions(+), 14 deletions(-)

diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index bb1afd9..0d46b7a 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -82,16 +82,15 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int 
bus,
 
switch (len) {
case 1:
-   *value = readb(mmcfg_virt_addr + reg);
+   *value = mmio_config_readb(mmcfg_virt_addr + reg);
break;
case 2:
-   *value = readw(mmcfg_virt_addr + reg);
+   *value = mmio_config_readw(mmcfg_virt_addr + reg);
break;
case 4:
-   *value = readl(mmcfg_virt_addr + reg);
+   *value = mmio_config_readl(mmcfg_virt_addr + reg);
break;
}
-
spin_unlock_irqrestore(pci_config_lock, flags);
 
return 0;
@@ -116,16 +115,15 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int 
bus,
 
switch (len) {
case 1:
-   writeb(value, mmcfg_virt_addr + reg);
+   mmio_config_writeb(mmcfg_virt_addr, value);
break;
case 2:
-   writew(value, mmcfg_virt_addr + reg);
+   mmio_config_writew(mmcfg_virt_addr, value);
break;
case 4:
-   writel(value, mmcfg_virt_addr + reg);
+   mmio_config_writel(mmcfg_virt_addr, value);
break;
}
-
spin_unlock_irqrestore(pci_config_lock, flags);
 
return 0;
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h
index e58bae2..8c66f27 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/i386/pci/pci.h
@@ -104,3 +104,46 @@ extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 
32*PCI_MMCFG_MAX_CHECK_BUS);
 extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
   unsigned int devfn);
 extern int __init pci_mmcfg_arch_init(void);
+
+/*
+ * AMD Fam10h CPUs are buggy, and cannot access MMIO config space
+ * on their northbrige except through the * %eax register. As such, you MUST
+ * NOT use normal IOMEM accesses, you need to only use the magic mmio-config
+ * accessor functions.
+ * In fact just use pci_config_*, nothing else please.
+ */
+static inline unsigned char mmio_config_readb(void __iomem *pos)
+{
+   u8 val;
+   asm volatile(movb (%1),%%al : =a (val) : r (pos));
+   return val;
+}
+
+static inline unsigned short mmio_config_readw(void __iomem *pos)
+{
+   u16 val;
+   asm volatile(movw (%1),%%ax : =a (val) : r (pos));
+   return val;
+}
+
+static inline unsigned int mmio_config_readl(void __iomem *pos)
+{
+   u32 val;
+   asm volatile(movl (%1),%%eax : =a (val) : r (pos));
+   return val;
+}
+
+static inline void mmio_config_writeb(void __iomem *pos, u8 val)
+{
+   asm volatile(movb %%al,(%1) :: a (val), r (pos) : memory);
+}
+
+static inline void mmio_config_writew(void __iomem *pos, u16 val)
+{
+   asm volatile(movw %%ax,(%1) :: a (val), r (pos) : memory);
+}
+
+static inline void mmio_config_writel(void __iomem *pos, u32 val)
+{
+   asm volatile(movl %%eax,(%1) :: a (val), r (pos) : memory);
+}
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index 65d8273..4095e4d 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -66,13 +66,13 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int 
bus,
 
switch (len) {
case 1:
-   *value = readb(addr + reg);
+   *value = mmio_config_readb(addr + reg);
break;
case 2:
-   *value = readw(addr + reg);
+   *value = mmio_config_readw(addr + reg);
  

x86_64: Calgary - Fix mis-handled PCI topology

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f055a0619aae795832ef6a783021184925758b67
Commit: f055a0619aae795832ef6a783021184925758b67
Parent: 3320ad994afb2c44ad34b3b34c3c5cf0da297331
Author: Murillo Fernandes Bernardes [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:31:00 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:12 2007 -0700

x86_64: Calgary - Fix mis-handled PCI topology

Current code assumed that devices were directly connected to a Calgary
bridge, as it tried to get the iommu table directly from the parent bus
controller.

When we have another bridge between the Calgary/CalIOC2 bridge and the
device we should look upwards until we get to the top (Calgary/CalIOC2
bridge), where the iommu table resides.

Signed-off-by: Murillo Fernandes Bernardes [EMAIL PROTECTED]
Signed-off-by: Muli Ben-Yehuda [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/kernel/pci-calgary.c |   13 ++---
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index ba16c96..71da01e 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -367,16 +367,15 @@ static inline struct iommu_table *find_iommu_table(struct 
device *dev)
 
pdev = to_pci_dev(dev);
 
-   /* is the device behind a bridge? */
-   if (unlikely(pdev-bus-parent))
-   pbus = pdev-bus-parent;
-   else
-   pbus = pdev-bus;
+   pbus = pdev-bus;
+
+   /* is the device behind a bridge? Look for the root bus */
+   while (pbus-parent)
+   pbus = pbus-parent;
 
tbl = pci_iommu(pbus);
 
-   BUG_ON(pdev-bus-parent 
-  (tbl-it_busno != pdev-bus-parent-number));
+   BUG_ON(tbl  (tbl-it_busno != pbus-number));
 
return tbl;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: Don't mark __exitcall as __cold

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3f3f7b74a7749c3a669ca146270c07568b548665
Commit: 3f3f7b74a7749c3a669ca146270c07568b548665
Parent: f055a0619aae795832ef6a783021184925758b67
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:31:01 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:13 2007 -0700

x86_64: Don't mark __exitcall as __cold

gcc currently doesn't support attributes on types, so we can't use it
function pointers.  This avoids some warnings on a gcc 4.3 build.

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/init.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/init.h b/include/linux/init.h
index 1a4a283..74b1f43 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -43,7 +43,7 @@
 #define __init __attribute__ ((__section__ (.init.text))) __cold
 #define __initdata __attribute__ ((__section__ (.init.data)))
 #define __exitdata __attribute__ ((__section__(.exit.data)))
-#define __exit_call__attribute_used__ __attribute__ ((__section__ 
(.exitcall.exit))) __cold
+#define __exit_call__attribute_used__ __attribute__ ((__section__ 
(.exitcall.exit)))
 
 /* modpost check for section mismatches during the kernel build.
  * A section mismatch happens when there are references from a
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: Disable CLFLUSH support again

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d3f3c9346979bfa074c64eac5fc3ed5bba4f40ed
Commit: d3f3c9346979bfa074c64eac5fc3ed5bba4f40ed
Parent: 3f3f7b74a7749c3a669ca146270c07568b548665
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:31:02 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:13 2007 -0700

x86: Disable CLFLUSH support again

It turns out CLFLUSH support is still not complete; we
flush the wrong pages.  Again disable it for the release.
Noticed by Jan Beulich who then also noticed a stupid typo later.

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/mm/pageattr.c   |2 +-
 arch/x86_64/mm/pageattr.c |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c
index 8927222..4241a74 100644
--- a/arch/i386/mm/pageattr.c
+++ b/arch/i386/mm/pageattr.c
@@ -82,7 +82,7 @@ static void flush_kernel_map(void *arg)
struct page *p;
 
/* High level code is not ready for clflush yet */
-   if (cpu_has_clflush) {
+   if (0  cpu_has_clflush) {
list_for_each_entry (p, lh, lru)
cache_flush_page(p);
} else if (boot_cpu_data.x86_model = 4)
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c
index 7e161c6..10b9809 100644
--- a/arch/x86_64/mm/pageattr.c
+++ b/arch/x86_64/mm/pageattr.c
@@ -75,7 +75,8 @@ static void flush_kernel_map(void *arg)
 
/* When clflush is available always use it because it is
   much cheaper than WBINVD. */
-   if (!cpu_has_clflush)
+   /* clflush is still broken. Disable for now. */
+   if (1 || !cpu_has_clflush)
asm volatile(wbinvd ::: memory);
else list_for_each_entry(pg, l, lru) {
void *adr = page_address(pg);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: Make patching more robust, fix paravirt issue

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ab144f5ec64c42218a555ec1dbde6b60cf2982d6
Commit: ab144f5ec64c42218a555ec1dbde6b60cf2982d6
Parent: d3f3c9346979bfa074c64eac5fc3ed5bba4f40ed
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:31:03 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:13 2007 -0700

i386: Make patching more robust, fix paravirt issue

Commit 19d36ccdc34f5ed444f8a6af0cbfdb6790eb1177 x86: Fix alternatives
and kprobes to remap write-protected kernel text uses code which is
being patched for patching.

In particular, paravirt_ops does patching in two stages: first it
calls paravirt_ops.patch, then it fills any remaining instructions
with nop_out().  nop_out calls text_poke() which calls
lookup_address() which calls pgd_val() (aka paravirt_ops.pgd_val):
that call site is one of the places we patch.

If we always do patching as one single call to text_poke(), we only
need make sure we're not patching the memcpy in text_poke itself.
This means the prototype to paravirt_ops.patch needs to change, to
marshal the new code into a buffer rather than patching in place as it
does now.  It also means all patching goes through text_poke(), which
is known to be safe (apply_alternatives is also changed to make a
single patch).

AK: fix compilation on x86-64 (bad rusty!)
AK: fix boot on x86-64 (sigh)
AK: merged with other patches

Signed-off-by: Rusty Russell [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/alternative.c |   33 -
 arch/i386/kernel/paravirt.c|   52 
 arch/i386/kernel/vmi.c |   35 --
 arch/i386/xen/enlighten.c  |   12 +
 drivers/lguest/lguest.c|9 ---
 include/asm-i386/paravirt.h|   16 +++
 6 files changed, 90 insertions(+), 67 deletions(-)

diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c
index c85598a..27a6b0c 100644
--- a/arch/i386/kernel/alternative.c
+++ b/arch/i386/kernel/alternative.c
@@ -11,6 +11,8 @@
 #include asm/mce.h
 #include asm/nmi.h
 
+#define MAX_PATCH_LEN (255-1)
+
 #ifdef CONFIG_HOTPLUG_CPU
 static int smp_alt_once;
 
@@ -148,7 +150,8 @@ static unsigned char** find_nop_table(void)
 
 #endif /* CONFIG_X86_64 */
 
-static void nop_out(void *insns, unsigned int len)
+/* Use this to add nops to a buffer, then text_poke the whole buffer. */
+static void add_nops(void *insns, unsigned int len)
 {
unsigned char **noptable = find_nop_table();
 
@@ -156,7 +159,7 @@ static void nop_out(void *insns, unsigned int len)
unsigned int noplen = len;
if (noplen  ASM_NOP_MAX)
noplen = ASM_NOP_MAX;
-   text_poke(insns, noptable[noplen], noplen);
+   memcpy(insns, noptable[noplen], noplen);
insns += noplen;
len -= noplen;
}
@@ -174,15 +177,15 @@ extern u8 *__smp_locks[], *__smp_locks_end[];
 void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
 {
struct alt_instr *a;
-   u8 *instr;
-   int diff;
+   char insnbuf[MAX_PATCH_LEN];
 
DPRINTK(%s: alt table %p - %p\n, __FUNCTION__, start, end);
for (a = start; a  end; a++) {
+   u8 *instr = a-instr;
BUG_ON(a-replacementlen  a-instrlen);
+   BUG_ON(a-instrlen  sizeof(insnbuf));
if (!boot_cpu_has(a-cpuid))
continue;
-   instr = a-instr;
 #ifdef CONFIG_X86_64
/* vsyscall code is not mapped yet. resolve it manually. */
if (instr = (u8 *)VSYSCALL_START  instr  (u8*)VSYSCALL_END) 
{
@@ -191,9 +194,10 @@ void apply_alternatives(struct alt_instr *start, struct 
alt_instr *end)
__FUNCTION__, a-instr, instr);
}
 #endif
-   memcpy(instr, a-replacement, a-replacementlen);
-   diff = a-instrlen - a-replacementlen;
-   nop_out(instr + a-replacementlen, diff);
+   memcpy(insnbuf, a-replacement, a-replacementlen);
+   add_nops(insnbuf + a-replacementlen,
+a-instrlen - a-replacementlen);
+   text_poke(instr, insnbuf, a-instrlen);
}
 }
 
@@ -215,16 +219,18 @@ static void alternatives_smp_lock(u8 **start, u8 **end, 
u8 *text, u8 *text_end)
 static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 
*text_end)
 {
u8 **ptr;
+   char insn[1];
 
if (noreplace_smp)
return;
 
+   add_nops(insn, 1);
for (ptr = start; ptr  end; ptr++) {
if (*ptr  text)
continue;
 

x86_64: Early segment setup for VT

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=08da5a2ca479c5e8805dc3f77fd77176c4293399
Commit: 08da5a2ca479c5e8805dc3f77fd77176c4293399
Parent: ab144f5ec64c42218a555ec1dbde6b60cf2982d6
Author: Zachary Amsden [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:31:05 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:13 2007 -0700

x86_64: Early segment setup for VT

VT is very picky about when it can enter execution.
Get all segments setup and get LDT and TR into valid state to allow
VT execution under VMware and KVM (untested).

This makes the boot decompression run under VT, which makes it several
orders of magnitude faster on 64-bit Intel hardware.

Before, I was seeing times up to a minute or more to decompress a 1.3MB 
kernel
on a very fast box.

Signed-off-by: Zachary Amsden [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/boot/compressed/head.S |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86_64/boot/compressed/head.S 
b/arch/x86_64/boot/compressed/head.S
index 1312bfa..9fd8030 100644
--- a/arch/x86_64/boot/compressed/head.S
+++ b/arch/x86_64/boot/compressed/head.S
@@ -195,6 +195,11 @@ ENTRY(startup_64)
movl%eax, %ds
movl%eax, %es
movl%eax, %ss
+   movl%eax, %fs
+   movl%eax, %gs
+   lldt%ax
+   movl$0x20, %eax
+   ltr %ax
 
/* Compute the decompressed kernel start address.  It is where
 * we were loaded at aligned to a 2M boundary. %rbp contains the
@@ -295,6 +300,8 @@ gdt:
.quad   0x  /* NULL descriptor */
.quad   0x00af9a00  /* __KERNEL_CS */
.quad   0x00cf9200  /* __KERNEL_DS */
+   .quad   0x00808900  /* TS descriptor */
+   .quad   0x  /* TS continued */
 gdt_end:
.bss
 /* Stack for uncompression */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: really stop MCEs during code patching

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d2d0251f6faa2cf341500a44310bbaa815a8a972
Commit: d2d0251f6faa2cf341500a44310bbaa815a8a972
Parent: 08da5a2ca479c5e8805dc3f77fd77176c4293399
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:31:06 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:13 2007 -0700

i386: really stop MCEs during code patching

It's CONFIG_X86_MCE, not CONFIG_MCE.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/alternative.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c
index 27a6b0c..1b66d5c 100644
--- a/arch/i386/kernel/alternative.c
+++ b/arch/i386/kernel/alternative.c
@@ -388,7 +388,7 @@ void __init alternative_instructions(void)
   that might execute the to be patched code.
   Other CPUs are not running. */
stop_nmi();
-#ifdef CONFIG_MCE
+#ifdef CONFIG_X86_MCE
stop_mce();
 #endif
 
@@ -426,7 +426,7 @@ void __init alternative_instructions(void)
local_irq_restore(flags);
 
restart_nmi();
-#ifdef CONFIG_MCE
+#ifdef CONFIG_X86_MCE
restart_mce();
 #endif
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86_64: vdso.lds in arch/x86_64/vdso/.gitignore

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1f1014896d0ddf26ae03c12c21f73706e8461013
Commit: 1f1014896d0ddf26ae03c12c21f73706e8461013
Parent: 43fb2387d0774a36f450b50d538cee84cf83858e
Author: Pete Zaitcev [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:31:09 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:14 2007 -0700

x86_64: vdso.lds in arch/x86_64/vdso/.gitignore

Create arch/x86_64/vdso/.gitignore and put vdso.lds into it.

Signed-off-by: Pete Zaitcev [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86_64/vdso/.gitignore |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86_64/vdso/.gitignore b/arch/x86_64/vdso/.gitignore
new file mode 100644
index 000..f8b69d8
--- /dev/null
+++ b/arch/x86_64/vdso/.gitignore
@@ -0,0 +1 @@
+vdso.lds
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: Fix start_kernel warning

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5fe4486c79cdc8dbbb2a9c3f884a5ad0830a5a23
Commit: 5fe4486c79cdc8dbbb2a9c3f884a5ad0830a5a23
Parent: 1f1014896d0ddf26ae03c12c21f73706e8461013
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:31:10 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:14 2007 -0700

i386: Fix start_kernel warning

Fix

WARNING: vmlinux.o(.text+0x183): Section mismatch: reference to 
.init.text:start_kernel (between 'is386' and 'check_x87')

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/head.S |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index 7c52b22..8f03821 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -162,9 +162,7 @@ page_pde_offset = (__PAGE_OFFSET  20);
  * which will be freed later
  */
 
-#ifdef CONFIG_HOTPLUG_CPU
-.section .text,ax,@progbits
-#else
+#ifndef CONFIG_HOTPLUG_CPU
 .section .init.text,ax,@progbits
 #endif
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


i386: Fix double fault handler

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3dab307e527f2a9bbb4f9d00240374bb93d1945f
Commit: 3dab307e527f2a9bbb4f9d00240374bb93d1945f
Parent: 5fe4486c79cdc8dbbb2a9c3f884a5ad0830a5a23
Author: Chuck Ebbert [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 22:31:11 2007 +0200
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat Aug 11 15:58:14 2007 -0700

i386: Fix double fault handler

The new percpu code has apparently broken the doublefault handler
when CONFIG_DEBUG_SPINLOCK is set. Doublefault is handled by
a hardware task, making the check

SPIN_BUG_ON(lock-owner == current, lock, recursion);

fault because it uses the FS register to access the percpu data
for current, and that register is zero in the new TSS. (The trace
I saw was on 2.6.20 where it was GS, but it looks like this will
still happen with FS on 2.6.22.)

Initializing FS in the doublefault_tss should fix it.

AK: Also fix broken ptr_ok() and turn printks into KERN_EMERG
AK: And add a PANIC prefix to make clear the system will hang
AK: (e.g. x86-64 will recover)

Signed-off-by: Chuck Ebbert [EMAIL PROTECTED]
Signed-off-by: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/doublefault.c |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/i386/kernel/doublefault.c b/arch/i386/kernel/doublefault.c
index 265c559..40978af 100644
--- a/arch/i386/kernel/doublefault.c
+++ b/arch/i386/kernel/doublefault.c
@@ -13,7 +13,7 @@
 static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE];
 #define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE)
 
-#define ptr_ok(x) ((x)  PAGE_OFFSET  (x)  PAGE_OFFSET + 0x100)
+#define ptr_ok(x) ((x)  PAGE_OFFSET  (x)  PAGE_OFFSET + MAXMEM)
 
 static void doublefault_fn(void)
 {
@@ -23,23 +23,23 @@ static void doublefault_fn(void)
store_gdt(gdt_desc);
gdt = gdt_desc.address;
 
-   printk(double fault, gdt at %08lx [%d bytes]\n, gdt, gdt_desc.size);
+   printk(KERN_EMERG PANIC: double fault, gdt at %08lx [%d bytes]\n, 
gdt, gdt_desc.size);
 
if (ptr_ok(gdt)) {
gdt += GDT_ENTRY_TSS  3;
tss = *(u16 *)(gdt+2);
tss += *(u8 *)(gdt+4)  16;
tss += *(u8 *)(gdt+7)  24;
-   printk(double fault, tss at %08lx\n, tss);
+   printk(KERN_EMERG double fault, tss at %08lx\n, tss);
 
if (ptr_ok(tss)) {
struct i386_hw_tss *t = (struct i386_hw_tss *)tss;
 
-   printk(eip = %08lx, esp = %08lx\n, t-eip, t-esp);
+   printk(KERN_EMERG eip = %08lx, esp = %08lx\n, t-eip, 
t-esp);
 
-   printk(eax = %08lx, ebx = %08lx, ecx = %08lx, edx = 
%08lx\n,
+   printk(KERN_EMERG eax = %08lx, ebx = %08lx, ecx = 
%08lx, edx = %08lx\n,
t-eax, t-ebx, t-ecx, t-edx);
-   printk(esi = %08lx, edi = %08lx\n,
+   printk(KERN_EMERG esi = %08lx, edi = %08lx\n,
t-esi, t-edi);
}
}
@@ -63,6 +63,7 @@ struct tss_struct doublefault_tss __cacheline_aligned = {
.cs = __KERNEL_CS,
.ss = __KERNEL_DS,
.ds = __USER_DS,
+   .fs = __KERNEL_PERCPU,
 
.__cr3  = __pa(swapper_pg_dir)
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: improve rq-clock overflow logic

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=529c77261bccd9d37f110f58b0753d95beaa9fa2
Commit: 529c77261bccd9d37f110f58b0753d95beaa9fa2
Parent: ac07860264bd2b18834d3fa3be47032115524cea
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 23:05:11 2007 +0200
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Fri Aug 10 23:05:11 2007 +0200

sched: improve rq-clock overflow logic

improve the rq-clock overflow logic: limit the absolute rq-clock
delta since the last scheduler tick, instead of limiting the delta
itself.

tested by Arjan van de Ven - whole laptop was misbehaving due to
an incorrectly calibrated cpu_khz confusing sched_clock().

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---
 kernel/sched.c |   15 +--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index b0afd8d..6247e4a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -263,6 +263,7 @@ struct rq {
 
unsigned int clock_warps, clock_overflows;
unsigned int clock_unstable_events;
+   u64 tick_timestamp;
 
atomic_t nr_iowait;
 
@@ -341,8 +342,11 @@ static void __update_rq_clock(struct rq *rq)
/*
 * Catch too large forward jumps too:
 */
-   if (unlikely(delta  2*TICK_NSEC)) {
-   clock++;
+   if (unlikely(clock + delta  rq-tick_timestamp + TICK_NSEC)) {
+   if (clock  rq-tick_timestamp + TICK_NSEC)
+   clock = rq-tick_timestamp + TICK_NSEC;
+   else
+   clock++;
rq-clock_overflows++;
} else {
if (unlikely(delta  rq-clock_max_delta))
@@ -3308,9 +3312,16 @@ void scheduler_tick(void)
int cpu = smp_processor_id();
struct rq *rq = cpu_rq(cpu);
struct task_struct *curr = rq-curr;
+   u64 next_tick = rq-tick_timestamp + TICK_NSEC;
 
spin_lock(rq-lock);
__update_rq_clock(rq);
+   /*
+* Let rq-clock advance by at least TICK_NSEC:
+*/
+   if (unlikely(rq-clock  next_tick))
+   rq-clock = next_tick;
+   rq-tick_timestamp = rq-clock;
update_cpu_load(rq);
if (curr != rq-idle) /* FIXME: needed? */
curr-sched_class-task_tick(rq, curr);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: fix typo in the FAIR_GROUP_SCHED branch

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e56f31aad9d8c0102bc074cdab4e3ee76b38600d
Commit: e56f31aad9d8c0102bc074cdab4e3ee76b38600d
Parent: 529c77261bccd9d37f110f58b0753d95beaa9fa2
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 23:05:11 2007 +0200
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Fri Aug 10 23:05:11 2007 +0200

sched: fix typo in the FAIR_GROUP_SCHED branch

while there's no in-tree way to turn group scheduling at the moment,
fix a typo in it nevertheless.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched_fair.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index e91db32..c5af389 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -959,13 +959,12 @@ load_balance_fair(struct rq *this_rq, int this_cpu, 
struct rq *busiest,
for_each_leaf_cfs_rq(busiest, busy_cfs_rq) {
 #ifdef CONFIG_FAIR_GROUP_SCHED
struct cfs_rq *this_cfs_rq;
-   long imbalances;
+   long imbalance;
unsigned long maxload;
 
this_cfs_rq = cpu_cfs_rq(busy_cfs_rq, this_cpu);
 
-   imbalance = busy_cfs_rq-load.weight -
-this_cfs_rq-load.weight;
+   imbalance = busy_cfs_rq-load.weight - this_cfs_rq-load.weight;
/* Don't pull if this_cfs_rq has more load than busy_cfs_rq */
if (imbalance = 0)
continue;
@@ -976,7 +975,7 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct 
rq *busiest,
 
*this_best_prio = cfs_rq_best_prio(this_cfs_rq);
 #else
-#define maxload rem_load_move
+# define maxload rem_load_move
 #endif
/* pass busy_cfs_rq argument into
 * load_balance_[start|next]_fair iterators
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched debug: dont print kernel address in /proc/sched_debug

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5167e75f4d2d10bff6afee1f358313e87b4df246
Commit: 5167e75f4d2d10bff6afee1f358313e87b4df246
Parent: e56f31aad9d8c0102bc074cdab4e3ee76b38600d
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 23:05:11 2007 +0200
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Fri Aug 10 23:05:11 2007 +0200

sched debug: dont print kernel address in /proc/sched_debug

Arjan van de Ven pointed out that we should not print kernel addresses
in world-readable /proc files - fix that.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Arjan van de Ven [EMAIL PROTECTED]
---
 kernel/sched_debug.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 3da3215..87e5247 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -108,7 +108,7 @@ print_cfs_rq_runtime_sum(struct seq_file *m, int cpu, 
struct cfs_rq *cfs_rq)
 
 void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 {
-   SEQ_printf(m, \ncfs_rq %p\n, cfs_rq);
+   SEQ_printf(m, \ncfs_rq\n);
 
 #define P(x) \
SEQ_printf(m,   .%-30s: %Ld\n, #x, (long long)(cfs_rq-x))
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] remove mm/filemap.c:file_send_actor()

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ec05b297f91a443aa26b74059b573bfad49c9ebb
Commit: ec05b297f91a443aa26b74059b573bfad49c9ebb
Parent: ac07860264bd2b18834d3fa3be47032115524cea
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Mon Jul 30 08:24:27 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Sat Aug 11 22:34:47 2007 +0200

[PATCH] remove mm/filemap.c:file_send_actor()

This patch removes the no longer used file_send_actor().

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 include/linux/fs.h |1 -
 mm/filemap.c   |   20 
 2 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6bf1395..16421f6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1659,7 +1659,6 @@ extern int sb_min_blocksize(struct super_block *, int);
 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
 extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
 extern int file_read_actor(read_descriptor_t * desc, struct page *page, 
unsigned long offset, unsigned long size);
-extern int file_send_actor(read_descriptor_t * desc, struct page *page, 
unsigned long offset, unsigned long size);
 int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int 
isblk);
 extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, 
unsigned long, loff_t);
 extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, 
unsigned long, loff_t);
diff --git a/mm/filemap.c b/mm/filemap.c
index 6cf700d..50021a6 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1218,26 +1218,6 @@ out:
 }
 EXPORT_SYMBOL(generic_file_aio_read);
 
-int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long 
offset, unsigned long size)
-{
-   ssize_t written;
-   unsigned long count = desc-count;
-   struct file *file = desc-arg.data;
-
-   if (size  count)
-   size = count;
-
-   written = file-f_op-sendpage(file, page, offset,
-  size, file-f_pos, sizecount);
-   if (written  0) {
-   desc-error = written;
-   written = 0;
-   }
-   desc-count = count - written;
-   desc-written += written;
-   return written;
-}
-
 static ssize_t
 do_readahead(struct address_space *mapping, struct file *filp,
 unsigned long index, unsigned long nr)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fix remap handling by blktrace

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c7149d6bce2561aeaa48caaa1700aa8b3b22008f
Commit: c7149d6bce2561aeaa48caaa1700aa8b3b22008f
Parent: ec05b297f91a443aa26b74059b573bfad49c9ebb
Author: Alan D. Brunelle [EMAIL PROTECTED]
AuthorDate: Tue Aug 7 15:30:23 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Sat Aug 11 22:34:48 2007 +0200

Fix remap handling by blktrace

This patch provides more information concerning REMAP operations on block
IOs. The additional information provides clearer details at the user level,
and supports post-processing analysis in btt.

o  Adds in partition remaps on the same device.
o  Fixed up the remap information in DM to be in the right order
o  Sent up mapped-from and mapped-to device information

Signed-off-by: Alan D. Brunelle [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 block/ll_rw_blk.c|4 
 drivers/md/dm.c  |4 ++--
 include/linux/blktrace_api.h |3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 8c2caff..a15845c 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -3047,6 +3047,10 @@ static inline void blk_partition_remap(struct bio *bio)
 
bio-bi_sector += p-start_sect;
bio-bi_bdev = bdev-bd_contains;
+
+   blk_add_trace_remap(bdev_get_queue(bio-bi_bdev), bio,
+   bdev-bd_dev, bio-bi_sector,
+   bio-bi_sector - p-start_sect);
}
 }
 
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 141ff9f..2120155 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -580,8 +580,8 @@ static void __map_bio(struct dm_target *ti, struct bio 
*clone,
/* the bio has been remapped so dispatch it */
 
blk_add_trace_remap(bdev_get_queue(clone-bi_bdev), clone,
-   tio-io-bio-bi_bdev-bd_dev, sector,
-   clone-bi_sector);
+   tio-io-bio-bi_bdev-bd_dev,
+   clone-bi_sector, sector);
 
generic_make_request(clone);
} else if (r  0 || r == DM_MAPIO_REQUEUE) {
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 90874a5..7b5d56b 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -105,7 +105,7 @@ struct blk_io_trace {
  */
 struct blk_io_trace_remap {
__be32 device;
-   u32 __pad;
+   __be32 device_from;
__be64 sector;
 };
 
@@ -272,6 +272,7 @@ static inline void blk_add_trace_remap(struct request_queue 
*q, struct bio *bio,
return;
 
r.device = cpu_to_be32(dev);
+   r.device_from = cpu_to_be32(bio-bi_bdev-bd_dev);
r.sector = cpu_to_be64(to);
 
__blk_add_trace(bt, from, bio-bi_size, bio-bi_rw, BLK_TA_REMAP, 
!bio_flagged(bio, BIO_UPTODATE), sizeof(r), r);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Clean up duplicate includes in drivers/block/

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b99628f8e9e0b5f5ecacce558defe529a6e00c1
Commit: 9b99628f8e9e0b5f5ecacce558defe529a6e00c1
Parent: c7149d6bce2561aeaa48caaa1700aa8b3b22008f
Author: Jesper Juhl [EMAIL PROTECTED]
AuthorDate: Sat Aug 11 22:34:27 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Sat Aug 11 22:34:48 2007 +0200

Clean up duplicate includes in drivers/block/

This patch cleans up duplicate includes in
drivers/block/

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Acked-by: Stephen Rothwell [EMAIL PROTECTED]
Cc: Satyam Sharma [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 drivers/block/viodasd.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index 85916e2..af3969a 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -41,7 +41,6 @@
 #include linux/dma-mapping.h
 #include linux/completion.h
 #include linux/device.h
-#include linux/kernel.h
 
 #include asm/uaccess.h
 #include asm/vio.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drivers/block/cciss.c: kmalloc + memset conversion to kzalloc

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1aebe18787ca2e915eb8204d365ba2484d53223b
Commit: 1aebe18787ca2e915eb8204d365ba2484d53223b
Parent: 9b99628f8e9e0b5f5ecacce558defe529a6e00c1
Author: Mariusz Kozlowski [EMAIL PROTECTED]
AuthorDate: Sat Aug 11 22:34:29 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Sat Aug 11 22:34:48 2007 +0200

drivers/block/cciss.c: kmalloc + memset conversion to kzalloc

 drivers/block/cciss.c | 104285 - 104168 (-117 bytes)
 drivers/block/cciss.o | 277400 - 277124 (-276 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Acked-by: Mike Miller [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 drivers/block/cciss.c |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index a11b2bd..084358a 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1977,12 +1977,13 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, 
sector_t *total_size,
 {
ReadCapdata_struct *buf;
int return_code;
-   buf = kmalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
-   if (buf == NULL) {
+
+   buf = kzalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
+   if (!buf) {
printk(KERN_WARNING cciss: out of memory\n);
return;
}
-   memset(buf, 0, sizeof(ReadCapdata_struct));
+
if (withirq)
return_code = sendcmd_withirq(CCISS_READ_CAPACITY,
ctlr, buf, sizeof(ReadCapdata_struct),
@@ -2003,7 +2004,6 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, 
sector_t *total_size,
printk(KERN_INFO   blocks= %llu block_size= %d\n,
(unsigned long long)*total_size+1, *block_size);
kfree(buf);
-   return;
 }
 
 static void
@@ -2011,12 +2011,13 @@ cciss_read_capacity_16(int ctlr, int logvol, int 
withirq, sector_t *total_size,
 {
ReadCapdata_struct_16 *buf;
int return_code;
-   buf = kmalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
-   if (buf == NULL) {
+
+   buf = kzalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
+   if (!buf) {
printk(KERN_WARNING cciss: out of memory\n);
return;
}
-   memset(buf, 0, sizeof(ReadCapdata_struct_16));
+
if (withirq) {
return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16,
ctlr, buf, sizeof(ReadCapdata_struct_16),
@@ -2038,7 +2039,6 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, 
sector_t *total_size,
printk(KERN_INFO   blocks= %llu block_size= %d\n,
   (unsigned long long)*total_size+1, *block_size);
kfree(buf);
-   return;
 }
 
 static int cciss_revalidate(struct gendisk *disk)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drivers/block/cpqarray.c: better error handling and kmalloc + memset conversion to k[cz]alloc

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e4934aa4586832c35e077191849a06f93e4a9a0
Commit: 2e4934aa4586832c35e077191849a06f93e4a9a0
Parent: 1aebe18787ca2e915eb8204d365ba2484d53223b
Author: Mariusz Kozlowski [EMAIL PROTECTED]
AuthorDate: Sat Aug 11 22:34:30 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Sat Aug 11 22:34:48 2007 +0200

drivers/block/cpqarray.c: better error handling and kmalloc + memset 
conversion to k[cz]alloc

This patch removes some redundant casts, does the kmalloc + memset to
k[cz]alloc conversion and it changes the error path to use goto (to avoid 
code
duplication).

 drivers/block/cpqarray.c | 49567 - 48623 (-944 bytes)
 drivers/block/cpqarray.o | 178820 - 178288 (-532 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Acked-by: Mike Miller [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 drivers/block/cpqarray.c |   78 +++--
 1 files changed, 26 insertions(+), 52 deletions(-)

diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index be4e347..eb9799a 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -420,18 +420,17 @@ static int __init cpqarray_register_ctlr( int i, struct 
pci_dev *pdev)
goto Enomem2;
}
 
-   hba[i]-cmd_pool = (cmdlist_t *)pci_alloc_consistent(
+   hba[i]-cmd_pool = pci_alloc_consistent(
hba[i]-pci_dev, NR_CMDS * sizeof(cmdlist_t),
(hba[i]-cmd_pool_dhandle));
-   hba[i]-cmd_pool_bits = kmalloc(
-   ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long),
+   hba[i]-cmd_pool_bits = kcalloc(
+   (NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG, sizeof(unsigned long),
GFP_KERNEL);
 
if (!hba[i]-cmd_pool_bits || !hba[i]-cmd_pool)
goto Enomem1;
 
memset(hba[i]-cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t));
-   memset(hba[i]-cmd_pool_bits, 0, 
((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long));
printk(KERN_INFO cpqarray: Finding drives on %s,
hba[i]-devname);
 
@@ -1660,45 +1659,30 @@ static void getgeometry(int ctlr)
 
info_p-log_drv_map = 0;

-   id_ldrive = kmalloc(sizeof(id_log_drv_t), GFP_KERNEL);
-   if(id_ldrive == NULL)
-   {
+   id_ldrive = kzalloc(sizeof(id_log_drv_t), GFP_KERNEL);
+   if (!id_ldrive) {
printk( KERN_ERR cpqarray:  out of memory.\n);
-   return;
+   goto err_0;
}
 
-   id_ctlr_buf = kmalloc(sizeof(id_ctlr_t), GFP_KERNEL);
-   if(id_ctlr_buf == NULL)
-   {
-   kfree(id_ldrive);
+   id_ctlr_buf = kzalloc(sizeof(id_ctlr_t), GFP_KERNEL);
+   if (!id_ctlr_buf) {
printk( KERN_ERR cpqarray:  out of memory.\n);
-   return;
+   goto err_1;
}
 
-   id_lstatus_buf = kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL);
-   if(id_lstatus_buf == NULL)
-   {
-   kfree(id_ctlr_buf);
-   kfree(id_ldrive);
+   id_lstatus_buf = kzalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL);
+   if (!id_lstatus_buf) {
printk( KERN_ERR cpqarray:  out of memory.\n);
-   return;
+   goto err_2;
}
 
-   sense_config_buf = kmalloc(sizeof(config_t), GFP_KERNEL);
-   if(sense_config_buf == NULL)
-   {
-   kfree(id_lstatus_buf);
-   kfree(id_ctlr_buf);
-   kfree(id_ldrive);
+   sense_config_buf = kzalloc(sizeof(config_t), GFP_KERNEL);
+   if (!sense_config_buf) {
printk( KERN_ERR cpqarray:  out of memory.\n);
-   return;
+   goto err_3;
}
 
-   memset(id_ldrive, 0, sizeof(id_log_drv_t));
-   memset(id_ctlr_buf, 0, sizeof(id_ctlr_t));
-   memset(id_lstatus_buf, 0, sizeof(sense_log_drv_stat_t));
-   memset(sense_config_buf, 0, sizeof(config_t));
-
info_p-phys_drives = 0;
info_p-log_drv_map = 0;
info_p-drv_assign_map = 0;
@@ -1712,13 +1696,8 @@ static void getgeometry(int ctlr)
 * so the idastubopen will fail on all logical drives
 * on the controller.
 */
-/* Free all the buffers and return */ 
printk(KERN_ERR cpqarray: error sending ID controller\n);
-   kfree(sense_config_buf);
-kfree(id_lstatus_buf);
-kfree(id_ctlr_buf);
-kfree(id_ldrive);
-return;
+goto err_4;
 }
 
info_p-log_drives = id_ctlr_buf-nr_drvs;
@@ -1764,12 +1743,7 @@ static void getgeometry(int ctlr)
 failed to report status of logical 

sysace: HDIO_GETGEO has it's own method for ages

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a6b3a93e15b2925a151e9ae13dcb93ad7b3e48aa
Commit: a6b3a93e15b2925a151e9ae13dcb93ad7b3e48aa
Parent: 2e4934aa4586832c35e077191849a06f93e4a9a0
Author: Christoph Hellwig [EMAIL PROTECTED]
AuthorDate: Sat Aug 11 22:34:31 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Sat Aug 11 22:34:48 2007 +0200

sysace: HDIO_GETGEO has it's own method for ages

The way this driver tries to implement HDIO_GETGEO it'll never be called.
Then again on ppc it probably will never be called anyway because it's
utterly pointless.

Signed-off-by: Christoph Hellwig [EMAIL PROTECTED]
Cc: Grant Likely [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 drivers/block/xsysace.c |   29 ++---
 1 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index cb27e88..3ede0b6 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -902,26 +902,17 @@ static int ace_release(struct inode *inode, struct file 
*filp)
return 0;
 }
 
-static int ace_ioctl(struct inode *inode, struct file *filp,
-unsigned int cmd, unsigned long arg)
+static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)
 {
-   struct ace_device *ace = inode-i_bdev-bd_disk-private_data;
-   struct hd_geometry __user *geo = (struct hd_geometry __user *)arg;
-   struct hd_geometry g;
-   dev_dbg(ace-dev, ace_ioctl()\n);
-
-   switch (cmd) {
-   case HDIO_GETGEO:
-   g.heads = ace-cf_id.heads;
-   g.sectors = ace-cf_id.sectors;
-   g.cylinders = ace-cf_id.cyls;
-   g.start = 0;
-   return copy_to_user(geo, g, sizeof(g)) ? -EFAULT : 0;
+   struct ace_device *ace = bdev-bd_disk-private_data;
 
-   default:
-   return -ENOTTY;
-   }
-   return -ENOTTY;
+   dev_dbg(ace-dev, ace_getgeo()\n);
+
+   geo-heads = ace-cf_id.heads;
+   geo-sectors = ace-cf_id.sectors;
+   geo-cylinders = ace-cf_id.cyls;
+
+   return 0;
 }
 
 static struct block_device_operations ace_fops = {
@@ -930,7 +921,7 @@ static struct block_device_operations ace_fops = {
.release = ace_release,
.media_changed = ace_media_changed,
.revalidate_disk = ace_revalidate_disk,
-   .ioctl = ace_ioctl,
+   .getgeo = ace_getgeo,
 };
 
 /* 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


BLOCK: Hide the contents of linux/bio.h if CONFIG_BLOCK=n

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=02a5e0acb3cb85d80d0fe834e366d38a92bbaa22
Commit: 02a5e0acb3cb85d80d0fe834e366d38a92bbaa22
Parent: a6b3a93e15b2925a151e9ae13dcb93ad7b3e48aa
Author: David Howells [EMAIL PROTECTED]
AuthorDate: Sat Aug 11 22:34:32 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Sat Aug 11 22:34:49 2007 +0200

BLOCK: Hide the contents of linux/bio.h if CONFIG_BLOCK=n

Hide the contents of linux/bio.h if CONFIG_BLOCK=n as there shouldn't be
compiled code that uses it.

Signed-off-by: David Howells [EMAIL PROTECTED]
Cc: James Bottomley [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 include/linux/bio.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/bio.h b/include/linux/bio.h
index 4d85262..1ddef34 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -24,6 +24,8 @@
 #include linux/mempool.h
 #include linux/ioprio.h
 
+#ifdef CONFIG_BLOCK
+
 /* Platforms may set this to teach the BIO layer about IOMMU hardware. */
 #include asm/io.h
 
@@ -361,4 +363,5 @@ static inline char *__bio_kmap_irq(struct bio *bio, 
unsigned short idx,
__bio_kmap_irq((bio), (bio)-bi_idx, (flags))
 #define bio_kunmap_irq(buf,flags)  __bio_kunmap_irq(buf, flags)
 
+#endif /* CONFIG_BLOCK */
 #endif /* __LINUX_BIO_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ocfs2: Restrict inode changes in ocfs2_update_inode_atime()

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c11e9fafb398411af7558fca913c2fa4a10b1f48
Commit: c11e9fafb398411af7558fca913c2fa4a10b1f48
Parent: 6adb31c90c47262c8a25bf5097de9b3426caf3ae
Author: Mark Fasheh [EMAIL PROTECTED]
AuthorDate: Fri Jul 20 11:24:53 2007 -0700
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Thu Aug 9 17:23:50 2007 -0700

ocfs2: Restrict inode changes in ocfs2_update_inode_atime()

ocfs2_update_inode_atime() calls ocfs2_mark_inode_dirty() to push changes
from the struct inode into the ocfs2 disk inode. The problem is,
ocfs2_mark_inode_dirty() might change other fields, depending on what
happened to the struct inode. Since we don't always have locking to
serialize changes to other fields (like i_size, etc), just fix things up to
only touch the atime field.

Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/file.c |   19 ++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index c4034f6..992eb56 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -187,6 +187,7 @@ int ocfs2_update_inode_atime(struct inode *inode,
int ret;
struct ocfs2_super *osb = OCFS2_SB(inode-i_sb);
handle_t *handle;
+   struct ocfs2_dinode *di = (struct ocfs2_dinode *) bh-b_data;
 
mlog_entry_void();
 
@@ -197,11 +198,27 @@ int ocfs2_update_inode_atime(struct inode *inode,
goto out;
}
 
+   ret = ocfs2_journal_access(handle, inode, bh,
+  OCFS2_JOURNAL_ACCESS_WRITE);
+   if (ret) {
+   mlog_errno(ret);
+   goto out_commit;
+   }
+
+   /*
+* Don't use ocfs2_mark_inode_dirty() here as we don't always
+* have i_mutex to guard against concurrent changes to other
+* inode fields.
+*/
inode-i_atime = CURRENT_TIME;
-   ret = ocfs2_mark_inode_dirty(handle, inode, bh);
+   di-i_atime = cpu_to_le64(inode-i_atime.tv_sec);
+   di-i_atime_nsec = cpu_to_le32(inode-i_atime.tv_nsec);
+
+   ret = ocfs2_journal_dirty(handle, bh);
if (ret  0)
mlog_errno(ret);
 
+out_commit:
ocfs2_commit_trans(OCFS2_SB(inode-i_sb), handle);
 out:
mlog_exit(ret);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ocfs2: use s_maxbytes directly in ocfs2_change_file_space()

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a00cce356b5592208e761525a48a25902322cce9
Commit: a00cce356b5592208e761525a48a25902322cce9
Parent: c11e9fafb398411af7558fca913c2fa4a10b1f48
Author: Mark Fasheh [EMAIL PROTECTED]
AuthorDate: Fri Jul 20 11:28:30 2007 -0700
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Thu Aug 9 17:25:07 2007 -0700

ocfs2: use s_maxbytes directly in ocfs2_change_file_space()

There's no need to recalculate things via ocfs2_max_file_offset() as we've
already done that to fill s_maxbytes, so use that instead. We can also
un-export ocfs2_max_file_offset() then.

Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/file.c  |2 +-
 fs/ocfs2/super.c |2 +-
 fs/ocfs2/super.h |2 --
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 992eb56..7e508e2 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1533,7 +1533,7 @@ static int __ocfs2_change_file_space(struct file *file, 
struct inode *inode,
struct ocfs2_super *osb = OCFS2_SB(inode-i_sb);
struct buffer_head *di_bh = NULL;
handle_t *handle;
-   unsigned long long max_off = 
ocfs2_max_file_offset(inode-i_sb-s_blocksize_bits);
+   unsigned long long max_off = inode-i_sb-s_maxbytes;
 
if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb))
return -EROFS;
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 200c7d4..a100b48 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -319,7 +319,7 @@ static void ocfs2_destroy_inode(struct inode *inode)
 /* From xfs_super.c:xfs_max_file_offset
  * Copyright (c) 2000-2004 Silicon Graphics, Inc.
  */
-unsigned long long ocfs2_max_file_offset(unsigned int blockshift)
+static unsigned long long ocfs2_max_file_offset(unsigned int blockshift)
 {
unsigned int pagefactor = 1;
unsigned int bitshift = BITS_PER_LONG - 1;
diff --git a/fs/ocfs2/super.h b/fs/ocfs2/super.h
index 3b9cb3d..783f527 100644
--- a/fs/ocfs2/super.h
+++ b/fs/ocfs2/super.h
@@ -45,6 +45,4 @@ void __ocfs2_abort(struct super_block *sb,
 
 #define ocfs2_abort(sb, fmt, args...) __ocfs2_abort(sb, __PRETTY_FUNCTION__, 
fmt, ##args)
 
-unsigned long long ocfs2_max_file_offset(unsigned int blockshift);
-
 #endif /* OCFS2_SUPER_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ocfs2: Fix some casting errors related to file writes

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c08d70c69150148c14f02633855f1591219c37c
Commit: 7c08d70c69150148c14f02633855f1591219c37c
Parent: a00cce356b5592208e761525a48a25902322cce9
Author: Mark Fasheh [EMAIL PROTECTED]
AuthorDate: Fri Jul 20 11:58:36 2007 -0700
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Thu Aug 9 17:25:27 2007 -0700

ocfs2: Fix some casting errors related to file writes

ocfs2_align_clusters_to_page_index() needs to cast the clusters shift to
pgoff_t and ocfs2_file_buffered_write() needs loff_t when calculating
destination start for memcpy.

Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/file.c  |2 +-
 fs/ocfs2/ocfs2.h |8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 7e508e2..b1ae4c7 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1959,7 +1959,7 @@ static ssize_t ocfs2_file_buffered_write(struct file 
*file, loff_t *ppos,
}
 
dst = kmap_atomic(page, KM_USER0);
-   memcpy(dst + (pos  (PAGE_CACHE_SIZE - 1)), buf, bytes);
+   memcpy(dst + (pos  (loff_t)(PAGE_CACHE_SIZE - 1)), buf, bytes);
kunmap_atomic(dst, KM_USER0);
flush_dcache_page(page);
ocfs2_put_write_source(user_page);
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 5cc90a4..5830785 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -494,16 +494,16 @@ static inline unsigned int 
ocfs2_page_index_to_clusters(struct super_block *sb,
 /*
  * Find the 1st page index which covers the given clusters.
  */
-static inline unsigned long ocfs2_align_clusters_to_page_index(struct 
super_block *sb,
+static inline pgoff_t ocfs2_align_clusters_to_page_index(struct super_block 
*sb,
u32 clusters)
 {
unsigned int cbits = OCFS2_SB(sb)-s_clustersize_bits;
-   unsigned long index = clusters;
+pgoff_t index = clusters;
 
if (PAGE_CACHE_SHIFT  cbits) {
-   index = clusters  (PAGE_CACHE_SHIFT - cbits);
+   index = (pgoff_t)clusters  (PAGE_CACHE_SHIFT - cbits);
} else if (PAGE_CACHE_SHIFT  cbits) {
-   index = clusters  (cbits - PAGE_CACHE_SHIFT);
+   index = (pgoff_t)clusters  (cbits - PAGE_CACHE_SHIFT);
}
 
return index;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ocfs2: check ia_size limits in setattr

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce76fd30ce98cdaeb38dca0dfbb3fa6d2801c5ce
Commit: ce76fd30ce98cdaeb38dca0dfbb3fa6d2801c5ce
Parent: 7c08d70c69150148c14f02633855f1591219c37c
Author: Mark Fasheh [EMAIL PROTECTED]
AuthorDate: Fri Jul 20 12:02:14 2007 -0700
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Thu Aug 9 17:25:38 2007 -0700

ocfs2: check ia_size limits in setattr

We have to manually check the requested truncate size as the check in
vmtruncate() comes too late for Ocfs2.

Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/file.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index b1ae4c7..4ffa715 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1028,6 +1028,11 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr 
*attr)
}
 
if (size_change  attr-ia_size != i_size_read(inode)) {
+   if (attr-ia_size  sb-s_maxbytes) {
+   status = -EFBIG;
+   goto bail_unlock;
+   }
+
if (i_size_read(inode)  attr-ia_size)
status = ocfs2_truncate_file(inode, bh, attr-ia_size);
else
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ocfs2: Fix max offset calculations

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a25403175b8a945e93fc9c64ae9cf54f5730add
Commit: 5a25403175b8a945e93fc9c64ae9cf54f5730add
Parent: ce76fd30ce98cdaeb38dca0dfbb3fa6d2801c5ce
Author: Mark Fasheh [EMAIL PROTECTED]
AuthorDate: Fri Jul 20 12:56:16 2007 -0700
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Thu Aug 9 17:25:49 2007 -0700

ocfs2: Fix max offset calculations

ocfs2_max_file_offset() was over-estimating the largest file size for
several cases. This wasn't really a problem before, but now that we support
sparse files, it needs to be more accurate.

Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/super.c |   68 +++--
 1 files changed, 40 insertions(+), 28 deletions(-)

diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index a100b48..c3c89e2 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -316,39 +316,51 @@ static void ocfs2_destroy_inode(struct inode *inode)
kmem_cache_free(ocfs2_inode_cachep, OCFS2_I(inode));
 }
 
-/* From xfs_super.c:xfs_max_file_offset
- * Copyright (c) 2000-2004 Silicon Graphics, Inc.
- */
-static unsigned long long ocfs2_max_file_offset(unsigned int blockshift)
+static unsigned long long ocfs2_max_file_offset(unsigned int bbits,
+   unsigned int cbits)
 {
-   unsigned int pagefactor = 1;
-   unsigned int bitshift = BITS_PER_LONG - 1;
-
-   /* Figure out maximum filesize, on Linux this can depend on
-* the filesystem blocksize (on 32 bit platforms).
-* __block_prepare_write does this in an [unsigned] long...
-*  page-index  (PAGE_CACHE_SHIFT - bbits)
-* So, for page sized blocks (4K on 32 bit platforms),
-* this wraps at around 8Tb (hence MAX_LFS_FILESIZE which is
-*  (((u64)PAGE_CACHE_SIZE  (BITS_PER_LONG-1))-1)
-* but for smaller blocksizes it is less (bbits = log2 bsize).
-* Note1: get_block_t takes a long (implicit cast from above)
-* Note2: The Large Block Device (LBD and HAVE_SECTOR_T) patch
-* can optionally convert the [unsigned] long from above into
-* an [unsigned] long long.
+   unsigned int bytes = 1  cbits;
+   unsigned int trim = bytes;
+   unsigned int bitshift = 32;
+
+   /*
+* i_size and all block offsets in ocfs2 are always 64 bits
+* wide. i_clusters is 32 bits, in cluster-sized units. So on
+* 64 bit platforms, cluster size will be the limiting factor.
 */
 
 #if BITS_PER_LONG == 32
 # if defined(CONFIG_LBD)
BUILD_BUG_ON(sizeof(sector_t) != 8);
-   pagefactor = PAGE_CACHE_SIZE;
-   bitshift = BITS_PER_LONG;
+   /*
+* We might be limited by page cache size.
+*/
+   if (bytes  PAGE_CACHE_SIZE) {
+   bytes = PAGE_CACHE_SIZE;
+   trim = 1;
+   /*
+* Shift by 31 here so that we don't get larger than
+* MAX_LFS_FILESIZE
+*/
+   bitshift = 31;
+   }
 # else
-   pagefactor = PAGE_CACHE_SIZE  (PAGE_CACHE_SHIFT - blockshift);
+   /*
+* We are limited by the size of sector_t. Use block size, as
+* that's what we expose to the VFS.
+*/
+   bytes = 1  bbits;
+   trim = 1;
+   bitshift = 31;
 # endif
 #endif
 
-   return (((unsigned long long)pagefactor)  bitshift) - 1;
+   /*
+* Trim by a whole cluster when we can actually approach the
+* on-disk limits. Otherwise we can overflow i_clusters when
+* an extent start is at the max offset.
+*/
+   return (((unsigned long long)bytes)  bitshift) - trim;
 }
 
 static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
@@ -1259,8 +1271,8 @@ static int ocfs2_initialize_super(struct super_block *sb,
  int sector_size)
 {
int status = 0;
-   int i;
-   struct ocfs2_dinode *di = NULL;
+   int i, cbits, bbits;
+   struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh-b_data;
struct inode *inode = NULL;
struct buffer_head *bitmap_bh = NULL;
struct ocfs2_journal *journal;
@@ -1281,7 +1293,9 @@ static int ocfs2_initialize_super(struct super_block *sb,
sb-s_export_op = ocfs2_export_ops;
sb-s_flags |= MS_NOATIME;
/* this is needed to support O_LARGEFILE */
-   sb-s_maxbytes = ocfs2_max_file_offset(sb-s_blocksize_bits);
+   cbits = le32_to_cpu(di-id2.i_super.s_clustersize_bits);
+   bbits = le32_to_cpu(di-id2.i_super.s_blocksize_bits);
+   sb-s_maxbytes = ocfs2_max_file_offset(bbits, cbits);
 
osb-sb = sb;
/* Save off for ocfs2_rw_direct */
@@ -1341,8 +1355,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
goto bail;
}
 
-   di = (struct ocfs2_dinode 

[2.6 patch] ocfs2_insert_extent(): remove dead code

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a18380e7ddd7d1a0493efe3be6475dd92323364
Commit: 6a18380e7ddd7d1a0493efe3be6475dd92323364
Parent: 5a25403175b8a945e93fc9c64ae9cf54f5730add
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Mon Jul 23 10:01:21 2007 +0200
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Thu Aug 9 17:26:03 2007 -0700

[2.6 patch] ocfs2_insert_extent(): remove dead code

This patch removes some now dead code.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/alloc.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index f5e11f4..4f51766 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -3731,7 +3731,6 @@ int ocfs2_insert_extent(struct ocfs2_super *osb,
 {
int status;
struct buffer_head *last_eb_bh = NULL;
-   struct buffer_head *bh = NULL;
struct ocfs2_insert_type insert = {0, };
struct ocfs2_extent_rec rec;
 
@@ -3783,9 +3782,6 @@ int ocfs2_insert_extent(struct ocfs2_super *osb,
ocfs2_extent_map_insert_rec(inode, rec);
 
 bail:
-   if (bh)
-   brelse(bh);
-
if (last_eb_bh)
brelse(last_eb_bh);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ocfs2: Fix rename/extend race

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=480214d71f1972756473415d31953647952400fb
Commit: 480214d71f1972756473415d31953647952400fb
Parent: 6a18380e7ddd7d1a0493efe3be6475dd92323364
Author: Sunil Mushran [EMAIL PROTECTED]
AuthorDate: Mon Aug 6 15:11:56 2007 -0700
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Thu Aug 9 17:27:10 2007 -0700

ocfs2: Fix rename/extend race

If one process is extending a file while another is renaming it, there
exists a window when rename could flush the old inode's stale i_size to
disk. This patch recognizes the fact that rename is only updating the old
inode's ctime, so it ensures only that value is flushed to disk.

Signed-off-by: Sunil Mushran [EMAIL PROTECTED]
Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/namei.c |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index d430fda..701e6d0 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -1080,6 +1080,7 @@ static int ocfs2_rename(struct inode *old_dir,
struct buffer_head *old_inode_de_bh = NULL; // if old_dentry is a dir,
// this is the 1st dirent bh
nlink_t old_dir_nlink = old_dir-i_nlink;
+   struct ocfs2_dinode *old_di;
 
/* At some point it might be nice to break this function up a
 * bit. */
@@ -1354,7 +1355,20 @@ static int ocfs2_rename(struct inode *old_dir,
 
old_inode-i_ctime = CURRENT_TIME;
mark_inode_dirty(old_inode);
-   ocfs2_mark_inode_dirty(handle, old_inode, old_inode_bh);
+
+   status = ocfs2_journal_access(handle, old_inode, old_inode_bh,
+ OCFS2_JOURNAL_ACCESS_WRITE);
+   if (status = 0) {
+   old_di = (struct ocfs2_dinode *) old_inode_bh-b_data;
+
+   old_di-i_ctime = cpu_to_le64(old_inode-i_ctime.tv_sec);
+   old_di-i_ctime_nsec = cpu_to_le32(old_inode-i_ctime.tv_nsec);
+
+   status = ocfs2_journal_dirty(handle, old_inode_bh);
+   if (status  0)
+   mlog_errno(status);
+   } else
+   mlog_errno(status);
 
/* now that the name has been added to new_dir, remove the old name */
status = ocfs2_delete_entry(handle, old_dir, old_de, old_de_bh);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ocfs2: Retry sendpage() if it returns EAGAIN

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce17204ae633001ef41318d487282730e96b9522
Commit: ce17204ae633001ef41318d487282730e96b9522
Parent: 480214d71f1972756473415d31953647952400fb
Author: Sunil Mushran [EMAIL PROTECTED]
AuthorDate: Mon Jul 30 11:02:50 2007 -0700
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Thu Aug 9 17:27:38 2007 -0700

ocfs2: Retry sendpage() if it returns EAGAIN

Instead of treating EAGAIN, returned from sendpage(), as an error, this
patch retries the operation.

Signed-off-by: Sunil Mushran [EMAIL PROTECTED]
Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/cluster/tcp.c |   24 
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index f0bdfd9..685c180 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -854,17 +854,25 @@ static void o2net_sendpage(struct o2net_sock_container 
*sc,
struct o2net_node *nn = o2net_nn_from_num(sc-sc_node-nd_num);
ssize_t ret;
 
-
-   mutex_lock(sc-sc_send_lock);
-   ret = sc-sc_sock-ops-sendpage(sc-sc_sock,
-virt_to_page(kmalloced_virt),
-(long)kmalloced_virt  ~PAGE_MASK,
-size, MSG_DONTWAIT);
-   mutex_unlock(sc-sc_send_lock);
-   if (ret != size) {
+   while (1) {
+   mutex_lock(sc-sc_send_lock);
+   ret = sc-sc_sock-ops-sendpage(sc-sc_sock,
+virt_to_page(kmalloced_virt),
+(long)kmalloced_virt  
~PAGE_MASK,
+size, MSG_DONTWAIT);
+   mutex_unlock(sc-sc_send_lock);
+   if (ret == size)
+   break;
+   if (ret == (ssize_t)-EAGAIN) {
+   mlog(0, sendpage of size %zu to  SC_NODEF_FMT
+ returned EAGAIN\n, size, SC_NODEF_ARGS(sc));
+   cond_resched();
+   continue;
+   }
mlog(ML_ERROR, sendpage of size %zu to  SC_NODEF_FMT 
  failed with %zd\n, size, SC_NODEF_ARGS(sc), ret);
o2net_ensure_shutdown(nn, sc, 0);
+   break;
}
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ocfs2: set non-default s_time_gran during mount

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e0dceaf0a4b8c55076a4dbcba7ac8b05755f5cc6
Commit: e0dceaf0a4b8c55076a4dbcba7ac8b05755f5cc6
Parent: ce17204ae633001ef41318d487282730e96b9522
Author: Mark Fasheh [EMAIL PROTECTED]
AuthorDate: Thu Aug 9 16:52:30 2007 -0700
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Thu Aug 9 17:27:58 2007 -0700

ocfs2: set non-default s_time_gran during mount

We need to manually set this to '1' during mount, otherwise inode_setattr()
will chop off the nanosecond portion of our timestamps.

Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/super.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index c3c89e2..f2fc9a7 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1291,6 +1291,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
sb-s_fs_info = osb;
sb-s_op = ocfs2_sops;
sb-s_export_op = ocfs2_export_ops;
+   sb-s_time_gran = 1;
sb-s_flags |= MS_NOATIME;
/* this is needed to support O_LARGEFILE */
cbits = le32_to_cpu(di-id2.i_super.s_clustersize_bits);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


async_tx: update MAINTAINERS for async_tx and iop-adma

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3e5f2634ad64dac43638d3d9d449bb432aa9e73
Commit: b3e5f2634ad64dac43638d3d9d449bb432aa9e73
Parent: 4a2a4df7b6db25df8f3d5cc6dd0b096119359d92
Author: Dan Williams [EMAIL PROTECTED]
AuthorDate: Tue Aug 7 10:26:35 2007 -0700
Committer:  Dan Williams [EMAIL PROTECTED]
CommitDate: Thu Aug 9 10:26:52 2007 -0700

async_tx: update MAINTAINERS for async_tx and iop-adma

Also, rename the dma engine entry since it is now a generic offload engine
subsystem, not just memcpy.

Signed-off-by: Dan Williams [EMAIL PROTECTED]
Signed-off-by: Shannon Nelson [EMAIL PROTECTED]
---
 MAINTAINERS |   21 +++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e65e96a..fa52a30 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -612,6 +612,15 @@ W: http://sourceforge.net/projects/acpi4asus
 W: http://xf.iksaif.net/acpi4asus
 S: Maintained
 
+ASYNCHRONOUS TRANSFERS/TRANSFORMS API
+P: Dan Williams
+M: [EMAIL PROTECTED]
+P: Shannon Nelson
+M: [EMAIL PROTECTED]
+L: [EMAIL PROTECTED]
+W: http://sourceforge.net/projects/xscaleiop
+S: Supported
+
 ATA OVER ETHERNET DRIVER
 P: Ed L. Cashin
 M: [EMAIL PROTECTED]
@@ -1277,11 +1286,13 @@ M:  [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 S: Maintained
 
-DMA GENERIC MEMCPY SUBSYSTEM
+DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
 P: Shannon Nelson
 M: [EMAIL PROTECTED]
+P: Dan Williams
+M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
-S: Maintained
+S: Supported
 
 DME1737 HARDWARE MONITOR DRIVER
 P: Juerg Haefliger
@@ -1958,6 +1969,12 @@ M:   [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 S: Supported
 
+INTEL IOP-ADMA DMA DRIVER
+P: Dan Williams
+M: [EMAIL PROTECTED]
+L: [EMAIL PROTECTED]
+S: Supported
+
 INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
 P: Deepak Saxena
 M: [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[POWERPC] Fix potential duplicate entry in SLB shadow buffer

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=edd0622bd2e8f755c960827e15aa6908c3c5aa94
Commit: edd0622bd2e8f755c960827e15aa6908c3c5aa94
Parent: ac07860264bd2b18834d3fa3be47032115524cea
Author: Paul Mackerras [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 21:04:07 2007 +1000
Committer:  Paul Mackerras [EMAIL PROTECTED]
CommitDate: Fri Aug 10 21:04:07 2007 +1000

[POWERPC] Fix potential duplicate entry in SLB shadow buffer

We were getting a duplicate entry in the SLB shadow buffer in
slb_flush_and_rebolt() if the kernel stack was in the same segment
as PAGE_OFFSET, which on POWER6 causes the hypervisor to terminate
the partition with an error.  This fixes it.

Also we were not creating an SLB entry (or an SLB shadow buffer
entry) for the kernel stack on secondary CPUs when starting the
CPU.  This isn't a major problem, since an appropriate entry will
be created on demand, but this fixes that also for consistency.

Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
 arch/powerpc/mm/slb.c |   45 -
 1 files changed, 16 insertions(+), 29 deletions(-)

diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index b069701..a73d2d7 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -69,20 +69,9 @@ static inline void slb_shadow_update(unsigned long ea,
smp_wmb();
 }
 
-static inline void create_shadowed_slbe(unsigned long ea, unsigned long flags,
-   unsigned long entry)
+static inline void slb_shadow_clear(unsigned long entry)
 {
-   /*
-* Updating the shadow buffer before writing the SLB ensures
-* we don't get a stale entry here if we get preempted by PHYP
-* between these two statements.
-*/
-   slb_shadow_update(ea, flags, entry);
-
-   asm volatile(slbmte  %0,%1 :
-: r (mk_vsid_data(ea, flags)),
-  r (mk_esid_data(ea, entry))
-: memory );
+   get_slb_shadow()-save_area[entry].esid = 0;
 }
 
 void slb_flush_and_rebolt(void)
@@ -100,11 +89,13 @@ void slb_flush_and_rebolt(void)
vflags = SLB_VSID_KERNEL | vmalloc_llp;
 
ksp_esid_data = mk_esid_data(get_paca()-kstack, 2);
-   if ((ksp_esid_data  ESID_MASK) == PAGE_OFFSET)
+   if ((ksp_esid_data  ESID_MASK) == PAGE_OFFSET) {
ksp_esid_data = ~SLB_ESID_V;
-
-   /* Only third entry (stack) may change here so only resave that */
-   slb_shadow_update(get_paca()-kstack, lflags, 2);
+   slb_shadow_clear(2);
+   } else {
+   /* Update stack entry; others don't change */
+   slb_shadow_update(get_paca()-kstack, lflags, 2);
+   }
 
/* We need to do this all in asm, so we're sure we don't touch
 * the stack between the slbia and rebolting it. */
@@ -235,16 +226,12 @@ void slb_initialize(void)
vflags = SLB_VSID_KERNEL | vmalloc_llp;
 
/* Invalidate the entire SLB (even slot 0)  all the ERATS */
-   asm volatile(isync:::memory);
-   asm volatile(slbmte  %0,%0::r (0) : memory);
-   asm volatile(isync; slbia; isync:::memory);
-   create_shadowed_slbe(PAGE_OFFSET, lflags, 0);
-
-   create_shadowed_slbe(VMALLOC_START, vflags, 1);
-
-   /* We don't bolt the stack for the time being - we're in boot,
-* so the stack is in the bolted segment.  By the time it goes
-* elsewhere, we'll call _switch() which will bolt in the new
-* one. */
-   asm volatile(isync:::memory);
+   slb_shadow_update(PAGE_OFFSET, lflags, 0);
+   asm volatile(isync; slbia; sync; slbmte  %0,%1; isync ::
+r (get_slb_shadow()-save_area[0].vsid),
+r (get_slb_shadow()-save_area[0].esid) : memory);
+
+   slb_shadow_update(VMALLOC_START, vflags, 1);
+
+   slb_flush_and_rebolt();
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[POWERPC] cell: Move SPU affinity init to spu_management_of_ops

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5996449e3244524cab0ba709a4bd87047a8175f
Commit: f5996449e3244524cab0ba709a4bd87047a8175f
Parent: edd0622bd2e8f755c960827e15aa6908c3c5aa94
Author: Andre Detsch [EMAIL PROTECTED]
AuthorDate: Fri Aug 3 18:53:46 2007 -0700
Committer:  Paul Mackerras [EMAIL PROTECTED]
CommitDate: Fri Aug 10 21:04:21 2007 +1000

[POWERPC] cell: Move SPU affinity init to spu_management_of_ops

This patch moves affinity initialization code from spu_base.c to a
new spu_management_of_ops function (init_affinity), which is empty
in the case of PS3. This fixes a linking problem that was happening
when compiling for PS3.
Also, some small code style changes were made.

Signed-off-by: Andre Detsch [EMAIL PROTECTED]
Signed-off-by: Geoff Levand [EMAIL PROTECTED]
Acked-by: Arnd Bergmann [EMAIL PROTECTED]
Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
 arch/powerpc/platforms/cell/spu_base.c   |  141 +-
 arch/powerpc/platforms/cell/spu_manage.c |  163 ++
 arch/powerpc/platforms/ps3/spu.c |6 +
 include/asm-powerpc/spu_priv1.h  |7 ++
 4 files changed, 177 insertions(+), 140 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spu_base.c 
b/arch/powerpc/platforms/cell/spu_base.c
index 9012422..095a303 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -36,7 +36,6 @@
 #include asm/spu_priv1.h
 #include asm/xmon.h
 #include asm/prom.h
-#include spu_priv1_mmio.h
 
 const struct spu_management_ops *spu_management_ops;
 EXPORT_SYMBOL_GPL(spu_management_ops);
@@ -636,138 +635,6 @@ static ssize_t spu_stat_show(struct sys_device *sysdev, 
char *buf)
 
 static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL);
 
-/* Hardcoded affinity idxs for QS20 */
-#define SPES_PER_BE 8
-static int QS20_reg_idxs[SPES_PER_BE] =   { 0, 2, 4, 6, 7, 5, 3, 1 };
-static int QS20_reg_memory[SPES_PER_BE] = { 1, 1, 0, 0, 0, 0, 0, 0 };
-
-static struct spu *spu_lookup_reg(int node, u32 reg)
-{
-   struct spu *spu;
-
-   list_for_each_entry(spu, cbe_spu_info[node].spus, cbe_list) {
-   if (*(u32 *)get_property(spu_devnode(spu), reg, NULL) == reg)
-   return spu;
-   }
-   return NULL;
-}
-
-static void init_aff_QS20_harcoded(void)
-{
-   int node, i;
-   struct spu *last_spu, *spu;
-   u32 reg;
-
-   for (node = 0; node  MAX_NUMNODES; node++) {
-   last_spu = NULL;
-   for (i = 0; i  SPES_PER_BE; i++) {
-   reg = QS20_reg_idxs[i];
-   spu = spu_lookup_reg(node, reg);
-   if (!spu)
-   continue;
-   spu-has_mem_affinity = QS20_reg_memory[reg];
-   if (last_spu)
-   list_add_tail(spu-aff_list,
-   last_spu-aff_list);
-   last_spu = spu;
-   }
-   }
-}
-
-static int of_has_vicinity(void)
-{
-   struct spu* spu;
-
-   spu = list_entry(cbe_spu_info[0].spus.next, struct spu, cbe_list);
-   return of_find_property(spu_devnode(spu), vicinity, NULL) != NULL;
-}
-
-static struct spu *aff_devnode_spu(int cbe, struct device_node *dn)
-{
-   struct spu *spu;
-
-   list_for_each_entry(spu, cbe_spu_info[cbe].spus, cbe_list)
-   if (spu_devnode(spu) == dn)
-   return spu;
-   return NULL;
-}
-
-static struct spu *
-aff_node_next_to(int cbe, struct device_node *target, struct device_node 
*avoid)
-{
-   struct spu *spu;
-   const phandle *vic_handles;
-   int lenp, i;
-
-   list_for_each_entry(spu, cbe_spu_info[cbe].spus, cbe_list) {
-   if (spu_devnode(spu) == avoid)
-   continue;
-   vic_handles = get_property(spu_devnode(spu), vicinity, lenp);
-   for (i=0; i  (lenp / sizeof(phandle)); i++) {
-   if (vic_handles[i] == target-linux_phandle)
-   return spu;
-   }
-   }
-   return NULL;
-}
-
-static void init_aff_fw_vicinity_node(int cbe)
-{
-   struct spu *spu, *last_spu;
-   struct device_node *vic_dn, *last_spu_dn;
-   phandle avoid_ph;
-   const phandle *vic_handles;
-   const char *name;
-   int lenp, i, added, mem_aff;
-
-   last_spu = list_entry(cbe_spu_info[cbe].spus.next, struct spu, 
cbe_list);
-   avoid_ph = 0;
-   for (added = 1; added  cbe_spu_info[cbe].n_spus; added++) {
-   last_spu_dn = spu_devnode(last_spu);
-   vic_handles = get_property(last_spu_dn, vicinity, lenp);
-
-   for (i = 0; i  (lenp / sizeof(phandle)); i++) {
-   if (vic_handles[i] == avoid_ph)
-   continue;
-
- 

[POWERPC] PS3: Fix storage probe logic

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=edd2a9d185799354db255de62c3ed1f2b1c6b0f4
Commit: edd2a9d185799354db255de62c3ed1f2b1c6b0f4
Parent: f5996449e3244524cab0ba709a4bd87047a8175f
Author: Geert Uytterhoeven [EMAIL PROTECTED]
AuthorDate: Wed Aug 8 11:01:21 2007 -0700
Committer:  Paul Mackerras [EMAIL PROTECTED]
CommitDate: Fri Aug 10 21:04:21 2007 +1000

[POWERPC] PS3: Fix storage probe logic

Fix the PS3 storage probe logic to properly find device regions on cold
startup.

 o Change the storage probe event mask from notify_device_ready
   to notify_region_update.
 o Improve the storage probe error handling.
 o Change ps3_storage_wait_for_device() to use a temporary variable to hold
   the buffer address.

Signed-off-by: Geert Uytterhoeven [EMAIL PROTECTED]
Signed-off-by: Geoff Levand [EMAIL PROTECTED]
Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
 arch/powerpc/platforms/ps3/device-init.c |   37 +++--
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/device-init.c 
b/arch/powerpc/platforms/ps3/device-init.c
index 825ebb2..e23a5a8 100644
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -273,55 +273,58 @@ static int ps3stor_wait_for_completion(u64 dev_id, u64 
tag,
 
 static int ps3_storage_wait_for_device(const struct ps3_repository_device 
*repo)
 {
+   int error = -ENODEV;
int result;
const u64 notification_dev_id = (u64)-1LL;
const unsigned int timeout = HZ;
u64 lpar;
u64 tag;
+   void *buf;
+   enum ps3_notify_type {
+   notify_device_ready = 0,
+   notify_region_probe = 1,
+   notify_region_update = 2,
+   };
struct {
u64 operation_code; /* must be zero */
-   u64 event_mask; /* 1 = device ready */
+   u64 event_mask; /* OR of 1UL  enum ps3_notify_type */
} *notify_cmd;
struct {
-   u64 event_type; /* notify_device_ready */
+   u64 event_type; /* enum ps3_notify_type */
u64 bus_id;
u64 dev_id;
u64 dev_type;
u64 dev_port;
} *notify_event;
-   enum {
-   notify_device_ready = 1
-   };
 
pr_debug( - %s:%u: bus_id %u, dev_id %u, dev_type %u\n, __func__,
 __LINE__, repo-bus_id, repo-dev_id, repo-dev_type);
 
-   notify_cmd = kzalloc(512, GFP_KERNEL);
-   notify_event = (void *)notify_cmd;
-   if (!notify_cmd)
+   buf = kzalloc(512, GFP_KERNEL);
+   if (!buf)
return -ENOMEM;
 
-   lpar = ps3_mm_phys_to_lpar(__pa(notify_cmd));
+   lpar = ps3_mm_phys_to_lpar(__pa(buf));
+   notify_cmd = buf;
+   notify_event = buf;
 
result = lv1_open_device(repo-bus_id, notification_dev_id, 0);
if (result) {
printk(KERN_ERR %s:%u: lv1_open_device %s\n, __func__,
   __LINE__, ps3_result(result));
-   result = -ENODEV;
goto fail_free;
}
 
/* Setup and write the request for device notification. */
 
-   notify_cmd-operation_code = 0; /* must be zero */
-   notify_cmd-event_mask = 0x01;  /* device ready */
+   notify_cmd-operation_code = 0; /* must be zero */
+   notify_cmd-event_mask = 1UL  notify_region_probe;
 
result = lv1_storage_write(notification_dev_id, 0, 0, 1, 0, lpar,
   tag);
if (result) {
printk(KERN_ERR %s:%u: write failed %s\n, __func__, __LINE__,
   ps3_result(result));
-   result = -ENODEV;
goto fail_close;
}
 
@@ -332,13 +335,11 @@ static int ps3_storage_wait_for_device(const struct 
ps3_repository_device *repo)
if (result) {
printk(KERN_ERR %s:%u: write not completed %s\n, __func__,
   __LINE__, ps3_result(result));
-   result = -ENODEV;
goto fail_close;
}
 
/* Loop here processing the requested notification events. */
 
-   result = -ENODEV;
while (1) {
memset(notify_event, 0, sizeof(*notify_event));
 
@@ -358,7 +359,7 @@ static int ps3_storage_wait_for_device(const struct 
ps3_repository_device *repo)
break;
}
 
-   if (notify_event-event_type != notify_device_ready ||
+   if (notify_event-event_type != notify_region_probe ||
notify_event-bus_id != repo-bus_id) {
pr_debug(%s:%u: bad notify_event: event %lu, 
 dev_id %lu, dev_type %lu\n,
@@ -386,9 +387,9 @@ static int ps3_storage_wait_for_device(const struct 

[POWERPC] PS3: Remove text saying PS3 support is incomplete

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=332a7b3e93c6521219be0a72ebfe2eee795a8345
Commit: 332a7b3e93c6521219be0a72ebfe2eee795a8345
Parent: edd2a9d185799354db255de62c3ed1f2b1c6b0f4
Author: Geoff Levand [EMAIL PROTECTED]
AuthorDate: Wed Aug 8 09:39:02 2007 -0700
Committer:  Paul Mackerras [EMAIL PROTECTED]
CommitDate: Fri Aug 10 21:04:22 2007 +1000

[POWERPC] PS3: Remove text saying PS3 support is incomplete

Remove the Kconfig message that indicates the PS3 platform support is
incomplete.

Signed-off-by: Geoff Levand [EMAIL PROTECTED]
Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
 arch/powerpc/platforms/ps3/Kconfig |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/Kconfig 
b/arch/powerpc/platforms/ps3/Kconfig
index d4fc74f..67144d1 100644
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -1,5 +1,5 @@
 config PPC_PS3
-   bool Sony PS3 (incomplete)
+   bool Sony PS3
depends on PPC_MULTIPLATFORM  PPC64
select PPC_CELL
select USB_ARCH_HAS_OHCI
@@ -10,10 +10,10 @@ config PPC_PS3
select MEMORY_HOTPLUG
help
  This option enables support for the Sony PS3 game console
- and other platforms using the PS3 hypervisor.
- Support for this platform is not yet complete, so
- enabling this will not result in a bootable kernel on a
- PS3 system.
+ and other platforms using the PS3 hypervisor.  Enabling this
+ option will allow building otheros.bld, a kernel image suitable
+ for programming into flash memory, and vmlinux, a kernel image
+ suitable for loading via kexec.
 
 menu PS3 Platform Options
depends on PPC_PS3
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[POWERPC] PS3: Update ps3_defconfig

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bd948b0377e7ab93559a80f68d38749bcc2e9a77
Commit: bd948b0377e7ab93559a80f68d38749bcc2e9a77
Parent: 332a7b3e93c6521219be0a72ebfe2eee795a8345
Author: [EMAIL PROTECTED] [EMAIL PROTECTED]
AuthorDate: Tue Aug 7 20:31:22 2007 -0700
Committer:  Paul Mackerras [EMAIL PROTECTED]
CommitDate: Fri Aug 10 21:04:22 2007 +1000

[POWERPC] PS3: Update ps3_defconfig

Update ps3_defconfig.

Signed-off-by: Geoff Levand [EMAIL PROTECTED]
Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
 arch/powerpc/configs/ps3_defconfig |  200 
 1 files changed, 65 insertions(+), 135 deletions(-)

diff --git a/arch/powerpc/configs/ps3_defconfig 
b/arch/powerpc/configs/ps3_defconfig
index d0b43df..ca7a197 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -1,9 +1,23 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22-rc6
-# Tue Jun 26 14:15:19 2007
+# Linux kernel version: 2.6.23-rc2
+# Tue Aug  7 19:17:26 2007
 #
 CONFIG_PPC64=y
+
+#
+# Processor support
+#
+# CONFIG_POWER4_ONLY is not set
+CONFIG_POWER3=y
+CONFIG_POWER4=y
+CONFIG_PPC_FPU=y
+CONFIG_ALTIVEC=y
+CONFIG_PPC_STD_MMU=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_VIRT_CPU_ACCOUNTING=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=2
 CONFIG_64BIT=y
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
@@ -15,6 +29,7 @@ CONFIG_ARCH_HAS_ILOG2_U64=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
 CONFIG_PPC=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_COMPAT=y
@@ -22,50 +37,32 @@ CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_PPC_OF=y
+CONFIG_OF=y
 # CONFIG_PPC_UDBG_16550 is not set
 # CONFIG_GENERIC_TBSYNC is not set
 CONFIG_AUDIT_ARCH=y
 CONFIG_GENERIC_BUG=y
 # CONFIG_DEFAULT_UIMAGE is not set
-
-#
-# Processor support
-#
-# CONFIG_POWER4_ONLY is not set
-CONFIG_POWER3=y
-CONFIG_POWER4=y
-CONFIG_PPC_FPU=y
 # CONFIG_PPC_DCR_NATIVE is not set
 # CONFIG_PPC_DCR_MMIO is not set
 # CONFIG_PPC_OF_PLATFORM_PCI is not set
-CONFIG_ALTIVEC=y
-CONFIG_PPC_STD_MMU=y
-# CONFIG_PPC_MM_SLICES is not set
-CONFIG_VIRT_CPU_ACCOUNTING=y
-CONFIG_SMP=y
-CONFIG_NR_CPUS=2
 CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=17
@@ -100,10 +97,6 @@ CONFIG_SLAB=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
@@ -111,12 +104,9 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
 CONFIG_STOP_MACHINE=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_BLK_DEV_BSG=y
 
 #
 # IO Schedulers
@@ -136,7 +126,9 @@ CONFIG_DEFAULT_IOSCHED=anticipatory
 #
 CONFIG_PPC_MULTIPLATFORM=y
 # CONFIG_EMBEDDED6xx is not set
-# CONFIG_APUS is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+# CONFIG_PPC_86xx is not set
 # CONFIG_PPC_PSERIES is not set
 # CONFIG_PPC_ISERIES is not set
 # CONFIG_PPC_MPC52xx is not set
@@ -223,6 +215,7 @@ CONFIG_MEMORY_HOTPLUG_SPARSE=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
 CONFIG_ARCH_MEMORY_PROBE=y
 # CONFIG_PPC_HAS_HASH_64K is not set
 # CONFIG_PPC_64K_PAGES is not set
@@ -241,6 +234,7 @@ CONFIG_ZONE_DMA=y
 CONFIG_GENERIC_ISA_DMA=y
 # CONFIG_PCI is not set
 # CONFIG_PCI_DOMAINS is not set
+# CONFIG_PCI_SYSCALL is not set
 # CONFIG_ARCH_SUPPORTS_MSI is not set
 
 #
@@ -365,6 +359,7 @@ CONFIG_WIRELESS_EXT=y
 # CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 # CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -379,26 +374,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace - kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
+CONFIG_OF_DEVICE=y
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
@@ -411,11 +391,8 @@ CONFIG_BLK_DEV_RAM_SIZE=65535
 

[POWERPC] Revert [POWERPC] Add 'mdio' to bus scan id list for platforms with QE UEC

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c5ede8cc6c75c3d85e46a5c20f106bcec933347
Commit: 3c5ede8cc6c75c3d85e46a5c20f106bcec933347
Parent: bd948b0377e7ab93559a80f68d38749bcc2e9a77
Author: Kim Phillips [EMAIL PROTECTED]
AuthorDate: Thu Jul 26 17:25:12 2007 -0500
Committer:  Paul Mackerras [EMAIL PROTECTED]
CommitDate: Fri Aug 10 21:04:22 2007 +1000

[POWERPC] Revert [POWERPC] Add 'mdio' to bus scan id list for platforms 
with QE UEC

This reverts commit 3baee955953957be5496cd28e9c544d9db214262.

That commit was a mistake from the start; I added mdio type to the
bus scan list early on in my ucc_geth migrate to phylib development,
which is just pure wrong (the ucc_geth_mii driver creates the mii
bus and the PHY layer handles PHY enumeration without translation).

This follows on from commit 77926826f301fbd8ed96d3cd9ff17a5b59560dfb:

 Revert [POWERPC] Don't complain if size-cells == 0 in prom_parse()

which was basically trying to hide a symptom of the original mistake
this revert fixes.

Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
 arch/powerpc/platforms/83xx/mpc832x_mds.c |1 -
 arch/powerpc/platforms/83xx/mpc832x_rdb.c |1 -
 arch/powerpc/platforms/83xx/mpc836x_mds.c |1 -
 arch/powerpc/platforms/85xx/mpc85xx_mds.c |1 -
 4 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c 
b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index b39cb52..2c8e641 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -106,7 +106,6 @@ static struct of_device_id mpc832x_ids[] = {
{ .type = soc, },
{ .compatible = soc, },
{ .type = qe, },
-   { .type = mdio, },
{},
 };
 
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c 
b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index b2b28a4..0909061 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -70,7 +70,6 @@ static struct of_device_id mpc832x_ids[] = {
{ .type = soc, },
{ .compatible = soc, },
{ .type = qe, },
-   { .type = mdio, },
{},
 };
 
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c 
b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 0e615fd..84b5893 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -113,7 +113,6 @@ static struct of_device_id mpc836x_ids[] = {
{ .type = soc, },
{ .compatible = soc, },
{ .type = qe, },
-   { .type = mdio, },
{},
 };
 
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c 
b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index e8003bf..be25ecd 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -142,7 +142,6 @@ static struct of_device_id mpc85xx_ids[] = {
{ .type = soc, },
{ .compatible = soc, },
{ .type = qe, },
-   { .type = mdio, },
{},
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[POWERPC] Fix more section mismatches in head_64.S

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=939e60f6808a9ffd3a4e5f145057379c138c89aa
Commit: 939e60f6808a9ffd3a4e5f145057379c138c89aa
Parent: 3c5ede8cc6c75c3d85e46a5c20f106bcec933347
Author: Stephen Rothwell [EMAIL PROTECTED]
AuthorDate: Tue Jul 31 16:44:13 2007 +1000
Committer:  Paul Mackerras [EMAIL PROTECTED]
CommitDate: Fri Aug 10 21:04:41 2007 +1000

[POWERPC] Fix more section mismatches in head_64.S

WARNING: vmlinux.o(.text+0x8174): Section mismatch: reference to 
.init.text:.prom_init (between '.__boot_from_prom' and '.__after_prom_start')
WARNING: vmlinux.o(.text+0x8498): Section mismatch: reference to 
.init.text:.early_setup (between '.start_here_multiplatform' and 
'.start_here_common')
WARNING: vmlinux.o(.text+0x8514): Section mismatch: reference to 
.init.text:.setup_system (between '.start_here_common' and 'system_call_common')
WARNING: vmlinux.o(.text+0x8530): Section mismatch: reference to 
.init.text:.start_kernel (between '.start_here_common' and 'system_call_common')

Signed-off-by: Stephen Rothwell [EMAIL PROTECTED]
Acked-by: Geert Uytterhoeven [EMAIL PROTECTED]
Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
 arch/powerpc/kernel/head_64.S |   16 +---
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 1448af9..1718000 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -1672,8 +1672,9 @@ _GLOBAL(__start_initialization_multiplatform)
 * Are we booted from a PROM Of-type client-interface ?
 */
cmpldi  cr0,r5,0
-   bne .__boot_from_prom   /* yes - prom */
-
+   beq 1f
+   b   .__boot_from_prom   /* yes - prom */
+1:
/* Save parameters */
mr  r31,r3
mr  r30,r4
@@ -1701,7 +1702,7 @@ _GLOBAL(__start_initialization_multiplatform)
bl  .__mmu_off
b   .__after_prom_start
 
-_STATIC(__boot_from_prom)
+_INIT_STATIC(__boot_from_prom)
/* Save parameters */
mr  r31,r3
mr  r30,r4
@@ -1768,9 +1769,10 @@ _STATIC(__after_prom_start)
/*  the source addr  */
 
cmpdi   r4,0/* In some cases the loader may  */
-   beq .start_here_multiplatform /* have already put us at zero */
+   bne 1f
+   b   .start_here_multiplatform /* have already put us at zero */
/* so we can skip the copy.  */
-   LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */
+1: LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */
sub r5,r5,r27
 
li  r6,0x100/* Start offset, the first 0x100 */
@@ -1957,7 +1959,7 @@ _GLOBAL(enable_64b_mode)
 /*
  * This is where the main kernel code starts.
  */
-_STATIC(start_here_multiplatform)
+_INIT_STATIC(start_here_multiplatform)
/* get a new offset, now that the kernel has moved. */
bl  .reloc_offset
mr  r26,r3
@@ -2019,7 +2021,7 @@ _STATIC(start_here_multiplatform)
b   .   /* prevent speculative execution */

/* This is where all platforms converge execution */
-_STATIC(start_here_common)
+_INIT_STATIC(start_here_common)
/* relocation is on at this point */
 
/* The following code sets up the SP and TOC now that we are */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[POWERPC] Fix initialization and usage of dma_mask

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f2ea1fd3f97ab7a809e939b5b9005a16f862439
Commit: 8f2ea1fd3f97ab7a809e939b5b9005a16f862439
Parent: 939e60f6808a9ffd3a4e5f145057379c138c89aa
Author: Benjamin Herrenschmidt [EMAIL PROTECTED]
AuthorDate: Tue Aug 7 08:05:10 2007 +1000
Committer:  Paul Mackerras [EMAIL PROTECTED]
CommitDate: Fri Aug 10 21:04:42 2007 +1000

[POWERPC] Fix initialization and usage of dma_mask

powerpc has a couple of bugs in the usage of dma_masks that tend to
break when drivers explicitly try to set a 32-bit mask for example.

First, the code that generates the pci devices from the OF device-tree
doesn't initialize the mask properly, then our implementation of
set_dma_mask() was trying to validate the -previous- mask value, not the
one passed in as an argument.

This fixes these problems.

Signed-off-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
 arch/powerpc/kernel/pci_64.c  |1 +
 include/asm-powerpc/dma-mapping.h |2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index a97e23a..291ffbc 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -313,6 +313,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
 
dev-current_state = 4; /* unknown power state */
dev-error_state = pci_channel_io_normal;
+   dev-dma_mask = 0x;
 
if (!strcmp(type, pci) || !strcmp(type, pciex)) {
/* a PCI-PCI bridge */
diff --git a/include/asm-powerpc/dma-mapping.h 
b/include/asm-powerpc/dma-mapping.h
index f6bd804..744d6bb 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -95,7 +95,7 @@ static inline int dma_set_mask(struct device *dev, u64 
dma_mask)
return -EIO;
if (dma_ops-set_dma_mask != NULL)
return dma_ops-set_dma_mask(dev, dma_mask);
-   if (!dev-dma_mask || !dma_supported(dev, *dev-dma_mask))
+   if (!dev-dma_mask || !dma_supported(dev, dma_mask))
return -EIO;
*dev-dma_mask = dma_mask;
return 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[POWERPC] Fix size check for hugetlbfs

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1f5a77f2c9db5b8a565eabdf8b534b02e32cc44
Commit: d1f5a77f2c9db5b8a565eabdf8b534b02e32cc44
Parent: 8f2ea1fd3f97ab7a809e939b5b9005a16f862439
Author: Benjamin Herrenschmidt [EMAIL PROTECTED]
AuthorDate: Wed Aug 8 15:44:15 2007 +1000
Committer:  Paul Mackerras [EMAIL PROTECTED]
CommitDate: Fri Aug 10 21:04:42 2007 +1000

[POWERPC] Fix size check for hugetlbfs

My slices address space management code that was added in the 2.6.22
implementation of get_unmapped_area() doesn't properly check that the
size is a multiple of the requested page size.  This allows userland to
create VMAs that aren't a multiple of the huge page size with hugetlbfs
(since hugetlbfs entirely relies on get_unmapped_area() to do that
checking) which leads to a kernel BUG() when such areas are torn down.

Signed-off-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Paul Mackerras [EMAIL PROTECTED]
---
 arch/powerpc/mm/slice.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index f833dba..d5fd390 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -405,6 +405,8 @@ unsigned long slice_get_unmapped_area(unsigned long addr, 
unsigned long len,
 
if (len  mm-task_size)
return -ENOMEM;
+   if (len  ((1ul  pshift) - 1))
+   return -EINVAL;
if (fixed  (addr  ((1ul  pshift) - 1)))
return -EINVAL;
if (fixed  addr  (mm-task_size - len))
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] cio: avoid memory leak on error in css_alloc_subchannel().

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5693ce6f9b9f08942e55e3825db014f8b1205772
Commit: 5693ce6f9b9f08942e55e3825db014f8b1205772
Parent: ac07860264bd2b18834d3fa3be47032115524cea
Author: Cornelia Huck [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 14:32:26 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Fri Aug 10 14:32:36 2007 +0200

[S390] cio: avoid memory leak on error in css_alloc_subchannel().

sch-lock has been allocated in cio_validate_subchannel(), it must be
freed if cio_modify() fails.

Signed-off-by: Cornelia Huck [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/cio/css.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 1c27a5a..5635e65 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -79,6 +79,7 @@ css_alloc_subchannel(struct subchannel_id schid)
sch-schib.pmcw.intparm = (__u32)(unsigned long)sch;
ret = cio_modify(sch);
if (ret) {
+   kfree(sch-lock);
kfree(sch);
return ERR_PTR(ret);
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] hypfs: implement show_options

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b01af5ba9105094ba4f1af60da8f7be44321a0c7
Commit: b01af5ba9105094ba4f1af60da8f7be44321a0c7
Parent: 5693ce6f9b9f08942e55e3825db014f8b1205772
Author: Michael Holzheu [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 14:32:27 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Fri Aug 10 14:32:36 2007 +0200

[S390] hypfs: implement show_options

Signed-off-by: Michael Holzheu [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 arch/s390/hypfs/inode.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 8e1ea1c..ad4ca75 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -17,6 +17,8 @@
 #include linux/parser.h
 #include linux/sysfs.h
 #include linux/module.h
+#include linux/seq_file.h
+#include linux/mount.h
 #include asm/ebcdic.h
 #include hypfs.h
 
@@ -256,6 +258,15 @@ static int hypfs_parse_options(char *options, struct 
super_block *sb)
return 0;
 }
 
+static int hypfs_show_options(struct seq_file *s, struct vfsmount *mnt)
+{
+   struct hypfs_sb_info *hypfs_info = mnt-mnt_sb-s_fs_info;
+
+   seq_printf(s, ,uid=%u, hypfs_info-uid);
+   seq_printf(s, ,gid=%u, hypfs_info-gid);
+   return 0;
+}
+
 static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
 {
struct inode *root_inode;
@@ -459,6 +470,7 @@ static struct file_system_type hypfs_type = {
 static struct super_operations hypfs_s_ops = {
.statfs = simple_statfs,
.drop_inode = hypfs_drop_inode,
+   .show_options   = hypfs_show_options,
 };
 
 static decl_subsys(s390, NULL, NULL);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] qdio: make sure data structures are correctly aligned.

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c6d0e8014a59b641c0669cf5df151667144f220e
Commit: c6d0e8014a59b641c0669cf5df151667144f220e
Parent: b01af5ba9105094ba4f1af60da8f7be44321a0c7
Author: Heiko Carstens [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 14:32:28 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Fri Aug 10 14:32:36 2007 +0200

[S390] qdio: make sure data structures are correctly aligned.

The slsb structure contained at the beginning of the qdio_q structure
must start on a 256 byte boundary. To make sure this is the case even
if slab debugging is turned on create an own slab cache for qdio_q
structures.
Besides that don't use the slab allocator to allocate whole pages. Use
the page allocator instead.
Also fix a few memory leaks in error handling code.

Signed-off-by: Heiko Carstens [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/cio/qdio.c |   92 ---
 1 files changed, 47 insertions(+), 45 deletions(-)

diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index ed026a1..03347ae 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -81,6 +81,7 @@ static __u32 volatile spare_indicator;
 static atomic_t spare_indicator_usecount;
 #define QDIO_MEMPOOL_SCSSC_ELEMENTS 2
 static mempool_t *qdio_mempool_scssc;
+static struct kmem_cache *qdio_q_cache;
 
 static debug_info_t *qdio_dbf_setup;
 static debug_info_t *qdio_dbf_sbal;
@@ -1617,23 +1618,21 @@ static void
 qdio_release_irq_memory(struct qdio_irq *irq_ptr)
 {
int i;
+   struct qdio_q *q;
 
-   for (i=0;iQDIO_MAX_QUEUES_PER_IRQ;i++) {
-   if (!irq_ptr-input_qs[i])
-   goto next;
-
-   kfree(irq_ptr-input_qs[i]-slib);
-   kfree(irq_ptr-input_qs[i]);
-
-next:
-   if (!irq_ptr-output_qs[i])
-   continue;
-
-   kfree(irq_ptr-output_qs[i]-slib);
-   kfree(irq_ptr-output_qs[i]);
-
+   for (i = 0; i  QDIO_MAX_QUEUES_PER_IRQ; i++) {
+   q = irq_ptr-input_qs[i];
+   if (q) {
+   free_page((unsigned long) q-slib);
+   kmem_cache_free(qdio_q_cache, q);
+   }
+   q = irq_ptr-output_qs[i];
+   if (q) {
+   free_page((unsigned long) q-slib);
+   kmem_cache_free(qdio_q_cache, q);
+   }
}
-   kfree(irq_ptr-qdr);
+   free_page((unsigned long) irq_ptr-qdr);
free_page((unsigned long) irq_ptr);
 }
 
@@ -1680,44 +1679,35 @@ qdio_alloc_qs(struct qdio_irq *irq_ptr,
 {
int i;
struct qdio_q *q;
-   int result=-ENOMEM;
-
-   for (i=0;ino_input_qs;i++) {
-   q = kzalloc(sizeof(struct qdio_q), GFP_KERNEL);
 
-   if (!q) {
-   QDIO_PRINT_ERR(kmalloc of q failed!\n);
-   goto out;
-   }
+   for (i = 0; i  no_input_qs; i++) {
+   q = kmem_cache_alloc(qdio_q_cache, GFP_KERNEL);
+   if (!q)
+   return -ENOMEM;
+   memset(q, 0, sizeof(*q));
 
-   q-slib = kmalloc(PAGE_SIZE, GFP_KERNEL);
+   q-slib = (struct slib *) __get_free_page(GFP_KERNEL);
if (!q-slib) {
-   QDIO_PRINT_ERR(kmalloc of slib failed!\n);
-   goto out;
+   kmem_cache_free(qdio_q_cache, q);
+   return -ENOMEM;
}
-
irq_ptr-input_qs[i]=q;
}
 
-   for (i=0;ino_output_qs;i++) {
-   q = kzalloc(sizeof(struct qdio_q), GFP_KERNEL);
-
-   if (!q) {
-   goto out;
-   }
+   for (i = 0; i  no_output_qs; i++) {
+   q = kmem_cache_alloc(qdio_q_cache, GFP_KERNEL);
+   if (!q)
+   return -ENOMEM;
+   memset(q, 0, sizeof(*q));
 
-   q-slib=kmalloc(PAGE_SIZE,GFP_KERNEL);
+   q-slib = (struct slib *) __get_free_page(GFP_KERNEL);
if (!q-slib) {
-   QDIO_PRINT_ERR(kmalloc of slib failed!\n);
-   goto out;
+   kmem_cache_free(qdio_q_cache, q);
+   return -ENOMEM;
}
-
irq_ptr-output_qs[i]=q;
}
-
-   result=0;
-out:
-   return result;
+   return 0;
 }
 
 static void
@@ -2985,17 +2975,17 @@ qdio_allocate(struct qdio_initialize *init_data)
QDIO_DBF_HEX0(0,setup,irq_ptr,sizeof(void*));
 
if (!irq_ptr) {
-   QDIO_PRINT_ERR(kmalloc of irq_ptr failed!\n);
+   QDIO_PRINT_ERR(allocation of irq_ptr failed!\n);
return -ENOMEM;
}
 

[S390] remove DEFAULT_MIGRATION_COST

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d740a438fcb8775008dfd3fc18df7f7a0ca2e12
Commit: 6d740a438fcb8775008dfd3fc18df7f7a0ca2e12
Parent: c6d0e8014a59b641c0669cf5df151667144f220e
Author: Heiko Carstens [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 14:32:29 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Fri Aug 10 14:32:37 2007 +0200

[S390] remove DEFAULT_MIGRATION_COST

0437e109e1841607f2988891eaa36c531c6aa6ac removes the migration
cost init code. Remove the s390 leftovers as well.

Signed-off-by: Heiko Carstens [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 arch/s390/Kconfig |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 098c62c..b711321 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -109,10 +109,6 @@ config HOTPLUG_CPU
  can be controlled through /sys/devices/system/cpu/cpu#.
  Say N if you want to disable CPU hotplug.
 
-config DEFAULT_MIGRATION_COST
-   int
-   default 100
-
 config MATHEMU
bool IEEE FPU emulation
depends on MARCH_G5
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] vmur: allocate single record buffers instead of one big data buffer

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1eade380c5f3e69348531ade5e9f9c5ae6485874
Commit: 1eade380c5f3e69348531ade5e9f9c5ae6485874
Parent: 6d740a438fcb8775008dfd3fc18df7f7a0ca2e12
Author: Michael Holzheu [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 14:32:30 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Fri Aug 10 14:32:37 2007 +0200

[S390] vmur: allocate single record buffers instead of one big data buffer

vmur allocates one contiguous kernel buffer to copy user data when creating
ccw programs for punch or printer. If big block sizes are used, under memory
pressure it can happen, that we do not get memory in one chunk. Now we
allocate memory for each single record to avoid high order allocations.

Signed-off-by: Michael Holzheu [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/char/vmur.c |   75 ++---
 1 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 161867c..1b758b5 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -119,10 +119,12 @@ static void urdev_put(struct urdev *urd)
 /*
  * Low-level functions to do I/O to a ur device.
  * alloc_chan_prog
+ * free_chan_prog
  * do_ur_io
  * ur_int_handler
  *
  * alloc_chan_prog allocates and builds the channel program
+ * free_chan_prog frees memory of the channel program
  *
  * do_ur_io issues the channel program to the device and blocks waiting
  * on a completion event it publishes at urd-io_done. The function
@@ -137,6 +139,16 @@ static void urdev_put(struct urdev *urd)
  * address pointer that alloc_chan_prog returned.
  */
 
+static void free_chan_prog(struct ccw1 *cpa)
+{
+   struct ccw1 *ptr = cpa;
+
+   while (ptr-cda) {
+   kfree((void *)(addr_t) ptr-cda);
+   ptr++;
+   }
+   kfree(cpa);
+}
 
 /*
  * alloc_chan_prog
@@ -144,44 +156,45 @@ static void urdev_put(struct urdev *urd)
  * with a final NOP CCW command-chained on (which ensures that CE and DE
  * are presented together in a single interrupt instead of as separate
  * interrupts unless an incorrect length indication kicks in first). The
- * data length in each CCW is reclen. The caller must ensure that count
- * is an integral multiple of reclen.
- * The channel program pointer returned by this function must be freed
- * with kfree. The caller is responsible for checking that
- * count/reclen is not ridiculously large.
+ * data length in each CCW is reclen.
  */
-static struct ccw1 *alloc_chan_prog(char *buf, size_t count, size_t reclen)
+static struct ccw1 *alloc_chan_prog(const char __user *ubuf, int rec_count,
+   int reclen)
 {
-   size_t num_ccws;
struct ccw1 *cpa;
+   void *kbuf;
int i;
 
-   TRACE(alloc_chan_prog(%p, %zu, %zu)\n, buf, count, reclen);
+   TRACE(alloc_chan_prog(%p, %i, %i)\n, ubuf, rec_count, reclen);
 
/*
 * We chain a NOP onto the writes to force CE+DE together.
 * That means we allocate room for CCWs to cover count/reclen
 * records plus a NOP.
 */
-   num_ccws = count / reclen + 1;
-   cpa = kmalloc(num_ccws * sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
+   cpa = kzalloc((rec_count + 1) * sizeof(struct ccw1),
+ GFP_KERNEL | GFP_DMA);
if (!cpa)
-   return NULL;
+   return ERR_PTR(-ENOMEM);
 
-   for (i = 0; count; i++) {
+   for (i = 0; i  rec_count; i++) {
cpa[i].cmd_code = WRITE_CCW_CMD;
cpa[i].flags = CCW_FLAG_CC | CCW_FLAG_SLI;
cpa[i].count = reclen;
-   cpa[i].cda = __pa(buf);
-   buf += reclen;
-   count -= reclen;
+   kbuf = kmalloc(reclen, GFP_KERNEL | GFP_DMA);
+   if (!kbuf) {
+   free_chan_prog(cpa);
+   return ERR_PTR(-ENOMEM);
+   }
+   cpa[i].cda = (u32)(addr_t) kbuf;
+   if (copy_from_user(kbuf, ubuf, reclen)) {
+   free_chan_prog(cpa);
+   return ERR_PTR(-EFAULT);
+   }
+   ubuf += reclen;
}
/* The following NOP CCW forces CE+DE to be presented together */
cpa[i].cmd_code = CCW_CMD_NOOP;
-   cpa[i].flags = 0;
-   cpa[i].count = 0;
-   cpa[i].cda = 0;
-
return cpa;
 }
 
@@ -325,24 +338,11 @@ static ssize_t do_write(struct urdev *urd, const char 
__user *udata,
size_t count, size_t reclen, loff_t *ppos)
 {
struct ccw1 *cpa;
-   char *buf;
int rc;
 
-   /* Data buffer must be under 2GB line for fmt1 CCWs: hence GFP_DMA */
-   buf = kmalloc(count, GFP_KERNEL | GFP_DMA);
-   if (!buf)
-

[S390] vmur: reject open on z/VM reader files with status HOLD

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2405598e0678e9c93dd780f2a12fc562ece3d13
Commit: f2405598e0678e9c93dd780f2a12fc562ece3d13
Parent: 278bc68c4bfcd1af97972f5c4458acf3b9b19c37
Author: Michael Holzheu [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 14:32:32 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Fri Aug 10 14:32:37 2007 +0200

[S390] vmur: reject open on z/VM reader files with status HOLD

If a reader file with HOLD status is at the top of the reader queue, 
currently
all read requests will return data of the second file in the queue. But the
semantics of vmur is that always the topmost file is read. With this fix
-EPERM is returned on open, if the topmost reader file is in HOLD status.

Signed-off-by: Michael Holzheu [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/char/vmur.c |4 +++-
 drivers/s390/char/vmur.h |4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 27b8bf9..04395c0 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -556,7 +556,9 @@ static int verify_device(struct urdev *urd)
rc = diag_read_next_file_info(fcb, 0);
if (rc)
return rc;
-
+   /* if file is in hold status, we do not read it */
+   if (fcb.file_stat  (FLG_SYSTEM_HOLD | FLG_USER_HOLD))
+   return -EPERM;
/* open file on virtual reader  */
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!buf)
diff --git a/drivers/s390/char/vmur.h b/drivers/s390/char/vmur.h
index 16d0a4e..522a9df 100644
--- a/drivers/s390/char/vmur.h
+++ b/drivers/s390/char/vmur.h
@@ -50,7 +50,9 @@ struct file_control_block {
char  rest[200];
 } __attribute__ ((packed));
 
-#define FLG_CP_DUMP 0x10
+#define FLG_SYSTEM_HOLD0x04
+#define FLG_CP_DUMP0x10
+#define FLG_USER_HOLD  0x20
 
 /*
  * A struct urdev is created for each ur device that is made available
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] vmur: add top of queue sanity check for reader open

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4eac34529bce2b4cca9be90a6903c965baa8193c
Commit: 4eac34529bce2b4cca9be90a6903c965baa8193c
Parent: f2405598e0678e9c93dd780f2a12fc562ece3d13
Author: Michael Holzheu [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 14:32:33 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Fri Aug 10 14:32:38 2007 +0200

[S390] vmur: add top of queue sanity check for reader open

If the z/VM reader is already open, it can happen that after opening the
Linux reader device, not the topmost file is processed. According the
semantics of the Linux z/VM unit record device driver, always the topmost
file has to be processed. With this fix an error is returned if that is
not the case.

Signed-off-by: Michael Holzheu [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/char/vmur.c |7 ++-
 drivers/s390/char/vmur.h |1 +
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 04395c0..a9d5862 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -565,9 +565,14 @@ static int verify_device(struct urdev *urd)
return -ENOMEM;
rc = diag_read_file(urd-dev_id.devno, buf);
kfree(buf);
-
if ((rc != 0)  (rc != -ENODATA)) /* EOF does not hurt */
return rc;
+   /* check if the file on top of the queue is open now */
+   rc = diag_read_next_file_info(fcb, 0);
+   if (rc)
+   return rc;
+   if (!(fcb.file_stat  FLG_IN_USE))
+   return -EMFILE;
return 0;
default:
return -ENOTSUPP;
diff --git a/drivers/s390/char/vmur.h b/drivers/s390/char/vmur.h
index 522a9df..2b3c564 100644
--- a/drivers/s390/char/vmur.h
+++ b/drivers/s390/char/vmur.h
@@ -53,6 +53,7 @@ struct file_control_block {
 #define FLG_SYSTEM_HOLD0x04
 #define FLG_CP_DUMP0x10
 #define FLG_USER_HOLD  0x20
+#define FLG_IN_USE 0x80
 
 /*
  * A struct urdev is created for each ur device that is made available
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] vmur: diag14 only works with buffers below 2GB

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3eed13cc3beaa9ee07b126a662def88f7281394e
Commit: 3eed13cc3beaa9ee07b126a662def88f7281394e
Parent: 4eac34529bce2b4cca9be90a6903c965baa8193c
Author: Michael Holzheu [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 14:32:34 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Fri Aug 10 14:32:39 2007 +0200

[S390] vmur: diag14 only works with buffers below 2GB

If memory buffers above 2GB are used, diagnose 14 raises a specification
exception. This fix ensures that buffer allocation is done below the 2GB
boundary.

Signed-off-by: Michael Holzheu [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/char/vmur.c |  106 ++
 1 files changed, 70 insertions(+), 36 deletions(-)

diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index a9d5862..04b19bd 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -472,7 +472,7 @@ static ssize_t diag14_read(struct file *file, char __user 
*ubuf, size_t count,
return rc;
 
len = min((size_t) PAGE_SIZE, count);
-   buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+   buf = (char *) __get_free_page(GFP_KERNEL | GFP_DMA);
if (!buf)
return -ENOMEM;
 
@@ -499,7 +499,7 @@ static ssize_t diag14_read(struct file *file, char __user 
*ubuf, size_t count,
*offs += copied;
rc = copied;
 fail:
-   kfree(buf);
+   free_page((unsigned long) buf);
return rc;
 }
 
@@ -542,63 +542,97 @@ static int diag_read_next_file_info(struct 
file_control_block *buf, int spid)
}
 }
 
-static int verify_device(struct urdev *urd)
+static int verify_uri_device(struct urdev *urd)
 {
-   struct file_control_block fcb;
+   struct file_control_block *fcb;
char *buf;
int rc;
 
+   fcb = kmalloc(sizeof(*fcb), GFP_KERNEL | GFP_DMA);
+   if (!fcb)
+   return -ENOMEM;
+
+   /* check for empty reader device (beginning of chain) */
+   rc = diag_read_next_file_info(fcb, 0);
+   if (rc)
+   goto fail_free_fcb;
+
+   /* if file is in hold status, we do not read it */
+   if (fcb-file_stat  (FLG_SYSTEM_HOLD | FLG_USER_HOLD)) {
+   rc = -EPERM;
+   goto fail_free_fcb;
+   }
+
+   /* open file on virtual reader  */
+   buf = (char *) __get_free_page(GFP_KERNEL | GFP_DMA);
+   if (!buf) {
+   rc = -ENOMEM;
+   goto fail_free_fcb;
+   }
+   rc = diag_read_file(urd-dev_id.devno, buf);
+   if ((rc != 0)  (rc != -ENODATA)) /* EOF does not hurt */
+   goto fail_free_buf;
+
+   /* check if the file on top of the queue is open now */
+   rc = diag_read_next_file_info(fcb, 0);
+   if (rc)
+   goto fail_free_buf;
+   if (!(fcb-file_stat  FLG_IN_USE)) {
+   rc = -EMFILE;
+   goto fail_free_buf;
+   }
+   rc = 0;
+
+fail_free_buf:
+   free_page((unsigned long) buf);
+fail_free_fcb:
+   kfree(fcb);
+   return rc;
+}
+
+static int verify_device(struct urdev *urd)
+{
switch (urd-class) {
case DEV_CLASS_UR_O:
return 0; /* no check needed here */
case DEV_CLASS_UR_I:
-   /* check for empty reader device (beginning of chain) */
-   rc = diag_read_next_file_info(fcb, 0);
-   if (rc)
-   return rc;
-   /* if file is in hold status, we do not read it */
-   if (fcb.file_stat  (FLG_SYSTEM_HOLD | FLG_USER_HOLD))
-   return -EPERM;
-   /* open file on virtual reader  */
-   buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-   if (!buf)
-   return -ENOMEM;
-   rc = diag_read_file(urd-dev_id.devno, buf);
-   kfree(buf);
-   if ((rc != 0)  (rc != -ENODATA)) /* EOF does not hurt */
-   return rc;
-   /* check if the file on top of the queue is open now */
-   rc = diag_read_next_file_info(fcb, 0);
-   if (rc)
-   return rc;
-   if (!(fcb.file_stat  FLG_IN_USE))
-   return -EMFILE;
-   return 0;
+   return verify_uri_device(urd);
default:
return -ENOTSUPP;
}
 }
 
-static int get_file_reclen(struct urdev *urd)
+static int get_uri_file_reclen(struct urdev *urd)
 {
-   struct file_control_block fcb;
+   struct file_control_block *fcb;
int rc;
 
+   fcb = kmalloc(sizeof(*fcb), GFP_KERNEL | GFP_DMA);
+   if (!fcb)
+   return -ENOMEM;
+   rc = diag_read_next_file_info(fcb, 0);
+   if (rc)
+   goto fail_free;
+   if (fcb-file_stat  FLG_CP_DUMP)
+   

[S390] monwriter: Serialization bug for multithreaded applications.

2007-08-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cbea66d9788a344e16e161f22a6e0c4deef2c0ed
Commit: cbea66d9788a344e16e161f22a6e0c4deef2c0ed
Parent: 3eed13cc3beaa9ee07b126a662def88f7281394e
Author: Melissa Howland [EMAIL PROTECTED]
AuthorDate: Fri Aug 10 14:32:35 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Fri Aug 10 14:32:39 2007 +0200

[S390] monwriter: Serialization bug for multithreaded applications.

Locking added so that multithreaded applications can now do writes
from different threads without the risk of storage corruption.

Signed-off-by: Melissa Howland [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/char/monwriter.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c
index 268598e..20442fb 100644
--- a/drivers/s390/char/monwriter.c
+++ b/drivers/s390/char/monwriter.c
@@ -17,6 +17,7 @@
 #include linux/miscdevice.h
 #include linux/ctype.h
 #include linux/poll.h
+#include linux/mutex.h
 #include asm/uaccess.h
 #include asm/ebcdic.h
 #include asm/io.h
@@ -41,6 +42,7 @@ struct mon_private {
size_t hdr_to_read;
size_t data_to_read;
struct mon_buf *current_buf;
+   struct mutex thread_mutex;
 };
 
 /*
@@ -179,6 +181,7 @@ static int monwrite_open(struct inode *inode, struct file 
*filp)
return -ENOMEM;
INIT_LIST_HEAD(monpriv-list);
monpriv-hdr_to_read = sizeof(monpriv-hdr);
+   mutex_init(monpriv-thread_mutex);
filp-private_data = monpriv;
return nonseekable_open(inode, filp);
 }
@@ -209,6 +212,7 @@ static ssize_t monwrite_write(struct file *filp, const char 
__user *data,
void *to;
int rc;
 
+   mutex_lock(monpriv-thread_mutex);
for (written = 0; written  count; ) {
if (monpriv-hdr_to_read) {
len = min(count - written, monpriv-hdr_to_read);
@@ -247,11 +251,13 @@ static ssize_t monwrite_write(struct file *filp, const 
char __user *data,
}
monpriv-hdr_to_read = sizeof(monpriv-hdr);
}
+   mutex_unlock(monpriv-thread_mutex);
return written;
 
 out_error:
monpriv-data_to_read = 0;
monpriv-hdr_to_read = sizeof(struct monwrite_hdr);
+   mutex_unlock(monpriv-thread_mutex);
return rc;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html