Re: ACPI bay - 2.6.20-rc3-mm1 hangs on boot

2007-01-05 Thread Pavel Machek
On Fri 2007-01-05 14:19:41, Jiri Kosina wrote:
> Hi,
> 
> 2.6.20-rc3-mm1 hangs on boot on my IBM T42p when compiled with ACPI_BAY=y. 
> Below is the trace of two BUGs I get.
> 
> When compiled with ACPI_BAY=n, it boots fine.

ACPI people usually prefer entries in bugzilla.kernel.org, try that if
you don't get a timely reply.

-- 
Thanks for all the (sleeping) penguins.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [nfsv4] RE: Finding hardlinks

2007-01-05 Thread Halevy, Benny
> From: [EMAIL PROTECTED] on behalf of Nicolas Williams
> Sent: Fri 1/5/2007 18:40
> To: Halevy, Benny
> Cc: Trond Myklebust; Jan Harkes; Miklos Szeredi; nfsv4@ietf.org; 
> linux-kernel@vger.kernel.org; Mikulas Patocka; linux-fsdevel@vger.kernel.org; 
> Jeff Layton; Arjan van de Ven
> Subject: Re: [nfsv4] RE: Finding hardlinks
> 
> On Thu, Jan 04, 2007 at 12:04:14PM +0200, Benny Halevy wrote:
> > I agree that the way the client implements its cache is out of the protocol
> > scope. But how do you interpret "correct behavior" in section 4.2.1?
> >  "Clients MUST use filehandle comparisons only to improve performance, not 
> > for correct behavior. All clients > need to be prepared for situations in 
> > which it cannot be determined whether two filehandles denote the same > 
> > object and in such cases, avoid making invalid assumptions which might 
> > cause incorrect behavior."
> > Don't you consider data corruption due to cache inconsistency an incorrect 
> > behavior?
> 
> If a file with multiple hardlinks appears to have multiple distinct
> filehandles then a client like Trond's will treat it as multiple
> distinct files (with the same hardlink count, and you won't be able to
> find the other links to them -- oh well).  Can this cause data
> corruption?  Yes, but only if there are applications that rely on the
> different file names referencing the same file, and backup apps on the
> client won't get the hardlinks right either.

Well, this is why the hard links were made, no?
FWIW, I believe that rename of an open file might also produce this problem.


> 
> What I don't understand is why getting the fileid is so hard -- always
> GETATTR when you GETFH and you'll be fine.  I'm guessing that's not as
> difficult as it is to maintain a hash table of fileids.


The problem with NFS is that fileid isn't enough because the client doesn't
know about removes by other clients until it uses the stale filehandle.
Also, quite a few file systems are not keeping fileids unique (this triggered
this thread)
 
> 
> Nico
> --

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.20-rc3] TTY_IO: Remove unnecessary kmalloc casts

2007-01-05 Thread Robert P. J. Day
On Sat, 6 Jan 2007, Ahmed S. Darwish wrote:

> > On Fri, Jan 05, 2007 at 09:10:01AM +0100, rday wrote:
> > > Ahmed S. Darwish wrote:
> > > Remove unnecessary kmalloc casts in drivers/char/tty_io.c
> > > Signed-off-by: Ahmed Darwish <[EMAIL PROTECTED]>
> >
> > rday
> >
> > p.s.  just FYI, i have a patch that does most of this, but i was going
> > to hold off submitting it until 2.6.20 had arrived.  but if you want
> > to take a shot at it, it's all yours.
>
> OK, then I should stop sending new patches related to that matter to
> avoid patch conflicts. right ?

no, no, go ahead.  i have enough to do to keep me busy.

rday
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.20-rc3-git4 oops on suspend: __drain_pages

2007-01-05 Thread Pavel Machek
Hi!

> Saw this oops on 2.6.20-rc3-git4 when attempting to 
> suspend. This only happened in 1 of 3 attempts.

Find out how reproducible it is... and if it works with minimum
modules loaded.
Pavel
-- 
Thanks for all the (sleeping) penguins.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] cx88xx: Fix lockup on suspend

2007-01-05 Thread Pavel Machek
Hi!

> Suspending with the cx88xx module loaded causes the 
> system to lock up because the cx88_audio_thread kthread 
> was missing a try_to_freeze() call, which caused it to 
> go into a tight loop and result in softlockup when 
> suspending. Fix that.
> 
> Signed-off-by: Robert Hancock <[EMAIL PROTECTED]>
>

Ack,
 
> --- 
> linux-2.6.20-rc3-git4-orig/drivers/media/video/cx88/cx88-tvaudio.c
> 2007-01-04 19:51:45.0 -0600
> +++ 
> linux-2.6.20-rc3-git4/drivers/media/video/cx88/cx88-tvaudio.c 2007-01-04 
> 19:25:19.0 -0600
> @@ -38,6 +38,7 @@
> #include 
> #include 
> #include 
> +#include 
> #include 
> #include 
> #include 

but your patch was whitespace-damaged. Can you retry?

> @@ -961,6 +962,7 @@ int cx88_audio_thread(void *data)
>   msleep_interruptible(1000);
>   if (kthread_should_stop())
>   break;
> + try_to_freeze();
> 

Pavel

-- 
Thanks for all the (sleeping) penguins.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: kernel + gcc 4.1 = several problems

2007-01-05 Thread Pavel Machek
Hi!

> >IMHO you should play such games with "g++ -O9", but 
> >that's
> >a discussion for a different mailing list.
> 
> For a different mailing list indeed; let me just point 
> out
> that for certain important quite common cases it's an 
> ~50%
> overall speedup.

Hmm, what code was that? 'signed int does not wrap around' does not
seem to provide _that_ much info...
Pavel
-- 
Thanks for all the (sleeping) penguins.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/6] adaptive readahead update

2007-01-05 Thread Fengguang Wu
Andrew,

Here're more readahead updates. They go like:

--- broken-out/series   2007-01-05 13:13:19.0 +0800
+++ patches/series  2007-01-05 22:11:37.0 +0800
@@ -985,13 +985,17 @@
 readahead-sysctl-parameters.patch
 readahead-sysctl-parameters-use-ctl_unnumbered.patch
 readahead-sysctl-parameters-fix.patch
+readahead-sysctl-parameters-set-readahead_hit_rate-1.patch
 readahead-min-max-sizes.patch
+readahead-min-max-sizes-remove-get_readahead_bounds.patch
 readahead-state-based-method-aging-accounting.patch
 readahead-state-based-method-routines.patch
 readahead-state-based-method.patch
 readahead-context-based-method.patch
 readahead-context-based-method-locking-fix.patch
 readahead-context-based-method-locking-fix-2.patch
+readahead-context-based-method-update-ra_min.patch
+readahead-context-based-method-remove-readahead_ratio.patch
 readahead-initial-method-guiding-sizes.patch
 readahead-initial-method-thrashing-guard-size.patch
 readahead-initial-method-user-recommended-size.patch
@@ -1001,9 +1005,10 @@
 readahead-call-scheme.patch
 readahead-call-scheme-ifdef-fix.patch
 readahead-call-scheme-build-fix.patch
+readahead-call-scheme-remove-get_readahead_bounds.patch
-readahead-laptop-mode.patch
 readahead-loop-case.patch
 readahead-nfsd-case.patch
+readahead-nfsd-case-remove-ra_min.patch
 readahead-nfsd-case-fix.patch
 readahead-nfsd-case-fix-uninitialized-ra_min-ra_max.patch
 readahead-turn-on-by-default.patch


Summary of changes
==

- change default value of readahead_hit_rate to 1
- remove defered readahead for laptop mode
- remove get_readahead_bounds() and update ra_min of the context method
- remove use of readahead_ratio in the context method


readahead-laptop-mode.patch
===

Please remove it for now.

It defers readahead when the laptop is spinned down, which may cause unpleasant
delays if the user is watching movie and the media player do not cache enough
data in userland.


readahead-nfsd-case-remove-ra_min.patch
===

Please fold it immediately to avoid a compile error when bisecting.


readahead-insert-cond_resched-calls.patch
readahead-remove-size-limit-on-read_ahead_kb.patch  

readahead-remove-size-limit-of-max_sectors_kb-on-read_ahead_kb.patch



It may be better to push them to mainline _before_ the other patches.

They solve some issues on large readahead size.
The main users are currently some laptop mode users.

Regards,
Fengguang Wu
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 6/6] readahead: nfsd case: remove ra_min

2007-01-05 Thread Fengguang Wu
ra_min => req_size.
Now it is for try_context_based_readahead() to compute ra_min from req_size.

Please fold it into readahead-nfsd-case.patch to avoid a compiling error.

Signed-off-by: Fengguang Wu <[EMAIL PROTECTED]>
---
 mm/readahead.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.20-rc3-mm1.orig/mm/readahead.c
+++ linux-2.6.20-rc3-mm1/mm/readahead.c
@@ -1673,7 +1673,7 @@ readit:
   !probe_page(mapping, ra_index)) {
ra->prev_page = ra_index - 1;
ret = try_context_based_readahead(mapping, ra, NULL,
-ra_index, ra_min, ra_max);
+ra_index, req_size, ra_max);
if (ret > 0)
ra_size += ra_submit(ra, mapping, filp);
}

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/6] readahead: sysctl parameters: set readahead_hit_rate=1

2007-01-05 Thread Fengguang Wu
Set default readahead_hit_rate to 1 for the majority users.

Signed-off-by: Fengguang Wu <[EMAIL PROTECTED]>
---
 Documentation/sysctl/vm.txt |2 +-
 mm/readahead.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux.orig/Documentation/sysctl/vm.txt
+++ linux/Documentation/sysctl/vm.txt
@@ -261,4 +261,4 @@ Possible values can be:
 
 The larger value, the more capabilities, with more possible overheads.
 
-The default value is 0.
+The default value is 1.
--- linux.orig/mm/readahead.c
+++ linux/mm/readahead.c
@@ -42,7 +42,7 @@ int readahead_ratio = 50;
 EXPORT_SYMBOL_GPL(readahead_ratio);
 
 /* Readahead as long as cache hit ratio keeps above 1/##. */
-int readahead_hit_rate = 0;
+int readahead_hit_rate = 1;
 #endif /* CONFIG_ADAPTIVE_READAHEAD */
 
 /*

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/6] readahead: min/max sizes: remove get_readahead_bounds()

2007-01-05 Thread Fengguang Wu
Remove get_readahead_bounds():
- ra_max: we already have get_max_readahead() for it
- ra_min: is only used by context based readahead, and will be moved there
  and set to a more reasonable value

Signed-off-by: Fengguang Wu <[EMAIL PROTECTED]>

---
 mm/readahead.c |   24 
 1 file changed, 24 deletions(-)

--- linux-2.6.20-rc3-mm1.orig/mm/readahead.c
+++ linux-2.6.20-rc3-mm1/mm/readahead.c
@@ -780,30 +780,6 @@ out:
return nr_pages;
 }
 
-/*
- * ra_min is mainly determined by the size of cache memory. Reasonable?
- *
- * Table of concrete numbers for 4KB page size:
- *   inactive + free (MB):4   8   16   32   64  128  256  512 1024
- *ra_min (KB):   16  16   16   16   20   24   32   48   64
- */
-static inline void get_readahead_bounds(struct file_ra_state *ra,
-   unsigned long *ra_min,
-   unsigned long *ra_max)
-{
-   unsigned long active;
-   unsigned long inactive;
-   unsigned long free;
-
-   __get_zone_counts(, , , NODE_DATA(numa_node_id()));
-
-   free += inactive;
-   *ra_max = min(min(ra->ra_pages, 0xUL), free / 2);
-   *ra_min = min(min(MIN_RA_PAGES + (free >> 14),
- DIV_ROUND_UP(64*1024, PAGE_CACHE_SIZE)),
- *ra_max / 8);
-}
-
 #endif /* CONFIG_ADAPTIVE_READAHEAD */
 
 /*

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/6] readahead: context based method: update ra_min

2007-01-05 Thread Fengguang Wu
Classify the 4 cases into 2 classes, and assign proper ra_min for them.
Also update comments correspondly.

Signed-off-by: Fengguang Wu <[EMAIL PROTECTED]>

---
 mm/readahead.c |   49 +++
 1 file changed, 33 insertions(+), 16 deletions(-)

--- linux-2.6.20-rc3-mm1.orig/mm/readahead.c
+++ linux-2.6.20-rc3-mm1/mm/readahead.c
@@ -1285,17 +1285,26 @@ static int
 try_context_based_readahead(struct address_space *mapping,
struct file_ra_state *ra,
struct page *page, pgoff_t offset,
-   unsigned long ra_min, unsigned long ra_max)
+   unsigned long req_size, unsigned long ra_max)
 {
pgoff_t start;
+   unsigned long ra_min;
unsigned long ra_size;
unsigned long la_size;
 
-   /* Check if there is a segment of history pages, and its end index.
+   /*
+* Check if there is a segment of history pages, and its end index.
 * Based on which we decide whether and where to start read-ahead.
-*
-* Case 1: we have a current page.
-* Search forward for a nearby hole.
+*/
+
+   /*
+* Select a reasonable large initial size for sequential reads.
+*/
+   ra_min = min(req_size * 4, mapping->backing_dev_info->ra_pages0);
+
+   /*
+* Case s1: we have a current page.
+* ===> Search forward for a nearby hole.
 */
read_lock_irq(>tree_lock);
if (page) {
@@ -1308,8 +1317,9 @@ try_context_based_readahead(struct addre
return -1;
}
 
-   /* Case 2: current page is missing; previous page is present.
-* Just do read-ahead from the current index on.
+   /*
+* Case s2: current page is missing; previous page is present.
+* ===> Just do read-ahead from the current index on.
 * There's clear sign of sequential reading. It can be
 *  a) seek => read => this read
 *  b) cache hit read(s) => this read
@@ -1321,26 +1331,33 @@ try_context_based_readahead(struct addre
goto has_history_pages;
}
 
-   /* Case 2x: the same context info as 2.
-* It can be the early stage of semi-sequential reads(interleaved/nfsd),
-* or an ugly random one.  So be conservative.
+   /*
+* Not an obvious sequential read:
+* select a conservative initial size, plus user prefered agressiveness.
+*/
+   ra_min = min(req_size, MIN_RA_PAGES) +
+readahead_hit_rate * 8192 / PAGE_CACHE_SIZE;
+
+   /*
+* Case r1: the same context info as s2, but not that obvious.
+* ===> The same action as s2, but be conservative.
+* It can be the early stage of intermixed sequential reads,
+* or an ugly random one.
 */
if (readahead_hit_rate && __probe_page(mapping, offset - 1)) {
start = offset;
-   if (ra_min > 2 * readahead_hit_rate)
-   ra_min = 2 * readahead_hit_rate;
goto has_history_pages;
}
 
-   /* Case 3: no current/previous pages;
-* sparse read-ahead is enabled: ok, be aggressive.
-* Check if there's any adjecent history pages.
+   /*
+* Case r2: no current/previous pages; sparse read-ahead is enabled.
+* ===> Do sparse read-ahead if there are adjecent history pages.
 */
if (readahead_hit_rate > 1) {
start = radix_tree_scan_data_backward(>page_tree,
   offset, ra_min);
if (start != ULONG_MAX && offset - start < ra_min) {
-   ra_min += offset - start;
+   ra_min *= 2;
offset = ++start; /* pretend the request starts here */
goto has_history_pages;
}

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/6] readahead: context based method: remove readahead_ratio

2007-01-05 Thread Fengguang Wu
The context based readahead is pretty conservative by nature,
so do not apply readahead_ratio here.

Signed-off-by: Fengguang Wu <[EMAIL PROTECTED]>

---
 mm/readahead.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

--- linux-2.6.20-rc3-mm1.orig/mm/readahead.c
+++ linux-2.6.20-rc3-mm1/mm/readahead.c
@@ -1236,9 +1236,7 @@ static unsigned long count_history_pages
 * Check the far pages coarsely.
 * The enlarged count will contribute to the look-ahead size.
 */
-   lookback = ra_max * (LOOKAHEAD_RATIO + 1) *
-   100 / (readahead_ratio | 1);
-
+   lookback = ra_max * LOOKAHEAD_RATIO;
for (count += ra_max; count < lookback; count += ra_max)
if (!__probe_page(mapping, offset - count))
break;
@@ -1384,7 +1382,8 @@ has_history_pages:
adjust_rala_aggressive(ra_max, _size, _size);
ra_set_class(ra, RA_CLASS_CONTEXT_AGGRESSIVE);
} else {
-   ra_size = max(ra_min, ra_size * readahead_ratio / 100);
+   if (ra_size < ra_min)
+   ra_size = ra_min;
if (!adjust_rala(ra_max, _size, _size))
return -1;
ra_set_class(ra, RA_CLASS_CONTEXT);

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/6] readahead: call scheme: remove get_readahead_bounds()

2007-01-05 Thread Fengguang Wu
Remove the one and only get_readahead_bounds() call.

Signed-off-by: Fengguang Wu <[EMAIL PROTECTED]>

---
 mm/readahead.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-2.6.20-rc3-mm1.orig/mm/readahead.c
+++ linux-2.6.20-rc3-mm1/mm/readahead.c
@@ -1572,7 +1572,6 @@ page_cache_readahead_adaptive(struct add
pgoff_t offset, unsigned long req_size)
 {
unsigned long ra_size;
-   unsigned long ra_min;
unsigned long ra_max;
int ret;
 
@@ -1593,7 +1592,7 @@ page_cache_readahead_adaptive(struct add
else if (offset)
ra_account(ra, RA_EVENT_CACHE_MISS, req_size);
 
-   get_readahead_bounds(ra, _min, _max);
+   ra_max = get_max_readahead(ra);
 
/* read-ahead disabled? */
if (unlikely(!ra_max || !readahead_ratio)) {
@@ -1633,7 +1632,7 @@ page_cache_readahead_adaptive(struct add
 * Context based sequential read-ahead.
 */
ret = try_context_based_readahead(mapping, ra, page,
-   offset, ra_min, ra_max);
+   offset, req_size, ra_max);
if (ret > 0)
return ra_submit(ra, mapping, filp);
if (ret < 0)

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] paravirt: isolate module ops

2007-01-05 Thread Ingo Molnar

* Rusty Russell <[EMAIL PROTECTED]> wrote:

> +EXPORT_SYMBOL(clts);
> +EXPORT_SYMBOL(read_cr0);
> +EXPORT_SYMBOL(write_cr0);

mark these a _GPL export. Perhaps even mark the symbol deprecated, to be 
unexported once we fix raid6.

> +EXPORT_SYMBOL(wbinvd);
> +EXPORT_SYMBOL(raw_safe_halt);
> +EXPORT_SYMBOL(halt);
> +EXPORT_SYMBOL_GPL(apic_write);
> +EXPORT_SYMBOL_GPL(apic_read);

these should be _GPL too. If any module uses it and breaks a user's box 
we need that big licensing hint to be able to debug them ...

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] paravirt: isolate module ops

2007-01-05 Thread Ingo Molnar

* Ingo Molnar <[EMAIL PROTECTED]> wrote:

> this doesnt do the most crutial step: the removal of the paravirt_ops 
> export. [...]

ah, you removed it already ... it hid at the very last line of the patch 
chunk. Good :)

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] paravirt: isolate module ops

2007-01-05 Thread Ingo Molnar

* Rusty Russell <[EMAIL PROTECTED]> wrote:

> diff -r 48f31ae5d7b5 arch/i386/kernel/paravirt.c
> --- a/arch/i386/kernel/paravirt.c Sat Jan 06 10:32:24 2007 +1100
> +++ b/arch/i386/kernel/paravirt.c Sat Jan 06 17:23:12 2007 +1100
> @@ -596,6 +596,154 @@ static int __init print_banner(void)
>   return 0;
>  }
>  core_initcall(print_banner);
> +
> +unsigned long paravirt_save_flags(void)
> +{
> + return paravirt_ops.save_fl();
> +}
> +EXPORT_SYMBOL(paravirt_save_flags);

ok, i like this one too - i agree that it's better than mine because it 
isolates on a per-API level not on a per-lowlevel-paravirt-op level. But 
this doesnt do the most crutial step: the removal of the paravirt_ops 
export. Without that the module build test is pointless.

btw., your patch does not apply to current -git - could you please 
rebase this patch to the head of your queue so that upstream can pick it 
up?

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 2.6.20-rc3] rtc-sa1100 correctly reports rtc_wkalrm.enabled

2007-01-05 Thread David Brownell
This fixes one bug in the SA-1100/PXA RTC support:  read_alarm()
isn't reporting whether the alarm is enabled.  This causes a small
regression, with procfs no longer reporting that state.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>

---
Note there are still bugs with how this driver handles this "enabled"
flag when it _sets_ alarms.  I'm told the hh.org tree already merged
this particular patch.

Index: at91/drivers/rtc/rtc-sa1100.c
===
--- at91.orig/drivers/rtc/rtc-sa1100.c  2006-12-18 23:32:22.0 -0800
+++ at91/drivers/rtc/rtc-sa1100.c   2006-12-19 00:09:46.0 -0800
@@ -263,8 +263,12 @@ static int sa1100_rtc_set_time(struct de
 
 static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 {
+   u32 rtsr;
+
memcpy(>time, _alarm, sizeof(struct rtc_time));
-   alrm->pending = RTSR & RTSR_AL ? 1 : 0;
+   rtsr = RTSR;
+   alrm->enabled = (rtsr & RTSR_ALE) ? 1 : 0;
+   alrm->pending = (rtsr & RTSR_AL) ? 1 : 0;
return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled

2007-01-05 Thread David Brownell
This fixes the SH rtc driver to
  (a) correctly report 'enabled' status with other alarm status;
  (b) not duplicate that status in its procfs dump

Signed-off-by: David Brownell <[EMAIL PROTECTED]>

---
An audit of the RTC driver treatment of the "enabled" flag turned
up a handful of clear bugs; most drivers handle it the same now
(assuming they support alarms).

This driver has another issue:  sh_rtc_set_alarm() ignores the
"enabled" flag, rather than using it to tell whether the alarm
should be enabled on exit from that routine.  One at a time.  :)

Index: at91/drivers/rtc/rtc-sh.c
===
--- at91.orig/drivers/rtc/rtc-sh.c  2006-12-18 23:32:22.0 -0800
+++ at91/drivers/rtc/rtc-sh.c   2006-12-18 23:34:37.0 -0800
@@ -264,8 +264,6 @@ static int sh_rtc_proc(struct device *de
unsigned int tmp;
 
tmp = readb(rtc->regbase + RCR1);
-   seq_printf(seq, "alarm_IRQ\t: %s\n",
-  (tmp & RCR1_AIE) ? "yes" : "no");
seq_printf(seq, "carry_IRQ\t: %s\n",
   (tmp & RCR1_CIE) ? "yes" : "no");
 
@@ -428,6 +426,8 @@ static int sh_rtc_read_alarm(struct devi
tm->tm_mon -= 1; /* RTC is 1-12, tm_mon is 0-11 */
tm->tm_year = 0x;
 
+   wkalrm->enabled = (readb(rtc->regbase + RCR1) & RCR1_AIE) ? 1 : 0;
+
spin_unlock_irq(>lock);
 
return 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kernel-doc: allow a little whitespace

2007-01-05 Thread Randy Dunlap
From: Randy Dunlap <[EMAIL PROTECTED]>

In kernel-doc syntax, be a little flexible:  allow whitespace between
a function parameter name and the colon that must follow it, such as:
@pdev : PCI device to unplug

(This allows lots of megaraid kernel-doc to work without tons of
editing.)

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 Documentation/kernel-doc-nano-HOWTO.txt |2 +-
 scripts/kernel-doc  |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2620-rc3g4.orig/scripts/kernel-doc
+++ linux-2620-rc3g4/scripts/kernel-doc
@@ -83,7 +83,7 @@ use strict;
 #  * my_function
 #  **/
 #
-# If the Description: header tag is ommitted, then there must be a blank line
+# If the Description: header tag is omitted, then there must be a blank line
 # after the last parameter specification.
 # e.g.
 # /**
@@ -265,7 +265,7 @@ my $doc_start = '^/\*\*\s*$'; # Allow wh
 my $doc_end = '\*/';
 my $doc_com = '\s*\*\s*';
 my $doc_decl = $doc_com.'(\w+)';
-my $doc_sect = $doc_com.'(['.$doc_special.']?[\w ]+):(.*)';
+my $doc_sect = $doc_com.'(['.$doc_special.']?[\w\s]+):(.*)';
 my $doc_content = $doc_com.'(.*)';
 my $doc_block = $doc_com.'DOC:\s*(.*)?';
 
--- linux-2620-rc3g4.orig/Documentation/kernel-doc-nano-HOWTO.txt
+++ linux-2620-rc3g4/Documentation/kernel-doc-nano-HOWTO.txt
@@ -101,7 +101,7 @@ The format of the block comment is like 
 
 /**
  * function_name(:)? (- short description)?
-(* @parameterx: (description of parameter x)?)*
+(* @parameterx(space)*: (description of parameter x)?)*
 (* a blank line)?
  * (Description:)? (Description of function)?
  * (section header: (section description)? )*


---
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] paravirt: isolate module ops

2007-01-05 Thread Rusty Russell
On Fri, 2007-01-05 at 16:31 -0800, Zachary Amsden wrote:
> Ingo Molnar wrote:
> > Subject: [patch] paravirt: isolate module ops
> > From: Ingo Molnar <[EMAIL PROTECTED]>
> >
> > only export those operations to modules that have been available to them 
> > historically: irq disable/enable, io-delay, udelay, etc.
> >
> > this isolates that functionality from other paravirtualization 
> > functionality that modules have no business messing with.
> >
> > boot and build tested with CONFIG_PARAVIRT=y.
> >
> > Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
> > ---
> >  arch/i386/kernel/paravirt.c |   41 +++
> >  include/asm-i386/delay.h|4 +-
> >  include/asm-i386/paravirt.h |   65 
> > ++--
> >  3 files changed, 75 insertions(+), 35 deletions(-)
> >
> > Index: linux/arch/i386/kernel/paravirt.c
> > ===
> > --- linux.orig/arch/i386/kernel/paravirt.c
> > +++ linux/arch/i386/kernel/paravirt.c
> > @@ -492,6 +492,7 @@ struct paravirt_ops paravirt_ops = {
> >  
> > .patch = native_patch,
> > .banner = default_banner,
> > +
> > .arch_setup = native_nop,
> > .memory_setup = machine_specific_memory_setup,
> > .get_wallclock = native_get_wallclock,
> > @@ -566,4 +567,42 @@ struct paravirt_ops paravirt_ops = {
> > .irq_enable_sysexit = native_irq_enable_sysexit,
> > .iret = native_iret,
> >  };
> > -EXPORT_SYMBOL(paravirt_ops);
> > +
> > +/*
> > + * These are exported to modules:
> > + */
> > +struct paravirt_ops paravirt_mod_ops = {
> > +   .name = "bare hardware",
> > +   .paravirt_enabled = 0,
> > +   .kernel_rpl = 0,
> > +
> > +   .patch = native_patch,
> >   
> 
> I don't think you want to leave that one... patching the kernel isn't 
> something modules should be doing.

Yeah, this patch is terrible, but I know why Ingo did it; it's my fault
for not finishing my version yesterday (but allmodconfig takes a while
to build and every change to paravirt.h rebuilds the universe...).

So here's my variant, compile-tested with "make allmodconfig".  Exports
individual functions, some of which can be reduced over time as the
modules involved are whacked into shape.

Note: it reduces the patching space by 1 byte (direct jumps vs indirect
jumps).  If this a problem for any paravirt_ops backend in practice, we
can add noops...

Cheers,
Rusty.
PS.  May break with other configurations...

Name: don't export paravirt_ops structure, do individual functions

Some of the more obscure ones are only used by one or two modules.
We can almost certainly reduce them with more work.

Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>

diff -r 48f31ae5d7b5 arch/i386/kernel/paravirt.c
--- a/arch/i386/kernel/paravirt.c   Sat Jan 06 10:32:24 2007 +1100
+++ b/arch/i386/kernel/paravirt.c   Sat Jan 06 17:23:12 2007 +1100
@@ -596,6 +596,154 @@ static int __init print_banner(void)
return 0;
 }
 core_initcall(print_banner);
+
+unsigned long paravirt_save_flags(void)
+{
+   return paravirt_ops.save_fl();
+}
+EXPORT_SYMBOL(paravirt_save_flags);
+
+void paravirt_restore_flags(unsigned long flags)
+{
+   paravirt_ops.restore_fl(flags);
+}
+EXPORT_SYMBOL(paravirt_restore_flags);
+
+void paravirt_irq_disable(void)
+{
+   paravirt_ops.irq_disable();
+}
+EXPORT_SYMBOL(paravirt_irq_disable);
+
+void paravirt_irq_enable(void)
+{
+   paravirt_ops.irq_enable();
+}
+EXPORT_SYMBOL(paravirt_irq_enable);
+
+void paravirt_io_delay(void)
+{
+   paravirt_ops.io_delay();
+}
+EXPORT_SYMBOL(paravirt_io_delay);
+
+void paravirt_const_udelay(unsigned long loops)
+{
+   paravirt_ops.const_udelay(loops);
+}
+EXPORT_SYMBOL(paravirt_const_udelay);
+
+u64 paravirt_read_msr(unsigned int msr, int *err)
+{
+   return paravirt_ops.read_msr(msr, err);
+}
+EXPORT_SYMBOL(paravirt_read_msr);
+
+int paravirt_write_msr(unsigned int msr, u64 val)
+{
+   return paravirt_ops.write_msr(msr, val);
+}
+EXPORT_SYMBOL(paravirt_write_msr);
+
+u64 paravirt_read_tsc(void)
+{
+   return paravirt_ops.read_tsc();
+}
+EXPORT_SYMBOL(paravirt_read_tsc);
+
+int paravirt_enabled(void)
+{
+   return paravirt_ops.paravirt_enabled;
+}
+EXPORT_SYMBOL(paravirt_enabled);
+
+void clts(void)
+{
+   paravirt_ops.clts();
+}
+EXPORT_SYMBOL(clts);
+
+unsigned long read_cr0(void)
+{
+   return paravirt_ops.read_cr0();
+}
+EXPORT_SYMBOL(read_cr0);
+
+void write_cr0(unsigned long cr0)
+{
+   paravirt_ops.write_cr0(cr0);
+}
+EXPORT_SYMBOL(write_cr0);
+
+void wbinvd(void)
+{
+   paravirt_ops.wbinvd();
+}
+EXPORT_SYMBOL(wbinvd);
+
+void raw_safe_halt(void)
+{
+   paravirt_ops.safe_halt();
+}
+EXPORT_SYMBOL(raw_safe_halt);
+
+void halt(void)
+{
+   paravirt_ops.safe_halt();
+}
+EXPORT_SYMBOL(halt);
+
+#ifdef CONFIG_X86_LOCAL_APIC
+void apic_write(unsigned long reg, unsigned long v)
+{
+   paravirt_ops.apic_write(reg,v);
+}
+EXPORT_SYMBOL_GPL(apic_write);
+
+unsigned long 

Re: [BUG 2.6.20-rc3-mm1] raid1 mount blocks for ever

2007-01-05 Thread Fengguang Wu
On Fri, Jan 05, 2007 at 07:59:11PM -0800, Andrew Morton wrote:
> On Sat, 6 Jan 2007 10:50:02 +0800
> Fengguang Wu <[EMAIL PROTECTED]> wrote:
> 
> > Jens: can this be a plugging issue?
> > 
> > The following command seems to block for ever:
> > # mount /home
> > 
> > It is an ext3 fs on top of /dev/md0, RAID1.
> 
> http://userweb.kernel.org/~akpm/2.6.20-rc3-mm1x.bz2 is basically 
> 2.6.20-rc3-mm1,
> minus git-block.patch.  Can you and Torsten please test that, see if the hangs
> go away?

Yes, now it mounts OK.
Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [ANNOUNCE] RAIF: Redundant Array of Independent Filesystems

2007-01-05 Thread Chaitanya Patti

> We are in the process of porting RAIF to 2.6.19 right now.  Should be done
> in early January.  The trick is that we are trying to keep the same source
> good for a wide range of kernel versions.  In fact, not too long ago we
> even were able to compile it for 2.4.24!
>
> Nikolai.

We now have RAIF for the 2.6.19 kernel available at:

ftp://ftp.fsl.cs.sunysb.edu/pub/raif/raif-1.1.tar.gz

This version is more stable but there are for sure still some remaining
bugs and we very much appreciate your feedback.

Thank you.

Chaitanya on behalf of the RAIF team.
Filesystems and Storage Laboratory
Stony Brook University
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] paravirt: isolate module ops

2007-01-05 Thread Rusty Russell
On Fri, 2007-01-05 at 18:07 -0800, Arjan van de Ven wrote:
> > 
> > I would suggest a slightly different carving.  For one, no TLB flushes.  
> > If you can't modify PTEs, why do you need to have TLB flushes?  And I 
> > would allow CR0 read / write for code which saves and restores FPU state 
> 
> no that is abstracted away by kernel_fpu_begin/end. Modules have no
> business doing that themselves

Sure, but it'll take some time to fix the raid modules (which are the
ones which abuse this).

I'm testing a patch now, I'll send the clts removal patch on top of that
once it's done.

Rusty.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: how to get serial_no from usb HD disk (HDIO_GET_IDENTITY ioctl, hdparm -i)

2007-01-05 Thread Greg KH
On Fri, Jan 05, 2007 at 12:27:34AM +0200, Yakov Lerner wrote:
> How can I get serial_no from usb-attached HD drive ?

use the *_id programs that come with udev, they show you how to properly
do that.

good luck,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Fix sparsemem on Cell (take 3)

2007-01-05 Thread John Rose
> I dropped this on the floor over Christmas.  This has had a few smoke
> tests on ppc64 and i386 and is ready for -mm.  Against 2.6.20-rc2-mm1.

Could this break ia64, given that it uses memmap_init_zone()?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] paravirt: isolate module ops

2007-01-05 Thread Zachary Amsden

Arjan van de Ven wrote:
I would suggest a slightly different carving.  For one, no TLB flushes.  
If you can't modify PTEs, why do you need to have TLB flushes?  And I 
would allow CR0 read / write for code which saves and restores FPU state 



no that is abstracted away by kernel_fpu_begin/end. Modules have no
business doing that themselves
  


As long as they don't rely on inlines for that... checking and 
kernel_fpu_end is inline and uses stts(), which requires CR0 read / 
write.  One can easily imagine binary modules which do use the fpu, and 
these were not broken before, so breaking them now seems the wrong thing 
to do.


I agree on debug registers - anything touching them is way too shady.  
And there is no reason modules should be doing raw page table 
operations, they should use proper mm functions and leave the page 
details to the mm layer, which doesn't do these things inline.


Basically, it is just the things that do get inlined that I think we 
should worry about.  If you all feel strongly that this should be fixed 
in 2.6.20, perhaps the best thing to do is in fact 
EXPORT_SYMBOL_GPL(paravirt_ops), and we can queue up a patch in -mm 
which will export those paravirt_ops required inline by modules for 
2.6.21.  Otherwise, I think there will be too many rejects against the 
paravirt code in Andrew's tree.


Zach
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: BUG: warning at mm/truncate.c:60/cancel_dirty_page()

2007-01-05 Thread Sami Farin
On Sat, Jan 06, 2007 at 04:39:07 +0200, Sami Farin wrote:
> Linux 2.6.19.1 SMP [2] on Pentium D...
> I was running dt-15.14 [2] and I ran
> "cinfo datafile" (it does mincore()).
> Well it went OK but when I ran "strace cinfo datafile"...:
> 04:18:48.062466 mincore(0x37f1f000, 2147266560, 

Forgot to do "git-whatchanged mm/mincore.c"...
Looks like git and 2.6.19.2 review patch include a fix for mincore.
Maybe it fixes this issue.

-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Sony Vaio VGN-SZ340 (was Re: sonypc with Sony Vaio VGN-SZ1VP)

2007-01-05 Thread Bjorn Helgaas
On Friday 05 January 2007 11:10, Len Brown wrote:
> On Friday 05 January 2007 12:24, MoRpHeUz wrote:
> > > What workaround are you using?
> > 
> >  This one: http://bugzilla.kernel.org/show_bug.cgi?id=7465
> 
> Ah yes, the duplicate MADT issue is clearly a BIOS bug.
> It is possible that we can tweak our Linux workaround for it to be more
> Microsoft Windows Bug Compatbile(TM).

Maybe Windows discovers processors using the namespace rather
than the MADT.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: RTC subsystem and fractions of seconds

2007-01-05 Thread David Brownell
>   Those rtc's actually have a 1/100th of second
> register.  Should the generic rtc interface not support that?

Are you implying a new userspace API, or just an in-kernel update?

Either way, that raises the question of what other features should
be included.  What sub-second precision?  Multiple alarms?  Ways
to manage output clocks?  Sub-HZ periodic alarms?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 2.6.20-rc3 1/3] rtc-cmos driver

2007-01-05 Thread David Brownell
On Friday 05 January 2007 7:10 pm, David Brownell wrote:
> On Friday 05 January 2007 12:45 pm, Alessandro Zummo wrote:

> >  I'd appreciate if someone (Woody?) can test
> >  this code on ARM.
> 
> There are PPC, M68K, SPARC, and other boards that could also
> use this; ARMs tend to integrate some other RTC on-chip.  But
> on whatever non-PC platform is involved in such sanity testing,
> that involves adding a platform_device to board setup code.

Let me put that differently.  That should be done as a separate
patch, adding (a) that platform_device, and maybe platform_data
if it's got additional alarm registers, and (b) Kconfig support
to let that work.  I'd call it a "patch #4 of 3".  ;)

The current Kconfig uses:

> +config RTC_DRV_CMOS
> +   tristate "CMOS real time clock"
> +   depends on RTC_CLASS && (X86_PC || ACPI)

Eventually maybe the PC-or-ACPI stuff should vanish, but IMO
not until this code has been used on a few other platforms.

- Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG 2.6.20-rc3-mm1] raid1 mount blocks for ever

2007-01-05 Thread Andrew Morton
On Sat, 6 Jan 2007 10:50:02 +0800
Fengguang Wu <[EMAIL PROTECTED]> wrote:

> Jens: can this be a plugging issue?
> 
> The following command seems to block for ever:
> # mount /home
> 
> It is an ext3 fs on top of /dev/md0, RAID1.

http://userweb.kernel.org/~akpm/2.6.20-rc3-mm1x.bz2 is basically 2.6.20-rc3-mm1,
minus git-block.patch.  Can you and Torsten please test that, see if the hangs
go away?

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


BUG: warning at mm/truncate.c:60/cancel_dirty_page()

2007-01-05 Thread Sami Farin
Linux 2.6.19.1 SMP [2] on Pentium D...
I was running dt-15.14 [2] and I ran
"cinfo datafile" (it does mincore()).
Well it went OK but when I ran "strace cinfo datafile"...:
04:18:48.062466 mincore(0x37f1f000, 2147266560, 
...
2007-01-06 04:19:03.788181500 <4>BUG: warning at 
mm/truncate.c:60/cancel_dirty_page()
2007-01-06 04:19:03.788221500 <4> [] dump_trace+0x215/0x21a
2007-01-06 04:19:03.788223500 <4> [] show_trace_log_lvl+0x1a/0x30
2007-01-06 04:19:03.788224500 <4> [] show_trace+0x12/0x14
2007-01-06 04:19:03.788225500 <4> [] dump_stack+0x19/0x1b
2007-01-06 04:19:03.788227500 <4> [] cancel_dirty_page+0x7e/0x80
2007-01-06 04:19:03.788228500 <4> [] truncate_complete_page+0x1a/0x47
2007-01-06 04:19:03.788229500 <4> [] 
truncate_inode_pages_range+0x114/0x2ae
2007-01-06 04:19:03.788245500 <4> [] truncate_inode_pages+0x1a/0x1c
2007-01-06 04:19:03.788247500 <4> [] fs_flushinval_pages+0x40/0x77
2007-01-06 04:19:03.788248500 <4> [] xfs_write+0x8c4/0xb68
2007-01-06 04:19:03.788250500 <4> [] xfs_file_aio_write+0x7e/0x95
2007-01-06 04:19:03.788251500 <4> [] do_sync_write+0xca/0x119
2007-01-06 04:19:03.788265500 <4> [] vfs_write+0x187/0x18c
2007-01-06 04:19:03.788267500 <4> [] sys_write+0x3d/0x64
2007-01-06 04:19:03.788268500 <4> [] syscall_call+0x7/0xb
2007-01-06 04:19:03.788269500 <4> [<001cf410>] 0x1cf410
2007-01-06 04:19:03.788289500 <4> ===

funny that when stracing, mincore does not return?

$ time cinfo dtfile-2091
dtfile-2091: 524285 pages, 0 pages cached (0.00%)

real0m0.049s
user0m0.003s
sys 0m0.046s

safari6941 29.9 10.8 2098768 108788 pts/2  D+   04:20   3:41 strace -vfttT 
cinfo dtfile-2091

straceD C179A000 0  6941   8737  6942  2089 (NOTLB)
   e790 0046 c172e240 c179a000 c1731880 c17c51a0 c17b5be0 c1771c20
   e9b1f740 0086 d55dd74c e76c  c02666b8 c17fd700 c2c2513c
   fdac b2203610 616f c2c25030 c17fd700 e7f8 c17d31f0 e79c
Call Trace:
 [] io_schedule+0x26/0x30
 [] sync_page+0x3d/0x48
 [] __wait_on_bit_lock+0x45/0x67
 [] __lock_page+0x88/0x95
 [] filemap_nopage+0x1f4/0x386
 [] do_no_page+0x82/0x2fa
 [] __handle_mm_fault+0x1fe/0x2eb
 [] get_user_pages+0xc7/0x2e5
 [] access_process_vm+0x74/0x116
 [] arch_ptrace+0x388/0x539
 [] sys_ptrace+0x58/0xb9
 [] syscall_call+0x7/0xb
 [<0081e410>] 0x81e410
 ===
cinfo t CB7DA040 0  6942   6941 (NOTLB)
   e5fcdee8 0046 ce7d9284 cb7da040 ce7d9284 cb7da078 cb7da040 e5fcdf10
   cb7da040 13a973f5 60e3 0078  c2c25030 c1805700 d483013c
   0021fd53 13a97513 60e3 d4830030 e5fcdf04 0005  e5fcdefc
Call Trace:
 [] ptrace_stop+0xf8/0x17f
 [] ptrace_notify+0x6a/0x92
 [] do_syscall_trace+0xd4/0x1eb
 [] syscall_exit_work+0x16/0x1b
 [<00878410>] 0x878410
 ===


[1]
includes these
8c08540f8755c451d8b96ea14cfe796bc3cd712d [PATCH] clean up 
__set_page_dirty_nobuffers()
55e829af06681e5d731c03ba04febbd1c76ca293 [PATCH] io-accounting: write 
accounting
e08748ce01e02f0ec154b141f392ccb9555333f4 [PATCH] io-accounting: 
write-cancel accounting
fba2591bf4e418b6c3f9f8794c9dd8fe40ae7bd9 VM: Remove 
"clear_page_dirty()" and "test_clear_page_dirty()" functions
3e67c0987d7567ad41164a153dca9a43b11d [PATCH] truncate: clear page 
dirtiness before running try_to_free_buffers()
5f2a105d5e33a038a717995d2738434f9c25aed2 [PATCH] truncate: dirty memory 
accounting fix
8368e328dfe1c534957051333a87b3210a12743b Clean up and export 
cancel_dirty_page() to modules
7658cc289288b8ae7dd2c2224549a048431222b3 VM: Fix nasty and subtle race 
in shared mmap'ed page writeback
7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2 [PATCH] io-accounting: core 
statistics
cb876f451455b6187a7d69de2c112c45ec4b7f99 Fix up CIFS for 
"test_clear_page_dirty()" removal
7dfb71030f7636a0d65200158113c37764552f93 [PATCH] Add 
include/linux/freezer.h and move definitions from sched.h
46d2277c796f9f4937bfa668c40b2e3f43e93dd0 Clean up and make 
try_to_free_buffers() not race with dirty 
e61c90188b9956edae1105eef361d8981a352fcd [PATCH] optimize o_direct on 
block devices
5fcf7bb73f66cc1c4ad90788b0f367c4d6852b75 [PATCH] 
read_zero_pagealigned() locking fix
ffaa82008f1aad52a6d3979f49d2a76c2928b60f Fix reiserfs after 
"test_clear_page_dirty()" removal
d0e671a932cb9c653b27393cec26aec012a8d97e [PATCH] Fix JFS after 
clear_page_dirty() removal
9280f6822c2d7112b47107251fce307aefb31f35 [PATCH] fuse: remove 
clear_page_dirty() call
921320210bd2ec4f17053d283355b73048ac0e56 [PATCH] Fix XFS after 
clear_page_dirty() removal

[2]
dt pattern=iot incr=variable records=32768 lbs=65536 bs=65536 of=dtfile 
log=dtfile.log.direct.random passes=1 procs=2 iotype=random flags=direct
http://home.comcast.net/~SCSIguy/SCSI_FAQ/RMiller_Tools/ftp/dt/dt-source.tar.gz

-- 
-
To unsubscribe from this list: send the 

Re: [PATCH] romsignature/checksum cleanup

2007-01-05 Thread Rene Herman

Jeremy Fitzhardinge wrote:


Well, in the Xen case, where the pages are simply not mapped, then
the signature simply won't exist.  In other cases, I guess its
possible the signature might exist but the rest of the ROM doesn't,
but that won't happen on normal hardware.


In your opinion, is the attached (versus 2.6.20-rc3) better? This uses 
probe_kernel_address() for all accesses. Or rather, an expanded version 
thereof. The set_fs() and pagefault_{disable,enable} calls are only done 
once in probe_roms().


Accessing the length byte at rom[2] with __get_user() is overkill after 
just checking the signature at 0 and 1 but direcly accessing only that 
makes for inconsistent code IMO. It's only a .fixup entry...


I can't say I'm all that sure that that pagefault_disable() call is 
still applicable now that it got expanded into the probe_roms() stage?


Rene.

commit f153a588097c08cefdb799f22123192a9975d273
Author: Rene Herman <[EMAIL PROTECTED]>
Date:   Sat Jan 6 04:09:32 2007 +0100

Use __get_user() for ISA ROM accesses.

In virtualized environments, the ISA ROMs may not be mapped so be careful
about touching them.

Signed-off-by: Rene Herman <[EMAIL PROTECTED]>

diff --git a/arch/i386/kernel/e820.c b/arch/i386/kernel/e820.c
index f391abc..8b54f65 100644
--- a/arch/i386/kernel/e820.c
+++ b/arch/i386/kernel/e820.c
@@ -156,29 +156,34 @@ static struct resource standard_io_resou
.flags  = IORESOURCE_BUSY | IORESOURCE_IO
 } };
 
-static int romsignature(const unsigned char *x)
+#define ROM_SIG 0xaa55
+
+static int __init romsignature(const unsigned char *rom)
 {
unsigned short sig;
-   int ret = 0;
-   if (probe_kernel_address((const unsigned short *)x, sig) == 0)
-   ret = (sig == 0xaa55);
-   return ret;
+   
+   return !__get_user(sig, (const unsigned short *)rom) && sig == ROM_SIG;
 }
 
-static int __init romchecksum(unsigned char *rom, unsigned long length)
+static int __init romchecksum(const unsigned char *rom, unsigned long length)
 {
-   unsigned char *p, sum = 0;
+   unsigned char sum, c;
 
-   for (p = rom; p < rom + length; p++)
-   sum += *p;
-   return sum == 0;
+   for (sum = 0; length && !__get_user(c, rom); rom++, length--)
+   sum += c;
+   return !length && !sum;
 }
 
 static void __init probe_roms(void)
 {
+   const unsigned char *rom;
unsigned long start, length, upper;
-   unsigned char *rom;
-   int   i;
+   unsigned char c;
+   int i;
+   mm_segment_t old_fs = get_fs();
+
+   set_fs(KERNEL_DS);
+   pagefault_disable();
 
/* video rom */
upper = adapter_rom_resources[0].start;
@@ -189,8 +194,11 @@ static void __init probe_roms(void)
 
video_rom_resource.start = start;
 
+   if (__get_user(c, rom + 2))
+   continue;
+
/* 0 < length <= 0x7f * 512, historically */
-   length = rom[2] * 512;
+   length = c * 512;
 
/* if checksum okay, trust length byte */
if (length && romchecksum(rom, length))
@@ -224,8 +232,11 @@ static void __init probe_roms(void)
if (!romsignature(rom))
continue;
 
+   if (__get_user(c, rom + 2))
+   continue;
+
/* 0 < length <= 0x7f * 512, historically */
-   length = rom[2] * 512;
+   length = c * 512;
 
/* but accept any length that fits if checksum okay */
if (!length || start + length > upper || !romchecksum(rom, 
length))
@@ -237,6 +248,9 @@ static void __init probe_roms(void)
 
start = adapter_rom_resources[i++].end & ~2047UL;
}
+
+   pagefault_enable();
+   set_fs(old_fs);
 }
 
 /*


Re: [PATCH] qconf: fix SIGSEGV on empty menu items

2007-01-05 Thread Roman Zippel
Hi,

On Thu, 4 Jan 2007, Cyrill V. Gorcunov wrote:

> qconf may cause SIGSEGV by trying to show debug
> information on empty menu items

Thanks, but this is more complex than necessary.
It simply lacks some initializers.

bye, Roman

Signed-off-by: Roman Zippel <[EMAIL PROTECTED]>

---
Index: linux-2.6/scripts/kconfig/qconf.cc
===
--- linux-2.6.orig/scripts/kconfig/qconf.cc 2007-01-05 01:47:54.0 
+0100
+++ linux-2.6/scripts/kconfig/qconf.cc  2007-01-05 01:56:54.0 +0100
@@ -915,7 +915,7 @@ void ConfigView::updateListAll(void)
 }
 
 ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
-   : Parent(parent, name), menu(0)
+   : Parent(parent, name), menu(0), sym(0)
 {
if (name) {
configSettings->beginGroup(name);
@@ -951,6 +951,7 @@ void ConfigInfoView::setInfo(struct menu
if (menu == m)
return;
menu = m;
+   sym = NULL;
if (!menu)
clear();
else
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.20-rc3] qconf Search Dialog

2007-01-05 Thread Roman Zippel
On Friday 05 January 2007 11:44, Shlomi Fish wrote:

> > I would prefer it as separate smaller steps.
> > So one patch where you move the dialog and another where you improve
> > the search dialog.
>
> Move the dialog from where, to where, and in what respect?

Move the Find entry to a separate menu and then add improvements on top of the 
current find infrastructure and please don't just change the current 
behaviour, give the user a choice.

bye, Roman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 2.6.20-rc3 1/3] rtc-cmos driver

2007-01-05 Thread David Brownell
On Friday 05 January 2007 12:45 pm, Alessandro Zummo wrote:
> On Fri, 5 Jan 2007 10:01:57 -0800
> David Brownell <[EMAIL PROTECTED]> wrote:
> 
> > This is an "RTC framework" driver for the "CMOS" RTCs which are standard
> > on PCs and some other platforms.  That's MC146818 compatible silicon.
> > Advantages of this vs. drivers/char/rtc.c (use one _or_ the other, only
> > one will be able to claim the RTC irq) include:
> 
>  Hi David,
> 
>   good code and well commented, thank you.

Glad to hear it!
  
>  I only have some comments:
>
>  - I would put anything that is x86 related (pnp,acpi)
>  in a separate file so that people working on
>  non x86 systems can have a better grasp of the driver.

I believe that splitting this driver into multiple files
would create more confusion confusion than it solves.  Bus
glue is actually a very small part of the code, and it's
cleanly split out.  So I'm not keen on this change at all.

And having done a grep of the source tree, splitting out PNP
bus glue (and platform bus glue?) into a separate file isn't
common.  IDE does, and 8250; both cases with a *very* complex
core, shared with many drivers.  But the normal case #ifdefs
PNP support, combining it with alternative bus glue which is
all too often nasty legacy "probe the hardware" logic.

(Also:  there are no longer any ACPI calls in this driver; and
do recall that at least ia64 uses ACPI too.  So _none_ of that
code is x86-specific...)


>  - the name should be rtc-mc146818 to be coherent with
>  the other drivers, but this can cause confusion.

Yes, I used the "rtc-cmos" name to minimize confusion.  It's a
generic name; I've even seen multiple books, including some
southbridge docs, talking about "CMOS RTC" or "CMOS clock".

"MC146818" is easy to mistype, hard to say, obsolete (!), and
virtually unused in most technical contexts.  But "cmos clock"
is widely understood, at least in PC-derived contexts, and
make sense talking about most any southbridge.

I guess I'm surprised you called rtc-m48t86 that, instead of
using the name rtc-mc146818 (since ST markets that M48 chip
as a replacement for the mc146818)... :)

I'm not deeply attached to this name, but I couldn't come up
with a better generic name.


>  - please put yourself in MODULE_AUTHOR

OK.  Appended.


>  other than that, I'm fine with the code.
> 
>  I'd appreciate if someone (Woody?) can test
>  this code on ARM.

There are PPC, M68K, SPARC, and other boards that could also
use this; ARMs tend to integrate some other RTC on-chip.  But
on whatever non-PC platform is involved in such sanity testing,
that involves adding a platform_device to board setup code.

- Dave

==  CUT HERE
This is an "RTC framework" driver for the "CMOS" RTCs which are standard
on PCs and some other platforms.  That's MC146818 compatible silicon.
Advantages of this vs. drivers/char/rtc.c (use one _or_ the other, only
one will be able to claim the RTC irq) include:

 - This leverages both the new RTC framework and the driver model; both
   PNPACPI and platform device modes are supported.  (A separate patch
   creates a platform device on PCs where PNPACPI isn't configured.)

 - It supports common extensions like longer alarms.  (A separate patch
   exports that information from ACPI through platform_data.)

 - Likewise, system wakeup events use "real driver model support", with
   policy control via sysfs "wakeup" attributes and and using normal rtc
   ioctls to manage wakeup.  (Patch in the works.  The ACPI hooks are
   known; /proc/acpi/alarm can vanish.  Making it work with EFI will
   be a minor challenge to someone with e.g. a MiniMac.)

It's not yet been tested on non-x86 systems, without ACPI, or with HPET.
And the RTC framework will surely have teething pains on "mainstream"
PC-based systems (though must embedded Linux systems use it heavily),
not limited to sorting out the "/dev/rtc0" issue (udev easily tweaked).
Also, the ALSA rtctimer code doesn't use the new RTC API.

Otherwise, this should be a no-known-regressions replacement for the
old drivers/char/rtc.c driver, and should help the non-embedded distros
(and the new timekeeping code) start to switch to the framework.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>

---
Note also that any systems using "rtc-m48t86" are candidates to switch over
to this more functional driver; the platform data is different, and the way
bytes are read is different, but otherwise those chips should be compatible.

 drivers/rtc/Kconfig |   13 
 drivers/rtc/Makefile|1 
 drivers/rtc/rtc-cmos.c  |  718 
 include/linux/mc146818rtc.h |   10 
 4 files changed, 742 insertions(+)

Index: g26/drivers/rtc/Kconfig
===
--- g26.orig/drivers/rtc/Kconfig2007-01-02 19:24:32.0 -0800
+++ g26/drivers/rtc/Kconfig 2007-01-02 23:35:41.0 -0800
@@ -95,6 +95,19 @@ config RTC_INTF_DEV_UIE_EMUL
 

[BUG 2.6.20-rc3-mm1] raid1 mount blocks for ever

2007-01-05 Thread Fengguang Wu
Jens: can this be a plugging issue?

The following command seems to block for ever:
# mount /home

It is an ext3 fs on top of /dev/md0, RAID1.

The call trace is:

 mount D 00210a34f3b6  5488  5574    (NOTLB)
  8100799718c8 0046  0286
   0286 81007dc67220 0020
  0008 810037c42040 813a74e0 1441
 Call Trace:
  [] getnstimeofday+0x3a/0xa0
  [] io_schedule+0x98/0xd0
  [] sleep_on_buffer+0x9/0x10
  [] __wait_on_bit+0x45/0x80
  [] sleep_on_buffer+0x0/0x10
  [] sleep_on_buffer+0x0/0x10
  [] out_of_line_wait_on_bit+0x78/0x90
  [] wake_bit_function+0x0/0x40
  [] __wait_on_buffer+0x20/0x30
  [] sync_dirty_buffer+0xad/0xf0
  [] ext3_commit_super+0x6a/0x80
  [] ext3_setup_super+0x106/0x1c0
  [] d_instantiate+0x9e/0xb0
  [] ext3_fill_super+0x12f4/0x1650
  [] get_sb_bdev+0x117/0x180
  [] ext3_fill_super+0x0/0x1650
  [] ext3_get_sb+0x13/0x20
  [] vfs_kern_mount+0xc0/0x160
  [] do_kern_mount+0x4a/0x70
  [] do_mount+0x73e/0x7c0
  [] _read_unlock_irq+0x2b/0x40
  [] bad_range+0x1f/0x80
  [] get_page_from_freelist+0x307/0x600
  [] __up_read+0x8b/0xa0
  [] __alloc_pages+0x75/0x320
  [] alloc_pages_current+0xb9/0xd0
  [] sys_mount+0x94/0xf0
  [] trace_hardirqs_on_thunk+0x35/0x37
  [] system_call+0x7e/0x83
 

My precious data!
After that, the system just refuses to shutdown or sync:

 shutdown  D 004f59251224  4880  5622   5576 (NOTLB)
  8100796cfe78 0046  8104d0c2
   0246  0246
  0006 810079082080 813a74e0 545a
 Call Trace:
  [] pagevec_lookup_tag+0x22/0x30
  [] __down_read+0x95/0xb4
  [] down_read+0x41/0x50
  [] __sync_inodes+0x78/0x120
  [] background_writeout+0x0/0xd0
  [] sync_inodes+0x21/0x50
  [] do_sync+0x1a/0x60
  [] sys_sync+0xe/0x20
  [] system_call+0x7e/0x83
 
 sync  D 0061fa86adc8  5680  5649   5624 (NOTLB)
  8100789abe78 0046  8104d0c2
   0246  0246
  0008 81007842e0c0 813a74e0 2b68
 Call Trace:
  [] pagevec_lookup_tag+0x22/0x30
  [] __down_read+0x95/0xb4
  [] down_read+0x41/0x50
  [] __sync_inodes+0x78/0x120
  [] background_writeout+0x0/0xd0
  [] sync_inodes+0x21/0x50
  [] do_sync+0x1a/0x60
  [] sys_sync+0xe/0x20
  [] system_call+0x7e/0x83
 
 
 Showing all locks held in the system:
 2 locks held by init/1:
  #0:  (tty_mutex){--..}, at: [] mutex_lock+0x25/0x30
  #1:  (_inode_imutex_key){--..}, at: [] 
mutex_lock+0x25/0x30
 
Thanks,
Wu
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.20-rc3-mm1
# Fri Jan  5 22:15:34 2007
#
CONFIG_X86_64=y
CONFIG_64BIT=y
CONFIG_X86=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_ZONE_DMA32=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_X86_CMPXCHG=y
CONFIG_EARLY_PRINTK=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_DMI=y
CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32

#
# General setup
#
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SWAP=y
CONFIG_SWAP_PREFETCH=y
CONFIG_SYSVIPC=y
CONFIG_IPC_NS=y
CONFIG_POSIX_MQUEUE=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
# CONFIG_UTS_NS is not set
CONFIG_USER_NS=y
CONFIG_AUDIT=y
# CONFIG_AUDITSYSCALL is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_CPUSETS=y
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_SYSCTL=y
CONFIG_EMBEDDED=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SHMEM=y
CONFIG_SLAB=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
# CONFIG_SLOB is not set

#
# Loadable module support
#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=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=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=m
CONFIG_IOSCHED_DEADLINE=m

[patch 07/50] DVB: lgdt330x: fix signal / lock status detection bug

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Michael Krufky <[EMAIL PROTECTED]>

In some cases when using VSB, the AGC status register has been known to
falsely report "no signal" when in fact there is a carrier lock.  The
datasheet labels these status flags as QAM only, yet the lgdt330x
module is using these flags for both QAM and VSB.

This patch allows for the carrier recovery lock status register to be
tested, even if the agc signal status register falsely reports no signal.

Thanks to jcrews from #linuxtv in irc, for initially reporting this bug.

Signed-off-by: Michael Krufky <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>

---

 drivers/media/dvb/frontends/lgdt330x.c |6 --
 1 file changed, 6 deletions(-)

--- linux-2.6.19.1.orig/drivers/media/dvb/frontends/lgdt330x.c
+++ linux-2.6.19.1/drivers/media/dvb/frontends/lgdt330x.c
@@ -435,9 +435,6 @@ static int lgdt3302_read_status(struct d
/* Test signal does not exist flag */
/* as well as the AGC lock flag.   */
*status |= FE_HAS_SIGNAL;
-   } else {
-   /* Without a signal all other status bits are meaningless */
-   return 0;
}
 
/*
@@ -500,9 +497,6 @@ static int lgdt3303_read_status(struct d
/* Test input signal does not exist flag */
/* as well as the AGC lock flag.   */
*status |= FE_HAS_SIGNAL;
-   } else {
-   /* Without a signal all other status bits are meaningless */
-   return 0;
}
 
/* Carrier Recovery Lock Status Register */

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 14/50] sched: remove __cpuinitdata anotation to cpu_isolated_map

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Tim Chen <[EMAIL PROTECTED]>

The structure cpu_isolated_map is used not only during initialization. 
Multi-core scheduler configuration changes and exclusive cpusets 
use this during run time.  During setting of sched_mc_power_savings
 policy, this structure is accessed to update sched_domains.

Signed-off-by: Tim Chen <[EMAIL PROTECTED]>
Acked-by: Suresh Siddha <[EMAIL PROTECTED]>
Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 kernel/sched.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/kernel/sched.c
+++ linux-2.6.19.1/kernel/sched.c
@@ -5493,7 +5493,7 @@ static void cpu_attach_domain(struct sch
 }
 
 /* cpus with isolated domains */
-static cpumask_t __cpuinitdata cpu_isolated_map = CPU_MASK_NONE;
+static cpumask_t cpu_isolated_map = CPU_MASK_NONE;
 
 /* Setup the mask of cpus configured for isolated domains */
 static int __init isolated_cpu_setup(char *str)

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 16/50] SCSI: add missing cdb clearing in scsi_execute()

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Tejun Heo <[EMAIL PROTECTED]>

Clear-garbage-after-CDB patch missed scsi_execute() and it causes some
ODDs (HL-DT-ST DVD-RAM GSA-H30N) choke during SCSI scan.  Note that
this patch is only for -stable.  There is another more reliable fix
for this problem proposed for devel tree.

http://thread.gmane.org/gmane.linux.ide/14605/focus=14605

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Jens Axboe <[EMAIL PROTECTED]>
Cc: Douglas Gilbert <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>

---
 drivers/scsi/scsi_lib.c |1 +
 1 file changed, 1 insertion(+)

--- linux-2.6.19.1.orig/drivers/scsi/scsi_lib.c
+++ linux-2.6.19.1/drivers/scsi/scsi_lib.c
@@ -191,6 +191,7 @@ int scsi_execute(struct scsi_device *sde
goto out;
 
req->cmd_len = COMMAND_SIZE(cmd[0]);
+   memset(req->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
memcpy(req->cmd, cmd, req->cmd_len);
req->sense = sense;
req->sense_len = 0;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 26/50] ramfs breaks without CONFIG_BLOCK

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Dimitri Gorokhovik <[EMAIL PROTECTED]>

ramfs doesn't provide the .set_dirty_page a_op, and when the BLOCK layer is
not configured in, 'set_page_dirty' makes a call via a NULL pointer.

Signed-off-by: Dimitri Gorokhovik <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 fs/ramfs/file-mmu.c   |4 +++-
 fs/ramfs/file-nommu.c |4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

--- linux-2.6.19.1.orig/fs/ramfs/file-mmu.c
+++ linux-2.6.19.1/fs/ramfs/file-mmu.c
@@ -25,11 +25,13 @@
  */
 
 #include 
+#include 
 
 const struct address_space_operations ramfs_aops = {
.readpage   = simple_readpage,
.prepare_write  = simple_prepare_write,
-   .commit_write   = simple_commit_write
+   .commit_write   = simple_commit_write,
+   .set_page_dirty = __set_page_dirty_nobuffers,
 };
 
 const struct file_operations ramfs_file_operations = {
--- linux-2.6.19.1.orig/fs/ramfs/file-nommu.c
+++ linux-2.6.19.1/fs/ramfs/file-nommu.c
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -30,7 +31,8 @@ static int ramfs_nommu_setattr(struct de
 const struct address_space_operations ramfs_aops = {
.readpage   = simple_readpage,
.prepare_write  = simple_prepare_write,
-   .commit_write   = simple_commit_write
+   .commit_write   = simple_commit_write,
+   .set_page_dirty = __set_page_dirty_nobuffers,
 };
 
 const struct file_operations ramfs_file_operations = {

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 34/50] SPARC64: Fix "mem=xxx" handling.

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: David Miller <[EMAIL PROTECTED]>

We were not being careful enough.  When we trim the physical
memory areas, we have to make sure we don't remove the kernel
image or initial ramdisk image ranges.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>

---
 arch/sparc64/mm/init.c |  147 +
 1 file changed, 124 insertions(+), 23 deletions(-)

--- linux-2.6.19.1.orig/arch/sparc64/mm/init.c
+++ linux-2.6.19.1/arch/sparc64/mm/init.c
@@ -872,6 +872,115 @@ static unsigned long __init choose_bootm
prom_halt();
 }
 
+static void __init trim_pavail(unsigned long *cur_size_p,
+  unsigned long *end_of_phys_p)
+{
+   unsigned long to_trim = *cur_size_p - cmdline_memory_size;
+   unsigned long avoid_start, avoid_end;
+   int i;
+
+   to_trim = PAGE_ALIGN(to_trim);
+
+   avoid_start = avoid_end = 0;
+#ifdef CONFIG_BLK_DEV_INITRD
+   avoid_start = initrd_start;
+   avoid_end = PAGE_ALIGN(initrd_end);
+#endif
+
+   /* Trim some pavail[] entries in order to satisfy the
+* requested "mem=xxx" kernel command line specification.
+*
+* We must not trim off the kernel image area nor the
+* initial ramdisk range (if any).  Also, we must not trim
+* any pavail[] entry down to zero in order to preserve
+* the invariant that all pavail[] entries have a non-zero
+* size which is assumed by all of the code in here.
+*/
+   for (i = 0; i < pavail_ents; i++) {
+   unsigned long start, end, kern_end;
+   unsigned long trim_low, trim_high, n;
+
+   kern_end = PAGE_ALIGN(kern_base + kern_size);
+
+   trim_low = start = pavail[i].phys_addr;
+   trim_high = end = start + pavail[i].reg_size;
+
+   if (kern_base >= start &&
+   kern_base < end) {
+   trim_low = kern_base;
+   if (kern_end >= end)
+   continue;
+   }
+   if (kern_end >= start &&
+   kern_end < end) {
+   trim_high = kern_end;
+   }
+   if (avoid_start &&
+   avoid_start >= start &&
+   avoid_start < end) {
+   if (trim_low > avoid_start)
+   trim_low = avoid_start;
+   if (avoid_end >= end)
+   continue;
+   }
+   if (avoid_end &&
+   avoid_end >= start &&
+   avoid_end < end) {
+   if (trim_high < avoid_end)
+   trim_high = avoid_end;
+   }
+
+   if (trim_high <= trim_low)
+   continue;
+
+   if (trim_low == start && trim_high == end) {
+   /* Whole chunk is available for trimming.
+* Trim all except one page, in order to keep
+* entry non-empty.
+*/
+   n = (end - start) - PAGE_SIZE;
+   if (n > to_trim)
+   n = to_trim;
+
+   if (n) {
+   pavail[i].phys_addr += n;
+   pavail[i].reg_size -= n;
+   to_trim -= n;
+   }
+   } else {
+   n = (trim_low - start);
+   if (n > to_trim)
+   n = to_trim;
+
+   if (n) {
+   pavail[i].phys_addr += n;
+   pavail[i].reg_size -= n;
+   to_trim -= n;
+   }
+   if (to_trim) {
+   n = end - trim_high;
+   if (n > to_trim)
+   n = to_trim;
+   if (n) {
+   pavail[i].reg_size -= n;
+   to_trim -= n;
+   }
+   }
+   }
+
+   if (!to_trim)
+   break;
+   }
+
+   /* Recalculate.  */
+   *cur_size_p = 0UL;
+   for (i = 0; i < pavail_ents; i++) {
+   *end_of_phys_p = pavail[i].phys_addr +
+   pavail[i].reg_size;
+   *cur_size_p += pavail[i].reg_size;
+   }
+}
+
 static unsigned long __init bootmem_init(unsigned long *pages_avail,
 unsigned long phys_base)
 {
@@ -889,31 +998,13 @@ static unsigned long __init bootmem_init
  

[patch 27/50] Buglet in vmscan.c

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Shantanu Goel <[EMAIL PROTECTED]>

Fix a rather obvious buglet.  Noticed while instrumenting the VM using
/proc/vmstat.

Cc: Christoph Lameter <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 mm/vmscan.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/mm/vmscan.c
+++ linux-2.6.19.1/mm/vmscan.c
@@ -691,7 +691,7 @@ static unsigned long shrink_inactive_lis
__count_vm_events(KSWAPD_STEAL, nr_freed);
} else
__count_zone_vm_events(PGSCAN_DIRECT, zone, nr_scan);
-   __count_vm_events(PGACTIVATE, nr_freed);
+   __count_zone_vm_events(PGSTEAL, zone, nr_freed);
 
if (nr_taken == 0)
goto done;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 36/50] NET: Dont export linux/random.h outside __KERNEL__

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: David Woodhouse <[EMAIL PROTECTED]>

Don't add it there please; add it lower down inside the existing #ifdef
__KERNEL__. You just made the _userspace_ net.h include random.h, which
then fails to compile unless  was already included.

Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>

---
 include/linux/net.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/include/linux/net.h
+++ linux-2.6.19.1/include/linux/net.h
@@ -19,7 +19,6 @@
 #define _LINUX_NET_H
 
 #include 
-#include 
 #include 
 
 struct poll_table_struct;
@@ -57,6 +56,7 @@ typedef enum {
 
 #ifdef __KERNEL__
 #include 
+#include 
 
 #define SOCK_ASYNC_NOSPACE 0
 #define SOCK_ASYNC_WAITDATA1

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 38/50] VM: Fix nasty and subtle race in shared mmaped page writeback

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Linus Torvalds <[EMAIL PROTECTED]>

The VM layer (on the face of it, fairly reasonably) expected that when
it does a ->writepage() call to the filesystem, it would write out the
full page at that point in time.  Especially since it had earlier marked
the whole page dirty with "set_page_dirty()".

But that isn't actually the case: ->writepage() does not actually write
a page, it writes the parts of the page that have been explicitly marked
dirty before, *and* that had not got written out for other reasons since
the last time we told it they were dirty.

That last caveat is the important one.

Which _most_ of the time ends up being the whole page (since we had
called "set_page_dirty()" on the page earlier), but if the filesystem
had done any dirty flushing of its own (for example, to honor some
internal write ordering guarantees), it might end up doing only a
partial page IO (or none at all) when ->writepage() is actually called.

That is the correct thing in general (since we actually often _want_
only the known-dirty parts of the page to be written out), but the
shared dirty page handling had implicitly forgotten about these details,
and had a number of cases where it was doing just the "->writepage()"
part, without telling the low-level filesystem that the whole page might
have been re-dirtied as part of being mapped writably into user space.

Since most of the time the FS did actually write out the full page, we
didn't notice this for a loong time, and this needed some really odd
patterns to trigger.  But it caused occasional corruption with rtorrent
and with the Debian "apt" database, because both use shared mmaps to
update the end result.

This fixes it. Finally. After way too much hair-pulling.

Acked-by: Nick Piggin <[EMAIL PROTECTED]>
Acked-by: Martin J. Bligh <[EMAIL PROTECTED]>
Acked-by: Martin Michlmayr <[EMAIL PROTECTED]>
Acked-by: Martin Johansson <[EMAIL PROTECTED]>
Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
Acked-by: Andrei Popa <[EMAIL PROTECTED]>
Cc: High Dickins <[EMAIL PROTECTED]>
Cc: Andrew Morton <[EMAIL PROTECTED]>,
Cc: Peter Zijlstra <[EMAIL PROTECTED]>
Cc: Segher Boessenkool <[EMAIL PROTECTED]>
Cc: David Miller <[EMAIL PROTECTED]>
Cc: Arjan van de Ven <[EMAIL PROTECTED]>
Cc: Gordon Farquharson <[EMAIL PROTECTED]>
Cc: Guillaume Chazarain <[EMAIL PROTECTED]>
Cc: Theodore Tso <[EMAIL PROTECTED]>
Cc: Kenneth Cheng <[EMAIL PROTECTED]>
Cc: Tobias Diedrich <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
[chrisw: backport to 2.6.19.1]
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 mm/page-writeback.c |   39 ++-
 1 file changed, 34 insertions(+), 5 deletions(-)

--- linux-2.6.19.1.orig/mm/page-writeback.c
+++ linux-2.6.19.1/mm/page-writeback.c
@@ -893,12 +893,41 @@ int clear_page_dirty_for_io(struct page 
 {
struct address_space *mapping = page_mapping(page);
 
-   if (mapping) {
+   if (mapping && mapping_cap_account_dirty(mapping)) {
+   /*
+* Yes, Virginia, this is indeed insane.
+*
+* We use this sequence to make sure that
+*  (a) we account for dirty stats properly
+*  (b) we tell the low-level filesystem to
+*  mark the whole page dirty if it was
+*  dirty in a pagetable. Only to then
+*  (c) clean the page again and return 1 to
+*  cause the writeback.
+*
+* This way we avoid all nasty races with the
+* dirty bit in multiple places and clearing
+* them concurrently from different threads.
+*
+* Note! Normally the "set_page_dirty(page)"
+* has no effect on the actual dirty bit - since
+* that will already usually be set. But we
+* need the side effects, and it can help us
+* avoid races.
+*
+* We basically use the page "master dirty bit"
+* as a serialization point for all the different
+* threads doing their things.
+*
+* FIXME! We still have a race here: if somebody
+* adds the page back to the page tables in
+* between the "page_mkclean()" and the "TestClearPageDirty()",
+* we might have it mapped without the dirty bit set.
+*/
+   if (page_mkclean(page))
+   set_page_dirty(page);
if (TestClearPageDirty(page)) {
-   if (mapping_cap_account_dirty(mapping)) {
-   page_mkclean(page);
-   dec_zone_page_state(page, NR_FILE_DIRTY);
-   }
+   dec_zone_page_state(page, 

[patch 45/50] IPV4/IPV6: Fix inet{,6} device initialization order.

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: David L Stevens <[EMAIL PROTECTED]>

It is important that we only assign dev->ip{,6}_ptr
only after all portions of the inet{,6} are setup.

Otherwise we can receive packets before the multicast
spinlocks et al. are initialized.

Signed-off-by: David L Stevens <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
commit 30c4cf577fb5b68c16e5750d6bdbd7072e42b279

 net/ipv4/devinet.c  |5 +++--
 net/ipv6/addrconf.c |4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

--- linux-2.6.19.1.orig/net/ipv4/devinet.c
+++ linux-2.6.19.1/net/ipv4/devinet.c
@@ -165,9 +165,8 @@ struct in_device *inetdev_init(struct ne
  NET_IPV4_NEIGH, "ipv4", NULL, NULL);
 #endif
 
-   /* Account for reference dev->ip_ptr */
+   /* Account for reference dev->ip_ptr (below) */
in_dev_hold(in_dev);
-   rcu_assign_pointer(dev->ip_ptr, in_dev);
 
 #ifdef CONFIG_SYSCTL
devinet_sysctl_register(in_dev, _dev->cnf);
@@ -176,6 +175,8 @@ struct in_device *inetdev_init(struct ne
if (dev->flags & IFF_UP)
ip_mc_up(in_dev);
 out:
+   /* we can receive as soon as ip_ptr is set -- do this last */
+   rcu_assign_pointer(dev->ip_ptr, in_dev);
return in_dev;
 out_kfree:
kfree(in_dev);
--- linux-2.6.19.1.orig/net/ipv6/addrconf.c
+++ linux-2.6.19.1/net/ipv6/addrconf.c
@@ -413,8 +413,6 @@ static struct inet6_dev * ipv6_add_dev(s
if (netif_carrier_ok(dev))
ndev->if_flags |= IF_READY;
 
-   /* protected by rtnl_lock */
-   rcu_assign_pointer(dev->ip6_ptr, ndev);
 
ipv6_mc_init_dev(ndev);
ndev->tstamp = jiffies;
@@ -425,6 +423,8 @@ static struct inet6_dev * ipv6_add_dev(s
  NULL);
addrconf_sysctl_register(ndev, >cnf);
 #endif
+   /* protected by rtnl_lock */
+   rcu_assign_pointer(dev->ip6_ptr, ndev);
return ndev;
 }
 

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 39/50] V4L: cx2341x: audio_properties is an u16, not u8

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Hans Verkuil <[EMAIL PROTECTED]>

This bug broke the MPEG audio mode controls.

Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
Signed-off-by: Michael Krufky <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
(cherry picked from commit cb2c7b4927c8f376b7ba9557978d8c59ed472664)

 include/media/cx2341x.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/include/media/cx2341x.h
+++ linux-2.6.19.1/include/media/cx2341x.h
@@ -49,7 +49,7 @@ struct cx2341x_mpeg_params {
enum v4l2_mpeg_audio_mode_extension audio_mode_extension;
enum v4l2_mpeg_audio_emphasis audio_emphasis;
enum v4l2_mpeg_audio_crc audio_crc;
-   u8 audio_properties;
+   u16 audio_properties;
 
/* video */
enum v4l2_mpeg_video_encoding video_encoding;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2.6.20-rc3] TTY_IO: Remove unnecessary kmalloc casts

2007-01-05 Thread Ahmed S. Darwish
> On Fri, Jan 05, 2007 at 09:10:01AM +0100, rday wrote:
> > Ahmed S. Darwish wrote:
> > Remove unnecessary kmalloc casts in drivers/char/tty_io.c
> > Signed-off-by: Ahmed Darwish <[EMAIL PROTECTED]>
>
> rday
> 
> p.s.  just FYI, i have a patch that does most of this, but i was going
> to hold off submitting it until 2.6.20 had arrived.  but if you want
> to take a shot at it, it's all yours.

OK, then I should stop sending new patches related to that matter to avoid
patch conflicts. right ?

-- 
Ahmed S. Darwish
http://darwish-07.blogspot.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 33/50] PKTGEN: Fix module load/unload races.

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Robert Olsson <[EMAIL PROTECTED]>

---
 net/core/pktgen.c |   20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

--- linux-2.6.19.1.orig/net/core/pktgen.c
+++ linux-2.6.19.1/net/core/pktgen.c
@@ -147,6 +147,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -206,6 +207,11 @@ static struct proc_dir_entry *pg_proc_di
 #define VLAN_TAG_SIZE(x) ((x)->vlan_id == 0x ? 0 : 4)
 #define SVLAN_TAG_SIZE(x) ((x)->svlan_id == 0x ? 0 : 4)
 
+struct pktgen_thread_info {
+   struct pktgen_thread *t;
+   struct completion *c;
+};
+
 struct flow_state {
__u32 cur_daddr;
int count;
@@ -3264,10 +3270,11 @@ out:;
  * Main loop of the thread goes here
  */
 
-static void pktgen_thread_worker(struct pktgen_thread *t)
+static void pktgen_thread_worker(struct pktgen_thread_info *info)
 {
DEFINE_WAIT(wait);
struct pktgen_dev *pkt_dev = NULL;
+   struct pktgen_thread *t = info->t;
int cpu = t->cpu;
sigset_t tmpsig;
u32 max_before_softirq;
@@ -3307,6 +3314,8 @@ static void pktgen_thread_worker(struct 
__set_current_state(TASK_INTERRUPTIBLE);
mb();
 
+complete(info->c);
+
while (1) {
 
__set_current_state(TASK_RUNNING);
@@ -3518,6 +3527,8 @@ static struct pktgen_thread *__init pktg
 static int __init pktgen_create_thread(const char *name, int cpu)
 {
int err;
+   struct pktgen_thread_info info;
+struct completion started;
struct pktgen_thread *t = NULL;
struct proc_dir_entry *pe;
 
@@ -3558,7 +3569,11 @@ static int __init pktgen_create_thread(c
 
t->removed = 0;
 
-   err = kernel_thread((void *)pktgen_thread_worker, (void *)t,
+   init_completion();
+info.t = t;
+info.c = 
+
+   err = kernel_thread((void *)pktgen_thread_worker, (void *),
  CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
if (err < 0) {
printk("pktgen: kernel_thread() failed for cpu %d\n", t->cpu);
@@ -3568,6 +3583,7 @@ static int __init pktgen_create_thread(c
return err;
}
 
+   wait_for_completion();
return 0;
 }
 

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 47/50] NetLabel: correctly fill in unused CIPSOv4 level and category mappings

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Paul Moore <[EMAIL PROTECTED]>

Back when the original NetLabel patches were being changed to use Netlink
attributes correctly some code was accidentially dropped which set all of the
undefined CIPSOv4 level and category mappings to a sentinel value.  The result
is the mappings data in the kernel contains bogus mappings which always map to
zero.  Having level and category mappings that map to zero could result in the
kernel assigning incorrect security attributes to packets.

This patch restores the old/correct behavior by initializing the mapping
data to the correct sentinel value.

Signed-off-by: Paul Moore <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 net/netlabel/netlabel_cipso_v4.c |9 +
 1 file changed, 9 insertions(+)

--- linux-2.6.19.1.orig/net/netlabel/netlabel_cipso_v4.c
+++ linux-2.6.19.1/net/netlabel/netlabel_cipso_v4.c
@@ -162,6 +162,7 @@ static int netlbl_cipsov4_add_std(struct
struct nlattr *nla_b;
int nla_a_rem;
int nla_b_rem;
+   u32 iter;
 
if (!info->attrs[NLBL_CIPSOV4_A_TAGLST] ||
!info->attrs[NLBL_CIPSOV4_A_MLSLVLLST])
@@ -223,6 +224,10 @@ static int netlbl_cipsov4_add_std(struct
ret_val = -ENOMEM;
goto add_std_failure;
}
+   for (iter = 0; iter < doi_def->map.std->lvl.local_size; iter++)
+   doi_def->map.std->lvl.local[iter] = CIPSO_V4_INV_LVL;
+   for (iter = 0; iter < doi_def->map.std->lvl.cipso_size; iter++)
+   doi_def->map.std->lvl.cipso[iter] = CIPSO_V4_INV_LVL;
nla_for_each_nested(nla_a,
info->attrs[NLBL_CIPSOV4_A_MLSLVLLST],
nla_a_rem)
@@ -296,6 +301,10 @@ static int netlbl_cipsov4_add_std(struct
ret_val = -ENOMEM;
goto add_std_failure;
}
+   for (iter = 0; iter < doi_def->map.std->cat.local_size; iter++)
+   doi_def->map.std->cat.local[iter] = CIPSO_V4_INV_CAT;
+   for (iter = 0; iter < doi_def->map.std->cat.cipso_size; iter++)
+   doi_def->map.std->cat.cipso[iter] = CIPSO_V4_INV_CAT;
nla_for_each_nested(nla_a,
info->attrs[NLBL_CIPSOV4_A_MLSCATLST],
nla_a_rem)

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 49/50] fix OOM killing of swapoff

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Hugh Dickins <[EMAIL PROTECTED]>

These days, if you swapoff when there isn't enough memory, OOM killer gives
"BUG: scheduling while atomic" and the machine hangs: badness() needs to do
its PF_SWAPOFF return after the task_unlock (tasklist_lock is also held
here, so p isn't going to be freed: PF_SWAPOFF might get turned off at any
moment, but that doesn't really matter).

Signed-off-by: Hugh Dickins <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 mm/oom_kill.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

--- linux-2.6.19.1.orig/mm/oom_kill.c
+++ linux-2.6.19.1/mm/oom_kill.c
@@ -61,12 +61,6 @@ unsigned long badness(struct task_struct
}
 
/*
-* swapoff can easily use up all memory, so kill those first.
-*/
-   if (p->flags & PF_SWAPOFF)
-   return ULONG_MAX;
-
-   /*
 * The memory size of the process is the basis for the badness.
 */
points = mm->total_vm;
@@ -77,6 +71,12 @@ unsigned long badness(struct task_struct
task_unlock(p);
 
/*
+* swapoff can easily use up all memory, so kill those first.
+*/
+   if (p->flags & PF_SWAPOFF)
+   return ULONG_MAX;
+
+   /*
 * Processes which fork a lot of child processes are likely
 * a good choice. We add half the vmsize of the children if they
 * have an own mm. This prevents forking servers to flood the

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 50/50] Fix incorrect user space access locking in mincore() (CVE-2006-4814)

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Linus Torvalds <[EMAIL PROTECTED]>

Doug Chapman noticed that mincore() will doa "copy_to_user()" of the
result while holding the mmap semaphore for reading, which is a big
no-no.  While a recursive read-lock on a semaphore in the case of a page
fault happens to work, we don't actually allow them due to deadlock
schenarios with writers due to fairness issues.

Doug and Marcel sent in a patch to fix it, but I decided to just rewrite
the mess instead - not just fixing the locking problem, but making the
code smaller and (imho) much easier to understand.

Cc: Doug Chapman <[EMAIL PROTECTED]>
Cc: Marcel Holtmann <[EMAIL PROTECTED]>
Cc: Hugh Dickins <[EMAIL PROTECTED]>
Cc: Andrew Morton <[EMAIL PROTECTED]>
[chrisw: fold in subsequent fix: 4fb23e439ce0]
Acked-by: Hugh Dickins <[EMAIL PROTECTED]>
[chrisw: fold in subsequent fix: 825020c3866e]
Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 mm/mincore.c |  181 +--
 1 file changed, 77 insertions(+), 104 deletions(-)

--- linux-2.6.19.1.orig/mm/mincore.c
+++ linux-2.6.19.1/mm/mincore.c
@@ -1,7 +1,7 @@
 /*
  * linux/mm/mincore.c
  *
- * Copyright (C) 1994-1999  Linus Torvalds
+ * Copyright (C) 1994-2006  Linus Torvalds
  */
 
 /*
@@ -38,46 +38,51 @@ static unsigned char mincore_page(struct
return present;
 }
 
-static long mincore_vma(struct vm_area_struct * vma,
-   unsigned long start, unsigned long end, unsigned char __user * vec)
+/*
+ * Do a chunk of "sys_mincore()". We've already checked
+ * all the arguments, we hold the mmap semaphore: we should
+ * just return the amount of info we're asked for.
+ */
+static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long 
pages)
 {
-   long error, i, remaining;
-   unsigned char * tmp;
-
-   error = -ENOMEM;
-   if (!vma->vm_file)
-   return error;
-
-   start = ((start - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
-   if (end > vma->vm_end)
-   end = vma->vm_end;
-   end = ((end - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
-
-   error = -EAGAIN;
-   tmp = (unsigned char *) __get_free_page(GFP_KERNEL);
-   if (!tmp)
-   return error;
-
-   /* (end - start) is # of pages, and also # of bytes in "vec */
-   remaining = (end - start),
+   unsigned long i, nr, pgoff;
+   struct vm_area_struct *vma = find_vma(current->mm, addr);
 
-   error = 0;
-   for (i = 0; remaining > 0; remaining -= PAGE_SIZE, i++) {
-   int j = 0;
-   long thispiece = (remaining < PAGE_SIZE) ?
-   remaining : PAGE_SIZE;
+   /*
+* find_vma() didn't find anything above us, or we're
+* in an unmapped hole in the address space: ENOMEM.
+*/
+   if (!vma || addr < vma->vm_start)
+   return -ENOMEM;
 
-   while (j < thispiece)
-   tmp[j++] = mincore_page(vma, start++);
+   /*
+* Ok, got it. But check whether it's a segment we support
+* mincore() on. Right now, we don't do any anonymous mappings.
+*
+* FIXME: This is just stupid. And returning ENOMEM is 
+* stupid too. We should just look at the page tables. But
+* this is what we've traditionally done, so we'll just
+* continue doing it.
+*/
+   if (!vma->vm_file)
+   return -ENOMEM;
 
-   if (copy_to_user(vec + PAGE_SIZE * i, tmp, thispiece)) {
-   error = -EFAULT;
-   break;
-   }
-   }
+   /*
+* Calculate how many pages there are left in the vma, and
+* what the pgoff is for our address.
+*/
+   nr = (vma->vm_end - addr) >> PAGE_SHIFT;
+   if (nr > pages)
+   nr = pages;
+
+   pgoff = (addr - vma->vm_start) >> PAGE_SHIFT;
+   pgoff += vma->vm_pgoff;
+
+   /* And then we just fill the sucker in.. */
+   for (i = 0 ; i < nr; i++, pgoff++)
+   vec[i] = mincore_page(vma, pgoff);
 
-   free_page((unsigned long) tmp);
-   return error;
+   return nr;
 }
 
 /*
@@ -107,82 +112,50 @@ static long mincore_vma(struct vm_area_s
 asmlinkage long sys_mincore(unsigned long start, size_t len,
unsigned char __user * vec)
 {
-   int index = 0;
-   unsigned long end, limit;
-   struct vm_area_struct * vma;
-   size_t max;
-   int unmapped_error = 0;
-   long error;
+   long retval;
+   unsigned long pages;
+   unsigned char *tmp;
 
-   /* check the arguments */
+   /* Check the start address: needs to be page-aligned.. */
if (start & ~PAGE_CACHE_MASK)
-   goto einval;
-
-   limit 

[patch 43/50] SOUND: Sparc CS4231: Fix IRQ return value and initialization.

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Georg Chini <[EMAIL PROTECTED]>

fix some initialisation problems.

Change period_bytes_min from 4096 to 256 to allow driver to work with
low latency (VOIP) applications. Hope this does not break EBUS.

Signed-off-by: Georg Chini <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
commit d35a1b9e10481c9f1d3b87e778a0f1f6a0a2dd48

 sound/sparc/cs4231.c |   26 --
 1 file changed, 12 insertions(+), 14 deletions(-)

--- linux-2.6.19.1.orig/sound/sparc/cs4231.c
+++ linux-2.6.19.1/sound/sparc/cs4231.c
@@ -1268,7 +1268,7 @@ static struct snd_pcm_hardware snd_cs423
.channels_min   = 1,
.channels_max   = 2,
.buffer_bytes_max   = (32*1024),
-   .period_bytes_min   = 4096,
+   .period_bytes_min   = 256,
.period_bytes_max   = (32*1024),
.periods_min= 1,
.periods_max= 1024,
@@ -1288,7 +1288,7 @@ static struct snd_pcm_hardware snd_cs423
.channels_min   = 1,
.channels_max   = 2,
.buffer_bytes_max   = (32*1024),
-   .period_bytes_min   = 4096,
+   .period_bytes_min   = 256,
.period_bytes_max   = (32*1024),
.periods_min= 1,
.periods_max= 1024,
@@ -1796,7 +1796,7 @@ static irqreturn_t snd_cs4231_sbus_inter
snd_cs4231_outm(chip, CS4231_IRQ_STATUS, ~CS4231_ALL_IRQS | ~status, 0);
spin_unlock_irqrestore(>lock, flags);
 
-   return 0;
+   return IRQ_HANDLED;
 }
 
 /*
@@ -1821,7 +1821,6 @@ static int sbus_dma_request(struct cs423
if (!(csr & test))
goto out;
err = -EBUSY;
-   csr = sbus_readl(base->regs + APCCSR);
test = APC_XINT_CNVA;
if ( base->dir == APC_PLAY )
test = APC_XINT_PNVA;
@@ -1862,17 +1861,16 @@ static void sbus_dma_enable(struct cs423
 
spin_lock_irqsave(>lock, flags);
if (!on) {
-   if (base->dir == APC_PLAY) { 
-   sbus_writel(0, base->regs + base->dir + APCNVA); 
-   sbus_writel(1, base->regs + base->dir + APCC); 
-   }
-   else
-   {
-   sbus_writel(0, base->regs + base->dir + APCNC); 
-   sbus_writel(0, base->regs + base->dir + APCVA); 
-   } 
+   sbus_writel(0, base->regs + base->dir + APCNC);
+   sbus_writel(0, base->regs + base->dir + APCNVA);
+   sbus_writel(0, base->regs + base->dir + APCC);
+   sbus_writel(0, base->regs + base->dir + APCVA);
+
+   /* ACK any APC interrupts. */
+   csr = sbus_readl(base->regs + APCCSR);
+   sbus_writel(csr, base->regs + APCCSR);
} 
-   udelay(600); 
+   udelay(1000);
csr = sbus_readl(base->regs + APCCSR);
shift = 0;
if ( base->dir == APC_PLAY )

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 00/50] -stable review

2007-01-05 Thread Chris Wright

rollup available (when mirroring completes):


http://www.kernel.org/pub/linux/kernel/people/chrisw/stable/patch-2.6.19.2-rc1.{gz,bz2}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 37/50] sparc32: add offset in pci_map_sg()

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Jan Andersson <[EMAIL PROTECTED]>

Add sg->offset to sg->dvma_address in pci_map_sg() on sparc32.  Without the
offset, transfers to buffers that do not begin on a page boundary will not
work as expected.

Signed-off-by: Jan Andersson <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: William Lee Irwin III <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>

---
 arch/sparc/kernel/ioport.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.19.1.orig/arch/sparc/kernel/ioport.c
+++ linux-2.6.19.1/arch/sparc/kernel/ioport.c
@@ -728,7 +728,8 @@ int pci_map_sg(struct pci_dev *hwdev, st
/* IIep is write-through, not flushing. */
for (n = 0; n < nents; n++) {
BUG_ON(page_address(sg->page) == NULL);
-   sg->dvma_address = virt_to_phys(page_address(sg->page));
+   sg->dvma_address =
+   virt_to_phys(page_address(sg->page)) + sg->offset;
sg->dvma_length = sg->length;
sg++;
}

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 44/50] SOUND: Sparc CS4231: Use 64 for period_bytes_min

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: David Miller <[EMAIL PROTECTED]>


This matches what the ISA cs4231 driver uses.

Tested by Georg Chini.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
commit f9af1d9deaaffe6803dec693748498886915d766

 sound/sparc/cs4231.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.19.1.orig/sound/sparc/cs4231.c
+++ linux-2.6.19.1/sound/sparc/cs4231.c
@@ -1268,7 +1268,7 @@ static struct snd_pcm_hardware snd_cs423
.channels_min   = 1,
.channels_max   = 2,
.buffer_bytes_max   = (32*1024),
-   .period_bytes_min   = 256,
+   .period_bytes_min   = 64,
.period_bytes_max   = (32*1024),
.periods_min= 1,
.periods_max= 1024,
@@ -1288,7 +1288,7 @@ static struct snd_pcm_hardware snd_cs423
.channels_min   = 1,
.channels_max   = 2,
.buffer_bytes_max   = (32*1024),
-   .period_bytes_min   = 256,
+   .period_bytes_min   = 64,
.period_bytes_max   = (32*1024),
.periods_min= 1,
.periods_max= 1024,

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 48/50] connector: some fixes for ia64 unaligned access errors

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Erik Jacobson <[EMAIL PROTECTED]>

On ia64, the various functions that make up cn_proc.c cause kernel
unaligned access errors.

If you are using these, for example, to get notification about all tasks
forking and exiting, you get multiple unaligned access errors per process.

Use put_unaligned() in the appropriate palces to fix this.

Signed-off-by: Erik Jacobson <[EMAIL PROTECTED]>
Cc: Evgeniy Polyakov <[EMAIL PROTECTED]>
Cc: Tony Luck <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 drivers/connector/cn_proc.c |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

--- linux-2.6.19.1.orig/drivers/connector/cn_proc.c
+++ linux-2.6.19.1/drivers/connector/cn_proc.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -60,7 +61,7 @@ void proc_fork_connector(struct task_str
ev = (struct proc_event*)msg->data;
get_seq(>seq, >cpu);
ktime_get_ts(); /* get high res monotonic timestamp */
-   ev->timestamp_ns = timespec_to_ns();
+   put_unaligned(timespec_to_ns(), (__u64 *)>timestamp_ns);
ev->what = PROC_EVENT_FORK;
ev->event_data.fork.parent_pid = task->real_parent->pid;
ev->event_data.fork.parent_tgid = task->real_parent->tgid;
@@ -88,7 +89,7 @@ void proc_exec_connector(struct task_str
ev = (struct proc_event*)msg->data;
get_seq(>seq, >cpu);
ktime_get_ts(); /* get high res monotonic timestamp */
-   ev->timestamp_ns = timespec_to_ns();
+   put_unaligned(timespec_to_ns(), (__u64 *)>timestamp_ns);
ev->what = PROC_EVENT_EXEC;
ev->event_data.exec.process_pid = task->pid;
ev->event_data.exec.process_tgid = task->tgid;
@@ -124,7 +125,7 @@ void proc_id_connector(struct task_struc
return;
get_seq(>seq, >cpu);
ktime_get_ts(); /* get high res monotonic timestamp */
-   ev->timestamp_ns = timespec_to_ns();
+   put_unaligned(timespec_to_ns(), (__u64 *)>timestamp_ns);
 
memcpy(>id, _proc_event_id, sizeof(msg->id));
msg->ack = 0; /* not used */
@@ -146,7 +147,7 @@ void proc_exit_connector(struct task_str
ev = (struct proc_event*)msg->data;
get_seq(>seq, >cpu);
ktime_get_ts(); /* get high res monotonic timestamp */
-   ev->timestamp_ns = timespec_to_ns();
+   put_unaligned(timespec_to_ns(), (__u64 *)>timestamp_ns);
ev->what = PROC_EVENT_EXIT;
ev->event_data.exit.process_pid = task->pid;
ev->event_data.exit.process_tgid = task->tgid;
@@ -181,7 +182,7 @@ static void cn_proc_ack(int err, int rcv
ev = (struct proc_event*)msg->data;
msg->seq = rcvd_seq;
ktime_get_ts(); /* get high res monotonic timestamp */
-   ev->timestamp_ns = timespec_to_ns();
+   put_unaligned(timespec_to_ns(), (__u64 *)>timestamp_ns);
ev->cpu = -1;
ev->what = PROC_EVENT_NONE;
ev->event_data.ack.err = err;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 46/50] asix: Fix typo for AX88772 PHY Selection

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: David Hollis <[EMAIL PROTECTED]>

The attached patch fixes a PHY selection problem that prevents AX88772
based devices (Linksys USB200Mv2, etc) devices from working.  The
interface comes up and everything seems fine except the device doesn't
send/receive any packets.  The one-liner attached fixes this issue and
makes the devices usable again.

Signed-off-by: David Hollis <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
Patch has already been applied for 2.6.20+ kernels but it would be very
helpful for end-users/distributions to have this fixed in the 2.6.19
series as well.

 drivers/usb/net/asix.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/drivers/usb/net/asix.c
+++ linux-2.6.19.1/drivers/usb/net/asix.c
@@ -920,7 +920,7 @@ static int ax88772_bind(struct usbnet *d
goto out2;
 
if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
-   0x, 0, 0, buf)) < 0) {
+   1, 0, 0, buf)) < 0) {
dbg("Select PHY #1 failed: %d", ret);
goto out2;
}

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 28/50] softmac: Fixed handling of deassociation from AP

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Ulrich Kunitz <[EMAIL PROTECTED]>

In 2.6.19 a deauthentication from the AP doesn't start a
reassociation by the softmac code. It appears that
mac->associnfo.associating must be set and the
ieee80211softmac_assoc_work function must be scheduled. This patch
fixes that.

Signed-off-by: Ulrich Kunitz <[EMAIL PROTECTED]>
Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
Date: Sun, 3 Dec 2006 15:32:00 + (+0100)
Subject: [patch 28/50] [PATCH] softmac: Fixed handling of deassociation from AP
X-Git-Tag: v2.6.20-rc1
X-Git-Url: 
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2b50c24554d31c2db2f93b1151b5991e62f96594

 net/ieee80211/softmac/ieee80211softmac_assoc.c |   14 --
 net/ieee80211/softmac/ieee80211softmac_auth.c  |2 ++
 net/ieee80211/softmac/ieee80211softmac_priv.h  |2 ++
 3 files changed, 16 insertions(+), 2 deletions(-)

--- linux-2.6.19.1.orig/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ linux-2.6.19.1/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -427,6 +427,17 @@ ieee80211softmac_handle_assoc_response(s
return 0;
 }
 
+void
+ieee80211softmac_try_reassoc(struct ieee80211softmac_device *mac)
+{
+   unsigned long flags;
+
+   spin_lock_irqsave(>lock, flags);
+   mac->associnfo.associating = 1;
+   schedule_work(>associnfo.work);
+   spin_unlock_irqrestore(>lock, flags);
+}
+
 int
 ieee80211softmac_handle_disassoc(struct net_device * dev,
 struct ieee80211_disassoc *disassoc)
@@ -445,8 +456,7 @@ ieee80211softmac_handle_disassoc(struct 
dprintk(KERN_INFO PFX "got disassoc frame\n");
ieee80211softmac_disassoc(mac);
 
-   /* try to reassociate */
-   schedule_work(>associnfo.work);
+   ieee80211softmac_try_reassoc(mac);
 
return 0;
 }
--- linux-2.6.19.1.orig/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ linux-2.6.19.1/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -328,6 +328,8 @@ ieee80211softmac_deauth_from_net(struct 
/* can't transmit data right now... */
netif_carrier_off(mac->dev);
spin_unlock_irqrestore(>lock, flags);
+
+   ieee80211softmac_try_reassoc(mac);
 }
 
 /* 
--- linux-2.6.19.1.orig/net/ieee80211/softmac/ieee80211softmac_priv.h
+++ linux-2.6.19.1/net/ieee80211/softmac/ieee80211softmac_priv.h
@@ -238,4 +238,6 @@ void ieee80211softmac_call_events_locked
 int ieee80211softmac_notify_internal(struct ieee80211softmac_device *mac,
int event, void *event_context, notify_function_ptr fun, void *context, 
gfp_t gfp_mask);
 
+void ieee80211softmac_try_reassoc(struct ieee80211softmac_device *mac);
+
 #endif /* IEEE80211SOFTMAC_PRIV_H_ */

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 40/50] dvb-core: fix bug in CRC-32 checking on 64-bit systems

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Ang Way Chuang <[EMAIL PROTECTED]>

CRC-32 checking during ULE decapsulation always failed on x86_64 systems due
to the size of a variable used to store CRC. This bug was discovered on
Fedora Core 6 with kernel-2.6.18-1.2849. The i386 counterpart has no such
problem. This patch has been tested on 64-bit system as well as 32-bit system.

Signed-off-by: Ang Way Chuang <[EMAIL PROTECTED]>
Signed-off-by: Michael Krufky <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
(cherry picked from commit dedcefb085fe98a1feaf63590fe2fc7e0ecb1987)

 drivers/media/dvb/dvb-core/dvb_net.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.19.1.orig/drivers/media/dvb/dvb-core/dvb_net.c
+++ linux-2.6.19.1/drivers/media/dvb/dvb-core/dvb_net.c
@@ -604,7 +604,7 @@ static void dvb_net_ule( struct net_devi
{ , sizeof utype },
{ priv->ule_skb->data, priv->ule_skb->len - 4 }
};
-   unsigned long ule_crc = ~0L, expected_crc;
+   u32 ule_crc = ~0L, expected_crc;
if (priv->ule_dbit) {
/* Set D-bit for CRC32 verification,
 * if it was set originally. */
@@ -617,7 +617,7 @@ static void dvb_net_ule( struct net_devi
   *((u8 *)priv->ule_skb->tail - 2) << 8 |
   *((u8 *)priv->ule_skb->tail - 1);
if (ule_crc != expected_crc) {
-   printk(KERN_WARNING "%lu: CRC32 check FAILED: 
%#lx / %#lx, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n",
+   printk(KERN_WARNING "%lu: CRC32 check FAILED: 
%08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n",
   priv->ts_count, ule_crc, expected_crc, 
priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain > 2 ? *(unsigned 
short *)from_where : 0);
 
 #ifdef ULE_DEBUG

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 19/50] sched: fix bad missed wakeups in the i386, x86_64, ia64, ACPI and APM idle code

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Ingo Molnar <[EMAIL PROTECTED]>

Fernando Lopez-Lezcano reported frequent scheduling latencies and audio 
xruns starting at the 2.6.18-rt kernel, and those problems persisted all 
until current -rt kernels. The latencies were serious and unjustified by 
system load, often in the milliseconds range.

After a patient and heroic multi-month effort of Fernando, where he 
tested dozens of kernels, tried various configs, boot options, 
test-patches of mine and provided latency traces of those incidents, the 
following 'smoking gun' trace was captured by him:

 _--=> CPU#
/ _-=> irqs-off
   | / _=> need-resched
   || / _---=> hardirq/softirq
   ||| / _--=> preempt-depth
    /
   | delay
   cmd pid | time  |   caller
  \   /|   \   |   /
  IRQ_19-1479  1D..10us : __trace_start_sched_wakeup (try_to_wake_up)
  IRQ_19-1479  1D..10us : __trace_start_sched_wakeup <<...>-5856> (37 0)
  IRQ_19-1479  1D..10us : __trace_start_sched_wakeup (c01262ba 0 0)
  IRQ_19-1479  1D..10us : resched_task (try_to_wake_up)
  IRQ_19-1479  1D..10us : __spin_unlock_irqrestore (try_to_wake_up)
  ...
  -0 1...1   11us!: default_idle (cpu_idle)
  ...
  -0 0Dn.1  602us : smp_apic_timer_interrupt (c0103baf 1 0)
  ...
   <...>-5856  0D..2  618us : __switch_to (__schedule)
   <...>-5856  0D..2  618us : __schedule <-0> (20 162)
   <...>-5856  0D..2  619us : __spin_unlock_irq (__schedule)
   <...>-5856  0...1  619us : trace_stop_sched_switched (__schedule)
   <...>-5856  0D..1  619us : trace_stop_sched_switched <<...>-5856> (37 0)

what is visible in this trace is that CPU#1 ran try_to_wake_up() for 
PID:5856, it placed PID:5856 on CPU#0's runqueue and ran resched_task() 
for CPU#0. But it decided to not send an IPI that no CPU - due to 
TS_POLLING. But CPU#0 never woke up after its NEED_RESCHED bit was set, 
and only rescheduled to PID:5856 upon the next lapic timer IRQ. The 
result was a 600+ usecs latency and a missed wakeup!

the bug turned out to be an idle-wakeup bug introduced into the mainline 
kernel this summer via an optimization in the x86_64 tree:

commit 495ab9c045e1b0e5c82951b762257fe1c9d81564
Author: Andi Kleen <[EMAIL PROTECTED]>
Date:   Mon Jun 26 13:59:11 2006 +0200

[PATCH] i386/x86-64/ia64: Move polling flag into thread_info_status

During some profiling I noticed that default_idle causes a lot of
memory traffic. I think that is caused by the atomic operations
to clear/set the polling flag in thread_info. There is actually
no reason to make this atomic - only the idle thread does it
to itself, other CPUs only read it. So I moved it into ti->status.

the problem is this type of change:

if (!hlt_counter && boot_cpu_data.hlt_works_ok) {
-   clear_thread_flag(TIF_POLLING_NRFLAG);
+   current_thread_info()->status &= ~TS_POLLING;
smp_mb__after_clear_bit();
while (!need_resched()) {
local_irq_disable();

this changes clear_thread_flag() to an explicit clearing of TS_POLLING. 
clear_thread_flag() is defined as:

clear_bit(flag, >flags);

and clear_bit() is a LOCK-ed atomic instruction on all x86 platforms:

  static inline void clear_bit(int nr, volatile unsigned long * addr)
  {
  __asm__ __volatile__( LOCK_PREFIX
  "btrl %1,%0"

hence smp_mb__after_clear_bit() is defined as a simple compile barrier:

  #define smp_mb__after_clear_bit()   barrier()

but the explicit TS_POLLING clearing introduced by the patch:

+   current_thread_info()->status &= ~TS_POLLING;

is not an atomic op! So the clearing of the TS_POLLING bit is freely 
reorderable with the reading of the NEED_RESCHED bit - and both now 
reside in different memory addresses.

CPU idle wakeup very much depends on ordered memory ops, the clearing of 
the TS_POLLING flag must always be done before we test need_resched() 
and hit the idle instruction(s). [Symmetrically, the wakeup code needs 
to set NEED_RESCHED before it tests the TS_POLLING flag, so memory 
ordering is paramount.]

Fernando's dual-core Athlon64 system has a sufficiently advanced memory 
ordering model so that it triggered this scenario very often.

( And it also turned out that the reason why these latencies never
  triggered on my testsystems is that i routinely use idle=poll, which
  was the only idle variant not affected by this bug. )

The fix is to change the smp_mb__after_clear_bit() to an smp_mb(), to 
act as an absolute barrier between the TS_POLLING write and the 
NEED_RESCHED read. This affects almost all idling methods (default, 
ACPI, APM), on all 3 x86 architectures: i386, x86_64, ia64.

Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
Tested-by: Fernando Lopez-Lezcano 

[patch 30/50] handle ext3 directory corruption better (CVE-2006-6053)

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Eric Sandeen <[EMAIL PROTECTED]>

I've been using Steve Grubb's purely evil "fsfuzzer" tool, at
http://people.redhat.com/sgrubb/files/fsfuzzer-0.4.tar.gz

Basically it makes a filesystem, splats some random bits over it, then
tries to mount it and do some simple filesystem actions.

At best, the filesystem catches the corruption gracefully.  At worst,
things spin out of control.

As you might guess, we found a couple places in ext3 where things spin out
of control :)

First, we had a corrupted directory that was never checked for
consistency...  it was corrupt, and pointed to another bad "entry" of
length 0.  The for() loop looped forever, since the length of
ext3_next_entry(de) was 0, and we kept looking at the same pointer over and
over and over and over...  I modeled this check and subsequent action on
what is done for other directory types in ext3_readdir...

(adding this check adds some computational expense; I am testing a followup
patch to reduce the number of times we check and re-check these directory
entries, in all cases.  Thanks for the idea, Andreas).

Next we had a root directory inode which had a corrupted size, claimed to
be > 200M on a 4M filesystem.  There was only really 1 block in the
directory, but because the size was so large, readdir kept coming back for
more, spewing thousands of printk's along the way.

Per Andreas' suggestion, if we're in this read error condition and we're
trying to read an offset which is greater than i_blocks worth of bytes,
stop trying, and break out of the loop.

With these two changes fsfuzz test survives quite well on ext3.

Signed-off-by: Eric Sandeen <[EMAIL PROTECTED]>
Cc: 
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
Date: Thu, 7 Dec 2006 04:36:26 + (-0800)
Subject: [patch 30/50] [PATCH] handle ext3 directory corruption better
X-Git-Tag: v2.6.20-rc1
X-Git-Url: 
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=40b851348fe9bf49c26025b34261d25142269b60

 fs/ext3/dir.c   |3 +++
 fs/ext3/namei.c |9 +
 2 files changed, 12 insertions(+)

--- linux-2.6.19.1.orig/fs/ext3/dir.c
+++ linux-2.6.19.1/fs/ext3/dir.c
@@ -154,6 +154,9 @@ static int ext3_readdir(struct file * fi
ext3_error (sb, "ext3_readdir",
"directory #%lu contains a hole at offset %lu",
inode->i_ino, (unsigned long)filp->f_pos);
+   /* corrupt size?  Maybe no more blocks to read */
+   if (filp->f_pos > inode->i_blocks << 9)
+   break;
filp->f_pos += sb->s_blocksize - offset;
continue;
}
--- linux-2.6.19.1.orig/fs/ext3/namei.c
+++ linux-2.6.19.1/fs/ext3/namei.c
@@ -552,6 +552,15 @@ static int htree_dirblock_to_tree(struct
   dir->i_sb->s_blocksize -
   EXT3_DIR_REC_LEN(0));
for (; de < top; de = ext3_next_entry(de)) {
+   if (!ext3_check_dir_entry("htree_dirblock_to_tree", dir, de, bh,
+   (blockb_data))) {
+   /* On error, skip the f_pos to the next block. */
+   dir_file->f_pos = (dir_file->f_pos |
+   (dir->i_sb->s_blocksize - 1)) + 1;
+   brelse (bh);
+   return count;
+   }
ext3fs_dirhash(de->name, de->name_len, hinfo);
if ((hinfo->hash < start_hash) ||
((hinfo->hash == start_hash) &&

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 31/50] corrupted cramfs filesystems cause kernel oops (CVE-2006-5823)

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Phillip Lougher <[EMAIL PROTECTED]>

Steve Grubb's fzfuzzer tool (http://people.redhat.com/sgrubb/files/
fsfuzzer-0.6.tar.gz) generates corrupt Cramfs filesystems which cause
Cramfs to kernel oops in cramfs_uncompress_block().  The cause of the oops
is an unchecked corrupted block length field read by cramfs_readpage().

This patch adds a sanity check to cramfs_readpage() which checks that the
block length field is sensible.  The (PAGE_CACHE_SIZE << 1) size check is
intentional, even though the uncompressed data is not going to be larger
than PAGE_CACHE_SIZE, gzip sometimes generates compressed data larger than
the original source data.  Mkcramfs checks that the compressed size is
always less than or equal to PAGE_CACHE_SIZE << 1.  Of course Cramfs could
use the original uncompressed data in this case, but it doesn't.

Signed-off-by: Phillip Lougher <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
Date: Thu, 7 Dec 2006 04:37:20 + (-0800)
Subject: [patch 31/50] [PATCH] corrupted cramfs filesystems cause kernel oops
X-Git-Tag: v2.6.20-rc1
X-Git-Url: 
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=8bb0269160df2a60764013994d0bc5165406cf4a

 fs/cramfs/inode.c |2 ++
 1 file changed, 2 insertions(+)

--- linux-2.6.19.1.orig/fs/cramfs/inode.c
+++ linux-2.6.19.1/fs/cramfs/inode.c
@@ -481,6 +481,8 @@ static int cramfs_readpage(struct file *
pgdata = kmap(page);
if (compr_len == 0)
; /* hole */
+   else if (compr_len > (PAGE_CACHE_SIZE << 1))
+   printk(KERN_ERR "cramfs: bad compressed blocksize 
%u\n", compr_len);
else {
mutex_lock(_mutex);
bytes_filled = cramfs_uncompress_block(pgdata,

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 22/50] fix aoe without scatter-gather [Bug 7662]

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Ed L Cashin <[EMAIL PROTECTED]>

Fix a bug that only appears when AoE goes over a network card that does not
support scatter-gather.  The headers in the linear part of the skb appeared
to be larger than they really were, resulting in data that was offset by 24
bytes.

This patch eliminates the offset data on cards that don't support
scatter-gather or have had scatter-gather turned off.  There remains an
unrelated issue that I'll address in a separate email.

Fixes bugzilla #7662

Signed-off-by: "Ed L. Cashin" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Cc: Greg KH <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 drivers/block/aoe/aoecmd.c |   13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

--- linux-2.6.19.1.orig/drivers/block/aoe/aoecmd.c
+++ linux-2.6.19.1/drivers/block/aoe/aoecmd.c
@@ -30,8 +30,6 @@ new_skb(ulong len)
skb->nh.raw = skb->mac.raw = skb->data;
skb->protocol = __constant_htons(ETH_P_AOE);
skb->priority = 0;
-   skb_put(skb, len);
-   memset(skb->head, 0, len);
skb->next = skb->prev = NULL;
 
/* tell the network layer not to perform IP checksums
@@ -122,8 +120,8 @@ aoecmd_ata_rw(struct aoedev *d, struct f
skb = f->skb;
h = (struct aoe_hdr *) skb->mac.raw;
ah = (struct aoe_atahdr *) (h+1);
-   skb->len = sizeof *h + sizeof *ah;
-   memset(h, 0, ETH_ZLEN);
+   skb_put(skb, sizeof *h + sizeof *ah);
+   memset(h, 0, skb->len);
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
f->buf = buf;
@@ -149,7 +147,6 @@ aoecmd_ata_rw(struct aoedev *d, struct f
skb->len += bcnt;
skb->data_len = bcnt;
} else {
-   skb->len = ETH_ZLEN;
writebit = 0;
}
 
@@ -206,6 +203,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigne
printk(KERN_INFO "aoe: skb alloc failure\n");
continue;
}
+   skb_put(skb, sizeof *h + sizeof *ch);
skb->dev = ifp;
if (sl_tail == NULL)
sl_tail = skb;
@@ -243,6 +241,7 @@ freeframe(struct aoedev *d)
continue;
if (atomic_read(_shinfo(f->skb)->dataref) == 1) {
skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
+   skb_trim(f->skb, 0);
return f;
}
n++;
@@ -698,8 +697,8 @@ aoecmd_ata_id(struct aoedev *d)
skb = f->skb;
h = (struct aoe_hdr *) skb->mac.raw;
ah = (struct aoe_atahdr *) (h+1);
-   skb->len = ETH_ZLEN;
-   memset(h, 0, ETH_ZLEN);
+   skb_put(skb, sizeof *h + sizeof *ah);
+   memset(h, 0, skb->len);
f->tag = aoehdr_atainit(d, h);
f->waited = 0;
 

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 24/50] cciss: fix XFER_READ/XFER_WRITE in do_cciss_request

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Mike Miller <[EMAIL PROTECTED]>

This patch fixes a stupid bug. Sometime during the 2tb enhancement I ended up
replacing the macros XFER_READ and XFER_WRITE with h->cciss_read and
h->cciss_write respectively. It seemed to work somehow at least on x86_64 and
ia64. I don't know how. But people started complaining about command timeouts
on older controllers like the 64xx series and only on ia32. This resolves the
issue reproduced in our lab. Please consider this for inclusion. 

Signed-off-by: Mike Miller <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 drivers/block/cciss.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/drivers/block/cciss.c
+++ linux-2.6.19.1/drivers/block/cciss.c
@@ -2530,7 +2530,7 @@ static void do_cciss_request(request_que
c->Request.Type.Type = TYPE_CMD;// It is a command.
c->Request.Type.Attribute = ATTR_SIMPLE;
c->Request.Type.Direction =
-   (rq_data_dir(creq) == READ) ? h->cciss_read : h->cciss_write;
+   (rq_data_dir(creq) == READ) ? XFER_READ : XFER_WRITE;
c->Request.Timeout = 0; // Don't time out
c->Request.CDB[0] =
(rq_data_dir(creq) == READ) ? h->cciss_read : h->cciss_write;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 06/50] bonding: incorrect bonding state reported via ioctl

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Andy Gospodarek <[EMAIL PROTECTED]>

This is a small fix-up to finish out the work done by Jay Vosburgh to
add carrier-state support for bonding devices.  The output in
/proc/net/bonding/bondX was correct, but when collecting the same info
via an iotcl it could still be incorrect.

Signed-off-by: Andy Gospodarek <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 drivers/net/bonding/bond_main.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/drivers/net/bonding/bond_main.c
+++ linux-2.6.19.1/drivers/net/bonding/bond_main.c
@@ -3675,7 +3675,7 @@ static int bond_do_ioctl(struct net_devi
mii->val_out = 0;
read_lock_bh(>lock);
read_lock(>curr_slave_lock);
-   if (bond->curr_active_slave) {
+   if (netif_carrier_ok(bond->dev)) {
mii->val_out = BMSR_LSTATUS;
}
read_unlock(>curr_slave_lock);

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RTC subsystem and fractions of seconds

2007-01-05 Thread Philippe De Muyter
Hi all,

A comment in driver/rtc/hctosys says :

/* IMPORTANT: the RTC only stores whole seconds. It is arbitrary
 * whether it stores the most close value or the value with partial
 * seconds truncated. However, it is important that we use it to store
 * the truncated value. This is because otherwise it is necessary,
 * in an rtc sync function, to read both xtime.tv_sec and
 * xtime.tv_nsec. On some processors (i.e. ARM), an atomic read
 * of >32bits is not possible. So storing the most close value would
 * slow down the sync API. So here we have the truncated value and
 * the best guess is to add 0.5s.
 */

I work with ST m41t81 rtc's.  Those rtc's actually have a 1/100th of second
register.  Should the generic rtc interface not support that ? 

Philippe
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 42/50] ebtables: dont compute gap before checking struct type

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Chuck Ebbert <[EMAIL PROTECTED]>

We cannot compute the gap until we know we have a 'struct ebt_entry'
and not 'struct ebt_entries'.  Failure to check can cause crash.

Tested-by: Santiago Garcia Mantinan <[EMAIL PROTECTED]>
Acked-by: Al Viro <[EMAIL PROTECTED]>
Acked-by: Patrick McHardy <[EMAIL PROTECTED]>
Signed-off-by: Chuck Ebbert <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 net/bridge/netfilter/ebtables.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.19.1.orig/net/bridge/netfilter/ebtables.c
+++ linux-2.6.19.1/net/bridge/netfilter/ebtables.c
@@ -575,7 +575,7 @@ ebt_check_entry(struct ebt_entry *e, str
struct ebt_entry_target *t;
struct ebt_target *target;
unsigned int i, j, hook = 0, hookmask = 0;
-   size_t gap = e->next_offset - e->target_offset;
+   size_t gap;
int ret;
 
/* don't mess with the struct ebt_entries */
@@ -625,6 +625,7 @@ ebt_check_entry(struct ebt_entry *e, str
if (ret != 0)
goto cleanup_watchers;
t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
+   gap = e->next_offset - e->target_offset;
target = find_target_lock(t->u.name, , _mutex);
if (!target)
goto cleanup_watchers;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 41/50] V4L: cx88: Fix leadtek_eeprom tagging

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Jean Delvare <[EMAIL PROTECTED]>

reference to .init.text: from .text between 'cx88_card_setup'
(at offset 0x68c) and 'cx88_risc_field'
Caused by leadtek_eeprom() being declared __devinit and called from
a non-devinit context.

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
Signed-off-by: Michael Krufky <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
(cherry picked from commit 69f7e75a9d45e5eaca16917a8d0dedf76149f13f)

 drivers/media/video/cx88/cx88-cards.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/drivers/media/video/cx88/cx88-cards.c
+++ linux-2.6.19.1/drivers/media/video/cx88/cx88-cards.c
@@ -1610,7 +1610,7 @@ const unsigned int cx88_idcount = ARRAY_
 /* --- */
 /* some leadtek specific stuff */
 
-static void __devinit leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
+static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
 {
/* This is just for the "Winfast 2000XP Expert" board ATM; I don't have 
data on
 * any others.

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 32/50] ext2: skip pages past number of blocks in ext2_find_entry (CVE-2006-6054)

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Eric Sandeen <[EMAIL PROTECTED]>

This one was pointed out on the MOKB site:
http://kernelfun.blogspot.com/2006/11/mokb-09-11-2006-linux-26x-ext2checkpage.html

If a directory's i_size is corrupted, ext2_find_entry() will keep processing
pages until the i_size is reached, even if there are no more blocks associated
with the directory inode.  This patch puts in some minimal sanity-checking
so that we don't keep checking pages (and issuing errors) if we know there
can be no more data to read, based on the block count of the directory inode.

This is somewhat similar in approach to the ext3 patch I sent earlier this
year.

Signed-off-by: Eric Sandeen <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
Not upstream yet

 fs/ext2/dir.c |8 
 1 file changed, 8 insertions(+)

--- linux-2.6.19.1.orig/fs/ext2/dir.c
+++ linux-2.6.19.1/fs/ext2/dir.c
@@ -368,6 +368,14 @@ struct ext2_dir_entry_2 * ext2_find_entr
}
if (++n >= npages)
n = 0;
+   /* next page is past the blocks we've got */
+   if (unlikely(n > (dir->i_blocks >> (PAGE_CACHE_SHIFT - 9 {
+   ext2_error(dir->i_sb, __FUNCTION__,
+   "dir %lu size %lld exceeds block count %llu",
+   dir->i_ino, dir->i_size,
+   (unsigned long long)dir->i_blocks);
+   goto out;
+   }
} while (n != start);
 out:
return NULL;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 18/50] i2c: fix broken ds1337 initialization

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Dirk Eibach <[EMAIL PROTECTED]>

On a custom board with ds1337 RTC I found that upgrade from 2.6.15 to
2.6.18 broke RTC support.

The main problem are changes to ds1337_init_client().
When a ds1337 recognizes a problem (e.g. power or clock failure) bit 7
in status register is set. This has to be reset by writing 0 to status
register. But since there are only 16 byte written to the chip and the
first byte is interpreted as an address, the status register (which is
the 16th) is never written.
The other problem is, that initializing all registers to zero is not
valid for day, date and month register. Funny enough this is checked by
ds1337_detect(), which depends on this values not being zero. So then
treated by ds1337_init_client() the ds1337 is not detected anymore,
whereas the failure bit in the status register is still set.

Broken by commit f9e8957937ebf60d22732a5ca9130f48a7603f60 (2.6.16-rc1,
2006-01-06). This fix is in Linus' tree since 2.6.20-rc1 (commit
763d9c046a2e511ec090a8986d3f85edf7448e7e).

Signed-off-by: Dirk Stieler <[EMAIL PROTECTED]>
Signed-off-by: Dirk Eibach <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 drivers/i2c/chips/ds1337.c |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- linux-2.6.19.1.orig/drivers/i2c/chips/ds1337.c
+++ linux-2.6.19.1/drivers/i2c/chips/ds1337.c
@@ -347,13 +347,19 @@ static void ds1337_init_client(struct i2
 
if ((status & 0x80) || (control & 0x80)) {
/* RTC not running */
-   u8 buf[16];
+   u8 buf[1+16];   /* First byte is interpreted as address */
struct i2c_msg msg[1];
 
dev_dbg(>dev, "%s: RTC not running!\n", __FUNCTION__);
 
/* Initialize all, including STATUS and CONTROL to zero */
memset(buf, 0, sizeof(buf));
+
+   /* Write valid values in the date/time registers */
+   buf[1+DS1337_REG_DAY] = 1;
+   buf[1+DS1337_REG_DATE] = 1;
+   buf[1+DS1337_REG_MONTH] = 1;
+
msg[0].addr = client->addr;
msg[0].flags = 0;
msg[0].len = sizeof(buf);

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 35/50] SPARC64: Handle ISA devices with no regs property.

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: David Miller <[EMAIL PROTECTED]>

And this points out that the return value from
isa_dev_get_resource() and the 'pregs' arg to
isa_dev_get_irq() are totally unused.

Based upon a patch from Richard Mortimer <[EMAIL PROTECTED]>

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>

---
 arch/sparc64/kernel/isa.c |   20 
 1 file changed, 8 insertions(+), 12 deletions(-)

--- linux-2.6.19.1.orig/arch/sparc64/kernel/isa.c
+++ linux-2.6.19.1/arch/sparc64/kernel/isa.c
@@ -22,14 +22,15 @@ static void __init report_dev(struct spa
printk(" [%s", isa_dev->prom_node->name);
 }
 
-static struct linux_prom_registers * __init
-isa_dev_get_resource(struct sparc_isa_device *isa_dev)
+static void __init isa_dev_get_resource(struct sparc_isa_device *isa_dev)
 {
struct linux_prom_registers *pregs;
unsigned long base, len;
int prop_len;
 
pregs = of_get_property(isa_dev->prom_node, "reg", _len);
+   if (!pregs)
+   return;
 
/* Only the first one is interesting. */
len = pregs[0].reg_size;
@@ -44,12 +45,9 @@ isa_dev_get_resource(struct sparc_isa_de
 
request_resource(_dev->bus->parent->io_space,
 _dev->resource);
-
-   return pregs;
 }
 
-static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev,
-  struct linux_prom_registers *pregs)
+static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev)
 {
struct of_device *op = of_find_device_by_node(isa_dev->prom_node);
 
@@ -69,7 +67,6 @@ static void __init isa_fill_children(str
 
printk(" ->");
while (dp) {
-   struct linux_prom_registers *regs;
struct sparc_isa_device *isa_dev;
 
isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL);
@@ -87,8 +84,8 @@ static void __init isa_fill_children(str
isa_dev->bus = parent_isa_dev->bus;
isa_dev->prom_node = dp;
 
-   regs = isa_dev_get_resource(isa_dev);
-   isa_dev_get_irq(isa_dev, regs);
+   isa_dev_get_resource(isa_dev);
+   isa_dev_get_irq(isa_dev);
 
report_dev(isa_dev, 1);
 
@@ -101,7 +98,6 @@ static void __init isa_fill_devices(stru
struct device_node *dp = isa_br->prom_node->child;
 
while (dp) {
-   struct linux_prom_registers *regs;
struct sparc_isa_device *isa_dev;
 
isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL);
@@ -141,8 +137,8 @@ static void __init isa_fill_devices(stru
isa_dev->bus = isa_br;
isa_dev->prom_node = dp;
 
-   regs = isa_dev_get_resource(isa_dev);
-   isa_dev_get_irq(isa_dev, regs);
+   isa_dev_get_resource(isa_dev);
+   isa_dev_get_irq(isa_dev);
 
report_dev(isa_dev, 0);
 

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 29/50] zd1211rw: Call ieee80211_rx in tasklet

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Ulrich Kunitz <[EMAIL PROTECTED]>

[PATCH] zd1211rw: Call ieee80211_rx in tasklet

The driver called ieee80211_rx in hardware interrupt context.  This has
been against the intention of the ieee80211_rx function.  It caused a bug
in the crypto routines used by WPA.  This patch calls ieee80211_rx in a
tasklet.

Signed-off-by: Ulrich Kunitz <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
Date: Sun, 10 Dec 2006 19:13:12 + (-0800)
Subject: [patch 29/50] [PATCH] zd1211rw: Call ieee80211_rx in tasklet
X-Git-Tag: v2.6.20-rc2
X-Git-Url: 
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=4d1feabcbf41f875447a392015acd0796f57baf6

 drivers/net/wireless/zd1211rw/zd_mac.c |   91 -
 drivers/net/wireless/zd1211rw/zd_mac.h |6 +-
 drivers/net/wireless/zd1211rw/zd_usb.c |4 -
 3 files changed, 75 insertions(+), 26 deletions(-)

--- linux-2.6.19.1.orig/drivers/net/wireless/zd1211rw/zd_mac.c
+++ linux-2.6.19.1/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -37,6 +37,8 @@ static void housekeeping_init(struct zd_
 static void housekeeping_enable(struct zd_mac *mac);
 static void housekeeping_disable(struct zd_mac *mac);
 
+static void do_rx(unsigned long mac_ptr);
+
 int zd_mac_init(struct zd_mac *mac,
struct net_device *netdev,
struct usb_interface *intf)
@@ -47,6 +49,10 @@ int zd_mac_init(struct zd_mac *mac,
spin_lock_init(>lock);
mac->netdev = netdev;
 
+   skb_queue_head_init(>rx_queue);
+   tasklet_init(>rx_tasklet, do_rx, (unsigned long)mac);
+   tasklet_disable(>rx_tasklet);
+
ieee_init(ieee);
softmac_init(ieee80211_priv(netdev));
zd_chip_init(>chip, netdev, intf);
@@ -132,6 +138,8 @@ out:
 
 void zd_mac_clear(struct zd_mac *mac)
 {
+   skb_queue_purge(>rx_queue);
+   tasklet_kill(>rx_tasklet);
zd_chip_clear(>chip);
ZD_ASSERT(!spin_is_locked(>lock));
ZD_MEMCLEAR(mac, sizeof(struct zd_mac));
@@ -160,6 +168,8 @@ int zd_mac_open(struct net_device *netde
struct zd_chip *chip = >chip;
int r;
 
+   tasklet_enable(>rx_tasklet);
+
r = zd_chip_enable_int(chip);
if (r < 0)
goto out;
@@ -210,6 +220,8 @@ int zd_mac_stop(struct net_device *netde
 */
 
zd_chip_disable_rx(chip);
+   skb_queue_purge(>rx_queue);
+   tasklet_disable(>rx_tasklet);
housekeeping_disable(mac);
ieee80211softmac_stop(netdev);
 
@@ -873,45 +885,78 @@ static int fill_rx_stats(struct ieee8021
return 0;
 }
 
-int zd_mac_rx(struct zd_mac *mac, const u8 *buffer, unsigned int length)
+static void zd_mac_rx(struct zd_mac *mac, struct sk_buff *skb)
 {
int r;
struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
struct ieee80211_rx_stats stats;
const struct rx_status *status;
-   struct sk_buff *skb;
 
-   if (length < ZD_PLCP_HEADER_SIZE + IEEE80211_1ADDR_LEN +
-IEEE80211_FCS_LEN + sizeof(struct rx_status))
-   return -EINVAL;
+   if (skb->len < ZD_PLCP_HEADER_SIZE + IEEE80211_1ADDR_LEN +
+  IEEE80211_FCS_LEN + sizeof(struct rx_status))
+   {
+   dev_dbg_f(zd_mac_dev(mac), "Packet with length %u to small.\n",
+skb->len);
+   goto free_skb;
+   }
 
-   r = fill_rx_stats(, , mac, buffer, length);
-   if (r)
-   return r;
+   r = fill_rx_stats(, , mac, skb->data, skb->len);
+   if (r) {
+   /* Only packets with rx errors are included here. */
+   goto free_skb;
+   }
 
-   length -= ZD_PLCP_HEADER_SIZE+IEEE80211_FCS_LEN+
- sizeof(struct rx_status);
-   buffer += ZD_PLCP_HEADER_SIZE;
+   __skb_pull(skb, ZD_PLCP_HEADER_SIZE);
+   __skb_trim(skb, skb->len -
+   (IEEE80211_FCS_LEN + sizeof(struct rx_status)));
 
-   update_qual_rssi(mac, buffer, length, stats.signal, stats.rssi);
+   update_qual_rssi(mac, skb->data, skb->len, stats.signal,
+status->signal_strength);
 
-   r = filter_rx(ieee, buffer, length, );
-   if (r <= 0)
-   return r;
 
-   skb = dev_alloc_skb(sizeof(struct zd_rt_hdr) + length);
-   if (!skb)
-   return -ENOMEM;
+   r = filter_rx(ieee, skb->data, skb->len, );
+   if (r <= 0) {
+   if (r < 0)
+   dev_dbg_f(zd_mac_dev(mac), "Error in packet.\n");
+   goto free_skb;
+   }
+
if (ieee->iw_mode == IW_MODE_MONITOR)
-   fill_rt_header(skb_put(skb, sizeof(struct zd_rt_hdr)), mac,
+   fill_rt_header(skb_push(skb, sizeof(struct zd_rt_hdr)), mac,
   

[patch 25/50] [stable] [stable patch] i386: CPU hotplug broken with 2GB VMSPLIT

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Shaohua Li <[EMAIL PROTECTED]>

In VMSPLIT mode, kernel PGD might have more entries than user space

Signed-off-by: Shaohua Li <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 arch/i386/kernel/smpboot.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/arch/i386/kernel/smpboot.c
+++ linux-2.6.19.1/arch/i386/kernel/smpboot.c
@@ -1095,7 +1095,7 @@ static int __cpuinit __smp_prepare_cpu(i
 
/* init low mem mapping */
clone_pgd_range(swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS,
-   KERNEL_PGD_PTRS);
+   min_t(unsigned long, KERNEL_PGD_PTRS, USER_PGD_PTRS));
flush_tlb_all();
schedule_work();
wait_for_completion();

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 20/50] Fix for shmem_truncate_range() BUG_ON()

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Badari Pulavarty <[EMAIL PROTECTED]>

Ran into BUG() while doing madvise(REMOVE) testing.  If we are punching a
hole into shared memory segment using madvise(REMOVE) and the entire hole
is below the indirect blocks, we hit following assert.

BUG_ON(limit <= SHMEM_NR_DIRECT);

Signed-off-by: Badari Pulavarty <[EMAIL PROTECTED]>
Cc: Hugh Dickins <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 mm/shmem.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- linux-2.6.19.1.orig/mm/shmem.c
+++ linux-2.6.19.1/mm/shmem.c
@@ -515,7 +515,12 @@ static void shmem_truncate_range(struct 
size = SHMEM_NR_DIRECT;
nr_swaps_freed = shmem_free_swp(ptr+idx, ptr+size);
}
-   if (!topdir)
+
+   /*
+* If there are no indirect blocks or we are punching a hole
+* below indirect blocks, nothing to be done.
+*/
+   if (!topdir || (punch_hole && (limit <= SHMEM_NR_DIRECT)))
goto done2;
 
BUG_ON(limit <= SHMEM_NR_DIRECT);

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 23/50] UDP: Fix reversed logic in udp_get_port()

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: David Miller <[EMAIL PROTECTED]>

When this code was converted to use sk_for_each() the
logic for the "best hash chain length" code was reversed,
breaking everything.

The original code was of the form:

size = 0;
do {
if (++size >= best_size_so_far)
goto next;
} while ((sk = sk->next) != NULL);
best_size_so_far = size;
best = result;
next:;

and this got converted into:

sk_for_each(sk2, node, head)
if (++size < best_size_so_far) {
best_size_so_far = size;
best = result;
}

Which does something very very different from the original.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 net/ipv4/udp.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

--- linux-2.6.19.1.orig/net/ipv4/udp.c
+++ linux-2.6.19.1/net/ipv4/udp.c
@@ -167,11 +167,14 @@ int udp_get_port(struct sock *sk, unsign
goto gotit;
}
size = 0;
-   sk_for_each(sk2, node, head)
-   if (++size < best_size_so_far) {
-   best_size_so_far = size;
-   best = result;
-   }
+   sk_for_each(sk2, node, head) {
+   if (++size >= best_size_so_far)
+   goto next;
+   }
+   best_size_so_far = size;
+   best = result;
+   next:
+   ;
}
result = best;
for(i = 0; i < (1 << 16) / UDP_HTABLE_SIZE; i++, result += 
UDP_HTABLE_SIZE) {

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 21/50] smc911x: fix netpoll compilation faliure

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Vitaly Wool <[EMAIL PROTECTED]>

Fix the compilation failure for smc911x.c when NET_POLL_CONTROLLER is set.

Signed-off-by: Vitaly Wool <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 drivers/net/smc911x.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/drivers/net/smc911x.c
+++ linux-2.6.19.1/drivers/net/smc911x.c
@@ -1331,7 +1331,7 @@ smc911x_rx_dma_irq(int dma, void *data)
 static void smc911x_poll_controller(struct net_device *dev)
 {
disable_irq(dev->irq);
-   smc911x_interrupt(dev->irq, dev, NULL);
+   smc911x_interrupt(dev->irq, dev);
enable_irq(dev->irq);
 }
 #endif

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 15/50] IB/srp: Fix FMR mapping for 32-bit kernels and addresses above 4G

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Roland Dreier <[EMAIL PROTECTED]>

struct srp_device.fmr_page_mask was unsigned long, which means that
the top part of addresses above 4G was being chopped off on 32-bit
architectures.  Of course nothing good happens when data from SRP
targets is DMAed to the wrong place.

Fix this by changing fmr_page_mask to u64, to match the addresses
actually used by IB devices.

Thanks to Brian Cain <[EMAIL PROTECTED]> and David McMillen
<[EMAIL PROTECTED]> for help diagnosing the bug and testing
the fix.

Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
I just asked Linus to pull this.  It fixes nasty corruption/crash
problems on 32-bit systems with > 4G of memory.

 drivers/infiniband/ulp/srp/ib_srp.c |2 +-
 drivers/infiniband/ulp/srp/ib_srp.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.19.1.orig/drivers/infiniband/ulp/srp/ib_srp.c
+++ linux-2.6.19.1/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1879,7 +1879,7 @@ static void srp_add_one(struct ib_device
 */
srp_dev->fmr_page_shift = max(9, ffs(dev_attr->page_size_cap) - 1);
srp_dev->fmr_page_size  = 1 << srp_dev->fmr_page_shift;
-   srp_dev->fmr_page_mask  = ~((unsigned long) srp_dev->fmr_page_size - 1);
+   srp_dev->fmr_page_mask  = ~((u64) srp_dev->fmr_page_size - 1);
 
INIT_LIST_HEAD(_dev->dev_list);
 
--- linux-2.6.19.1.orig/drivers/infiniband/ulp/srp/ib_srp.h
+++ linux-2.6.19.1/drivers/infiniband/ulp/srp/ib_srp.h
@@ -87,7 +87,7 @@ struct srp_device {
struct ib_fmr_pool *fmr_pool;
int fmr_page_shift;
int fmr_page_size;
-   unsigned long   fmr_page_mask;
+   u64 fmr_page_mask;
 };
 
 struct srp_host {

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 17/50] Bluetooth: Add packet size checks for CAPI messages (CVE-2006-6106)

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Marcel Holtmann <[EMAIL PROTECTED]>

With malformed packets it might be possible to overwrite internal
CMTP and CAPI data structures. This patch adds additional length
checks to prevent these kinds of remote attacks.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 net/bluetooth/cmtp/capi.c |   39 +--
 1 file changed, 33 insertions(+), 6 deletions(-)

--- linux-2.6.19.1.orig/net/bluetooth/cmtp/capi.c
+++ linux-2.6.19.1/net/bluetooth/cmtp/capi.c
@@ -196,6 +196,9 @@ static void cmtp_recv_interopmsg(struct 
 
switch (CAPIMSG_SUBCOMMAND(skb->data)) {
case CAPI_CONF:
+   if (skb->len < CAPI_MSG_BASELEN + 10)
+   break;
+
func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 5);
info = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 8);
 
@@ -226,6 +229,9 @@ static void cmtp_recv_interopmsg(struct 
break;
 
case CAPI_FUNCTION_GET_PROFILE:
+   if (skb->len < CAPI_MSG_BASELEN + 11 + 
sizeof(capi_profile))
+   break;
+
controller = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 
11);
msgnum = CAPIMSG_MSGID(skb->data);
 
@@ -246,17 +252,26 @@ static void cmtp_recv_interopmsg(struct 
break;
 
case CAPI_FUNCTION_GET_MANUFACTURER:
+   if (skb->len < CAPI_MSG_BASELEN + 15)
+   break;
+
controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 
10);
 
if (!info && ctrl) {
+   int len = min_t(uint, CAPI_MANUFACTURER_LEN,
+   skb->data[CAPI_MSG_BASELEN + 
14]);
+
+   memset(ctrl->manu, 0, CAPI_MANUFACTURER_LEN);
strncpy(ctrl->manu,
-   skb->data + CAPI_MSG_BASELEN + 15,
-   skb->data[CAPI_MSG_BASELEN + 14]);
+   skb->data + CAPI_MSG_BASELEN + 15, len);
}
 
break;
 
case CAPI_FUNCTION_GET_VERSION:
+   if (skb->len < CAPI_MSG_BASELEN + 32)
+   break;
+
controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 
12);
 
if (!info && ctrl) {
@@ -269,13 +284,18 @@ static void cmtp_recv_interopmsg(struct 
break;
 
case CAPI_FUNCTION_GET_SERIAL_NUMBER:
+   if (skb->len < CAPI_MSG_BASELEN + 17)
+   break;
+
controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 
12);
 
if (!info && ctrl) {
+   int len = min_t(uint, CAPI_SERIAL_LEN,
+   skb->data[CAPI_MSG_BASELEN + 
16]);
+
memset(ctrl->serial, 0, CAPI_SERIAL_LEN);
strncpy(ctrl->serial,
-   skb->data + CAPI_MSG_BASELEN + 17,
-   skb->data[CAPI_MSG_BASELEN + 16]);
+   skb->data + CAPI_MSG_BASELEN + 17, len);
}
 
break;
@@ -284,14 +304,18 @@ static void cmtp_recv_interopmsg(struct 
break;
 
case CAPI_IND:
+   if (skb->len < CAPI_MSG_BASELEN + 6)
+   break;
+
func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 3);
 
if (func == CAPI_FUNCTION_LOOPBACK) {
+   int len = min_t(uint, skb->len - CAPI_MSG_BASELEN - 6,
+   skb->data[CAPI_MSG_BASELEN + 
5]);
appl = CAPIMSG_APPID(skb->data);
msgnum = CAPIMSG_MSGID(skb->data);
cmtp_send_interopmsg(session, CAPI_RESP, appl, msgnum, 
func,
-   skb->data + CAPI_MSG_BASELEN + 
6,
-   skb->data[CAPI_MSG_BASELEN + 
5]);
+   skb->data + CAPI_MSG_BASELEN + 
6, len);
}
 
break;
@@ -309,6 +333,9 @@ void cmtp_recv_capimsg(struct cmtp_sessi
 
BT_DBG("session %p skb %p len %d", session, skb, skb->len);
 
+   if (skb->len < CAPI_MSG_BASELEN)
+   return;
+
if (CAPIMSG_COMMAND(skb->data) == CAPI_INTEROPERABILITY) {
cmtp_recv_interopmsg(session, skb);
return;

--
-
To unsubscribe from this list: 

[patch 12/50] kbuild: dont put temp files in source

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Roman Zippel <[EMAIL PROTECTED]>

The as-instr/ld-option need to create temporary files, but create them in the
output directory, when compiling external modules.  Reformat them a bit and
use $(CC) instead of $(AS) as the former is used by kbuild to assemble files.

Signed-off-by: Roman Zippel <[EMAIL PROTECTED]>
Cc: Andi Kleen <[EMAIL PROTECTED]>
Cc: Jan Beulich <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Cc: Horst Schirmeier <[EMAIL PROTECTED]>
Cc: Daniel Drake <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
It fixes building of external modules in a sandboxed environment.
http://bugs.gentoo.org/149307

 scripts/Kbuild.include |   19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

--- linux-2.6.19.1.orig/scripts/Kbuild.include
+++ linux-2.6.19.1/scripts/Kbuild.include
@@ -56,6 +56,9 @@ endef
 # gcc support functions
 # See documentation in Documentation/kbuild/makefiles.txt
 
+# output directory for tests below
+TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
+
 # as-option
 # Usage: cflags-y += $(call as-option, -Wa$(comma)-isa=foo,)
 
@@ -66,9 +69,11 @@ as-option = $(shell if $(CC) $(CFLAGS) $
 # as-instr
 # Usage: cflags-y += $(call as-instr, instr, option1, option2)
 
-as-instr = $(shell if echo -e "$(1)" | $(AS) >/dev/null 2>&1 -W -Z -o 
astest.out ; \
-  then echo "$(2)"; else echo "$(3)"; fi; \
-  rm -f astest.out)
+as-instr = $(shell if echo -e "$(1)" | \
+ $(CC) $(AFLAGS) -c -xassembler - \
+   -o $(TMPOUT)astest.out > /dev/null 2>&1; \
+  then rm $(TMPOUT)astest.out; echo "$(2)"; \
+  else echo "$(3)"; fi)
 
 # cc-option
 # Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586)
@@ -97,10 +102,10 @@ cc-ifversion = $(shell if [ $(call cc-ve
 
 # ld-option
 # Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both)
-ld-option = $(shell if $(CC) $(1) \
--nostdlib -o ldtest.out -xc /dev/null \
- > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi; \
-rm -f ldtest.out)
+ld-option = $(shell if $(CC) $(1) -nostdlib -xc /dev/null \
+-o $(TMPOUT)ldtest.out > /dev/null 2>&1; \
+ then rm $(TMPOUT)ldtest.out; echo "$(1)"; \
+ else echo "$(2)"; fi)
 
 ###
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 04/50] ieee80211softmac: Fix mutex_lock at exit of ieee80211_softmac_get_genie

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Ulrich Kunitz <[EMAIL PROTECTED]>

ieee80211softmac_wx_get_genie locks the associnfo mutex at
function exit. This patch fixes it. The patch is against Linus'
tree (commit af1713e0).

Signed-off-by: Ulrich Kunitz <[EMAIL PROTECTED]>
Signed-off-by: Michael Buesch <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 net/ieee80211/softmac/ieee80211softmac_wx.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ linux-2.6.19.1/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -463,7 +463,7 @@ ieee80211softmac_wx_get_genie(struct net
err = -E2BIG;
}
spin_unlock_irqrestore(>lock, flags);
-   mutex_lock(>associnfo.mutex);
+   mutex_unlock(>associnfo.mutex);
 
return err;
 }

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 09/50] Revert "[PATCH] zd1211rw: Removed unneeded packed attributes"

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: John W. Linville <[EMAIL PROTECTED]>

This reverts commit 4e1bbd846d00a245dcf78b6b331d8a9afed8e6d7.

Quoth Daniel Drake <[EMAIL PROTECTED]>:

"A user reported that commit 4e1bbd846d00a245dcf78b6b331d8a9afed8e6d7
(Remove unneeded packed attributes) breaks the zd1211rw driver on ARM."

Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 drivers/net/wireless/zd1211rw/zd_ieee80211.h |2 +-
 drivers/net/wireless/zd1211rw/zd_mac.c   |2 +-
 drivers/net/wireless/zd1211rw/zd_mac.h   |4 ++--
 drivers/net/wireless/zd1211rw/zd_usb.h   |   14 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)

--- linux-2.6.19.1.orig/drivers/net/wireless/zd1211rw/zd_ieee80211.h
+++ linux-2.6.19.1/drivers/net/wireless/zd1211rw/zd_ieee80211.h
@@ -64,7 +64,7 @@ struct cck_plcp_header {
u8 service;
__le16 length;
__le16 crc16;
-};
+} __attribute__((packed));
 
 static inline u8 zd_cck_plcp_header_rate(const struct cck_plcp_header *header)
 {
--- linux-2.6.19.1.orig/drivers/net/wireless/zd1211rw/zd_mac.c
+++ linux-2.6.19.1/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -721,7 +721,7 @@ struct zd_rt_hdr {
u8  rt_rate;
u16 rt_channel;
u16 rt_chbitmask;
-};
+} __attribute__((packed));
 
 static void fill_rt_header(void *buffer, struct zd_mac *mac,
   const struct ieee80211_rx_stats *stats,
--- linux-2.6.19.1.orig/drivers/net/wireless/zd1211rw/zd_mac.h
+++ linux-2.6.19.1/drivers/net/wireless/zd1211rw/zd_mac.h
@@ -82,7 +82,7 @@ struct zd_ctrlset {
 struct rx_length_info {
__le16 length[3];
__le16 tag;
-};
+} __attribute__((packed));
 
 #define RX_LENGTH_INFO_TAG 0x697e
 
@@ -93,7 +93,7 @@ struct rx_status {
u8 signal_quality_ofdm;
u8 decryption_type;
u8 frame_status;
-};
+} __attribute__((packed));
 
 /* rx_status field decryption_type */
 #define ZD_RX_NO_WEP   0
--- linux-2.6.19.1.orig/drivers/net/wireless/zd1211rw/zd_usb.h
+++ linux-2.6.19.1/drivers/net/wireless/zd1211rw/zd_usb.h
@@ -74,17 +74,17 @@ enum control_requests {
 struct usb_req_read_regs {
__le16 id;
__le16 addr[0];
-};
+} __attribute__((packed));
 
 struct reg_data {
__le16 addr;
__le16 value;
-};
+} __attribute__((packed));
 
 struct usb_req_write_regs {
__le16 id;
struct reg_data reg_writes[0];
-};
+} __attribute__((packed));
 
 enum {
RF_IF_LE = 0x02,
@@ -101,7 +101,7 @@ struct usb_req_rfwrite {
/* RF2595: 24 */
__le16 bit_values[0];
/* (CR203 & ~(RF_IF_LE | RF_CLK | RF_DATA)) | (bit ? RF_DATA : 0) */
-};
+} __attribute__((packed));
 
 /* USB interrupt */
 
@@ -118,12 +118,12 @@ enum usb_int_flags {
 struct usb_int_header {
u8 type;/* must always be 1 */
u8 id;
-};
+} __attribute__((packed));
 
 struct usb_int_regs {
struct usb_int_header hdr;
struct reg_data regs[0];
-};
+} __attribute__((packed));
 
 struct usb_int_retry_fail {
struct usb_int_header hdr;
@@ -131,7 +131,7 @@ struct usb_int_retry_fail {
u8 _dummy;
u8 addr[ETH_ALEN];
u8 ibss_wakeup_dest;
-};
+} __attribute__((packed));
 
 struct read_regs_int {
struct completion completion;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 13/50] ARM: Add sys_*at syscalls

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Russell King <[EMAIL PROTECTED]>

Later glibc requires the *at syscalls.  Add them.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 arch/arm/kernel/calls.S  |   13 +
 include/asm-arm/unistd.h |   13 +
 2 files changed, 26 insertions(+)

bca0b8e75f6b7cf52cf52c967286b72d84f9b37e
--- linux-2.6.19.1.orig/arch/arm/kernel/calls.S
+++ linux-2.6.19.1/arch/arm/kernel/calls.S
@@ -331,6 +331,19 @@
CALL(sys_mbind)
 /* 320 */  CALL(sys_get_mempolicy)
CALL(sys_set_mempolicy)
+   CALL(sys_openat)
+   CALL(sys_mkdirat)
+   CALL(sys_mknodat)
+/* 325 */  CALL(sys_fchownat)
+   CALL(sys_futimesat)
+   CALL(sys_fstatat64)
+   CALL(sys_unlinkat)
+   CALL(sys_renameat)
+/* 330 */  CALL(sys_linkat)
+   CALL(sys_symlinkat)
+   CALL(sys_readlinkat)
+   CALL(sys_fchmodat)
+   CALL(sys_faccessat)
 #ifndef syscalls_counted
 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
 #define syscalls_counted
--- linux-2.6.19.1.orig/include/asm-arm/unistd.h
+++ linux-2.6.19.1/include/asm-arm/unistd.h
@@ -347,6 +347,19 @@
 #define __NR_mbind (__NR_SYSCALL_BASE+319)
 #define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)
 #define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)
+#define __NR_openat(__NR_SYSCALL_BASE+322)
+#define __NR_mkdirat   (__NR_SYSCALL_BASE+323)
+#define __NR_mknodat   (__NR_SYSCALL_BASE+324)
+#define __NR_fchownat  (__NR_SYSCALL_BASE+325)
+#define __NR_futimesat (__NR_SYSCALL_BASE+326)
+#define __NR_fstatat64 (__NR_SYSCALL_BASE+327)
+#define __NR_unlinkat  (__NR_SYSCALL_BASE+328)
+#define __NR_renameat  (__NR_SYSCALL_BASE+329)
+#define __NR_linkat(__NR_SYSCALL_BASE+330)
+#define __NR_symlinkat (__NR_SYSCALL_BASE+331)
+#define __NR_readlinkat(__NR_SYSCALL_BASE+332)
+#define __NR_fchmodat  (__NR_SYSCALL_BASE+333)
+#define __NR_faccessat (__NR_SYSCALL_BASE+334)
 
 /*
  * The following SWIs are ARM private.

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 10/50] libata: handle 0xff status properly

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Tejun Heo <[EMAIL PROTECTED]>

libata waits for !BSY even when the status register reports 0xff.
This causes long boot delays when D8 isn't pulled down properly.  This
patch does the followings.

* don't wait if status register is 0xff in all wait functions

* make ata_busy_sleep() return 0 on success and -errno on failure.
  -ENODEV is returned on 0xff status and -EBUSY on other failures.

* make ata_bus_softreset() succeed on 0xff status.  0xff status is not
  reset failure.  It indicates no device.  This removes unnecessary
  retries on such ports.  Note that the code change assumes unoccupied
  port reporting 0xff status does not produce valid device signature.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Joe Jin <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
It fixes a long delay during booting for some hardware.
http://bugs.gentoo.org/157326

 drivers/ata/libata-core.c |   30 ++
 include/linux/libata.h|9 -
 2 files changed, 22 insertions(+), 17 deletions(-)

--- linux-2.6.19.1.orig/drivers/ata/libata-core.c
+++ linux-2.6.19.1/drivers/ata/libata-core.c
@@ -2325,11 +2325,14 @@ static inline void ata_tf_to_host(struct
  * Sleep until ATA Status register bit BSY clears,
  * or a timeout occurs.
  *
- * LOCKING: None.
+ * LOCKING:
+ * Kernel thread context (may sleep).
+ *
+ * RETURNS:
+ * 0 on success, -errno otherwise.
  */
-
-unsigned int ata_busy_sleep (struct ata_port *ap,
-unsigned long tmout_pat, unsigned long tmout)
+int ata_busy_sleep(struct ata_port *ap,
+  unsigned long tmout_pat, unsigned long tmout)
 {
unsigned long timer_start, timeout;
u8 status;
@@ -2337,27 +2340,32 @@ unsigned int ata_busy_sleep (struct ata_
status = ata_busy_wait(ap, ATA_BUSY, 300);
timer_start = jiffies;
timeout = timer_start + tmout_pat;
-   while ((status & ATA_BUSY) && (time_before(jiffies, timeout))) {
+   while (status != 0xff && (status & ATA_BUSY) &&
+  time_before(jiffies, timeout)) {
msleep(50);
status = ata_busy_wait(ap, ATA_BUSY, 3);
}
 
-   if (status & ATA_BUSY)
+   if (status != 0xff && (status & ATA_BUSY))
ata_port_printk(ap, KERN_WARNING,
"port is slow to respond, please be patient "
"(Status 0x%x)\n", status);
 
timeout = timer_start + tmout;
-   while ((status & ATA_BUSY) && (time_before(jiffies, timeout))) {
+   while (status != 0xff && (status & ATA_BUSY) &&
+  time_before(jiffies, timeout)) {
msleep(50);
status = ata_chk_status(ap);
}
 
+   if (status == 0xff)
+   return -ENODEV;
+
if (status & ATA_BUSY) {
ata_port_printk(ap, KERN_ERR, "port failed to respond "
"(%lu secs, Status 0x%x)\n",
tmout / HZ, status);
-   return 1;
+   return -EBUSY;
}
 
return 0;
@@ -2448,10 +2456,8 @@ static unsigned int ata_bus_softreset(st
 * the bus shows 0xFF because the odd clown forgets the D7
 * pulldown resistor.
 */
-   if (ata_check_status(ap) == 0xFF) {
-   ata_port_printk(ap, KERN_ERR, "SRST failed (status 0xFF)\n");
-   return AC_ERR_OTHER;
-   }
+   if (ata_check_status(ap) == 0xFF)
+   return 0;
 
ata_bus_post_reset(ap, devmask);
 
--- linux-2.6.19.1.orig/include/linux/libata.h
+++ linux-2.6.19.1/include/linux/libata.h
@@ -744,9 +744,8 @@ extern int ata_scsi_device_suspend(struc
 extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
 extern void ata_host_resume(struct ata_host *host);
 extern int ata_ratelimit(void);
-extern unsigned int ata_busy_sleep(struct ata_port *ap,
-  unsigned long timeout_pat,
-  unsigned long timeout);
+extern int ata_busy_sleep(struct ata_port *ap,
+ unsigned long timeout_pat, unsigned long timeout);
 extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *),
void *data, unsigned long delay);
 extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
@@ -1061,7 +1060,7 @@ static inline u8 ata_busy_wait(struct at
udelay(10);
status = ata_chk_status(ap);
max--;
-   } while ((status & bits) && (max > 0));
+   } while (status != 0xff && (status & bits) && (max > 0));
 
return status;
 }
@@ -1082,7 +1081,7 @@ static inline u8 ata_wait_idle(struct at
 {
u8 status = ata_busy_wait(ap, ATA_BUSY | 

[patch 11/50] ieee1394: ohci1394: add PPC_PMAC platform code to driver probe

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Stefan Richter <[EMAIL PROTECTED]>

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=7431
iBook G3 threw a machine check exception and put the display backlight
to full brightness after ohci1394 was unloaded and reloaded.

Signed-off-by: Stefan Richter <[EMAIL PROTECTED]>
[EMAIL PROTECTED]: also added missing if condition, commit
 63cca59e89892497e95e1e9c7156d3345fb7e2e8]
Signed-off-by: Daniel Drake <[EMAIL PROTECTED]>
Acked-by: Stefan Richter <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
It fixes a kernel oops which occurs when the ohci1394 driver is reloaded on PPC
http://bugs.gentoo.org/154851

 drivers/ieee1394/ohci1394.c |   21 -
 1 file changed, 16 insertions(+), 5 deletions(-)

--- linux-2.6.19.1.orig/drivers/ieee1394/ohci1394.c
+++ linux-2.6.19.1/drivers/ieee1394/ohci1394.c
@@ -3217,6 +3217,19 @@ static int __devinit ohci1394_pci_probe(
struct ti_ohci *ohci;   /* shortcut to currently handled device */
resource_size_t ohci_base;
 
+#ifdef CONFIG_PPC_PMAC
+   /* Necessary on some machines if ohci1394 was loaded/ unloaded before */
+   if (machine_is(powermac)) {
+   struct device_node *of_node = pci_device_to_OF_node(dev);
+
+   if (of_node) {
+   pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, of_node,
+ 0, 1);
+   pmac_call_feature(PMAC_FTR_1394_ENABLE, of_node, 0, 1);
+   }
+   }
+#endif /* CONFIG_PPC_PMAC */
+
 if (pci_enable_device(dev))
FAIL(-ENXIO, "Failed to enable OHCI hardware");
 pci_set_master(dev);
@@ -3505,11 +3518,9 @@ static void ohci1394_pci_remove(struct p
 #endif
 
 #ifdef CONFIG_PPC_PMAC
-   /* On UniNorth, power down the cable and turn off the chip
-* clock when the module is removed to save power on
-* laptops. Turning it back ON is done by the arch code when
-* pci_enable_device() is called */
-   {
+   /* On UniNorth, power down the cable and turn off the chip clock
+* to save power on laptops */
+   if (machine_is(powermac)) {
struct device_node* of_node;
 
of_node = pci_device_to_OF_node(ohci->dev);

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 08/50] V4L: Fix broken TUNER_LG_NTSC_TAPE radio support

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Hans Verkuil <[EMAIL PROTECTED]>

The TUNER_LG_NTSC_TAPE is identical in all respects to the
TUNER_PHILIPS_FM1236_MK3. So use the params struct for the Philips tuner.
Also add this LG_NTSC_TAPE tuner to the switches where radio specific
parameters are set so it behaves like a TUNER_PHILIPS_FM1236_MK3. This
change fixes the radio support for this tuner (the wrong bandswitch byte
was used).

Thanks to Andy Walls <[EMAIL PROTECTED]> for finding this bug.

Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
Signed-off-by: Michael Krufky <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>

---

 drivers/media/video/tuner-simple.c |2 ++
 drivers/media/video/tuner-types.c  |   14 ++
 2 files changed, 4 insertions(+), 12 deletions(-)

--- linux-2.6.19.1.orig/drivers/media/video/tuner-simple.c
+++ linux-2.6.19.1/drivers/media/video/tuner-simple.c
@@ -108,6 +108,7 @@ static int tuner_stereo(struct i2c_clien
case TUNER_PHILIPS_FM1216ME_MK3:
case TUNER_PHILIPS_FM1236_MK3:
case TUNER_PHILIPS_FM1256_IH3:
+   case TUNER_LG_NTSC_TAPE:
stereo = ((status & TUNER_SIGNAL) == TUNER_STEREO_MK3);
break;
default:
@@ -421,6 +422,7 @@ static void default_set_radio_freq(struc
case TUNER_PHILIPS_FM1216ME_MK3:
case TUNER_PHILIPS_FM1236_MK3:
case TUNER_PHILIPS_FMD1216ME_MK3:
+   case TUNER_LG_NTSC_TAPE:
buffer[3] = 0x19;
break;
case TUNER_TNF_5335MF:
--- linux-2.6.19.1.orig/drivers/media/video/tuner-types.c
+++ linux-2.6.19.1/drivers/media/video/tuner-types.c
@@ -672,16 +672,6 @@ static struct tuner_params tuner_panason
},
 };
 
-/*  TUNER_LG_NTSC_TAPE - LGINNOTEK NTSC  */
-
-static struct tuner_params tuner_lg_ntsc_tape_params[] = {
-   {
-   .type   = TUNER_PARAM_TYPE_NTSC,
-   .ranges = tuner_fm1236_mk3_ntsc_ranges,
-   .count  = ARRAY_SIZE(tuner_fm1236_mk3_ntsc_ranges),
-   },
-};
-
 /*  TUNER_TNF_8831BGFF - Philips PAL  */
 
 static struct tuner_range tuner_tnf_8831bgff_pal_ranges[] = {
@@ -1331,8 +1321,8 @@ struct tunertype tuners[] = {
},
[TUNER_LG_NTSC_TAPE] = { /* LGINNOTEK NTSC */
.name   = "LG NTSC (TAPE series)",
-   .params = tuner_lg_ntsc_tape_params,
-   .count  = ARRAY_SIZE(tuner_lg_ntsc_tape_params),
+   .params = tuner_fm1236_mk3_params,
+   .count  = ARRAY_SIZE(tuner_fm1236_mk3_params),
},
[TUNER_TNF_8831BGFF] = { /* Philips PAL */
.name   = "Tenna TNF 8831 BGFF)",

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 02/50] sha512: Fix sha384 block size

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Herbert Xu <[EMAIL PROTECTED]>

The SHA384 block size should be 128 bytes, not 96 bytes.  This was
spotted by Andrew Donofrio.

This breaks HMAC which uses the block size during setup and the final
calculation.

Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 crypto/sha512.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19.1.orig/crypto/sha512.c
+++ linux-2.6.19.1/crypto/sha512.c
@@ -24,7 +24,7 @@
 
 #define SHA384_DIGEST_SIZE 48
 #define SHA512_DIGEST_SIZE 64
-#define SHA384_HMAC_BLOCK_SIZE  96
+#define SHA384_HMAC_BLOCK_SIZE 128
 #define SHA512_HMAC_BLOCK_SIZE 128
 
 struct sha512_ctx {

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 01/50] dm-crypt: Select CRYPTO_CBC

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Herbert Xu <[EMAIL PROTECTED]>

As CBC is the default chaining method for cryptoloop, we should select
it from cryptoloop to ease the transition.  Spotted by Rene Herman.

Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
 drivers/md/Kconfig |1 +
 1 file changed, 1 insertion(+)

--- linux-2.6.19.1.orig/drivers/md/Kconfig
+++ linux-2.6.19.1/drivers/md/Kconfig
@@ -215,6 +215,7 @@ config DM_CRYPT
tristate "Crypt target support"
depends on BLK_DEV_DM && EXPERIMENTAL
select CRYPTO
+   select CRYPTO_CBC
---help---
  This device-mapper target allows you to create a device that
  transparently encrypts the data on it. You'll need to activate

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 05/50] x86-64: Mark rdtsc as sync only for netburst, not for core2

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Arjan van de Ven <[EMAIL PROTECTED]>

On the Core2 cpus, the rdtsc instruction is not serializing (as defined
in the architecture reference since rdtsc exists) and due to the deep
speculation of these cores, it's possible that you can observe time go
backwards between cores due to this speculation. Since the kernel
already deals with this with the SYNC_RDTSC flag, the solution is
simple, only assume that the instruction is serializing on family 15...

The price one pays for this is a slightly slower gettimeofday (by a
dozen or two cycles), but that increase is quite small to pay for a
really-going-forward tsc counter.

Signed-off-by: Arjan van de Ven <[EMAIL PROTECTED]>
Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---
Commit: f3d73707a1e84f0687a05144b70b660441e999c7
Author: Arjan van de Ven <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 7 02:14:12 2006 +0100

 arch/x86_64/kernel/setup.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

--- linux-2.6.19.1.orig/arch/x86_64/kernel/setup.c
+++ linux-2.6.19.1/arch/x86_64/kernel/setup.c
@@ -854,7 +854,10 @@ static void __cpuinit init_intel(struct 
set_bit(X86_FEATURE_CONSTANT_TSC, >x86_capability);
if (c->x86 == 6)
set_bit(X86_FEATURE_REP_GOOD, >x86_capability);
-   set_bit(X86_FEATURE_SYNC_RDTSC, >x86_capability);
+   if (c->x86 == 15)
+   set_bit(X86_FEATURE_SYNC_RDTSC, >x86_capability);
+   else
+   clear_bit(X86_FEATURE_SYNC_RDTSC, >x86_capability);
c->x86_max_cores = intel_num_cpu_cores(c);
 
srat_detect_node();

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 03/50] read_zero_pagealigned() locking fix

2007-01-05 Thread Chris Wright
-stable review patch.  If anyone has any objections, please let us know.
--

From: Hugh Dickins <[EMAIL PROTECTED]>

Ramiro Voicu hits the BUG_ON(!pte_none(*pte)) in zeromap_pte_range: kernel
bugzilla 7645.  Right: read_zero_pagealigned uses down_read of mmap_sem,
but another thread's racing read of /dev/zero, or a normal fault, can
easily set that pte again, in between zap_page_range and zeromap_page_range
getting there.  It's been wrong ever since 2.4.3.

The simple fix is to use down_write instead, but that would serialize reads
of /dev/zero more than at present: perhaps some app would be badly
affected.  So instead let zeromap_page_range return the error instead of
BUG_ON, and read_zero_pagealigned break to the slower clear_user loop in
that case - there's no need to optimize for it.

Use -EEXIST for when a pte is found: BUG_ON in mmap_zero (the other user of
zeromap_page_range), though it really isn't interesting there.  And since
mmap_zero wants -EAGAIN for out-of-memory, the zeromaps better return that
than -ENOMEM.

Signed-off-by: Hugh Dickins <[EMAIL PROTECTED]>
Cc: Ramiro Voicu: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Chris Wright <[EMAIL PROTECTED]>
---

 drivers/char/mem.c |   12 
 mm/memory.c|   32 +---
 2 files changed, 29 insertions(+), 15 deletions(-)

--- linux-2.6.19.1.orig/drivers/char/mem.c
+++ linux-2.6.19.1/drivers/char/mem.c
@@ -646,7 +646,8 @@ static inline size_t read_zero_pagealign
count = size;
 
zap_page_range(vma, addr, count, NULL);
-   zeromap_page_range(vma, addr, count, PAGE_COPY);
+   if (zeromap_page_range(vma, addr, count, PAGE_COPY))
+   break;
 
size -= count;
buf += count;
@@ -713,11 +714,14 @@ out:
 
 static int mmap_zero(struct file * file, struct vm_area_struct * vma)
 {
+   int err;
+
if (vma->vm_flags & VM_SHARED)
return shmem_zero_setup(vma);
-   if (zeromap_page_range(vma, vma->vm_start, vma->vm_end - vma->vm_start, 
vma->vm_page_prot))
-   return -EAGAIN;
-   return 0;
+   err = zeromap_page_range(vma, vma->vm_start,
+   vma->vm_end - vma->vm_start, vma->vm_page_prot);
+   BUG_ON(err == -EEXIST);
+   return err;
 }
 #else /* CONFIG_MMU */
 static ssize_t read_zero(struct file * file, char * buf, 
--- linux-2.6.19.1.orig/mm/memory.c
+++ linux-2.6.19.1/mm/memory.c
@@ -1110,23 +1110,29 @@ static int zeromap_pte_range(struct mm_s
 {
pte_t *pte;
spinlock_t *ptl;
+   int err = 0;
 
pte = pte_alloc_map_lock(mm, pmd, addr, );
if (!pte)
-   return -ENOMEM;
+   return -EAGAIN;
arch_enter_lazy_mmu_mode();
do {
struct page *page = ZERO_PAGE(addr);
pte_t zero_pte = pte_wrprotect(mk_pte(page, prot));
+
+   if (unlikely(!pte_none(*pte))) {
+   err = -EEXIST;
+   pte++;
+   break;
+   }
page_cache_get(page);
page_add_file_rmap(page);
inc_mm_counter(mm, file_rss);
-   BUG_ON(!pte_none(*pte));
set_pte_at(mm, addr, pte, zero_pte);
} while (pte++, addr += PAGE_SIZE, addr != end);
arch_leave_lazy_mmu_mode();
pte_unmap_unlock(pte - 1, ptl);
-   return 0;
+   return err;
 }
 
 static inline int zeromap_pmd_range(struct mm_struct *mm, pud_t *pud,
@@ -1134,16 +1140,18 @@ static inline int zeromap_pmd_range(stru
 {
pmd_t *pmd;
unsigned long next;
+   int err;
 
pmd = pmd_alloc(mm, pud, addr);
if (!pmd)
-   return -ENOMEM;
+   return -EAGAIN;
do {
next = pmd_addr_end(addr, end);
-   if (zeromap_pte_range(mm, pmd, addr, next, prot))
-   return -ENOMEM;
+   err = zeromap_pte_range(mm, pmd, addr, next, prot);
+   if (err)
+   break;
} while (pmd++, addr = next, addr != end);
-   return 0;
+   return err;
 }
 
 static inline int zeromap_pud_range(struct mm_struct *mm, pgd_t *pgd,
@@ -1151,16 +1159,18 @@ static inline int zeromap_pud_range(stru
 {
pud_t *pud;
unsigned long next;
+   int err;
 
pud = pud_alloc(mm, pgd, addr);
if (!pud)
-   return -ENOMEM;
+   return -EAGAIN;
do {
next = pud_addr_end(addr, end);
-   if (zeromap_pmd_range(mm, pud, addr, next, prot))
-   return -ENOMEM;
+   err = zeromap_pmd_range(mm, pud, addr, next, prot);
+   if (err)
+   break;
} while (pud++, addr = next, addr != end);
-   return 0;
+   return 

[patch 00/50] -stable review

2007-01-05 Thread Chris Wright
This is the start of the stable review cycle for the 2.6.19.2 release.
There are 50 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let us know.  If anyone is a maintainer of the proper subsystem, and
wants to add a Signed-off-by: line to the patch, please respond with it.

These patches are sent out with a number of different people on the
Cc: line.  If you wish to be a reviewer, please email [EMAIL PROTECTED]
to add your name to the list.  If you want to be off the reviewer list,
also email us.

Responses should be made by Mon Jan 8 02:30 UTC.
Anything received after that time might be too late.

thanks,

the -stable release team
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch] paravirt: isolate module ops

2007-01-05 Thread Arjan van de Ven
> 
> I would suggest a slightly different carving.  For one, no TLB flushes.  
> If you can't modify PTEs, why do you need to have TLB flushes?  And I 
> would allow CR0 read / write for code which saves and restores FPU state 

no that is abstracted away by kernel_fpu_begin/end. Modules have no
business doing that themselves

> - possibly even debug register access, although any code which touches 
> DRs could be doing something sneaky.  I'm on the fence about that one.

lets not allow it at all


-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via 
http://www.linuxfirmwarekit.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: PL2303 module

2007-01-05 Thread Gene Heskett
On Friday 05 January 2007 20:32, Greg KH wrote:
[...]
>> >
>> >It should work like any other serial port on Linux, so try the serial
>> >port programming HOWTO.
>>
>> Maybe so Greg, but I spent quite some time on it a few months back,
>> trying to make '7 wire' protocol work, could not.  I could type back
>> and forth between terminal proggies, but an rzsz file transfer never
>> got past the first packet.
>
>Hm, a number of the "odd" settings might not work on the usb-serial
>converters, as they can't do them (or the driver doesn't know how to
>configure the chip to do that.)

There is absolutely nothing 'odd' about the '7 wire', it is _the_ standard 
for bi-directional hardware flow control, in common usage for at least 25 
years that I'm aware of.

>The pl2303 driver was reverse engineered by looking at data from other
>operating systems, so perhaps no one has added that mode to it.

Humm, src code snooping time I guess, when I get a chance.  Right now its 
a race against time to get us on the air with a fresher transmitter since 
I can no longer get 4-1000 tubes to service our old GE, and the ones in 
it are on their last month.  So I'm outta here in a few minutes to go see 
if I can do a decent job of cutting 3.125" transmission lines on a 12" 
chop saw with a carbide blade.

>good luck,
>
>greg k-h
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in the body of a message to [EMAIL PROTECTED]
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2007 by Maurice Eugene Heskett, all rights reserved.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


asynchronous memory transfer/transform api(s) (was: Re: [RFC] Heads up on a series of AIO patchsets)

2007-01-05 Thread Dan Williams

[ trimmed the cc to just linux-kernel ]
On 1/3/07, Evgeniy Polyakov <[EMAIL PROTECTED]> wrote:

On Tue, Jan 02, 2007 at 02:38:13PM -0700, Dan Williams ([EMAIL PROTECTED]) 
wrote:
> Would you have time to comment on the approach I have taken to
> implement a standard asynchronous memcpy interface?  It seems it would
> be a good complement to what you are proposing.  The entity that
> describes the aio operation could take advantage of asynchronous
> engines to carry out copies or other transforms (maybe an acrypto tie
> in as well).
>
> Here is the posting for 2.6.19.  There has since been updates for
> 2.6.20, but the overall approach remains the same.
> intro: http://marc.theaimsgroup.com/?l=linux-raid=116491661527161=2
> async_tx: http://marc.theaimsgroup.com/?l=linux-raid=116491753318175=2

My first impression is that it has too many lists :)


Ok, I think I can cut this down if I use static allocations for the
software descriptors.


Looks good, but IMHO there are steps to implement further.
I have not found there any kind of scheduler - what if system has two
async engines?

It supports multiple engines (the iop341 has three), but it only does
a simple round robin for load balancing.  I'll look to acrypto for
other load balancing schemes, at the same time I am concerned about
cpu overhead of a scheduling algorithm.


What if sync engine faster than async in some cases (and
it is indeed the case for small buffers), and should be selected that time?

Yes I need to profile for this and make it tunable.


What if you will want to add additional transformations for some
devices like crypto processing or checksumming?


It would be nice to use an async_tx-style engine to handle the xor and
GF multiply portions of a crypto algorithm, but how do we handle the
case when an acrypto-style engine is available to handle the entire
algorithm from end-to-end?  It seems like there would need to be a
third layer to hide this distinction from application code, but as
quoted below maybe a layer is not the right way to go...



I would just create a driver for low-level engine, and exported its
functionality - iop3_async_copy(), iop3_async_checksum(), iop3_async_crypto_1(),
iop3_async_crypto_2() and so on.

There will be a lot of potential users of exactly that functionality,
but not stricly hardcoded higher layer operations like raidX.


This is the goal of the async_tx layer, it provides (currently)
async_memcpy, async_memset, async_xor and async_xor_zero_sum.  The
iop-adma driver exposes iop_adma_prep_dma_memcpy,
iop_adma_prep_dma_xor etc... for async_tx to consume.


More generic solution must be used to select appropriate device.
We had a very brief discussion about asynchronous crypto layer (acrypto)
and how its ideas could be used for async dma engines - user should not
even know how his data has been transferred - it calls async_copy(),
which selects appropriate device (and sync copy is just an additional
usual device in that case) from the list of devices, exported its
functionality, selection can be done in millions of different ways from
getting the fisrt one from the list (this is essentially how your
approach is implemented right now), or using special (including run-time
updated) heueristics (like it is done in acrypto).


async_memcpy makes an attempt at transparent fallback but currently
assumes that an engine is always faster.


Thinking further, async_copy() is just a usual case for async class of
operations. So the same above logic must be applied on this layer too.

But 'layers are the way to design protocols, not implement them'.
David Miller on netchannels

So, user should not even know about layers - it should just say 'copy
data from pointer A to pointer B', or 'copy data from pointer A to
socket B' or even 'copy it from file "/tmp/file" to "192.168.0.1:80:tcp"',
without ever knowing that there are sockets and/or memcpy() calls,
and if user requests to perform it asynchronously, it must be later
notified (one might expect, that I will prefer to use kevent :)
The same approach thus can be used by NFS/SAMBA/CIFS and other users.

That is how I start to implement AIO (it looks like it becomes popular):
1. system exports set of operations it supports (send, receive, copy,
crypto, )
2. each operation has subsequent set of suboptions (different crypto
types, for example)
3. each operation has set of low-level drivers, which support it (with
optional performance or any other parameters)
4. each driver when loaded publishes its capabilities (async copy with
speed A, XOR and so on)


The only problem with engines is that they are problematic to use on
userspace buffers (on non-coherent architectures).


From user's point of view its aio_sendfile() or async_copy() will look
following:
1. call aio_schedule_pointer(source='0xaabbccdd', dest='0x123456578')
1. call aio_schedule_file_socket(source='/tmp/file', dest='socket')
1. call aio_schedule_file_addr(source='/tmp/file',

Re: PL2303 module

2007-01-05 Thread Greg KH
On Fri, Jan 05, 2007 at 08:25:59PM -0500, Gene Heskett wrote:
> On Friday 05 January 2007 19:45, Greg KH wrote:
> >On Wed, Dec 27, 2006 at 10:48:06PM -0500, Gene Heskett wrote:
> >> Greetings;
> >>
> >> Rather offtopic, but:
> >>
> >> Is there available anyplace, a document that describes how to
> >> configure the PL2303 USB<->serial adaptor to match up with all the
> >> hardware and flow control variations inherent in the basic rs-232
> >> spec?
> >
> >It should work like any other serial port on Linux, so try the serial
> >port programming HOWTO.
> 
> Maybe so Greg, but I spent quite some time on it a few months back, trying 
> to make '7 wire' protocol work, could not.  I could type back and forth 
> between terminal proggies, but an rzsz file transfer never got past the 
> first packet.

Hm, a number of the "odd" settings might not work on the usb-serial
converters, as they can't do them (or the driver doesn't know how to
configure the chip to do that.)

The pl2303 driver was reverse engineered by looking at data from other
operating systems, so perhaps no one has added that mode to it.

good luck,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: PL2303 module

2007-01-05 Thread Gene Heskett
On Friday 05 January 2007 19:45, Greg KH wrote:
>On Wed, Dec 27, 2006 at 10:48:06PM -0500, Gene Heskett wrote:
>> Greetings;
>>
>> Rather offtopic, but:
>>
>> Is there available anyplace, a document that describes how to
>> configure the PL2303 USB<->serial adaptor to match up with all the
>> hardware and flow control variations inherent in the basic rs-232
>> spec?
>
>It should work like any other serial port on Linux, so try the serial
>port programming HOWTO.

Maybe so Greg, but I spent quite some time on it a few months back, trying 
to make '7 wire' protocol work, could not.  I could type back and forth 
between terminal proggies, but an rzsz file transfer never got past the 
first packet.

But I'll take a look at those docs too, thanks.

>good luck,
>
>greg k-h
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in the body of a message to [EMAIL PROTECTED]
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2007 by Maurice Eugene Heskett, all rights reserved.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Fix sparsemem on Cell (take 3)

2007-01-05 Thread Dave Hansen
I dropped this on the floor over Christmas.  This has had a few smoke
tests on ppc64 and i386 and is ready for -mm.  Against 2.6.20-rc2-mm1.

The following patch fixes an oops experienced on the Cell architecture
when init-time functions, early_*(), are called at runtime.  It alters
the call paths to make sure that the callers explicitly say whether the
call is being made on behalf of a hotplug even, or happening at
boot-time. 

Signed-off-by: Dave Hansen <[EMAIL PROTECTED]>

---

 lxc-dave/arch/s390/mm/vmem.c|3 ++-
 lxc-dave/include/linux/mm.h |7 ++-
 lxc-dave/include/linux/mmzone.h |3 ++-
 lxc-dave/mm/memory_hotplug.c|6 --
 lxc-dave/mm/page_alloc.c|   25 +
 5 files changed, 31 insertions(+), 13 deletions(-)

diff -puN mm/page_alloc.c~sparsemem-enum1 mm/page_alloc.c
--- lxc/mm/page_alloc.c~sparsemem-enum1 2006-12-19 09:38:34.0 -0800
+++ lxc-dave/mm/page_alloc.c2006-12-19 11:18:24.0 -0800
@@ -2062,17 +2062,24 @@ static inline unsigned long wait_table_b
  * done. Non-atomic initialization, single-pass.
  */
 void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long 
zone,
-   unsigned long start_pfn)
+   unsigned long start_pfn, enum memmap_context context)
 {
struct page *page;
unsigned long end_pfn = start_pfn + size;
unsigned long pfn;
 
for (pfn = start_pfn; pfn < end_pfn; pfn++) {
-   if (!early_pfn_valid(pfn))
-   continue;
-   if (!early_pfn_in_nid(pfn, nid))
-   continue;
+   /*
+* There can be holes in boot-time mem_map[]s
+* handed to this function.  They do not
+* exist on hotplugged memory.
+*/
+   if (context == MEMMAP_EARLY) {
+   if (!early_pfn_valid(pfn))
+   continue;
+   if (!early_pfn_in_nid(pfn, nid))
+   continue;
+   }
page = pfn_to_page(pfn);
set_page_links(page, zone, nid, pfn);
init_page_count(page);
@@ -2102,7 +2109,7 @@ void zone_init_free_lists(struct pglist_
 
 #ifndef __HAVE_ARCH_MEMMAP_INIT
 #define memmap_init(size, nid, zone, start_pfn) \
-   memmap_init_zone((size), (nid), (zone), (start_pfn))
+   memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY)
 #endif
 
 static int __cpuinit zone_batchsize(struct zone *zone)
@@ -2348,7 +2355,8 @@ static __meminit void zone_pcp_init(stru
 
 __meminit int init_currently_empty_zone(struct zone *zone,
unsigned long zone_start_pfn,
-   unsigned long size)
+   unsigned long size,
+   enum memmap_context context)
 {
struct pglist_data *pgdat = zone->zone_pgdat;
int ret;
@@ -2792,7 +2800,8 @@ static void __meminit free_area_init_cor
if (!size)
continue;
 
-   ret = init_currently_empty_zone(zone, zone_start_pfn, size);
+   ret = init_currently_empty_zone(zone, zone_start_pfn,
+   size, MEMMAP_EARLY);
BUG_ON(ret);
zone_start_pfn += size;
}
diff -puN include/linux/mm.h~sparsemem-enum1 include/linux/mm.h
--- lxc/include/linux/mm.h~sparsemem-enum1  2006-12-19 09:38:45.0 
-0800
+++ lxc-dave/include/linux/mm.h 2006-12-19 09:50:47.0 -0800
@@ -979,7 +979,12 @@ extern int early_pfn_to_nid(unsigned lon
 #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
 #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
 extern void set_dma_reserve(unsigned long new_dma_reserve);
-extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long);
+enum memmap_context {
+   MEMMAP_EARLY,
+   MEMMAP_HOTPLUG,
+};
+extern void memmap_init_zone(unsigned long, int, unsigned long,
+   unsigned long, enum memmap_context);
 extern void setup_per_zone_pages_min(void);
 extern void mem_init(void);
 extern void show_mem(void);
diff -puN mm/memory_hotplug.c~sparsemem-enum1 mm/memory_hotplug.c
--- lxc/mm/memory_hotplug.c~sparsemem-enum1 2006-12-19 09:39:19.0 
-0800
+++ lxc-dave/mm/memory_hotplug.c2006-12-19 09:50:24.0 -0800
@@ -67,11 +67,13 @@ static int __add_zone(struct zone *zone,
zone_type = zone - pgdat->node_zones;
if (!populated_zone(zone)) {
int ret = 0;
-   ret = init_currently_empty_zone(zone, phys_start_pfn, nr_pages);
+   ret = init_currently_empty_zone(zone, phys_start_pfn,
+   nr_pages, MEMMAP_HOTPLUG);
if (ret < 0)
return ret;
}
-   

[2.6 patch] cleanup include/linux/reiserfs_xattr.h

2007-01-05 Thread Adrian Bunk
- #ifdef guard this header for multiple inclusion
- adjust the #include's to what is actually required by this header
- remove an unneeded #ifdef
- #endif comments

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

 include/linux/reiserfs_xattr.h |   24 +++-
 1 file changed, 19 insertions(+), 5 deletions(-)

--- linux-2.6.20-rc3-mm1/include/linux/reiserfs_xattr.h.old 2007-01-05 
23:47:43.0 +0100
+++ linux-2.6.20-rc3-mm1/include/linux/reiserfs_xattr.h 2007-01-05 
23:48:31.0 +0100
@@ -2,7 +2,10 @@
   File: linux/reiserfs_xattr.h
 */
 
-#include 
+#ifndef _LINUX_REISERFS_XATTR_H
+#define _LINUX_REISERFS_XATTR_H
+
+#include 
 
 /* Magic value in header */
 #define REISERFS_XATTR_MAGIC 0x52465841/* "RFXA" */
@@ -13,7 +16,18 @@
 };
 
 #ifdef __KERNEL__
+
 #include 
+#include 
+#include 
+#include 
+#include 
+
+struct inode;
+struct dentry;
+struct iattr;
+struct super_block;
+struct nameidata;
 
 struct reiserfs_xattr_handler {
char *prefix;
@@ -49,9 +63,7 @@
 
 extern struct reiserfs_xattr_handler user_handler;
 extern struct reiserfs_xattr_handler trusted_handler;
-#ifdef CONFIG_REISERFS_FS_SECURITY
 extern struct reiserfs_xattr_handler security_handler;
-#endif
 
 int reiserfs_xattr_register_handlers(void) __init;
 void reiserfs_xattr_unregister_handlers(void);
@@ -137,6 +149,8 @@
 static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
 {
 }
-#endif
+#endif  /*  CONFIG_REISERFS_FS_XATTR  */
+
+#endif  /*  __KERNEL__  */
 
-#endif /* __KERNEL__ */
+#endif  /*  _LINUX_REISERFS_XATTR_H  */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[2.6 patch] cleanup include/linux/xattr.h

2007-01-05 Thread Adrian Bunk
- reduce the userspace visible part
- fix the in-kernel compilation

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

 include/linux/Kbuild  |2 +-
 include/linux/xattr.h |8 
 2 files changed, 9 insertions(+), 1 deletion(-)

--- linux-2.6.20-rc3-mm1/include/linux/Kbuild.old   2007-01-05 
23:42:02.0 +0100
+++ linux-2.6.20-rc3-mm1/include/linux/Kbuild   2007-01-05 23:42:47.0 
+0100
@@ -159,7 +159,6 @@
 header-y += videotext.h
 header-y += vt.h
 header-y += wireless.h
-header-y += xattr.h
 header-y += x25.h
 
 unifdef-y += acct.h
@@ -337,6 +336,7 @@
 unifdef-y += wanrouter.h
 unifdef-y += watchdog.h
 unifdef-y += wireless.h
+unifdef-y += xattr.h
 unifdef-y += xfrm.h
 
 objhdr-y += version.h
--- linux-2.6.20-rc3-mm1/include/linux/xattr.h.old  2007-01-05 
23:42:43.0 +0100
+++ linux-2.6.20-rc3-mm1/include/linux/xattr.h  2007-01-05 23:42:47.0 
+0100
@@ -13,6 +13,10 @@
 #define XATTR_CREATE   0x1 /* set value, fail if attr already exists */
 #define XATTR_REPLACE  0x2 /* set value, fail if attr does not exist */
 
+#ifdef  __KERNEL__
+
+#include 
+
 /* Namespaces */
 #define XATTR_OS2_PREFIX "os2."
 #define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1)
@@ -29,6 +33,8 @@
 #define XATTR_USER_PREFIX "user."
 #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
 
+struct inode;
+struct dentry;
 
 struct xattr_handler {
char *prefix;
@@ -50,4 +56,6 @@
 int generic_setxattr(struct dentry *dentry, const char *name, const void 
*value, size_t size, int flags);
 int generic_removexattr(struct dentry *dentry, const char *name);
 
+#endif  /*  __KERNEL__  */
+
 #endif /* _LINUX_XATTR_H */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[-mm patch] make proc_dointvec_taint() static

2007-01-05 Thread Adrian Bunk
On Thu, Jan 04, 2007 at 10:02:00PM -0800, Andrew Morton wrote:
>...
> Changes since 2.6.20-rc2-mm1:
>...
> +add-taint_user-and-ability-to-set-taint-flags-from-userspace.patch
>...
>  Misc fixes and updates
>...

This patch makes the needlessly global proc_dointvec_taint() static.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

 include/linux/sysctl.h |2 --
 kernel/sysctl.c|7 +--
 2 files changed, 5 insertions(+), 4 deletions(-)

--- linux-2.6.20-rc3-mm1/include/linux/sysctl.h.old 2007-01-05 
23:28:46.0 +0100
+++ linux-2.6.20-rc3-mm1/include/linux/sysctl.h 2007-01-05 23:28:54.0 
+0100
@@ -929,8 +929,6 @@
 void __user *, size_t *, loff_t *);
 extern int proc_dointvec_bset(ctl_table *, int, struct file *,
  void __user *, size_t *, loff_t *);
-extern int proc_dointvec_taint(ctl_table *, int, struct file *,
-  void __user *, size_t *, loff_t *);
 extern int proc_dointvec_minmax(ctl_table *, int, struct file *,
void __user *, size_t *, loff_t *);
 extern int proc_dointvec_jiffies(ctl_table *, int, struct file *,
--- linux-2.6.20-rc3-mm1/kernel/sysctl.c.old2007-01-05 23:29:05.0 
+0100
+++ linux-2.6.20-rc3-mm1/kernel/sysctl.c2007-01-05 23:30:31.0 
+0100
@@ -181,6 +181,9 @@
 int sysctl_legacy_va_layout;
 #endif
 
+static int proc_dointvec_taint(ctl_table *table, int write, struct file *filp,
+  void __user *buffer, size_t *lenp, loff_t *ppos);
+
 static void *get_uts(ctl_table *table, int write)
 {
char *which = table->data;
@@ -2022,8 +2025,8 @@
 /*
  * Taint values can only be increased
  */
-int proc_dointvec_taint(ctl_table *table, int write, struct file *filp,
-   void __user *buffer, size_t *lenp, loff_t *ppos)
+static int proc_dointvec_taint(ctl_table *table, int write, struct file *filp,
+  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
int op;
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   4   5   6   7   >