Re: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen

2007-10-12 Thread Steen Eugen Poulsen
Andrew Morton skrev:
> On Wed, 10 Oct 2007 10:28:45 +0200 (CEST)
> [EMAIL PROTECTED] wrote:
> 
>> I get this on brand new hardware, 2xHitachi Deathstar 320gb SATA2
>> (sata_via driver)

Sep 28 04:32:40 locker ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0
action 0x2 frozen
Sep 28 04:32:40 locker ata1.00: cmd b0/d2:f1:00:4f:c2/00:00:00:00:00/00
tag 0 cdb 0x0 data 123392 in
Sep 28 04:32:40 locker res 50/00:f1:00:4f:c2/00:00:00:00:00/00 Emask
0x202 (HSM violation)
Sep 28 04:32:41 locker  current size: 625140335 sectors

Sep 28 04:32:41 locker  native size: 625142448 sectors

Sep 28 04:32:41 locker  current size: 625140335 sectors

Sep 28 04:32:41 locker  native size: 625142448 sectors

Another machine:

Sep 28 03:47:55 dragonslair ata1.00: exception Emask 0x0 SAct 0x0 SErr
0x0 action 0x2 frozen
Sep 28 03:47:55 dragonslair ata1.00: cmd
b0/db:f8:00:4f:c2/00:00:00:00:00/00 tag 0 cdb 0x0 data 126976 in

Sep 28 03:47:55 dragonslair res 50/00:f8:00:4f:c2/00:00:00:00:00/00
Emask 0x202 (HSM violation)
Sep 28 03:47:55 dragonslair ata1: soft resetting port

Sep 28 03:47:55 dragonslair ata1.00: configured for UDMA/133

Sep 28 03:47:55 dragonslair ata1: EH complete

Sep 28 03:47:55 dragonslair sd 0:0:0:0: [sda] Write cache: enabled, read
cache: enabled, doesn't support DPO or FUA
Sep 28 03:47:55 dragonslair sd 0:0:0:0: [sda] 15625 512-byte
hardware sectors (8 MB)
Sep 28 03:47:55 dragonslair sd 0:0:0:0: [sda] Write Protect is off

Sep 28 03:47:55 dragonslair sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00

Sep 28 03:47:55 dragonslair sd 0:0:0:0: [sda] Write cache: enabled, read
cache: enabled, doesn't support DPO or FUA

And yet another:

Sep 28 04:33:52 liferaft kernel: ata1.00: exception Emask 0x0 SAct 0x0
SErr 0x0 action 0x2 frozen
Sep 28 04:33:55 liferaft kernel: ata1.00: cmd
b0/d2:f1:00:4f:c2/00:00:00:00:00/00 tag 0 cdb 0x0 data 123392 in
Sep 28 04:33:55 liferaft kernel:  res
50/00:f1:00:4f:c2/00:00:00:00:00/00 Emask 0x202 (HSM violation)
Sep 28 04:33:55 liferaft kernel: ata1: soft resetting port
Sep 28 04:33:55 liferaft kernel: ata1: SATA link up 3.0 Gbps (SStatus
123 SControl 300)
Sep 28 04:33:55 liferaft kernel: ata1.00: configured for UDMA/133
Sep 28 04:33:55 liferaft kernel: ata1: EH complete



Another few cases, taken from semi random locations from my log to get
the many different data, maybe some of it can help out.

Weirdness 1: I have 3 machines, that decide to spew this garbage within
the same second? (smartd running at it is around the hour that smartd
would run, but it's just this one day Sep 28 that horrible bad)

Note 1: Bad/failing hardware creates these type of errors.

Note 2: The hardware didn't freeze for me and I believe the freeze is do
to swap breaking due to the errors.

Note 3: dragonslair's harddisk actually crashed, kernel didn't die, it
just remounted read only. Reboot and the disk was missing, more reboot
and the machine started with all disks running again, been stable since
the 28th Sep. (knock on wood)

Note 4: I've changed hardware and kernel in a non controled manner, so I
was waiting for another case of these errors where I would be able to
write down kernel config.

I'm not sure, but I do believe that a keyword with this stuff is SMP and
2.6.22, older kernels doesn't seem to trigger this and non SMP seems to
avoid it with 2.6.22, but I can't trigger the error, so there is no way
of knowing if the conclusion can be trusted.

Dragonslair:
P4 x2 3.0 Ghz
Chips Intel 865GV & ICH5
32bit SMP kernel (2.6.22)
2 SATA disks WDC WD800JD-75MSA3
(I'm guessing this one has a physical bad disk, since it's the only one
the disk has physically failed and the only one with a worrying SMART
error: 1 Raw_Read_Error_Rate 0x000f 200 200 051 Pre-fail Always - 5)

Locker:
AMD 64x2
Chips Nvidia 570
32bit SMP kernel (2.6.22)
6 SATA disks 2xWD3200YS-01PGB0 4xWD3200AAKS-00TMA0

Liferaft:
AMD 64x2
Chips Nvidia 590
32bit SMP kernel (vserver 2.6.22 based)
1 SATA disk WD2500KS-00MJB0



smime.p7s
Description: S/MIME Cryptographic Signature


Re: 2.6.23.git build error

2007-10-12 Thread Giacomo Catenazzi
Mike Galbraith wrote:
> On Fri, 2007-10-12 at 23:31 +0200, Sam Ravnborg wrote:
>> On Fri, Oct 12, 2007 at 06:48:58AM +0200, Mike Galbraith wrote:
>>> Greetings,
>>>
>>> Freshly pulled 2.6.23.git failed to build:
>>>
>>> make[1]: *** No rule to make target `arch/x86/kernel/asm-offsets.c', needed 
>>> by `arch/x86/kernel/asm-offsets.s'.  Stop.
>>> make: *** [prepare0] Error 2
>>> make: *** Waiting for unfinished jobs
>> You are the only reporter of this bug.
>> I do not see it here and I have the asm-offset.c file.
> 
> Yeah, I noticed nobody else was griping.


I also saw this behaiour, but make mrproper solved the problem.


ciao
cate
-
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/


[linux-2.6.git] IDE/ATA fighting over driver name?

2007-10-12 Thread Mike Galbraith
Greetings,

Perhaps my .config is dainbramaged.  When make oldconfig asked me if I
wanted CONFIG_PATA_PLATFORM, I said "Damned if I know, go for it".

drivers/ide/legacy/ide_platform.c:  .name = "pata_platform",
drivers/ata/pata_platform.c:#define DRV_NAME "pata_platform"

[   26.586663] sysfs: duplicate filename 'pata_platform' can not be created
[   26.601006] WARNING: at fs/sysfs/dir.c:425 sysfs_add_one()
[   26.614080]  [] show_trace_log_lvl+0x1a/0x30
[   26.626777]  [] show_trace+0x12/0x14
[   26.638668]  [] dump_stack+0x16/0x18
[   26.650306]  [] sysfs_add_one+0x91/0xc6
[   26.662311]  [] create_dir+0x43/0x7a
[   26.673884]  [] sysfs_create_dir+0x2b/0x43
[   26.685944]  [] kobject_add+0x97/0x1b5
[   26.697775]  [] kobject_register+0x1c/0x37
[   26.709873]  [] bus_add_driver+0x62/0x1cf
[   26.721833]  [] driver_register+0x42/0x6c
[   26.733682]  [] platform_driver_register+0x66/0x68
[   26.746301]  [] pata_platform_init+0xd/0xf
[   26.758138]  [] kernel_init+0x131/0x2fb
[   26.769631]  [] kernel_thread_helper+0x7/0x14
[   26.781659]  ===
[   26.791959] kobject_add failed for pata_platform with -EEXIST, don't try to 
register things with the same name in the same directory.
[   26.818148]  [] show_trace_log_lvl+0x1a/0x30
[   26.830479]  [] show_trace+0x12/0x14
[   26.842032]  [] dump_stack+0x16/0x18
[   26.853507]  [] kobject_add+0x11c/0x1b5
[   26.865070]  [] kobject_register+0x1c/0x37
[   26.876702]  [] bus_add_driver+0x62/0x1cf
[   26.888250]  [] driver_register+0x42/0x6c
[   26.899788]  [] platform_driver_register+0x66/0x68
[   26.912009]  [] pata_platform_init+0xd/0xf
[   26.923379]  [] kernel_init+0x131/0x2fb
[   26.934490]  [] kernel_thread_helper+0x7/0x14
[   26.946010]  ===


-
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: [GIT PULL] MMC updates

2007-10-12 Thread Randy Dunlap
On Fri, 12 Oct 2007 23:00:27 +0200 Pierre Ossman wrote:

> Ok, let's see if we can finally sort this out.
> 
> Please pull/cherry-pick from:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.git for-linus
> 
> to receive the following update:
> 
>  drivers/mmc/core/host.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> Pierre Ossman (1):
>   mmc: use correct unregister function for led trigger
> 
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 64fbc97..c65d203 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -143,7 +143,7 @@ void mmc_remove_host(struct mmc_host *host)
>  
> device_del(>class_dev);
>  
> -   led_trigger_unregister(host->led);
> +   led_trigger_unregister_simple(host->led);
>  
> spin_lock(_host_lock);
> idr_remove(_host_idr, host->index);

Patch doesn't apply cleanly due to spaces instead of tabs.
Copy-and-paste ?

---
~Randy
-
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: Off-Topic: Patent infringement cases filed in U.S.

2007-10-12 Thread Steen Eugen Poulsen
Jan Engelhardt skrev:
> On Oct 12 2007 18:25, Renato S. Yamane wrote:
>> "IP Innovation LLC has just filed a patent infringement claim against Red Hat
>> and Novell. It was filed October 9, case no. 2:2007cv00447, IP Innovation, 
>> LLC
>> et al v. Red Hat Inc. et al, in Texas":
> 
> I think the number of news sites like lwn,osnews,slashdot,etc
> is already high enough that no developer would miss out on that.
> That is, those who even care for such.

The fact it has nothing to do with Linux Kernel, not even remotely as
the patent is never, no matter how wide you stretch it, is going to
cower any technology in the kernel, makes this a FUD post, since the
poster didn't bother to explain it.


It's still unclear what the patent actually mean, might be multi
monitor, virtual desktop or maybe sticky windows. Only thing clear is
that it can't be the Linux Kernel it's about.



smime.p7s
Description: S/MIME Cryptographic Signature


Re: [PATCH] Reserve N process to root

2007-10-12 Thread Al Boldi
Gustavo Chain wrote:
> Al Boldi <[EMAIL PROTECTED]> escribió:
> > Kyle Moffett wrote:
> > > On Oct 12, 2007, at 01:37:23, Al Boldi wrote:
> > > > You have a point, and resource-controllers can probably control
> > > > DoS a lot better, but the they also incur more overhead.  Think
> > > > of this "lockout prevention" patch as a near zero overhead safety
> > > > valve.
> > >
> > > But why do you need to add "lockout prevention" if it already
> > > exists?
> >
> > I said this before, but I'll say it again: it's about overhead!
> >
> > > With CFS' extremely efficient per-user-scheduling (hopefully
> > > soon to be the default) there are only two forms of lockout by non-
> > > root processes:  (1) Running out of PIDs in the box's PID-space
> > > (think tens or hundreds of thousands of processes), or (2) Swap-
> > > storming the box to death.  To put it bluntly trying to reserve free
> > > PID slots is attacking the wrong end of the problem and your so
> > > called "lockout prevention" could very easily ensure that 10 PIDs
> > > are available even if the user has swapstormed the box with the
> > > PIDs he does have.
> >
> > I think you are reading this wrong.  It's not about reserving PIDs,
> > it's about exceeding the max-threads limit.  This limit is global and
> > affects every user including root, which is good, as this allows the
> > sysadmin to fence the system into a controllable state.  So once the
> > system reaches the fence, sysadmin-intervention allows root to exceed
> > the fence.
> >
> > Again, this is much nicer with real resource-controllers, but again
> > it's also more overhead.
>
> Just an _if()_ ?
>
> may be enable it as an option in kernel config ?

Here is the patch again:

[PATCH 1/1] threads_max: Simple lockout prevention patch

Simple attempt to provide a backdoor in a process lockout situation.

echo $$ > /proc/sys/kernel/su-pid allows pid to exceed the threads_max limit.

Note that this patch incurs zero runtime-overhead.

Signed-off-by: Al Boldi <[EMAIL PROTECTED]>

---
(patch against 2.6.14)

--- kernel/fork.c.orig  2005-11-14 20:55:33.0 +0300
+++ kernel/fork.c   2005-11-14 20:58:25.0 +0300
@@ -57,6 +57,7 @@
 int nr_threads;/* The idle threads do not count.. */
 
 int max_threads;   /* tunable limit on nr_threads */
+int su_pid;/* BackDoor pid to exceed limit on nr_threads */
 
 DEFINE_PER_CPU(unsigned long, process_counts) = 0;
 
@@ -926,6 +927,7 @@
 * to stop root fork bombs.
 */
if (nr_threads >= max_threads)
+   if (p->pid != su_pid)
goto bad_fork_cleanup_count;
 
if (!try_module_get(p->thread_info->exec_domain->module))


--- kernel/sysctl.c.orig2005-11-14 20:58:45.0 +0300
+++ kernel/sysctl.c 2005-11-14 21:01:20.0 +0300
@@ -57,6 +57,7 @@
 extern int sysctl_overcommit_memory;
 extern int sysctl_overcommit_ratio;
 extern int max_threads;
+extern int su_pid;
 extern int sysrq_enabled;
 extern int core_uses_pid;
 extern int suid_dumpable;
@@ -509,6 +510,14 @@
.proc_handler   = _dointvec,
},
{
+   .ctl_name   = KERN_SU_PID,
+   .procname   = "su-pid",
+   .data   = _pid,
+   .maxlen = sizeof(int),
+   .mode   = 0644,
+   .proc_handler   = _dointvec,
+   },
+   {
.ctl_name   = KERN_RANDOM,
.procname   = "random",
.mode   = 0555,


--- include/linux/sysctl.h.orig 2005-11-14 20:54:55.0 +0300
+++ include/linux/sysctl.h  2005-11-14 20:55:15.0 +0300
@@ -146,6 +146,7 @@
KERN_RANDOMIZE=68, /* int: randomize virtual address space */
KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core 
*/
KERN_SPIN_RETRY=70, /* int: number of spinlock retries */
+   KERN_SU_PID=71, /* int: BackDoor pid to exceed Maximum
+   /*  nr of threads in the system */
 };


-
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 002/002] Create/delete kmem_cache_node for SLUB on memory online callback

2007-10-12 Thread Yasunori Goto
> On Fri, 12 Oct 2007, Yasunori Goto wrote:
> 
> > > > +   down_read(_lock);
> > > > +   list_for_each_entry(s, _caches, list) {
> > > > +   local_node = page_to_nid(virt_to_page(s));
> > > > +   if (local_node == offline_node)
> > > > +   /* This slub is on the offline node. */
> > > > +   return -EBUSY;
> > > > +   }
> > > > +   up_read(_lock);
> > > 
> > > So this checks if the any kmem_cache structure is on the offlined node? If
> > > so then we cannot offline the node?
> > 
> > Right. If slabs' migration is possible, here would be good place for
> > doing it. But, it is not possible (at least now).
> 
> I think you can avoid this check. The kmem_cache structures are allocated 
> from the kmalloc array. The check if the kmalloc slabs are empty will fail 
> if kmem_cache structures still exist on the node.

Ah, Ok.


> 
> > > > +* because the node is used by slub yet.
> > > > +*/
> > > 
> > > It may be clearer to say:
> > > 
> > > "If nr_slabs > 0 then slabs still exist on the node that is going down.
> > > We were unable to free them so we must fail."
> > 
> > Again. If nr_slabs > 0, offline_pages must be fail due to slabs
> > remaining on the node before. So, this callback isn't called.
> 
> Ok then we can remove these checks?

Hmm. Yes. I'll remove it.

> 
> > > > +static int slab_mem_going_online_callback(void *arg)
> > > > +{
> > > > +   struct kmem_cache_node *n;
> > > > +   struct kmem_cache *s;
> > > > +   struct memory_notify *marg = arg;
> > > > +   int nid = marg->status_change_nid;
> > > > +
> > > > +   /* If the node already has memory, then nothing is necessary. */
> > > > +   if (nid < 0)
> > > > +   return 0;
> > > 
> > > The node must have memory  Or we have already brought up the code?
> > 
> > kmem_cache_node is created at boot time if the node has memory.
> > (Or, it is created by this callback on first added memory on the node).
> > 
> > When nid = - 1, kmem_cache_node is created before this node due to
> > node has memory. 
> 
> So the function can be called for a node that is already online?

already "node memory available", accurately ;-)


> 
> > > > +* New memory will be onlined on the node which has no memory 
> > > > so far.
> > > > +* New kmem_cache_node is necssary for it.
> > > 
> > > "We are bringing a node online. No memory is available yet. We must 
> > > allocate a kmem_cache_node structure in order to bring the node online." ?
> > 
> > Your mention might be ok.
> > But. I would like to prefer to define status of node hotplug for
> > exactitude like followings
> > 
> > 
> > A)Node online -- pgdat is created and can be accessed for this node.
> >  but there are no gurantee that cpu or memory is onlined.
> >  This status is very close from memory-less node.
> >  But this might be halfway status for node hotplug.
> >  Node online bit is set. But N_HIGH_MEMORY
> >  (or N_NORMAL_MEMORY) might be not set.
> 
> Ahh.. Okay.
> 
> > B)Node has memory--
> >  one or more sections memory is onlined on the node.
> >  N_HIGH_MEMORY (or N_NORMAL_MEMORY) is set.
> > 
> > If first memory is onlined on the node, the node status changes
> > from A) to B).
> > 
> > I feel this is very useful to manage "halfway status" of node
> > hotplug. (So, memory-less node patch is very helpful for me.)
> > 
> > So, I would like to avoid using the word "node online" at here.
> > But, if above definition is messy for others, I'll change it.
> 
> Ok can we talk about this as
> 
>   node online
> 
> and
> 
>   node memory available?

Yes. Thanks.


-- 
Yasunori Goto 


-
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] sched: Rationalize sys_sched_rr_get_interval()

2007-10-12 Thread Peter Williams

Jarek Poplawski wrote:

On 12-10-2007 00:23, Peter Williams wrote:
...
The reason I was going that route was for modularity (which helps when 
adding plugsched patches).  I'll submit a revised patch for consideration.

...

IMHO, it looks like modularity could suck here:


+static unsigned int default_timeslice_fair(struct task_struct *p)
+{
+   return NS_TO_JIFFIES(sysctl_sched_min_granularity);
+}


If it's needed for outside and sched_fair will use something else
(to avoid double conversion) this could be misleading. Shouldn't
this be kind of private and return something usable for the class
mainly?


This is supplying data for a system call not something for internal use 
by the class.  As far as the sched_fair class is concerned this is just 
a (necessary - because it's need by a system call) diversion.



Why anything else than sched_fair should care about this?


sched_fair doesn't care so if nothing else does why do we even have 
sys_sched_rr_get_interval()?  Is this whole function an anachronism that 
can be expunged?  I'm assuming that the reason it exists is that there 
are user space programs that use this system call.  Am I correct in this 
assumption?  Personally, I can't think of anything it would be useful 
for other than satisfying curiosity.


Peter
--
Peter Williams   [EMAIL PROTECTED]

"Learning, n. The kind of ignorance distinguishing the studious."
 -- Ambrose Bierce
-
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.23-mm1 - build failure with advansys

2007-10-12 Thread Kamalesh Babulal
Hi Andrew,

Another build failure with following message

  CC  drivers/scsi/advansys.o
drivers/scsi/advansys.c:71:2: warning: #warning this driver is still not 
properly converted to the DMA API
drivers/scsi/advansys.c: In function ‘AdvBuildCarrierFreelist’:
drivers/scsi/advansys.c:6486: error: implicit declaration of function 
‘virt_to_bus’
drivers/scsi/advansys.c: In function ‘AdvInitAsc3550Driver’:
drivers/scsi/advansys.c:6974: error: implicit declaration of function 
‘bus_to_virt’
drivers/scsi/advansys.c:6974: warning: cast to pointer from integer of 
different size
drivers/scsi/advansys.c:6994: warning: cast to pointer from integer of 
different size
drivers/scsi/advansys.c: In function ‘AdvInitAsc38C0800Driver’:
drivers/scsi/advansys.c:7450: warning: cast to pointer from integer of 
different size
drivers/scsi/advansys.c:7471: warning: cast to pointer from integer of 
different size
drivers/scsi/advansys.c: In function ‘AdvInitAsc38C1600Driver’:
drivers/scsi/advansys.c:7939: warning: cast to pointer from integer of 
different size
drivers/scsi/advansys.c:7963: warning: cast to pointer from integer of 
different size
drivers/scsi/advansys.c: In function ‘adv_isr_callback’:
drivers/scsi/advansys.c:8175: warning: cast to pointer from integer of 
different size
drivers/scsi/advansys.c: In function ‘AdvISR’:
drivers/scsi/advansys.c:8392: warning: cast to pointer from integer of 
different size
drivers/scsi/advansys.c:8412: warning: cast to pointer from integer of 
different size
drivers/scsi/advansys.c: In function ‘AdvExeScsiQueue’:
drivers/scsi/advansys.c:10845: warning: cast to pointer from integer of 
different size
make[2]: *** [drivers/scsi/advansys.o] Error 1
make[1]: *** [drivers/scsi] Error 2
make: *** [drivers] Error 2


The functions virt_to_bus and bus_to_virt are begin defined between ifdef 
CONFIG_PPC32
but when i compile allyesconfig with ppc64 box,i get this error. This patch 
removes the
ifdef.

Signed-off-by : Kamalesh Babulal <[EMAIL PROTECTED]>
---
--- linux-2.6.23/include/asm-powerpc/io.h   2007-10-12 15:46:14.0 
+0530
+++ linux-2.6.23/include/asm-powerpc/~io.h  2007-10-12 15:46:00.0 
+0530
@@ -690,7 +690,6 @@ static inline void * phys_to_virt(unsign
  * drivers (shame shame shame) that use bus_to_virt() and haven't been
  * fixed yet so I need to define it here.
  */
-#ifdef CONFIG_PPC32
 
 static inline unsigned long virt_to_bus(volatile void * address)
 {
@@ -708,7 +707,6 @@ static inline void * bus_to_virt(unsigne
 
 #define page_to_bus(page)  (page_to_phys(page) + PCI_DRAM_OFFSET)
 
-#endif /* CONFIG_PPC32 */
 
 /* access ports */
 #define setbits32(_addr, _v) out_be32((_addr), in_be32(_addr) |  (_v))


-
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.23-mm1 - Build failure on rgmii

2007-10-12 Thread Kamalesh Babulal
Hi Andrew,

The build fails with following message

CC drivers/net/ibm_newemac/zmii.o
CC drivers/net/ibm_newemac/rgmii.o
drivers/net/ibm_newemac/rgmii.c: In function ‘rgmii_probe’:
drivers/net/ibm_newemac/rgmii.c:254: error: implicit declaration of
function ‘device_is_compatible’
make[3]: *** [drivers/net/ibm_newemac/rgmii.o] Error 1
make[2]: *** [drivers/net/ibm_newemac] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

The function device_is_compatible does not exist, and seems to called
instead of
of_device_compatible. This patch replace the function.

Signed-off-by : Kamalesh Babulal <[EMAIL PROTECTED]>
---

--- linux-2.6.23/drivers/net/ibm_newemac/rgmii.c2007-10-12 
12:10:48.0 +0530
+++ linux-2.6.23/drivers/net/ibm_newemac/~rgmii.c   2007-10-12 
14:37:21.0 +0530
@@ -251,7 +251,7 @@ static int __devinit rgmii_probe(struct 
}
 
/* Check for RGMII type */
-   if (device_is_compatible(ofdev->node, "ibm,rgmii-axon"))
+   if (of_device_is_compatible(ofdev->node, "ibm,rgmii-axon"))
dev->type = RGMII_AXON;
else
dev->type = RGMII_STANDARD;


-- 
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.

-
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/5] docbook/mcabook: fixup x86 path/file names

2007-10-12 Thread Randy Dunlap
From: Randy Dunlap <[EMAIL PROTECTED]>

Fix docbook templates for new x86 path/filenames:
docproc: linux-2.6.23-git2/include/asm-i386/mca_dma.h: No such file or directory

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 Documentation/DocBook/mcabook.tmpl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.23-git2.orig/Documentation/DocBook/mcabook.tmpl
+++ linux-2.6.23-git2/Documentation/DocBook/mcabook.tmpl
@@ -101,7 +101,7 @@
 
   
  DMA Functions Provided
-!Iinclude/asm-i386/mca_dma.h
+!Iinclude/asm-x86/mca_dma.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 1/5] docbook/deviceiobook: fixup x86 path/file names

2007-10-12 Thread Randy Dunlap
From: Randy Dunlap <[EMAIL PROTECTED]>

Fix docbook templates for new x86 path/filenames:

docproc: linux-2.6.23-git2/include/asm-i386/io.h: No such file or directory

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 Documentation/DocBook/deviceiobook.tmpl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.23-git2.orig/Documentation/DocBook/deviceiobook.tmpl
+++ linux-2.6.23-git2/Documentation/DocBook/deviceiobook.tmpl
@@ -316,7 +316,7 @@ CPU B:  spin_unlock_irqrestore(dev_
 
   
  Public Functions Provided
-!Iinclude/asm-i386/io.h
+!Iinclude/asm-x86/io_32.h
 !Elib/iomap.c
   
 
-
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/5] net core: fix kernel-doc for new function parameters

2007-10-12 Thread Randy Dunlap
From: Randy Dunlap <[EMAIL PROTECTED]>

Fix networking code kernel-doc for newly added parameters.

Warning(linux-2.6.23-git2//net/core/sock.c:879): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:570): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:594): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:617): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:641): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:667): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:722): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:959): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:1195): No description found for 
parameter 'dev'
Warning(linux-2.6.23-git2//net/core/dev.c:2105): No description found for 
parameter 'n'
Warning(linux-2.6.23-git2//net/core/dev.c:3272): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:3445): No description found for 
parameter 'net'
Warning(linux-2.6.23-git2//include/linux/netdevice.h:1301): No description 
found for parameter 'cpu'

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 include/linux/netdevice.h |1 +
 net/core/dev.c|   13 +++--
 net/core/sock.c   |1 +
 3 files changed, 13 insertions(+), 2 deletions(-)

--- linux-2.6.23-git2.orig/include/linux/netdevice.h
+++ linux-2.6.23-git2/include/linux/netdevice.h
@@ -1294,6 +1294,7 @@ static inline void netif_rx_complete(str
 /**
  * netif_tx_lock - grab network device transmit lock
  * @dev: network device
+ * @cpu: cpu number of lock owner
  *
  * Get network device transmit lock
  */
--- linux-2.6.23-git2.orig/net/core/sock.c
+++ linux-2.6.23-git2/net/core/sock.c
@@ -869,6 +869,7 @@ static inline void sock_lock_init(struct
 
 /**
  * sk_alloc - All socket objects are allocated here
+ * @net: the applicable net namespace
  * @family: protocol family
  * @priority: for allocation (%GFP_KERNEL, %GFP_ATOMIC, etc)
  * @prot: struct proto associated with this new sock instance
--- linux-2.6.23-git2.orig/net/core/dev.c
+++ linux-2.6.23-git2/net/core/dev.c
@@ -557,6 +557,7 @@ __setup("netdev=", netdev_boot_setup);
 
 /**
  * __dev_get_by_name   - find a device by its name
+ * @net: the applicable net namespace
  * @name: name to find
  *
  * Find an interface by name. Must be called under RTNL semaphore
@@ -581,6 +582,7 @@ struct net_device *__dev_get_by_name(str
 
 /**
  * dev_get_by_name - find a device by its name
+ * @net: the applicable net namespace
  * @name: name to find
  *
  * Find an interface by name. This can be called from any
@@ -604,6 +606,7 @@ struct net_device *dev_get_by_name(struc
 
 /**
  * __dev_get_by_index - find a device by its ifindex
+ * @net: the applicable net namespace
  * @ifindex: index of device
  *
  * Search for an interface by index. Returns %NULL if the device
@@ -629,6 +632,7 @@ struct net_device *__dev_get_by_index(st
 
 /**
  * dev_get_by_index - find a device by its ifindex
+ * @net: the applicable net namespace
  * @ifindex: index of device
  *
  * Search for an interface by index. Returns NULL if the device
@@ -651,6 +655,7 @@ struct net_device *dev_get_by_index(stru
 
 /**
  * dev_getbyhwaddr - find a device by its hardware address
+ * @net: the applicable net namespace
  * @type: media type of device
  * @ha: hardware address
  *
@@ -709,6 +714,7 @@ EXPORT_SYMBOL(dev_getfirstbyhwtype);
 
 /**
  * dev_get_by_flags - find any device with given flags
+ * @net: the applicable net namespace
  * @if_flags: IFF_* values
  * @mask: bitmask of bits in if_flags to check
  *
@@ -948,6 +954,7 @@ void netdev_state_change(struct net_devi
 
 /**
  * dev_load- load a network module
+ * @net: the applicable net namespace
  * @name: name of interface
  *
  * If a network interface is not present and the process has suitable
@@ -1185,7 +1192,7 @@ int unregister_netdevice_notifier(struct
 /**
  * call_netdevice_notifiers - call all network notifier blocks
  *  @val: value passed unmodified to notifier function
- *  @v:   pointer passed unmodified to notifier function
+ *  @dev: net_device pointer passed unmodified to notifier function
  *
  * Call all network notifier blocks.  Parameters and return value
  * are as for raw_notifier_call_chain().
@@ -2097,7 +2104,7 @@ static int process_backlog(struct napi_s
 
 /**
  * __napi_schedule - schedule for receive
- * @napi: entry to schedule
+ * @n: entry to schedule
  *
  * The entry's receive function will be scheduled to run
  */
@@ -3259,6 +3266,7 @@ static int dev_ifsioc(struct net *net, s
 
 /**
  * dev_ioctl   -   

[PATCH 2/5] docbook/kernel-hacking: fixup x86 path/file names

2007-10-12 Thread Randy Dunlap
From: Randy Dunlap <[EMAIL PROTECTED]>

Fix docbook templates for modified x86 path/filenames.

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 Documentation/DocBook/kernel-hacking.tmpl |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.23-git2.orig/Documentation/DocBook/kernel-hacking.tmpl
+++ linux-2.6.23-git2/Documentation/DocBook/kernel-hacking.tmpl
@@ -1239,7 +1239,7 @@ static struct block_device_operations op
   
 
   
-   include/asm-i386/delay.h:
+   include/asm-x86/delay_32.h:
   
   
 #define ndelay(n) (__builtin_constant_p(n) ? \
@@ -1265,7 +1265,7 @@ static struct block_device_operations op
 
 
   
-   include/asm-i386/uaccess.h:
+   include/asm-x86/uaccess_32.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 3/5] docbook/kernel-api: fixup x86 path/file names

2007-10-12 Thread Randy Dunlap
From: Randy Dunlap <[EMAIL PROTECTED]>

Fix docbook templates for new x86 path/filenames.

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 Documentation/DocBook/kernel-api.tmpl |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

--- linux-2.6.23-git2.orig/Documentation/DocBook/kernel-api.tmpl
+++ linux-2.6.23-git2/Documentation/DocBook/kernel-api.tmpl
@@ -45,8 +45,8 @@
  
 
  Atomic and pointer manipulation
-!Iinclude/asm-i386/atomic.h
-!Iinclude/asm-i386/unaligned.h
+!Iinclude/asm-x86/atomic_32.h
+!Iinclude/asm-x86/unaligned_32.h
  
 
  Delaying, scheduling, and timer routines
@@ -119,7 +119,7 @@ X!Ilib/string.c
 !Elib/string.c
  
  Bit Operations
-!Iinclude/asm-i386/bitops.h
+!Iinclude/asm-x86/bitops_32.h
  
   
 
@@ -155,8 +155,8 @@ X!Ilib/string.c
 !Emm/slab.c
  
  User Space Memory Access
-!Iinclude/asm-i386/uaccess.h
-!Earch/i386/lib/usercopy.c
+!Iinclude/asm-x86/uaccess_32.h
+!Earch/x86/lib/usercopy_32.c
  
  More Memory Management Functions
 !Emm/readahead.c
@@ -293,7 +293,7 @@ X!Ekernel/module.c
  
 
  MTRR Handling
-!Earch/i386/kernel/cpu/mtrr/main.c
+!Earch/x86/kernel/cpu/mtrr/main.c
  
 
  PCI Support Library
@@ -316,14 +316,14 @@ X!Edrivers/pci/hotplug.c
  MCA Architecture
MCA Device Functions

-  Refer to the file arch/i386/kernel/mca.c for more information.
+  Refer to the file arch/x86/kernel/mca_32.c for more information.

 

MCA Bus DMA
-!Iinclude/asm-i386/mca_dma.h
+!Iinclude/asm-x86/mca_dma.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/


[GIT PULL] [RESEND] sh updates for 2.6.24-rc1

2007-10-12 Thread Paul Mundt
Please pull from:

master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.git

Which contains:

Adrian McMenamin (4):
  fb: pvr2fb: Shared IRQ for dreamcast pvr2.
  sh: Add maple bus support for the SEGA Dreamcast.
  video: pvr2fb: Add TV (RGB) support to Dreamcast PVR driver.
  sh: Fix SH-4 DMAC CHCR masking.

Aoi Shinkai (1):
  sh: rts7751r2d cf_ide rework

Kristoffer Ericson (9):
  sh: Fix OFFCHIP_IRQ_BASE compile error.
  sh: update hp6xx defconfig.
  sh: hp6xx: APM build fix and new battery values.
  backlight: Fix up hp680_bl build.
  sh: hd64461: Trivial build fixes for SH7709.
  sh: dma: Fix up build for SH7709 support.
  sh: hp6xx: Update CF IRQ for INTC changes.
  sh: hp6xx: Enable touchscreen and powerbutton IRQs.
  sh: hp6xx: Enable pata_platform in defconfig.

Magnus Damm (37):
  sh: intc - add support for SH7705
  sh: intc - add support for SH7710
  sh: intc - add support for SH7706, SH7707, SH7708, SH7709
  sh: intc - add missing vectors for SH7707
  sh: intc - avoid SH7710 specific vector on SH7712
  sh: intc - add support for SH7785
  sh: intc - add support for SH7760
  sh: simplify se7780 IRQ code
  sh: intc - fix IRQ4 and IRQ5 typo on sh3
  sh: intc - add support for x3
  sh: intc - remove redundant irq code for sh03, snapgear and titan
  sh: intc - remove redundant irq code for shmin
  sh: intc - add single bitmap register support
  sh: intc - convert voyagergx code
  sh: remove intc2 code
  sh: x3 - fix setup_bootmem_node() compile error with shx3_defconfig
  sh: intc - add a clear register to struct intc_prio_reg
  sh: intc - rework core code
  sh: intc - convert board specific r2d code
  sh: replace sh specific CONFIG_VOYAGERGX with CONFIG_MFD_SM501
  sh: x3 - add ipi vectors
  sh: intc - mark data structures as __initdata
  sh: intc - primary priority masking fixes
  sh: fix irqs for the second serial port on sh7206
  sh: intc - add support for sh7619
  sh: intc - add support for sh7206
  sh: defconfigs for R2D-PLUS and for R2D-1
  sh: remove CONFIG_CPU_HAS_INTC_IRQ
  sh: intc - irl mode update for sh7780 and sh7785
  sh: minor fixes
  sh: intc - rework higlander irq code for r7780mp and r7785rp
  sh: remove sh7780 interrupt controller hack from pci code
  sh: add writesb(), readsb(), writesw() and readsw() to io.h
  sh: intc - initial SMP support.
  sh: Hook up the SH-X3 SMP intc register groups.
  sh: fix r2d board detection
  sh: allow building for both r2d boards in same binary.

Markus Brunner (4):
  sh: Add gpio.h stubs for PFC definitions.
  sh: Add SH7720 CPU support.
  sh: Magic Panel R2 board support.
  sh: Magic Panel MTD mapping update.

Paul Mundt (66):
  sh: Support explicit L1 cache disabling.
  sh: Fix cache disabling build failures on nommu.
  sh: Initial multiple-node support for SH-X3.
  rtc: rtc-sh: Support 4-digit year on SH7705/SH7710/SH7712.
  sh: intc: Fix sense regs oops for IRL IRQs.
  sh: Plug in SH-X3 SCIF0 for sercon earlyprintk.
  sh: Initial support for SH-X3 prototype board.
  sh: x3proto: ILSEL IRQ support.
  sh: x3proto: Hook up ethernet and USB platform devices.
  sh: x3proto: Trivial ILSEL build fix.
  sh: Bump up NODES_SHIFT for SH-X3.
  serial: sh-sci: Shut up compiler warning for SH-X3 SCIF.
  sh: Wire up CSM node for SH-X3.
  serial: sh-sci: Tidy cpufreq printk.
  sh: Kill off duplicate symbol exports on SMP.
  sh: heartbeat driver update.
  sh: More license string silliness.
  sh: Kill off volatile silliness in sq_flush_range().
  sh: Overhaul spinlocks and rwlocks for SH-4A SMP.
  sh: Fix up heartbeat build and resource size.
  sh: Fix up se7751 build.
  sh: nommu fault handler needs signal.h.
  serial: sh-sci: kgdb console build fixes.
  sh: INTC stubs for SH7343 and SH7770 builds.
  sh: dma: Fix CONFIG_SYSFS=n build.
  sh: Don't enable FPU for SH4AL-DSP.
  sh: se7206: Make the I/O port routines less stupid.
  sh: se7206: heartbeat needs 32-bit writes.
  sh: hp6xx: Trivial build fixes for INTC changes.
  sh: r7780rp: irq-r7780rp needs linux/io.h.
  sh: se7206: Handle non-SuperIO I/O ports.
  sh: se7206: update defconfig.
  sh: Wire up URAM node on SH7785.
  sh: Fix up extended mode TLB for SH-X2+ cores.
  sh: rts7751r2d: Fix up trivial build failure.
  sh: Enable maple by default for the Dreamcast.
  sh: Make cpufreq driver less noisy on SMP.
  sh: Kill off special boot_cpu_data.
  sh: Avoid smp_processor_id() in cache desc paths.
  sh: Add SMP tlbflush variants.
  sh: Bring SMP support back from the dead.
  sh: Plug plat_smp_setup() in to generic setup path.
  sh: Initial SH-X3 SMP support.
  sh: Fix alias calculation for non-aliasing 

[GIT PULL] [RESEND] sh64 updates for 2.6.24-rc1

2007-10-12 Thread Paul Mundt
Please pull from:

master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh64-2.6.git

Which contains:

Paul Mundt (18):
  sh64: Move *_p() I/O routine variants to io.h.
  sh64: Tidy up includes for Cayman board.
  sh64: Kill off dead ROM-RAM and generic boards.
  sh64: Kill off duplicate frame pointer option.
  sh64: mach-harp: Build fixes.
  sh64: mach-sim: Build fixes.
  sh64: Some symbol exports and build fixes.
  sh64: Move consistent DMA routines to arch/sh64/mm/.
  sh64: Tidy up Kconfig dependencies.
  sh64: update cayman defconfig.
  sh64: Add defconfigs for mach-sim and mach-harp.
  sh64: alphanumeric display only on Cayman.
  sh64: Kill off dead gdb stub symbol.
  sh64: Kill off obsolete linux/blk.h reference.
  sh64: Set KBUILD_IMAGE to make the rpm target happy.
  sh64: linker script tidying and alignment fixups.
  sh64: Symbol export fixups.
  sh64: mach-cayman: Build fixes.

Thomas Gleixner (1):
  sh64: cleanup struct irqaction initializers.

 arch/sh64/Kconfig  |   51 --
 arch/sh64/Kconfig.debug|   13 
 arch/sh64/Makefile |6 
 arch/sh64/configs/cayman_defconfig |  258 ++--
 arch/sh64/configs/harp_defconfig   |  756 +
 arch/sh64/configs/sim_defconfig|  566 +++
 arch/sh64/kernel/Makefile  |2 
 arch/sh64/kernel/alphanum.c|1 
 arch/sh64/kernel/pci-dma.c |   50 --
 arch/sh64/kernel/sh_ksyms.c|   32 -
 arch/sh64/kernel/time.c|   14 
 arch/sh64/kernel/vmlinux.lds.S |   60 --
 arch/sh64/lib/c-checksum.c |3 
 arch/sh64/lib/io.c |   29 -
 arch/sh64/lib/iomap.c  |   10 
 arch/sh64/mach-cayman/setup.c  |   10 
 arch/sh64/mach-harp/Makefile   |   13 
 arch/sh64/mach-harp/setup.c|   25 -
 arch/sh64/mach-romram/Makefile |   14 
 arch/sh64/mach-romram/setup.c  |  141 --
 arch/sh64/mach-sim/Makefile|   13 
 arch/sh64/mach-sim/setup.c |   53 --
 arch/sh64/mm/Makefile  |4 
 arch/sh64/mm/consistent.c  |   52 ++
 arch/sh64/mm/init.c|4 
 arch/sh64/mm/ioremap.c |7 
 include/asm-sh64/io.h  |7 
 27 files changed, 1690 insertions(+), 504 deletions(-)
-
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 NULL pointer dereference in check_spread+0x0/0x26

2007-10-12 Thread Mike Galbraith
On Fri, 2007-10-12 at 14:40 +0200, Jan Blunck wrote:
> This is with 2.6.23-mm1 and allmodconfig.
> 
> Seems that se in the following is a NULL pointer.
> 
> 453 static void check_spread(struct cfs_rq *cfs_rq, struct
> sched_entity *se)
> 454 {
> 455 #ifdef CONFIG_SCHED_DEBUG
> 456 s64 d = se->vruntime - cfs_rq->min_vruntime;
> 457
> 458 if (d < 0)
> 459 d = -d;

I hit this once yesterday (in sched-devel), and again first boot this
morning.

-Mike

-
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.23.git build error

2007-10-12 Thread Mike Galbraith
On Fri, 2007-10-12 at 23:31 +0200, Sam Ravnborg wrote:
> On Fri, Oct 12, 2007 at 06:48:58AM +0200, Mike Galbraith wrote:
> > Greetings,
> > 
> > Freshly pulled 2.6.23.git failed to build:
> > 
> > make[1]: *** No rule to make target `arch/x86/kernel/asm-offsets.c', needed 
> > by `arch/x86/kernel/asm-offsets.s'.  Stop.
> > make: *** [prepare0] Error 2
> > make: *** Waiting for unfinished jobs
> 
> You are the only reporter of this bug.
> I do not see it here and I have the asm-offset.c file.

Yeah, I noticed nobody else was griping.

> Have you figured out more about this bug?
> For now I assume you did something bad when you updated your kernel tree.
> Could  you as minimum check the content of the arch/x86/kernel/ directory.

I just re-pulled, and the little bugger showed up.  Elves and Gremlins
at play I guess.

-Mike

-
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] x86/pci/acpi: fix DMI const-ification fallout

2007-10-12 Thread Jeff Garzik

Fix DMI const-ification fallout that appeared when merging subsystem
trees.

Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 arch/x86/pci/acpi.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 27a391d..2d88f7c 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -6,7 +6,7 @@
 #include 
 #include "pci.h"
 
-static int __devinit can_skip_ioresource_align(struct dmi_system_id *d)
+static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d)
 {
pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", 
d->ident);
-
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/


Delete filenames in comments.

2007-10-12 Thread Dave Jones
Since the x86 merge, lots of files that referenced their own filenames
are no longer correct.  Rather than keep them up to date, just delete
them, as they add no real value.

Additionally:
- fix up comment formatting in scx200_32.c
- Remove a credit from myself in setup_64.c from a time when we had no SCM
- remove longwinded history from tsc_32.c which can be figured out from
  git.

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

diff --git a/arch/x86/kernel/bugs_64.c b/arch/x86/kernel/bugs_64.c
index 4e5e9d3..9a189ce 100644
--- a/arch/x86/kernel/bugs_64.c
+++ b/arch/x86/kernel/bugs_64.c
@@ -1,6 +1,4 @@
 /*
- *  arch/x86_64/kernel/bugs.c
- *
  *  Copyright (C) 1994  Linus Torvalds
  *  Copyright (C) 2000  SuSE
  */
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 59266f0..205fd5b 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1,6 +1,4 @@
 /*
- *  arch/i386/cpu/bugs.c
- *
  *  Copyright (C) 1994  Linus Torvalds
  *
  *  Cyrix stuff, June 1998 by:
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 5c2faa1..f4548c9 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -11,8 +11,6 @@
  * --- */
 
 /*
- * cpuid.c
- *
  * x86 CPUID access device
  *
  * This device is accessed by lseek() to the appropriate CPUID level
diff --git a/arch/x86/kernel/crash_dump_32.c b/arch/x86/kernel/crash_dump_32.c
index 3f532df..32e75d0 100644
--- a/arch/x86/kernel/crash_dump_32.c
+++ b/arch/x86/kernel/crash_dump_32.c
@@ -1,5 +1,5 @@
 /*
- * kernel/crash_dump.c - Memory preserving reboot related code.
+ * Memory preserving reboot related code.
  *
  * Created by: Hariprasad Nellitheertha ([EMAIL PROTECTED])
  * Copyright (C) IBM Corporation, 2004. All rights reserved
diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c
index 942deac..15e6c6b 100644
--- a/arch/x86/kernel/crash_dump_64.c
+++ b/arch/x86/kernel/crash_dump_64.c
@@ -1,5 +1,5 @@
 /*
- * kernel/crash_dump.c - Memory preserving reboot related code.
+ * Memory preserving reboot related code.
  *
  * Created by: Hariprasad Nellitheertha ([EMAIL PROTECTED])
  * Copyright (C) IBM Corporation, 2004. All rights reserved
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 6c34bdd..8561f62 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/x86_64/kernel/head64.c -- prepare to run common code
+ *  prepare to run common code
  *
  *  Copyright (C) 2000 Andrea Arcangeli <[EMAIL PROTECTED]> SuSE
  */
diff --git a/arch/x86/kernel/i387_32.c b/arch/x86/kernel/i387_32.c
index 6658472..7d2e12f 100644
--- a/arch/x86/kernel/i387_32.c
+++ b/arch/x86/kernel/i387_32.c
@@ -1,6 +1,4 @@
 /*
- *  linux/arch/i386/kernel/i387.c
- *
  *  Copyright (C) 1994 Linus Torvalds
  *
  *  Pentium III FXSR, SSE support
diff --git a/arch/x86/kernel/i387_64.c b/arch/x86/kernel/i387_64.c
index 1d58c13..56c1f11 100644
--- a/arch/x86/kernel/i387_64.c
+++ b/arch/x86/kernel/i387_64.c
@@ -1,6 +1,4 @@
 /*
- *  linux/arch/x86_64/kernel/i387.c
- *
  *  Copyright (C) 1994 Linus Torvalds
  *  Copyright (C) 2002 Andi Kleen, SuSE Labs
  *
diff --git a/arch/x86/kernel/i8237.c b/arch/x86/kernel/i8237.c
index 6f508e8..2931383 100644
--- a/arch/x86/kernel/i8237.c
+++ b/arch/x86/kernel/i8237.c
@@ -1,5 +1,5 @@
 /*
- * i8237.c: 8237A DMA controller suspend functions.
+ * 8237A DMA controller suspend functions.
  *
  * Written by Pierre Ossman, 2005.
  *
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index ac15e4c..5cc8841 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -1,5 +1,5 @@
 /*
- * i8253.c  8253/PIT functions
+ * 8253/PIT functions
  *
  */
 #include 
diff --git a/arch/x86/kernel/ioport_32.c b/arch/x86/kernel/ioport_32.c
index 3d310a9..4ed48dc 100644
--- a/arch/x86/kernel/ioport_32.c
+++ b/arch/x86/kernel/ioport_32.c
@@ -1,6 +1,4 @@
 /*
- * linux/arch/i386/kernel/ioport.c
- *
  * This contains the io-permission bitmap code - written by obz, with changes
  * by Linus.
  */
diff --git a/arch/x86/kernel/ioport_64.c b/arch/x86/kernel/ioport_64.c
index 653efa3..5f62fad 100644
--- a/arch/x86/kernel/ioport_64.c
+++ b/arch/x86/kernel/ioport_64.c
@@ -1,6 +1,4 @@
 /*
- * linux/arch/x86_64/kernel/ioport.c
- *
  * This contains the io-permission bitmap code - written by obz, with changes
  * by Linus.
  */
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 4f681bc..e173b76 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -1,6 +1,4 @@
 /*
- * linux/arch/i386/kernel/irq.c
- *
  * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
  *
  * This file contains the lowest level x86-specific interrupt
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index bd11e42..865669e 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -1,6 

Re: [git patches] libata update

2007-10-12 Thread Bartlomiej Zolnierkiewicz

On Friday 12 October 2007, Jeff Garzik wrote:
> 
> [ I just sent this upstream to Andrew and Linus ]
> 
> Now that I have nailed down the corruption problem, I can attend to
> this...  Fun stuff:
> 
> * port multiplier support (like an ethernet hub, only dumber)

Great to see this here.

> * Asynchronous notification -- finally userspace CD-ROM polling can go away!

Is this AHCI specific or could be used by some other SATA hosts?

>   (NOTE: waiting on James B to apply the piece that actually makes this
>   work...)
> 
> * Alan continues to hammer out edge cases in generic ATA support.  An
>   amazing amount of ancient and/or obscure hardware works with libata   
> thanks to him :)

Worth to mention that this update also contains two new drivers from Alan,
pata_acpi and pata_ns87415. :)

> * Turn on ACPI by default (watch for bug reports!).  This should make
>   suspend/resume work a lot better.
> 
> * New drivers for embedded ATA chips.

Unfortunately both are broken ATM, details below.

[ added Sonic Zhang and Kristoffer Nyborg Gregertsen to cc: ]

> Please pull from 'upstream-linus' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
> upstream-linus

[ ... ]

> Alan Cox (22):
>   pata_cmd64x: Set up MWDMA modes properly

two minor things:

a.

@@ -88,14 +88,15 @@ static int cmd648_cable_detect(struct ata_port *ap)
 }
 
 /**
- * cmd64x_set_piomode  -   set initial PIO mode data
+ * cmd64x_set_piomode  -   set PIO and MWDMA timing
  * @ap: ATA interface
  * @adev: ATA device
+ * @mode: mode
  *
- * Called to do the PIO mode setup.
+ * Called to do the PIO and MWDMA mode setup.
  */
 
-static void cmd64x_set_piomode(struct ata_port *ap, struct ata_device *adev)
+static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 
mode)
 {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
struct ata_timing t;

function name in the documentation needs fixing

b.

regD fiddling in cmd64x_set_dmamode() could be removed completly

>   libata: correct handling of SRST reset sequences

This potentially adds a regression for nVidia boxes (but ACPI cable
detection should compensate for it):

pata_amd's ->cable_detect checks UDMA timings to get the cable type
(cable detection is done before the SRST) but pata_amd's ->set_piomode
messes with UDMA timings.  It seems that both methods need fixing.

> Jeff Garzik (14):

>   [libata] Turn on ACPI by default

-MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when 
set");
+MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in probe/suspend/resume 
when set");

Would be nice to have Documentation/kernel-parameters.txt updated as well.

> Kristoffer Nyborg Gregertsen (1):
>   AVR32 PATA driver

Won't build because this libata update removes ->irq_ack and ->port_disable
methods from struct ata_port.

> Sonic Zhang (1):
>   libata driver for bf548 on chip ATAPI controller.

Won't build, same problem as with AVR32 PATA driver + needs update to
accomodate for libata-link patches.

There are some other problems:

a.

+config PATA_BF54X_DMA
+   bool "DMA mode"
+   depends on PATA_BF54X
+   default y
+   help
+ Enable DMA mode for Blackfin ATAPI controller.

The preferred solution would be to use module parameter.

If this option is on by default it may be even possible to remove it
completly since this libata update also contains patch from Alan allowing
DMA disable per different classes of ATA devices.

b.

+static struct ata_port_info bfin_port_info[] = {
+   {
+   .sht= _sht,
+   .flags  = ATA_FLAG_SLAVE_POSS
+   | ATA_FLAG_MMIO
+   | ATA_FLAG_NO_LEGACY,
+   .pio_mask   = 0x1f, /* pio0-4 */
+   .mwdma_mask = 0,
+#ifdef CONFIG_PATA_BF54X_DMA
+   .udma_mask  = ATA_UDMA5,
+#else
+   .udma_mask  = 0,
+#endif
+   .port_ops   = _pata_ops,
+   },
+};

MWDMA is never enabled (even if CONFIG_PATA_BF54X_DMA=y) but the driver
contains MWDMA support...

c.

+/**
+ *
+ *Function:   wait_complete
+ *
+ *Description:Waits the interrupt from device
+ *
+ */
+static inline void wait_complete(void __iomem *base, unsigned short mask)
+{
+   unsigned short status;
+   unsigned int i = 0;
+
+#define PATA_BF54X_WAIT_TIMEOUT1
+
+   for (i = 0; i < PATA_BF54X_WAIT_TIMEOUT; i++) {
+   status = ATAPI_GET_INT_STATUS(base) & mask;
+   if (status)
+   break;
+   }
+
+   ATAPI_SET_INT_STATUS(base, mask);
+}

udelay() between retries?

d.

* write_atapi_register()
* read_atapi_register()
* write_atapi_data()
* read_atapi_data()

and

* wait_complete()

need a proper documentation (DocBook-ized etc).

Thanks,
Bart
-
To unsubscribe from this list: send the line 

Re: [PATCH] Reserve N process to root

2007-10-12 Thread Gustavo Chain
El Fri, 12 Oct 2007 09:29:10 +0300
Al Boldi <[EMAIL PROTECTED]> escribió:

> Kyle Moffett wrote:
> > On Oct 12, 2007, at 01:37:23, Al Boldi wrote:
> > > You have a point, and resource-controllers can probably control
> > > DoS a lot better, but the they also incur more overhead.  Think
> > > of this "lockout prevention" patch as a near zero overhead safety
> > > valve.
> >
> > But why do you need to add "lockout prevention" if it already
> > exists?
> 
> I said this before, but I'll say it again: it's about overhead!
> 
> > With CFS' extremely efficient per-user-scheduling (hopefully
> > soon to be the default) there are only two forms of lockout by non-
> > root processes:  (1) Running out of PIDs in the box's PID-space
> > (think tens or hundreds of thousands of processes), or (2) Swap-
> > storming the box to death.  To put it bluntly trying to reserve free
> > PID slots is attacking the wrong end of the problem and your so
> > called "lockout prevention" could very easily ensure that 10 PIDs
> > are available even if the user has swapstormed the box with the
> > PIDs he does have.
> 
> I think you are reading this wrong.  It's not about reserving PIDs,
> it's about exceeding the max-threads limit.  This limit is global and
> affects every user including root, which is good, as this allows the
> sysadmin to fence the system into a controllable state.  So once the
> system reaches the fence, sysadmin-intervention allows root to exceed
> the fence.
> 
> Again, this is much nicer with real resource-controllers, but again
> it's also more overhead.

Just an _if()_ ?

may be enable it as an option in kernel config ?

> 
> Thanks!
> 
> --
> Al
> 
> -
> 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/


-- 
Gustavo Chaín Dumit
Alumno de Ingeniería de Ejecución Informática
Pontificia Universidad Católica de Valparaiso
http://aleph.homeunix.com/~gchain
-
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: Current Linus' git compilation breakage.

2007-10-12 Thread Dave Jones
On Sat, Oct 13, 2007 at 11:11:31AM +1000, Nigel Cunningham wrote:
 > Hi all.
 > 
 > Maybe I just picked a bad time to try, but...
 > 
 > arch/x86/kernel/alternative.c: In function 'apply_alternatives':
 > arch/x86/kernel/alternative.c:191: error: 'VSYSCALL_START' undeclared (first 
 > use in this function)
 > arch/x86/kernel/alternative.c:191: error: (Each undeclared identifier is 
 > reported only once
 > arch/x86/kernel/alternative.c:191: error: for each function it appears in.)
 > arch/x86/kernel/alternative.c:191: error: 'VSYSCALL_END' undeclared (first 
 > use in this function)
 > make[1]: *** [arch/x86/kernel/alternative.o] Error 1
 > make: *** [arch/x86/kernel] Error 2

Try this.

Include missing header for vsyscall.

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

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index bd72d94..11b03d3 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define MAX_PATCH_LEN (255-1)
 
-- 
http://www.codemonkey.org.uk
-
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: Correct filenames in comments.

2007-10-12 Thread H. Peter Anvin

Dave Jones wrote:

I never really understood the motivation behind putting the filename
in a comment, but this fixes up a bunch of them that are now wrong
post-merge.


Presumably it is there just in case you print them out with lpr instead 
of enscript, or if your editor doesn't tell you the filename.


-hpa
-
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/


Current Linus' git compilation breakage.

2007-10-12 Thread Nigel Cunningham
Hi all.

Maybe I just picked a bad time to try, but...

arch/x86/kernel/alternative.c: In function 'apply_alternatives':
arch/x86/kernel/alternative.c:191: error: 'VSYSCALL_START' undeclared (first 
use in this function)
arch/x86/kernel/alternative.c:191: error: (Each undeclared identifier is 
reported only once
arch/x86/kernel/alternative.c:191: error: for each function it appears in.)
arch/x86/kernel/alternative.c:191: error: 'VSYSCALL_END' undeclared (first use 
in this function)
make[1]: *** [arch/x86/kernel/alternative.o] Error 1
make: *** [arch/x86/kernel] Error 2

This is UP AMD64. Config attached.

Regards,

Nigel
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.23-rc9
# Sat Oct  6 07:44:19 2007
#
CONFIG_X86_64=y
CONFIG_64BIT=y
CONFIG_X86=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CMOS_UPDATE=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"

#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_USER_NS is not set
# CONFIG_AUDIT is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=21
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
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_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_MODVERSIONS=y
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_KMOD=y
CONFIG_BLOCK=y
# CONFIG_BLK_DEV_IO_TRACE is not set
# CONFIG_BLK_DEV_BSG is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=m
CONFIG_IOSCHED_DEADLINE=m
CONFIG_IOSCHED_CFQ=m
# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
# CONFIG_DEFAULT_CFQ is not set
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"

#
# Processor type and features
#
CONFIG_X86_PC=y
# CONFIG_X86_VSMP is not set
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_L1_CACHE_BYTES=128
CONFIG_X86_L1_CACHE_SHIFT=7
CONFIG_X86_INTERNODE_CACHE_BYTES=128
CONFIG_X86_TSC=y
CONFIG_X86_GOOD_APIC=y
# CONFIG_MICROCODE is not set
CONFIG_X86_MSR=y
# CONFIG_X86_CPUID is not set
CONFIG_X86_IO_APIC=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_MTRR=y
# CONFIG_SMP is not set
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_BKL=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_PHYSICAL_ALIGN=0x20
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_HPET_TIMER=y
CONFIG_IOMMU=y
# CONFIG_CALGARY_IOMMU is not set
CONFIG_SWIOTLB=y
CONFIG_X86_MCE=y
# CONFIG_X86_MCE_INTEL is not set
CONFIG_X86_MCE_AMD=y
# CONFIG_KEXEC is not set
# CONFIG_CRASH_DUMP is not set
# CONFIG_RELOCATABLE is not set
CONFIG_PHYSICAL_START=0x20
# CONFIG_SECCOMP is not set
# CONFIG_CC_STACKPROTECTOR is not set
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
CONFIG_K8_NB=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_ISA_DMA_API=y

#
# Power management options
#
CONFIG_PM=y
CONFIG_PM_LEGACY=y
CONFIG_PM_DEBUG=y
# CONFIG_PM_VERBOSE is not set
# CONFIG_DISABLE_CONSOLE_SUSPEND is not set
# CONFIG_PRINTK_NOSAVE is not set
# CONFIG_PM_TRACE is not set
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND_UP_POSSIBLE=y
CONFIG_SUSPEND=y
CONFIG_HIBERNATION_UP_POSSIBLE=y
CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION=""
CONFIG_TOI_CORE=m

#
# Image Storage (you 

Re: [GIT PULL] please pull infiniband.git for-linus

2007-10-12 Thread Andrew Morton
On Thu, 11 Oct 2007 18:17:19 -0700 (PDT)
David Miller <[EMAIL PROTECTED]> wrote:

> From: Roland Dreier <[EMAIL PROTECTED]>
> Date: Thu, 11 Oct 2007 18:08:52 -0700
> 
> > This will get the batch of changes queued up for the 2.6.24 merge
> > window (although I still have a few more things to merge later, once
> > Dave Miller's networking tree has landed too):
> 
> Roland are you absolutely sure this won't create merge conflicts with
> my 8MB net-2.6 merge, inside of which there are many infiniband
> driver changes?

I'd have told him if there were any such problems.

There might of course be runtime problems, but I'm sure the infiniband
developers are testing -mm kernels so that any such problems will be
picked up beforehand (heh, I kill me).

-
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.23-mm1 thread exit_group issue

2007-10-12 Thread Andrew Morton
On Fri, 12 Oct 2007 15:47:59 -0400
Mathieu Desnoyers <[EMAIL PROTECTED]> wrote:

> Hi Andrew,
> 
> I noticed a regression between 2.6.23-rc8-mm2 and 2.6.23-mm1 (with your
> hotfixes). User space threads seems to receive a ERESTART_RESTARTBLOCK
> as soon as a thread does a pthread_join on them. The previous behavior
> was to wait for them to exit by taking a futex.
> 
> I provide a toy program that shows the problem. On 2.6.23-rc8-mm2, it
> loops forever (as it should). On 2.6.23-mm1, it exits after 10 seconds.
> 
> Any idea on what may cause this problem ?

Bisection shows that this problem is caused by these two patches:

pid-namespaces-allow-cloning-of-new-namespace.patch
pid-namespaces-allow-cloning-of-new-namespace-fix-check-for-return-value-of-create_pid_namespace.patch

> (I also provide complete ptrace -f of a correct and buggy run and my
> kernel config. Tests were done on i386.)
> 
> Mathieu
> 
> 
> /*
>  * Thread testing
>  *
>  * build with gcc -lpthread -o pthread pthread.c
>  *
>  * Mathieu Desnoyers
>  * License: GPL
>  */
> 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> 
> static int __thread test = 0;
> 
> /* signal handler */
> void handler(int signo)
> {
>   printf("Sig handler : TID %lu, pid : %lu\n", pthread_self(), getpid());
> }
> 
> void *thr1(void *arg)
> {
>   test = 1;
>   
>   while(1) {
>   printf("thread 1, thread id : %lu, pid %lu, test %d\n",
>   pthread_self(), getpid(), test);
>   sleep(2);
>   }
>   return ((void*)1);
> 
> }
> 
> void *thr2(void *arg)
> {
>   while(1) { 
>   printf("thread 2, thread id : %lu, pid %lu, test %d\n",
>   pthread_self(), getpid(), test);
>   sleep(2);
>   }
>   return ((void*)2);
> }
> 
> int main()
> {
>   int err;
>   pthread_t tid1, tid2;
>   void *tret;
>   static struct sigaction act;
> 
>   act.sa_handler = handler;
>   sigemptyset(&(act.sa_mask));
>   sigaddset(&(act.sa_mask), SIGUSR1);
>   sigaction(SIGUSR1, , NULL);
> 
>   err = pthread_create(, NULL, thr1, NULL);
>   if (err != 0)
>   exit(1);
> 
>   err = pthread_create(, NULL, thr2, NULL);
>   if (err != 0)
>   exit(1);
> 
>   sleep(10);
> 
>   err = pthread_join(tid1, );
>   if (err != 0)
>   exit(1);
> 
>   err = pthread_join(tid2, );
>   if (err != 0)
>   exit(1);
> 
>   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/


Re: [irda-users] [PATCH] mcs7780 needs to free allocated rx buffer

2007-10-12 Thread Samuel Ortiz
Hi Hinko,

On Fri, Oct 12, 2007 at 02:36:46PM +0200, [EMAIL PROTECTED] wrote:
> Hi,
> 
> While testing the mcs7780 based IrDA USB dongle I've stumbled upon
> memory leak in mcs_net_close(). Patch below fixes it.
Thanks for the fix. Applied to my local git, will push forward.

Cheers,
Samuel.


> Signed-off-by: Hinko Kocevar <[EMAIL PROTECTED]>
> 
> Best regards,
> Hinko
> 
> 
> 
> 

> --- linux-2.6.23/drivers/net/irda/mcs7780.c.orig  2007-10-12 
> 14:02:55.0 +0200
> +++ linux-2.6.23/drivers/net/irda/mcs7780.c   2007-10-12 14:05:03.0 
> +0200
> @@ -678,6 +678,8 @@ static int mcs_net_close(struct net_devi
>   /* Stop transmit processing */
>   netif_stop_queue(netdev);
>  
> + kfree_skb(mcs->rx_buff.skb);
> +
>   /* kill and free the receive and transmit URBs */
>   usb_kill_urb(mcs->rx_urb);
>   usb_free_urb(mcs->rx_urb);

> -
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> ___
> irda-users mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/irda-users


-
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: Correct filenames in comments.

2007-10-12 Thread Dave Jones
On Fri, Oct 12, 2007 at 05:49:50PM -0700, Andrew Morton wrote:
 > On Fri, 12 Oct 2007 20:43:32 -0400
 > Dave Jones <[EMAIL PROTECTED]> wrote:
 > 
 > > I never really understood the motivation behind putting the filename
 > > in a comment, but this fixes up a bunch of them that are now wrong
 > > post-merge.
 > 
 > Let's just delete them.

That works for me too. I'll send another diff.

Dave

-- 
http://www.codemonkey.org.uk
-
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: Correct filenames in comments.

2007-10-12 Thread Thomas Gleixner


On Fri, 12 Oct 2007, Andrew Morton wrote:

> On Fri, 12 Oct 2007 20:43:32 -0400
> Dave Jones <[EMAIL PROTECTED]> wrote:
> 
> > I never really understood the motivation behind putting the filename
> > in a comment, but this fixes up a bunch of them that are now wrong
> > post-merge.
> 
> Let's just delete them.
> 

ACk
tglx

-
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: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen

2007-10-12 Thread Andrew Morton
On Wed, 10 Oct 2007 15:17:19 -0400
"Greg Cormier" <[EMAIL PROTECTED]> wrote:

> I'd like to hop in on this, and add my similar problem. This is my
> first post so please excuse me if I'm doing something wrong.

Please cc [EMAIL PROTECTED] on ide, sata and pata reports.

A "hard freeze" is fairly serious.

> I've been having issues recently (couple of weeks?) with my server. I
> have three WD5000YS (500gb) drives in RAID5, on an Asus A8N
> motherboard which is nForce 4. I've even RMA'd one of the drives, but
> now I'm thinking the drives are fine.
> 
> The drive seems to have issues under heavy to moderate IO. I unmounted
> my raid, and forced an e2fsck. e2fsck didn't even print anything out,
> I got this.
> 
> Oct 10 14:50:40 zeus kernel: ata3: EH in ADMA mode, notifier 0x0
> notifier_error 0x0 gen_ctl 0x1501000 status 0x400 next cpb count 0x0
> next cpb idx 0x0
> Oct 10 14:50:40 zeus kernel: ata3: CPB 0: ctl_flags 0x1f, resp_flags 0x2
> Oct 10 14:50:40 zeus kernel: ata3: timeout waiting for ADMA IDLE, stat=0x400
> Oct 10 14:50:40 zeus kernel: ata3: timeout waiting for ADMA LEGACY, stat=0x400
> Oct 10 14:50:40 zeus kernel: ata3.00: exception Emask 0x0 SAct 0x1
> SErr 0x1c0 action 0x2 frozen
> Oct 10 14:50:40 zeus kernel: ata3.00: cmd
> 61/08:00:bf:4b:38/00:00:3a:00:00/40 tag 0 cdb 0x0 data 4096 out
> Oct 10 14:50:40 zeus kernel:  res
> 40/00:f2:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
> Oct 10 14:50:40 zeus kernel: ata3: soft resetting port
> Oct 10 14:50:40 zeus kernel: ata3: SATA link up 3.0 Gbps (SStatus 123
> SControl 300)
> Oct 10 14:50:40 zeus kernel: ata3.00: configured for UDMA/133
> Oct 10 14:50:40 zeus kernel: ata3: EH complete
> Oct 10 14:50:40 zeus kernel: sd 2:0:0:0: [sdb] 976773168 512-byte
> hardware sectors (500108 MB)
> Oct 10 14:50:40 zeus kernel: sd 2:0:0:0: [sdb] Write Protect is off
> Oct 10 14:50:40 zeus kernel: sd 2:0:0:0: [sdb] Write cache: enabled,
> read cache: enabled, doesn't support DPO or FUA
> Oct 10 14:51:40 zeus kernel: ata3: EH in ADMA mode, notifier 0x0
> notifier_error 0x0 gen_ctl 0x1501000 status 0x400 next cpb count 0x0
> next cpb idx 0x0
> Oct 10 14:51:40 zeus kernel: ata3: CPB 0: ctl_flags 0x1f, resp_flags 0x2
> Oct 10 14:51:40 zeus kernel: ata3: timeout waiting for ADMA IDLE, stat=0x400
> Oct 10 14:51:40 zeus kernel: ata3: timeout waiting for ADMA LEGACY, stat=0x400
> Oct 10 14:51:40 zeus kernel: ata3.00: exception Emask 0x0 SAct 0x1
> SErr 0x40 action 0x2 frozen
> Oct 10 14:51:40 zeus kernel: ata3.00: cmd
> 61/08:00:bf:4b:38/00:00:3a:00:00/40 tag 0 cdb 0x0 data 4096 out
> Oct 10 14:51:40 zeus kernel:  res
> 40/00:f2:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
> Oct 10 14:51:41 zeus kernel: ata3: soft resetting port
> Oct 10 14:51:41 zeus kernel: ata3: SATA link up 3.0 Gbps (SStatus 123
> SControl 300)
> Oct 10 14:51:41 zeus kernel: ata3.00: configured for UDMA/133
> Oct 10 14:51:41 zeus kernel: ata3: EH complete
> Oct 10 14:51:41 zeus kernel: sd 2:0:0:0: [sdb] 976773168 512-byte
> hardware sectors (500108 MB)
> Oct 10 14:51:41 zeus kernel: sd 2:0:0:0: [sdb] Write Protect is off
> Oct 10 14:51:41 zeus kernel: sd 2:0:0:0: [sdb] Write cache: enabled,
> read cache: enabled, doesn't support DPO or FUA
> Oct 10 14:52:19 zeus kernel: device eth0 left promiscuous mode
> Oct 10 14:52:41 zeus kernel: ata3: EH in ADMA mode, notifier 0x0
> notifier_error 0x0 gen_ctl 0x1501000 status 0x400 next cpb count 0x0
> next cpb idx 0x0
> Oct 10 14:52:41 zeus kernel: ata3: CPB 0: ctl_flags 0x1f, resp_flags 0x2
> Oct 10 14:52:41 zeus kernel: ata3: timeout waiting for ADMA IDLE, stat=0x400
> Oct 10 14:52:41 zeus kernel: ata3: timeout waiting for ADMA LEGACY, stat=0x400
> Oct 10 14:52:41 zeus kernel: ata3.00: exception Emask 0x0 SAct 0x1
> SErr 0x40 action 0x2 frozen
> Oct 10 14:52:41 zeus kernel: ata3.00: cmd
> 61/08:00:bf:4b:38/00:00:3a:00:00/40 tag 0 cdb 0x0 data 4096 out
> Oct 10 14:52:41 zeus kernel:  res
> 40/00:f2:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
> Oct 10 14:52:41 zeus kernel: ata3: soft resetting port
> Oct 10 14:52:42 zeus kernel: ata3: SATA link up 3.0 Gbps (SStatus 123
> SControl 300)
> Oct 10 14:52:42 zeus kernel: ata3.00: configured for UDMA/133
> Oct 10 14:52:42 zeus kernel: ata3: EH complete
> Oct 10 14:52:42 zeus kernel: sd 2:0:0:0: [sdb] 976773168 512-byte
> hardware sectors (500108 MB)
> Oct 10 14:52:42 zeus kernel: sd 2:0:0:0: [sdb] Write Protect is off
> Oct 10 14:52:42 zeus kernel: sd 2:0:0:0: [sdb] Write cache: enabled,
> read cache: enabled, doesn't support DPO or FUA
> 
> These errors have been happening on various .22 kernels, and this
> message is from the hot-off-the-press .23 kernel. This message is
> followed by a hard freeze.
> 
> I'm in the process of figuring out why netconsole isn't quite working,
> so hopefully I can provide more information soon. The server is
> currently frozen, when I get home I can perhaps provide more
> information? lspci?
> 
> Looks like another rebuild of the array when I 

Re: Correct filenames in comments.

2007-10-12 Thread Andrew Morton
On Fri, 12 Oct 2007 20:43:32 -0400
Dave Jones <[EMAIL PROTECTED]> wrote:

> I never really understood the motivation behind putting the filename
> in a comment, but this fixes up a bunch of them that are now wrong
> post-merge.

Let's just delete them.
-
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/


Correct filenames in comments.

2007-10-12 Thread Dave Jones
I never really understood the motivation behind putting the filename
in a comment, but this fixes up a bunch of them that are now wrong
post-merge.

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

diff --git a/arch/x86/kernel/bugs_64.c b/arch/x86/kernel/bugs_64.c
index 4e5e9d3..45aa435 100644
--- a/arch/x86/kernel/bugs_64.c
+++ b/arch/x86/kernel/bugs_64.c
@@ -1,5 +1,5 @@
 /*
- *  arch/x86_64/kernel/bugs.c
+ *  arch/x86/kernel/bugs_64.c
  *
  *  Copyright (C) 1994  Linus Torvalds
  *  Copyright (C) 2000  SuSE
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 59266f0..84f2496 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -1,5 +1,5 @@
 /*
- *  arch/i386/cpu/bugs.c
+ *  arch/x86/kernel/cpu/bugs.c
  *
  *  Copyright (C) 1994  Linus Torvalds
  *
diff --git a/arch/x86/kernel/crash_dump_32.c b/arch/x86/kernel/crash_dump_32.c
index 3f532df..d919089 100644
--- a/arch/x86/kernel/crash_dump_32.c
+++ b/arch/x86/kernel/crash_dump_32.c
@@ -1,5 +1,5 @@
 /*
- * kernel/crash_dump.c - Memory preserving reboot related code.
+ * arch/x86/kernel/crash_dump_32.c - Memory preserving reboot related code.
  *
  * Created by: Hariprasad Nellitheertha ([EMAIL PROTECTED])
  * Copyright (C) IBM Corporation, 2004. All rights reserved
diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c
index 942deac..7da6ff5 100644
--- a/arch/x86/kernel/crash_dump_64.c
+++ b/arch/x86/kernel/crash_dump_64.c
@@ -1,5 +1,5 @@
 /*
- * kernel/crash_dump.c - Memory preserving reboot related code.
+ * arch/x86/kernel/crash_dump_64.c - Memory preserving reboot related code.
  *
  * Created by: Hariprasad Nellitheertha ([EMAIL PROTECTED])
  * Copyright (C) IBM Corporation, 2004. All rights reserved
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 6c34bdd..a7f006d 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/x86_64/kernel/head64.c -- prepare to run common code
+ *  arch/x86/kernel/head64.c -- prepare to run common code
  *
  *  Copyright (C) 2000 Andrea Arcangeli <[EMAIL PROTECTED]> SuSE
  */
diff --git a/arch/x86/kernel/i387_32.c b/arch/x86/kernel/i387_32.c
index 6658472..3f51937 100644
--- a/arch/x86/kernel/i387_32.c
+++ b/arch/x86/kernel/i387_32.c
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/i386/kernel/i387.c
+ *  arch/x86/kernel/i387_32.c
  *
  *  Copyright (C) 1994 Linus Torvalds
  *
diff --git a/arch/x86/kernel/i387_64.c b/arch/x86/kernel/i387_64.c
index 1d58c13..3de4b03 100644
--- a/arch/x86/kernel/i387_64.c
+++ b/arch/x86/kernel/i387_64.c
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/x86_64/kernel/i387.c
+ *  arch/x86/kernel/i387_64.c
  *
  *  Copyright (C) 1994 Linus Torvalds
  *  Copyright (C) 2002 Andi Kleen, SuSE Labs
diff --git a/arch/x86/kernel/ioport_32.c b/arch/x86/kernel/ioport_32.c
index 3d310a9..82c0256 100644
--- a/arch/x86/kernel/ioport_32.c
+++ b/arch/x86/kernel/ioport_32.c
@@ -1,5 +1,5 @@
 /*
- * linux/arch/i386/kernel/ioport.c
+ * arch/x86/kernel/ioport_32.c
  *
  * This contains the io-permission bitmap code - written by obz, with changes
  * by Linus.
diff --git a/arch/x86/kernel/ioport_64.c b/arch/x86/kernel/ioport_64.c
index 653efa3..480b8af 100644
--- a/arch/x86/kernel/ioport_64.c
+++ b/arch/x86/kernel/ioport_64.c
@@ -1,5 +1,5 @@
 /*
- * linux/arch/x86_64/kernel/ioport.c
+ * arch/x86/kernel/ioport_64.c
  *
  * This contains the io-permission bitmap code - written by obz, with changes
  * by Linus.
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 4f681bc..ca20f1a 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -1,5 +1,5 @@
 /*
- * linux/arch/i386/kernel/irq.c
+ * arch/x86/kernel/irq_32.c
  *
  * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
  *
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index bd11e42..f505944 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -1,5 +1,5 @@
 /*
- * linux/arch/x86_64/kernel/irq.c
+ * arch/x86/kernel/irq_64.c
  *
  * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
  *
diff --git a/arch/x86/kernel/kprobes_32.c b/arch/x86/kernel/kprobes_32.c
index 448a50b..b0383f8 100644
--- a/arch/x86/kernel/kprobes_32.c
+++ b/arch/x86/kernel/kprobes_32.c
@@ -1,6 +1,6 @@
 /*
  *  Kernel Probes (KProbes)
- *  arch/i386/kernel/kprobes.c
+ *  arch/x86/kernel/kprobes_32.c
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/arch/x86/kernel/kprobes_64.c b/arch/x86/kernel/kprobes_64.c
index a30e004..925f248 100644
--- a/arch/x86/kernel/kprobes_64.c
+++ b/arch/x86/kernel/kprobes_64.c
@@ -1,6 +1,6 @@
 /*
  *  Kernel Probes (KProbes)
- *  arch/x86_64/kernel/kprobes.c
+ *  arch/x86/kernel/kprobes_64.c
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU 

Re: Hitachi disk: spurious completions during NCQ

2007-10-12 Thread Andrew Morton
On Wed, 10 Oct 2007 21:03:43 +0200
Luca Tettamanti <[EMAIL PROTECTED]> wrote:

> Hello,
> sometimes kernel complains about spurious completions on my new
> notebook:
> 
> ata3.00: exception Emask 0x2 SAct 0x407fd SErr 0x0 action 0x2 frozen
> ata3.00: spurious completions during NCQ issue=0x0 SAct=0x407fd 
> FIS=005040a1:0002
> ata3.00: cmd 61/08:00:c7:5a:82/00:00:1b:00:00/40 tag 0 cdb 0x0 data 4096 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/08:10:3f:5b:fa/00:00:18:00:00/40 tag 2 cdb 0x0 data 4096 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/08:18:5f:5b:fa/00:00:18:00:00/40 tag 3 cdb 0x0 data 4096 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/18:20:6f:5b:fa/00:00:18:00:00/40 tag 4 cdb 0x0 data 12288 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/08:28:e7:19:fd/00:00:18:00:00/40 tag 5 cdb 0x0 data 4096 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/08:30:df:59:ae/00:00:1a:00:00/40 tag 6 cdb 0x0 data 4096 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/08:38:3f:5a:ae/00:00:1a:00:00/40 tag 7 cdb 0x0 data 4096 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/08:40:6f:62:ae/00:00:1a:00:00/40 tag 8 cdb 0x0 data 4096 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/28:48:d7:59:7e/00:00:1b:00:00/40 tag 9 cdb 0x0 data 20480 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/10:50:07:5b:82/00:00:1b:00:00/40 tag 10 cdb 0x0 data 8192 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3.00: cmd 61/30:90:f7:5a:fa/00:00:18:00:00/40 tag 18 cdb 0x0 data 24576 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)
> ata3: soft resetting port
> ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> ata3.00: configured for UDMA/133
> ata3: EH complete
> sd 2:0:0:0: [sda] 488397168 512-byte hardware sectors (250059 MB)
> sd 2:0:0:0: [sda] Write Protect is off
> sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
> sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support 
> DPO or FUA
> 
> (this is a very recent 2.6.23-git, SMP, x86_64)

The latest kernel, a serious-looking problem, sent to the correct mailing
lists.  After two days nobody has bothered replying.

> The disk is:
> 
> ATA device, with non-removable media
> Model Number:   Hitachi HTS542525K9SA00
> Firmware Revision:  BBFOC31P
> 
> The controller is: 
> 
> 00:1f.2 SATA controller: Intel Corporation Mobile SATA AHCI Controller (rev 
> 03) (prog-if 01 [AHCI 1.0])
> Subsystem: ASUSTeK Computer Inc. Unknown device 14e7
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
> Stepping- SERR- FastB2B-
> Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
> SERR-  Latency: 0
> Interrupt: pin B routed to IRQ 1272
> Region 0: I/O ports at ec00 [size=8]
> Region 1: I/O ports at e880 [size=4]
> Region 2: I/O ports at e800 [size=8]
> Region 3: I/O ports at e480 [size=4]
> Region 4: I/O ports at e400 [size=32]
> Region 5: Memory at febff800 (32-bit, non-prefetchable) [size=2K]
> Capabilities: [80] Message Signalled Interrupts: Mask- 64bit- 
> Queue=0/2 Enable+
> Address: fee0300c  Data: 41b9
> Capabilities: [70] Power Management version 3
> Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA 
> PME(D0-,D1-,D2-,D3hot+,D3cold-)
> Status: D0 PME-Enable- DSel=0 DScale=0 PME-
> Capabilities: [a8] #12 [0010]
> 
> and I'm using AHCI driver.
> 
> I see that similar disks are already blacklisted, probably this one is
> bugged too - though the error is pretty rare :(
> 

Does this cause any other symptoms?  ie: does the system otherwise work OK?


-
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: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen

2007-10-12 Thread Andrew Morton
On Wed, 10 Oct 2007 10:28:45 +0200 (CEST)
[EMAIL PROTECTED] wrote:

> I get this on brand new hardware, 2xHitachi Deathstar 320gb SATA2
> (sata_via driver)
> 
> I get this a lot, the disk makes some sound after heavy IO and then the
> system hangs for a few seconds, then this comes up:
> 
> ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
> ata1.00: cmd 25/00:00:3f:76:30/00:04:00:00:00/e0 tag 0 cdb 0x0 data 524288 in
>   res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
> ata1: port is slow to respond, please be patient (Status 0xd0)
> ata1: soft resetting port
> ata1.00: configured for UDMA/133
> ata1: EH complete
> sd 0:0:0:0: [sda] 625142448 512-byte hardware sectors (320073 MB)
> sd 0:0:0:0: [sda] Write Protect is off
> sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
> sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't
> support DPO or FUA
> raid1: Disk failure on sdb1, disabling device.
> 
> This is on kernel 2.6.23
> 

(added linux-ide)
-
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 7/7] RT: (RFC) Only try to pull tasks in if we are downgrading our priority

2007-10-12 Thread Gregory Haskins
The current code runs the balance_rt_tasks() on every _schedule()
once the system enters an overload state.  Now that we have better
distribution on the push side, we can reduce the conditions that
require us to pull tasks.  They are as follows:

At the time of a _schedule(), if our priority is staying the same or
going logically higher between _prev_ and _next_ we can skip trying
to balance tasks because any tasks that were runnable by our queue
have already been pushed to us.  However, if our priority is
transitioning lower AND some CPUs out there are in overload, we
should check to see if we can pull some over.

Note: DO NOT RUN TEST WITH THIS PATCH APPLIED !

This patch is a concept only (for now) and is here for
demonstration/comment purposes only.  The current series is still
racy with respect to acquiring the lowest RQ in the system.  The
concept in this patch is predicated on raceless distribution to our
current priority level.  So the current balancer is a nice big
safety net to cleanup any issues related to that. This patch
effectively takes that net away, so we need to be sure we have all
our ducks lined up before turning this one on.  But once we do we can
eliminate the (fairly expensive) checks (e.g. rq double-locks, etc)
in a subset (hopefully significant #) of the calls to schedule(),
which sounds like a good optimization to me ;)  We shall see if that
pans out.

Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]>
---

 kernel/sched.c |   16 ++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index b79b968..9e1f3ec 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4118,8 +4118,20 @@ asmlinkage void __sched __schedule(void)
sub_preempt_count(PREEMPT_ACTIVE);
 
 #if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP)
-   if (unlikely(atomic_read(_overload)))
-   balance_rt_tasks(rq, cpu);
+   /*
+* If we are switching away from an RT task while the system is in
+* overload, we need to see if there is a way we can help a different
+* cpu.  If the next task to run is not RT, or if it *is* RT but
+* is a logically lower priority, try to balance the system.  Otherwise
+* we can skip it, because anyone that could have pushed their tasks
+* to us already did.
+*/
+   if (unlikely(rt_task(prev) && atomic_read(_overload))) {
+   struct task_struct *preview = pick_rt_task(rq, cpu);
+
+   if (!preview || (preview->prio > prev->prio))
+   balance_rt_tasks(rq, cpu);
+   }
 #endif
 
if (unlikely(!rq->nr_running))

-
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: arch merge fallout.

2007-10-12 Thread Linus Torvalds


On Fri, 12 Oct 2007, Dave Jones wrote:
> 
> $ git log --follow arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
> fatal: ambiguous argument 'arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c':
> unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions

Duh. You need to use the current name, of course.

git log --follow arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c


gives me the proper output.

> Is what I'm seeing above indicative of this bug ? Or something else?  
> Adding -p or --stat makes no difference at all.

Try it with the right path.

Linus
-
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/7] RT: Select tasks based on relative affinity

2007-10-12 Thread Gregory Haskins
In theory, tasks will be most efficient if they are allowed to re-wake to
the CPU that they last ran on due to cache affinity.  Short of that, it is
cheaper to wake up the current CPU.  If neither of those two are options,
than the lowest CPU will do. 

Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]>
---

 kernel/sched.c |   72 +---
 1 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 3c71156..b79b968 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1511,6 +1511,15 @@ static int double_lock_balance(struct rq *this_rq, 
struct rq *busiest);
 /* Only try this algorithm three times */
 #define RT_PUSH_MAX_TRIES 3
 
+static int non_rt_cpu(cpumask_t *mask, int cpu)
+{
+   if (!rt_prio(cpu_rq(cpu)->curr_prio) &&
+   cpu_isset(cpu, *mask))
+   return 1;
+
+   return 0;
+}
+
 /* Will lock the rq it finds */
 static int find_lowest_cpu(cpumask_t *cpu_mask, struct task_struct *task,
 struct rq *this_rq)
@@ -1519,32 +1528,57 @@ static int find_lowest_cpu(cpumask_t *cpu_mask, struct 
task_struct *task,
int dst_cpu = -1;
int cpu;
int tries;
+   int this_cpu = smp_processor_id();
 
for (tries = 0; tries < RT_PUSH_MAX_TRIES; tries++) {
+
/*
-* Scan each rq for the lowest prio.
+* We select a CPU in the following priority:
+*
+*   task_cpu, this_cpu, first_cpu
+*
+* for efficiency.
+*
+* - task_cpu preserves cache affinity
+* - this_cpu is (presumably) cheaper to preempt
+*   (note that sometimes task_cpu and this_cpu
+*   are the same).
+* - Finally, we will take whatever is available
+*   if the first two don't pan out by scanning.
 */
-   for_each_cpu_mask(cpu, *cpu_mask) {
-   struct rq *rq = _cpu(runqueues, cpu);
-
-   if (cpu == smp_processor_id())
-   continue;
-
-   /* We look for lowest RT prio or non-rt CPU */
-   if (rq->curr_prio >= MAX_RT_PRIO) {
-   lowest_rq = rq;
-   dst_cpu = cpu;
-   break;
-   }
+   if (non_rt_cpu(cpu_mask, task_cpu(task))) {
+   lowest_rq = task_rq(task);  
+   dst_cpu = lowest_rq->cpu;
+   } else if (non_rt_cpu(cpu_mask, this_cpu)) {
+   dst_cpu = this_cpu;
+   lowest_rq = cpu_rq(this_cpu);   
+   } else {
 
-   /* no locking for now */
-   if (rq->curr_prio > task->prio &&
-   (!lowest_rq || rq->curr_prio < 
lowest_rq->curr_prio)) {
-   dst_cpu = cpu;
-   lowest_rq = rq;
+   /*
+* Scan each rq for the lowest prio.
+*/
+   for_each_cpu_mask(cpu, *cpu_mask) {
+   struct rq *rq = _cpu(runqueues, cpu);
+   
+   if (cpu == this_cpu)
+   continue;
+   
+   /* We look for lowest RT prio or non-rt CPU */
+   if (rq->curr_prio >= MAX_RT_PRIO) {
+   lowest_rq = rq;
+   dst_cpu = cpu;
+   break;
+   }
+   
+   /* no locking for now */
+   if (rq->curr_prio > task->prio &&
+   (!lowest_rq || rq->curr_prio < 
lowest_rq->curr_prio)) {
+   dst_cpu = cpu;
+   lowest_rq = rq;
+   }
}
}
-
+   
if (!lowest_rq) {
dst_cpu = -1;
break;

-
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 v4] IBM power meter driver

2007-10-12 Thread Darrick J. Wong
On Tue, Oct 09, 2007 at 08:00:44AM -0400, Mark M. Hoffman wrote:

> Sorry it took me so long to get back to this.  I've applied this to my hwmon
> testing branch, but I would still like to get a review from an IPMI expert.

I'm working on finding somebody to do that.

> OBTW: please try to send patches which apply cleanly to some tree to which I
> have access.  E.g.  from the Makefile - preceding and trailing context are not
> present in any git tree that I know.

Oops, sorry about that.

The i5k_amb driver referenced in the Makefile diff is the same one that
I posted to lm-sensors a few weeks ago, though there hasn't been much
discussion after it was pointed out that someone had already written a
driver to achieve the same purpose.  Unfortunately, nothing's happened
to either driver; any thoughts?  I'm thinking that we ought to get one
of them into shape for upstream, though I don't particularly care which
one it is...

--D


signature.asc
Description: Digital signature


[PATCH 5/7] RT: Add support for low-priority wake-up to push_rt feature

2007-10-12 Thread Gregory Haskins
There are three events that require consideration for redistributing RT
tasks:

1) When one or more higher-priority tasks preempts a lower-one from a
   RQ
2) When a lower-priority task is woken up on a RQ
3) When a RQ downgrades its current priority

Steve Rostedt's push_rt patch addresses (1).  It hooks in right after
a new task has been switched-in.  If this was the result of an RT
preemption, or if more than one task was awoken at the same time, we
can try to push some of those other tasks away.

This patch addresses (2).  When we wake up a task, we check to see
if it would preempt the current task on the queue.  If it will not, we
attempt to find a better suited CPU (e.g. one running something lower
priority than the task being woken) and try to activate the task there.

Finally, we have (3).  In theory, we only need to balance_rt_tasks() if
the following conditions are met:
   1) One or more CPUs are in overload, AND
   2) We are about to switch to a task that lowers our priority.

(3) will be addressed in a later patch.

Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]>
---

 kernel/sched.c |   68 ++--
 1 files changed, 41 insertions(+), 27 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 62f9f0b..3c71156 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1628,6 +1628,12 @@ out:
return ret;
 }
 
+/* Push all tasks that we can to other CPUs */
+static void push_rt_tasks(struct rq *this_rq)
+{
+   while (push_rt_task(this_rq));
+}
+
 /*
  * Pull RT tasks from other CPUs in the RT-overload
  * case. Interrupts are disabled, local rq is locked.
@@ -1988,7 +1994,33 @@ out_set_cpu:
this_cpu = smp_processor_id();
cpu = task_cpu(p);
}
-
+   
+   /*
+* If a newly woken up RT task cannot preempt the
+* current (RT) task (on a target runqueue) then try
+* to find another CPU it can preempt:
+*/
+   if (rt_task(p) && !TASK_PREEMPTS_CURR(p, rq)) {
+   cpumask_t cpu_mask;
+   cpus_and(cpu_mask, cpu_online_map, p->cpus_allowed);
+
+   new_cpu = find_lowest_cpu(_mask, p, rq);
+   if ((new_cpu != -1) && (new_cpu != cpu)) {
+   set_task_cpu(p, new_cpu);
+   spin_unlock(>lock);
+
+   /* The new lock was already acquired in find_lowest */ 
+   rq = cpu_rq(new_cpu);
+   old_state = p->state;
+   if (!(old_state & state))
+   goto out;
+   if (p->se.on_rq)
+   goto out_running;
+   
+   this_cpu = smp_processor_id();
+   cpu = task_cpu(p);
+   }
+   }
 out_activate:
 #endif /* CONFIG_SMP */
update_rq_clock(rq);
@@ -2002,30 +2034,13 @@ out_activate:
 * to find another CPU it can preempt:
 */
if (rt_task(p) && !TASK_PREEMPTS_CURR(p, rq)) {
-   struct rq *this_rq = cpu_rq(this_cpu);
/*
-* Special-case: the task on this CPU can be
-* preempted. In that case there's no need to
-* trigger reschedules on other CPUs, we can
-* mark the current task for reschedule.
-*
-* (Note that it's safe to access this_rq without
-* extra locking in this particular case, because
-* we are on the current CPU.)
+* FIXME: Do we still need to do this here anymore, or
+* does the preemption-check above suffice.  The path
+* that makes my head hurt is when we have the
+* task_running->out_activate path
 */
-   if (TASK_PREEMPTS_CURR(p, this_rq))
-   set_tsk_need_resched(this_rq->curr);
-   else
-   /*
-* Neither the intended target runqueue
-* nor the current CPU can take this task.
-* Trigger a reschedule on all other CPUs
-* nevertheless, maybe one of them can take
-* this task:
-*/
-   smp_send_reschedule_allbutself_cpumask(p->cpus_allowed);
-
-   schedstat_inc(this_rq, rto_wakeup);
+   push_rt_tasks(rq);
} else {
/*
 * Sync wakeups (i.e. those types of wakeups where the waker
@@ -2360,13 +2375,12 @@ static inline void finish_task_switch(struct rq *rq, 
struct task_struct *prev)
 * the lock was owned by prev, we need to release it
 * first via finish_lock_switch and then reaquire it.
 */
-   if (unlikely(rt_task(current))) {
+   if (unlikely(rq->rt_nr_running > 1)) {

[PATCH 4/7] RT: Add support for updating push-rt priority under PI boost

2007-10-12 Thread Gregory Haskins
Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]>
---

 kernel/sched.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 50c88e8..62f9f0b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4663,6 +4663,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
 * this runqueue and our priority is higher than the current's
 */
if (task_running(rq, p)) {
+   set_rq_prio(rq, p->prio);
if (p->prio > oldprio)
resched_task(rq->curr);
} else {
@@ -4722,6 +4723,9 @@ void set_user_nice(struct task_struct *p, long nice)
 */
if (delta < 0 || (delta > 0 && task_running(rq, p)))
resched_task(rq->curr);
+
+   if (delta && task_running(rq, p))
+   set_rq_prio(rq, p->prio);
}
 out_unlock:
task_rq_unlock(rq, );

-
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/7] RT: Add a per-cpu rt_overload indication

2007-10-12 Thread Gregory Haskins
The system currently evaluates all online CPUs whenever one or more enters
an rt_overload condition.  This suffers from scalability limitations as
the # of online CPUs increases.  So we introduce a cpumask to track
exactly which CPUs need RT balancing.

Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]>
CC: Peter W. Morreale <[EMAIL PROTECTED]>
---

 kernel/sched.c |   12 +---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 86ff36d..0a1ad0e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -632,6 +632,7 @@ static inline struct rq *this_rq_lock(void)
 
 #if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP)
 static __cacheline_aligned_in_smp atomic_t rt_overload;
+static cpumask_t rto_cpus;
 #endif
 
 static inline void inc_rt_tasks(struct task_struct *p, struct rq *rq)
@@ -640,8 +641,11 @@ static inline void inc_rt_tasks(struct task_struct *p, 
struct rq *rq)
if (rt_task(p)) {
rq->rt_nr_running++;
 # ifdef CONFIG_SMP
-   if (rq->rt_nr_running == 2)
+   if (rq->rt_nr_running == 2) {
+   cpu_set(rq->cpu, rto_cpus);
+   smp_wmb();
atomic_inc(_overload);
+   }
 # endif
}
 #endif
@@ -654,8 +658,10 @@ static inline void dec_rt_tasks(struct task_struct *p, 
struct rq *rq)
WARN_ON(!rq->rt_nr_running);
rq->rt_nr_running--;
 # ifdef CONFIG_SMP
-   if (rq->rt_nr_running == 1)
+   if (rq->rt_nr_running == 1) {
atomic_dec(_overload);
+   cpu_clear(rq->cpu, rto_cpus);
+   }
 # endif
}
 #endif
@@ -1624,7 +1630,7 @@ static void balance_rt_tasks(struct rq *this_rq, int 
this_cpu)
 */
next = pick_next_task(this_rq, this_rq->curr);
 
-   for_each_online_cpu(cpu) {
+   for_each_cpu_mask(cpu, rto_cpus) {
if (cpu == this_cpu)
continue;
src_rq = cpu_rq(cpu);

-
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/7] RT: Wrap the RQ notion of priority to make it conditional

2007-10-12 Thread Gregory Haskins
A little cleanup to avoid #ifdef proliferation later in the series

Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]>
---

 kernel/sched.c |   23 ---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 0a1ad0e..c9afc8a 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -255,6 +255,10 @@ struct cfs_rq {
 #endif
 };
 
+#if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP)
+#define  ENABLE_RQ_PRIORITY   /* Steve wants this conditional on PREEMPT_RT */
+#endif /* CONFIG_PREEMPT_RT */
+
 /* Real-Time classes' related field in a runqueue: */
 struct rt_rq {
struct rt_prio_array active;
@@ -304,6 +308,9 @@ struct rq {
 #ifdef CONFIG_PREEMPT_RT
unsigned long rt_nr_running;
unsigned long rt_nr_uninterruptible;
+#endif
+
+#ifdef ENABLE_RQ_PRIORITY
int curr_prio;
 #endif
 
@@ -365,6 +372,16 @@ struct rq {
 static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
 static DEFINE_MUTEX(sched_hotcpu_mutex);
 
+#ifdef ENABLE_RQ_PRIORITY
+static inline void set_rq_prio(struct rq *rq, int prio)
+{
+   rq->curr_prio = prio;
+}
+
+#else
+#define set_rq_prio(rq, prio) do { } while(0)
+#endif
+
 static inline void check_preempt_curr(struct rq *rq, struct task_struct *p)
 {
rq->curr->sched_class->check_preempt_curr(rq, p);
@@ -2331,9 +2348,9 @@ static inline void finish_task_switch(struct rq *rq, 
struct task_struct *prev)
 */
prev_state = prev->state;
_finish_arch_switch(prev);
-#if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP)
-   rq->curr_prio = current->prio;
-#endif
+
+   set_rq_prio(rq, current->prio);
+
finish_lock_switch(rq, prev);
 #if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP)
/*

-
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/7] RT: Initialize the priority value

2007-10-12 Thread Gregory Haskins
Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]>
---

 kernel/sched.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index c9afc8a..50c88e8 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7395,6 +7395,8 @@ void __init sched_init(void)
highest_cpu = i;
/* delimiter for bitsearch: */
__set_bit(MAX_RT_PRIO, array->bitmap);
+
+   set_rq_prio(rq, MAX_PRIO);
}
 
set_load_weight(_task);

-
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/7] RT: RT-Overload/Sched enhancements (v2)

2007-10-12 Thread Gregory Haskins
This series applies to 2.6.23-rt1 + Steven Rostedt's last published "push-rt"
patch.

Changes since v1:

- Rebased to the final 23-rt1 from 23-rt1-pre1
- Rebased to Steve's last published patch
- Removed controversial "cpupri" algorithm (may revisit later, drop for now)
- Fixed a missing priority update in the set_user_nice() code
- Added experimental "phase 3" patch for limiting pulls to when necessary

Comments/suggestions/feedback are all welcome.

Regards,
-Greg 
-
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: arch merge fallout.

2007-10-12 Thread Dave Jones
On Fri, Oct 12, 2007 at 08:11:53PM -0400, Dave Jones wrote:
 > On Fri, Oct 12, 2007 at 04:14:54PM -0700, Linus Torvalds wrote:
 >  > 
 >  > 
 >  > On Fri, 12 Oct 2007, Dave Jones wrote:
 >  > >
 >  > > Something I find useful is to just do for eg..
 >  > > 
 >  > > git log arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
 >  > > 
 >  > > from time to time, to figure out when certain changes happened,
 >  > > or even to grep for something in a changelog.
 >  > > With that file moved, git refuses to tell me about the log
 >  > > of a file that doesn't exist, and the log of the moved
 >  > > file in arch/x86 just has a single commit, detailing the move.
 >  > > 
 >  > > Is there an easy way to get the complete log of a file?
 >  > 
 >  > The "--follow" flag will follow renames when doing a log, so a simple
 >  > 
 >  >   git log --follow arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
 >  > 
 >  > will do it.
 > 
 > Hrmm.
 > 
 > $ git log --follow arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
 > fatal: ambiguous argument 'arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c':
 > unknown revision or path not in the working tree.
 > Use '--' to separate paths from revisions
 > 
 > Using --follow on the arch/x86 post-merge file gives me even less info
 > than it does without it :)

duh.

git log --stat --follow arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c

works just fine.  Thanks.

(was running it on the old path)

Dave
 
-- 
http://www.codemonkey.org.uk
-
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: arch merge fallout.

2007-10-12 Thread Dave Jones
On Fri, Oct 12, 2007 at 04:14:54PM -0700, Linus Torvalds wrote:
 > 
 > 
 > On Fri, 12 Oct 2007, Dave Jones wrote:
 > >
 > > Something I find useful is to just do for eg..
 > > 
 > > git log arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
 > > 
 > > from time to time, to figure out when certain changes happened,
 > > or even to grep for something in a changelog.
 > > With that file moved, git refuses to tell me about the log
 > > of a file that doesn't exist, and the log of the moved
 > > file in arch/x86 just has a single commit, detailing the move.
 > > 
 > > Is there an easy way to get the complete log of a file?
 > 
 > The "--follow" flag will follow renames when doing a log, so a simple
 > 
 >  git log --follow arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
 > 
 > will do it.

Hrmm.

$ git log --follow arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
fatal: ambiguous argument 'arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c':
unknown revision or path not in the working tree.
Use '--' to separate paths from revisions

Using --follow on the arch/x86 post-merge file gives me even less info
than it does without it :)

 > [ Although I actually introduced a bug in that last week, so if it gives 
 >   empty output for you, add a "--stat" to get a diffstat (or "-p" to get 
 >   the whole patch) to work around a stupid mistake. That bug is in both 
 >   1.5.3.3 and 1.5.3.4 - and Junio happens to be away for two weeks, so 
 >   it's not fixed in any release yet. I have a trivial patch for it if you 
 >   care, but the "use -p" workaround is usually what you want to do anyway, 
 >   which is probably why  nobody even noticed it was broken! ]

Is what I'm seeing above indicative of this bug ? Or something else?  
Adding -p or --stat makes no difference at all.

Dave

-- 
http://www.codemonkey.org.uk
-
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: [git patches] libata update

2007-10-12 Thread Luben Tuikov
You should run "git-update-server-info" in 
pub/scm/linux/kernel/git/jgarzik/libata-dev.git.

info/refs disagrees with refs/heads/* .

   Luben

--- Jeff Garzik <[EMAIL PROTECTED]> wrote:

> 
> [ I just sent this upstream to Andrew and Linus ]
> 
> Now that I have nailed down the corruption problem, I can attend to
> this...  Fun stuff:
> 
> * port multiplier support (like an ethernet hub, only dumber)
> 
> * Asynchronous notification -- finally userspace CD-ROM polling can go away!
>   (NOTE: waiting on James B to apply the piece that actually makes this
>   work...)
> 
> * Alan continues to hammer out edge cases in generic ATA support.  An
>   amazing amount of ancient and/or obscure hardware works with libata   
> thanks to him :)
> 
> * Turn on ACPI by default (watch for bug reports!).  This should make
>   suspend/resume work a lot better.
> 
> * New drivers for embedded ATA chips.
> 
> 
> Please pull from 'upstream-linus' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 
> upstream-linus
> 
> to receive the following updates:
> 
>  Documentation/kernel-parameters.txt  |8 +-
>  drivers/ata/Kconfig  |   59 ++-
>  drivers/ata/Makefile |8 +-
>  drivers/ata/ahci.c   |  451 +++---
>  drivers/ata/ata_generic.c|   16 +-
>  drivers/ata/ata_piix.c   |   71 +-
>  drivers/ata/libata-acpi.c|  165 +++-
>  drivers/ata/libata-core.c| 1329 ++--
>  drivers/ata/libata-eh.c  |  922 ++--
>  drivers/ata/libata-pmp.c | 1191 +
>  drivers/ata/libata-scsi.c|  496 +++
>  drivers/ata/libata-sff.c |   69 +-
>  drivers/ata/libata.h |   41 +-
>  drivers/ata/pata_acpi.c  |  395 
>  drivers/ata/pata_ali.c   |   17 +-
>  drivers/ata/pata_amd.c   |   43 +-
>  drivers/ata/pata_artop.c |   20 +-
>  drivers/ata/pata_at32.c  |  441 +
>  drivers/ata/pata_atiixp.c|   15 +-
>  drivers/ata/pata_bf54x.c | 1627 
> ++
>  drivers/ata/pata_cmd640.c|4 +-
>  drivers/ata/pata_cmd64x.c|   43 +-
>  drivers/ata/pata_cs5520.c|   47 +-
>  drivers/ata/pata_cs5530.c|4 +-
>  drivers/ata/pata_cs5535.c|4 +-
>  drivers/ata/pata_cypress.c   |4 +-
>  drivers/ata/pata_efar.c  |   11 +-
>  drivers/ata/pata_hpt366.c|4 +-
>  drivers/ata/pata_hpt37x.c|   28 +-
>  drivers/ata/pata_hpt3x2n.c   |   11 +-
>  drivers/ata/pata_hpt3x3.c|   10 +-
>  drivers/ata/pata_icside.c|   39 +-
>  drivers/ata/pata_isapnp.c|8 +-
>  drivers/ata/pata_it8213.c|   11 +-
>  drivers/ata/pata_it821x.c|   17 +-
>  drivers/ata/pata_ixp4xx_cf.c |   24 +-
>  drivers/ata/pata_jmicron.c   |   24 +-
>  drivers/ata/pata_legacy.c|   27 +-
>  drivers/ata/pata_marvell.c   |   12 +-
>  drivers/ata/pata_mpc52xx.c   |9 +-
>  drivers/ata/pata_mpiix.c |   25 +-
>  drivers/ata/pata_netcell.c   |5 +-
>  drivers/ata/pata_ns87410.c   |   11 +-
>  drivers/ata/pata_ns87415.c   |  467 ++
>  drivers/ata/pata_oldpiix.c   |   11 +-
>  drivers/ata/pata_opti.c  |   11 +-
>  drivers/ata/pata_optidma.c   |   26 +-
>  drivers/ata/pata_pcmcia.c|   16 +-
>  drivers/ata/pata_pdc2027x.c  |  114 ++--
>  drivers/ata/pata_pdc202xx_old.c  |   23 +-
>  drivers/ata/pata_platform.c  |   16 +-
>  drivers/ata/pata_qdi.c   |   15 +-
>  drivers/ata/pata_radisys.c   |4 +-
>  drivers/ata/pata_rz1000.c|   13 +-
>  drivers/ata/pata_sc1200.c|4 +-
>  drivers/ata/pata_scc.c   |   66 +-
>  drivers/ata/pata_serverworks.c   |8 +-
>  drivers/ata/pata_sil680.c|   11 +-
>  drivers/ata/pata_sis.c   |   33 +-
>  drivers/ata/pata_sl82c105.c  |   11 +-
>  drivers/ata/pata_triflex.c   |   11 +-
>  drivers/ata/pata_via.c   |   16 +-
>  drivers/ata/pata_winbond.c   |   13 +-
>  drivers/ata/pdc_adma.c   |  103 ++-
>  drivers/ata/sata_inic162x.c  |   34 +-
>  drivers/ata/sata_mv.c|   68 +-
>  drivers/ata/sata_nv.c|   53 +-
>  drivers/ata/sata_promise.c   |   27 +-
>  drivers/ata/sata_qstor.c |   17 +-
>  drivers/ata/sata_sil.c   |   53 +-
>  drivers/ata/sata_sil24.c |  341 ++--
>  drivers/ata/sata_sis.c   |2 -
>  drivers/ata/sata_svw.c   |   14 +-
>  drivers/ata/sata_sx4.c   |   25 +-
>  drivers/ata/sata_uli.c   |   16 +-
>  

Re: [PATCH] hiddev: Add 32bit ioctl compatibilty

2007-10-12 Thread Al Viro
On Fri, Oct 12, 2007 at 04:51:00PM -0700, Philip Langdale wrote:
> The hiddev driver currently lacks 32bit ioctl compatibility, so
> if you're running with a 64bit kernel and 32bit userspace, it won't
> work.
> 
> I'm pretty sure that the only thing missing is a compat_ioctl
> implementation as all structs have fixed size fields.
> 
> +static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, 
> unsigned long arg)
> +{
> + struct inode *inode = file->f_path.dentry->d_inode;
> + return hiddev_ioctl(inode, file, cmd, compat_ptr(arg));
> +}

Just how many instances of that sucker do we need?  It's nothing but

 struct inode *inode = file->f_path.dentry->d_inode;
 return file->f_op->ioctl(inode, file, cmd, compat_ptr(arg));
-
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] hiddev: Add 32bit ioctl compatibilty

2007-10-12 Thread Philip Langdale
The hiddev driver currently lacks 32bit ioctl compatibility, so
if you're running with a 64bit kernel and 32bit userspace, it won't
work.

I'm pretty sure that the only thing missing is a compat_ioctl
implementation as all structs have fixed size fields.

With this change I can use revoco to configure my MX Revolution mouse.

Signed-off-by: Philip Langdale <[EMAIL PROTECTED]>

--- linux-2.6.23/drivers/hid/usbhid/hiddev.c2007-10-09 13:31:38.0 
-0700
+++ linux-phil/drivers/hid/usbhid/hiddev.c  2007-10-12 15:02:15.0 
-0700
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "usbhid.h"

 #ifdef CONFIG_USB_DYNAMIC_MINORS
@@ -738,6 +738,14 @@
return -EINVAL;
 }

+#ifdef CONFIG_COMPAT
+static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned 
long arg)
+{
+   struct inode *inode = file->f_path.dentry->d_inode;
+   return hiddev_ioctl(inode, file, cmd, compat_ptr(arg));
+}
+#endif
+
 static const struct file_operations hiddev_fops = {
.owner =THIS_MODULE,
.read = hiddev_read,
@@ -747,6 +754,9 @@
.release =  hiddev_release,
.ioctl =hiddev_ioctl,
.fasync =   hiddev_fasync,
+#ifdef CONFIG_COMPAT
+   .compat_ioctl   = hiddev_compat_ioctl,
+#endif
 };

 static struct usb_class_driver hiddev_class = {
-
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] Allow kconfig to accept overrides

2007-10-12 Thread Randy Dunlap

Jan Engelhardt wrote:

On Oct 12 2007 15:57, Randy Dunlap wrote:

On Fri, 12 Oct 2007 23:44:08 +0200 (CEST) Jan Engelhardt wrote:


warning("override: %s turns state choice", sym->name);

What does that warning message mean?  I can't decipher it.


It is when the value of a "choice" kconfig object is changed, for example
this .config excerpt:

CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
# CONFIG_PREEMPT_BKL is not set
# CONFIG_PREEMPT_NONE is not set
CONFIG_REEMPT_VOLUNTARY=y


Other than that, it works for me.  Thanks.


/What/ works, the patch, or the tree without the patch? (Note I was
testing that on 2.6.23.1, not the git head, so if someone silently
merged things behind me, I might have missed it. Then again, that
would have probably caused an offset, fuzz or reject, which was not
the case.)


The patch and me modifying the .config file by hand to cause overrides.

--
~Randy
-
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] Allow kconfig to accept overrides

2007-10-12 Thread Jan Engelhardt

On Oct 12 2007 15:57, Randy Dunlap wrote:
>On Fri, 12 Oct 2007 23:44:08 +0200 (CEST) Jan Engelhardt wrote:
>
>> warning("override: %s turns state choice", sym->name);
>
>What does that warning message mean?  I can't decipher it.

It is when the value of a "choice" kconfig object is changed, for example
this .config excerpt:

CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
# CONFIG_PREEMPT_BKL is not set
# CONFIG_PREEMPT_NONE is not set
CONFIG_REEMPT_VOLUNTARY=y

>Other than that, it works for me.  Thanks.

/What/ works, the patch, or the tree without the patch? (Note I was
testing that on 2.6.23.1, not the git head, so if someone silently
merged things behind me, I might have missed it. Then again, that
would have probably caused an offset, fuzz or reject, which was not
the case.)
-
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] [mmc] fix compile without LED Triggers

2007-10-12 Thread Randy Dunlap
On Sat, 13 Oct 2007 00:25:15 +0200 Sebastian Siewior wrote:

> drivers/mmc/core/host.c: In function 'mmc_remove_host':
> drivers/mmc/core/host.c:146: error: implicit declaration of function 
> 'led_trigger_unregister'
> drivers/mmc/core/host.c:146: error: 'struct mmc_host' has no member named 
> 'led'
> 
> Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]>
> ---
>  include/linux/leds.h |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/leds.h b/include/linux/leds.h
> index dc1178f..24c4830 100644
> --- a/include/linux/leds.h
> +++ b/include/linux/leds.h
> @@ -98,6 +98,7 @@ extern void led_trigger_event(struct led_trigger *trigger,
>  #define DEFINE_LED_TRIGGER_GLOBAL(x)
>  #define led_trigger_register_simple(x, y) do {} while(0)
>  #define led_trigger_unregister_simple(x) do {} while(0)
> +#define led_trigger_unregister(x) do {} while(0)
>  #define led_trigger_event(x, y) do {} while(0)
>  
>  #endif

or this patch that was posted earlier:
http://lkml.org/lkml/2007/10/12/380

---
~Randy
-
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: arch merge fallout.

2007-10-12 Thread Linus Torvalds


On Fri, 12 Oct 2007, Dave Jones wrote:
>
> Something I find useful is to just do for eg..
> 
> git log arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
> 
> from time to time, to figure out when certain changes happened,
> or even to grep for something in a changelog.
> With that file moved, git refuses to tell me about the log
> of a file that doesn't exist, and the log of the moved
> file in arch/x86 just has a single commit, detailing the move.
> 
> Is there an easy way to get the complete log of a file?

The "--follow" flag will follow renames when doing a log, so a simple

git log --follow arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c

will do it.

[ Although I actually introduced a bug in that last week, so if it gives 
  empty output for you, add a "--stat" to get a diffstat (or "-p" to get 
  the whole patch) to work around a stupid mistake. That bug is in both 
  1.5.3.3 and 1.5.3.4 - and Junio happens to be away for two weeks, so 
  it's not fixed in any release yet. I have a trivial patch for it if you 
  care, but the "use -p" workaround is usually what you want to do anyway, 
  which is probably why  nobody even noticed it was broken! ]

Linus
-
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: [RFD] iptables: mangle table obsoletes filter table

2007-10-12 Thread Patrick McHardy

Al Boldi wrote:

Patrick McHardy wrote:
  

The netlink based iptables successor I'm currently working on allows to
dynamically create tables with user-specified priorities and "built-in"
chains. The only built-in tables will be those that need extra
processing (mangle/nat). So it should be possible to set up tables
basically any way you desire.



Wow!  How soon can we expect this to surface on mainline?


I can't tell at this point, there's still too much work to do
for a realistic estimate. I'll post patches to netfilter-devel
as soon as its good enough for some real testing.

-
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] Allow kconfig to accept overrides

2007-10-12 Thread Randy Dunlap
On Fri, 12 Oct 2007 23:44:08 +0200 (CEST) Jan Engelhardt wrote:

> Allow config variables in .config to override earlier ones in the same
> file. In other words,
> 
>   # CONFIG_SECURITY is not defined
>   CONFIG_SECURITY=y
> 
> will activate it. This makes it a bit easier to do
> 
>   (cat original-config myconfig myconfig2 ... >.config)
> 
> and run menuconfig as expected.
> 
> Previously sent:
>   http://lkml.org/lkml/2006/10/25/81
>   http://lkml.org/lkml/2007/4/1/175
> 
> Signed-off-by: Jan Engelhardt <[EMAIL PROTECTED]>
> Cc: Sam Ravnborg <[EMAIL PROTECTED]>
> Cc: Roman Zippel <[EMAIL PROTECTED]>
> Cc: Randy Dunlap <[EMAIL PROTECTED]>
> 
> ---
>  scripts/kconfig/confdata.c |   14 +-
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> #
> # Applies cleanly to 2.6.22/23/git.
> #
> Index: linux-2.6.22.1/scripts/kconfig/confdata.c
> ===
> --- linux-2.6.22.1.orig/scripts/kconfig/confdata.c
> +++ linux-2.6.22.1/scripts/kconfig/confdata.c
> @@ -170,8 +170,7 @@ load:
>   sym->type = S_BOOLEAN;
>   }
>   if (sym->flags & def_flags) {
> - conf_warning("trying to reassign symbol %s", 
> sym->name);
> - break;
> + conf_warning("override: reassigning to symbol 
> %s", sym->name);
>   }
>   switch (sym->type) {
>   case S_BOOLEAN:
> @@ -210,8 +209,7 @@ load:
>   sym->type = S_OTHER;
>   }
>   if (sym->flags & def_flags) {
> - conf_warning("trying to reassign symbol %s", 
> sym->name);
> - break;
> + conf_warning("override: reassigning to symbol 
> %s", sym->name);
>   }
>   switch (sym->type) {
>   case S_TRISTATE:
> @@ -288,11 +286,9 @@ load:
>   }
>   break;
>   case yes:
> - if (cs->def[def].tri != no) {
> - conf_warning("%s creates inconsistent 
> choice state", sym->name);
> - cs->flags &= ~def_flags;
> - } else
> - cs->def[def].val = sym;
> + if(cs->def[def].tri != no)

if (
> + conf_warning("override: %s turns state 
> choice", sym->name);

What does that warning message mean?  I can't decipher it.

Other than that, it works for me.  Thanks.

> + cs->def[def].val = sym;
>   break;
>   }
>   cs->def[def].tri = E_OR(cs->def[def].tri, 
> sym->def[def].tri);


---
~Randy
-
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: [RFD] iptables: mangle table obsoletes filter table

2007-10-12 Thread Al Boldi
Patrick McHardy wrote:
> Al Boldi wrote:
> > But can you see how forcing people into splitting
> > their rules across tables adds complexity.  And without ipt_REJECT
> > patch, they can't even use REJECT in prerouting, which forces them to do
> > some strange hacks.
> >
> > IMHO, we should make things as easily configurable as possible, and as
> > things stand right now, the filter-table is completely useless for 99%
> > of use-cases.
>
> Sure, as I said, patches to remove the arbitary restrictions to
> tables are welcome, but please do this for all targets and
> matches which allow this, not only REJECT. And if you include a
> seperate (tested) patch for the IPv4 and IPv6 REJECT targets
> I'll consider it as well.

Sounds fair.  All we need now is for someone to kindly submit these rather 
straight forward patches.


Thanks!

--
Al

-
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: [RFD] iptables: mangle table obsoletes filter table

2007-10-12 Thread Al Boldi
Patrick McHardy wrote:
> Jan Engelhardt wrote:
> > On Oct 12 2007 16:30, Al Boldi wrote:
> With the existence of the mangle table, how useful is the filter
>  table?
> >>>
> >>>A similar discussion was back in March 2007.
> >>>http://marc.info/?l=netfilter-devel=117394977210823=2
> >>>http://marc.info/?l=netfilter-devel=117400063907706=2
> >>>
> >>>in the end, my proposal was something like
> >>>http://jengelh.hopto.org/GFX0/nf_proposal2.svg
> >>
> >>Any chance you could publish this as something readable like text/html?
> >
> > Like, image/png?
> > http://jengelh.hopto.org/GFX0/nf_proposal2.png
>
> The netlink based iptables successor I'm currently working on allows to
> dynamically create tables with user-specified priorities and "built-in"
> chains. The only built-in tables will be those that need extra
> processing (mangle/nat). So it should be possible to set up tables
> basically any way you desire.

Wow!  How soon can we expect this to surface on mainline?


Thanks a lot!

--
Al
-
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/1] x86: convert-cpuinfo_x86-array-to-a-per_cpu-array fix

2007-10-12 Thread travis

This fix corrects the problem that early_identify_cpu() sets
cpu_index to '0' (needed when called by setup_arch) after
smp_store_cpu_info() had set it to the correct value.

Thanks to Suresh for discovering this problem.

-- 
-
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/1] x86: convert-cpuinfo_x86-array-to-a-per_cpu-array fix

2007-10-12 Thread travis
This fix corrects the problem that early_identify_cpu() sets
cpu_index to '0' (needed when called by setup_arch) after
smp_store_cpu_info() had set it to the correct value.

Signed-off-by: Mike Travis <[EMAIL PROTECTED]>
---
 arch/x86_64/kernel/smpboot.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux.orig/arch/x86_64/kernel/smpboot.c 2007-10-12 14:28:45.0 
-0700
+++ linux/arch/x86_64/kernel/smpboot.c  2007-10-12 14:53:42.753508152 -0700
@@ -141,8 +141,8 @@ static void __cpuinit smp_store_cpu_info
struct cpuinfo_x86 *c = _data(id);
 
*c = boot_cpu_data;
-   c->cpu_index = id;
identify_cpu(c);
+   c->cpu_index = id;
print_cpu_info(c);
 }
 

-- 
-
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: arch merge fallout.

2007-10-12 Thread Dave Jones
On Fri, Oct 12, 2007 at 03:43:46PM -0700, Linus Torvalds wrote:
 > 
 > 
 > On Fri, 12 Oct 2007, Dave Jones wrote:
 > > 
 > > pull req below.  If it turns out to be more trouble than its worth,
 > 
 > It merged totally automatically, no trouble what-so-ever:
 > 
 >  Renamed arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c => 
 > arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
 >  Auto-merged arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
 >  Renamed arch/i386/kernel/cpu/cpufreq/longhaul.c => 
 > arch/x86/kernel/cpu/cpufreq/longhaul.c
 >  Auto-merged arch/x86/kernel/cpu/cpufreq/longhaul.c
 >  Auto-merged arch/powerpc/platforms/cell/cbe_cpufreq.c
 >  Merge made by recursive.
 > 
 > I think it was just unlucky that the particular version of git you have 
 > probably hit exactly in the window of "limited rename detection" *and* 
 > lacking the config switch to turn off the limiter.

Awesome! Thanks for doing that.
One other git quirk that I'm not sure how to work around btw..
Something I find useful is to just do for eg..

git log arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c

from time to time, to figure out when certain changes happened,
or even to grep for something in a changelog.
With that file moved, git refuses to tell me about the log
of a file that doesn't exist, and the log of the moved
file in arch/x86 just has a single commit, detailing the move.

Is there an easy way to get the complete log of a file?

Dave

-- 
http://www.codemonkey.org.uk
-
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: arch merge fallout.

2007-10-12 Thread Linus Torvalds


On Fri, 12 Oct 2007, Dave Jones wrote:
> 
> pull req below.  If it turns out to be more trouble than its worth,

It merged totally automatically, no trouble what-so-ever:

Renamed arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c => 
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
Auto-merged arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
Renamed arch/i386/kernel/cpu/cpufreq/longhaul.c => 
arch/x86/kernel/cpu/cpufreq/longhaul.c
Auto-merged arch/x86/kernel/cpu/cpufreq/longhaul.c
Auto-merged arch/powerpc/platforms/cell/cbe_cpufreq.c
Merge made by recursive.

I think it was just unlucky that the particular version of git you have 
probably hit exactly in the window of "limited rename detection" *and* 
lacking the config switch to turn off the limiter.

Linus
-
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: [GIT PATCH] USB patches for 2.6.23

2007-10-12 Thread Greg KH
On Fri, Oct 12, 2007 at 03:20:50PM -0700, David Miller wrote:
> From: Greg KH <[EMAIL PROTECTED]>
> Date: Fri, 12 Oct 2007 15:12:45 -0700
> 
> > Alan Stern (44):
>  ...
> >   USB: mutual exclusion for EHCI init and port resets
> 
> Greg, if you haven't already, please consider queueing
> this one up for -stable too.

Ah, good idea, I'll go do that.

thanks,

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/


[PATCH] [mmc] fix compile without LED Triggers

2007-10-12 Thread Sebastian Siewior
drivers/mmc/core/host.c: In function 'mmc_remove_host':
drivers/mmc/core/host.c:146: error: implicit declaration of function 
'led_trigger_unregister'
drivers/mmc/core/host.c:146: error: 'struct mmc_host' has no member named 'led'

Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]>
---
 include/linux/leds.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/leds.h b/include/linux/leds.h
index dc1178f..24c4830 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -98,6 +98,7 @@ extern void led_trigger_event(struct led_trigger *trigger,
 #define DEFINE_LED_TRIGGER_GLOBAL(x)
 #define led_trigger_register_simple(x, y) do {} while(0)
 #define led_trigger_unregister_simple(x) do {} while(0)
+#define led_trigger_unregister(x) do {} while(0)
 #define led_trigger_event(x, y) do {} while(0)
 
 #endif
-- 
1.5.3.4

-
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 75/75] PM: merge device power-management source files

2007-10-12 Thread Greg Kroah-Hartman
From: Alan Stern <[EMAIL PROTECTED]>

This patch (as993) merges the suspend.c and resume.c files in
drivers/base/power into main.c, making some public symbols private.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
Acked-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/base/power/Makefile  |2 +-
 drivers/base/power/main.c|  344 +-
 drivers/base/power/power.h   |   32 +
 drivers/base/power/resume.c  |  149 --
 drivers/base/power/suspend.c |  210 -
 5 files changed, 343 insertions(+), 394 deletions(-)
 delete mode 100644 drivers/base/power/resume.c
 delete mode 100644 drivers/base/power/suspend.c

diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
index 9caeaea..a803733 100644
--- a/drivers/base/power/Makefile
+++ b/drivers/base/power/Makefile
@@ -1,5 +1,5 @@
 obj-y  := shutdown.o
-obj-$(CONFIG_PM_SLEEP) += main.o suspend.o resume.o sysfs.o
+obj-$(CONFIG_PM_SLEEP) += main.o sysfs.o
 obj-$(CONFIG_PM_TRACE) += trace.o
 
 ifeq ($(CONFIG_DEBUG_DRIVER),y)
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index eb9f38d..0ab4ab2 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -20,19 +20,24 @@
  */
 
 #include 
+#include 
 #include 
+#include 
+#include 
 
+#include "../base.h"
 #include "power.h"
 
 LIST_HEAD(dpm_active);
-LIST_HEAD(dpm_off);
-LIST_HEAD(dpm_off_irq);
+static LIST_HEAD(dpm_off);
+static LIST_HEAD(dpm_off_irq);
 
-DEFINE_MUTEX(dpm_mtx);
-DEFINE_MUTEX(dpm_list_mtx);
+static DEFINE_MUTEX(dpm_mtx);
+static DEFINE_MUTEX(dpm_list_mtx);
 
 int (*platform_enable_wakeup)(struct device *dev, int is_on);
 
+
 int device_pm_add(struct device *dev)
 {
int error;
@@ -61,3 +66,334 @@ void device_pm_remove(struct device *dev)
 }
 
 
+/*- Resume routines -*/
+
+/**
+ * resume_device - Restore state for one device.
+ * @dev:   Device.
+ *
+ */
+
+static int resume_device(struct device * dev)
+{
+   int error = 0;
+
+   TRACE_DEVICE(dev);
+   TRACE_RESUME(0);
+
+   down(>sem);
+
+   if (dev->bus && dev->bus->resume) {
+   dev_dbg(dev,"resuming\n");
+   error = dev->bus->resume(dev);
+   }
+
+   if (!error && dev->type && dev->type->resume) {
+   dev_dbg(dev,"resuming\n");
+   error = dev->type->resume(dev);
+   }
+
+   if (!error && dev->class && dev->class->resume) {
+   dev_dbg(dev,"class resume\n");
+   error = dev->class->resume(dev);
+   }
+
+   up(>sem);
+
+   TRACE_RESUME(error);
+   return error;
+}
+
+
+static int resume_device_early(struct device * dev)
+{
+   int error = 0;
+
+   TRACE_DEVICE(dev);
+   TRACE_RESUME(0);
+   if (dev->bus && dev->bus->resume_early) {
+   dev_dbg(dev,"EARLY resume\n");
+   error = dev->bus->resume_early(dev);
+   }
+   TRACE_RESUME(error);
+   return error;
+}
+
+/*
+ * Resume the devices that have either not gone through
+ * the late suspend, or that did go through it but also
+ * went through the early resume
+ */
+static void dpm_resume(void)
+{
+   mutex_lock(_list_mtx);
+   while(!list_empty(_off)) {
+   struct list_head * entry = dpm_off.next;
+   struct device * dev = to_device(entry);
+
+   get_device(dev);
+   list_move_tail(entry, _active);
+
+   mutex_unlock(_list_mtx);
+   resume_device(dev);
+   mutex_lock(_list_mtx);
+   put_device(dev);
+   }
+   mutex_unlock(_list_mtx);
+}
+
+
+/**
+ * device_resume - Restore state of each device in system.
+ *
+ * Walk the dpm_off list, remove each entry, resume the device,
+ * then add it to the dpm_active list.
+ */
+
+void device_resume(void)
+{
+   might_sleep();
+   mutex_lock(_mtx);
+   dpm_resume();
+   mutex_unlock(_mtx);
+}
+
+EXPORT_SYMBOL_GPL(device_resume);
+
+
+/**
+ * dpm_power_up - Power on some devices.
+ *
+ * Walk the dpm_off_irq list and power each device up. This
+ * is used for devices that required they be powered down with
+ * interrupts disabled. As devices are powered on, they are moved
+ * to the dpm_active list.
+ *
+ * Interrupts must be disabled when calling this.
+ */
+
+static void dpm_power_up(void)
+{
+   while(!list_empty(_off_irq)) {
+   struct list_head * entry = dpm_off_irq.next;
+   struct device * dev = to_device(entry);
+
+   list_move_tail(entry, _off);
+   resume_device_early(dev);
+   }
+}
+
+
+/**
+ * device_power_up - Turn on all devices that need special attention.
+ *
+ * Power on system devices then devices that required we shut them down
+ * with interrupts disabled.
+ * Called with 

[PATCH 74/75] sysfs: add copyrights

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

Sysfs has gone through considerable amount of reimplementation.  Add
copyrights.  Any objections?  :-)

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/bin.c|8 +++-
 fs/sysfs/dir.c|   10 +-
 fs/sysfs/file.c   |   10 +-
 fs/sysfs/inode.c  |8 ++--
 fs/sysfs/mount.c  |   10 +-
 fs/sysfs/symlink.c|   10 +-
 fs/sysfs/sysfs.h  |   10 ++
 include/linux/sysfs.h |2 ++
 8 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 247ea19..006fc64 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -1,9 +1,15 @@
 /*
- * bin.c - binary file operations for sysfs.
+ * fs/sysfs/bin.c - sysfs binary file implementation
  *
  * Copyright (c) 2003 Patrick Mochel
  * Copyright (c) 2003 Matthew Wilcox
  * Copyright (c) 2004 Silicon Graphics, Inc.
+ * Copyright (c) 2007 SUSE Linux Products GmbH
+ * Copyright (c) 2007 Tejun Heo <[EMAIL PROTECTED]>
+ *
+ * This file is released under the GPLv2.
+ *
+ * Please see Documentation/filesystems/sysfs.txt for more information.
  */
 
 #undef DEBUG
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index e301a12..9161db4 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -1,5 +1,13 @@
 /*
- * dir.c - Operations for sysfs directories.
+ * fs/sysfs/dir.c - sysfs core and dir operation implementation
+ *
+ * Copyright (c) 2001-3 Patrick Mochel
+ * Copyright (c) 2007 SUSE Linux Products GmbH
+ * Copyright (c) 2007 Tejun Heo <[EMAIL PROTECTED]>
+ *
+ * This file is released under the GPLv2.
+ *
+ * Please see Documentation/filesystems/sysfs.txt for more information.
  */
 
 #undef DEBUG
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index c05f961..d3be1e7 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -1,5 +1,13 @@
 /*
- * file.c - operations for regular (text) files.
+ * fs/sysfs/file.c - sysfs regular (text) file implementation
+ *
+ * Copyright (c) 2001-3 Patrick Mochel
+ * Copyright (c) 2007 SUSE Linux Products GmbH
+ * Copyright (c) 2007 Tejun Heo <[EMAIL PROTECTED]>
+ *
+ * This file is released under the GPLv2.
+ *
+ * Please see Documentation/filesystems/sysfs.txt for more information.
  */
 
 #include 
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 2210cf0..9236635 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -1,7 +1,11 @@
 /*
- * inode.c - basic inode and dentry operations.
+ * fs/sysfs/inode.c - basic sysfs inode and dentry operations
  *
- * sysfs is Copyright (c) 2001-3 Patrick Mochel
+ * Copyright (c) 2001-3 Patrick Mochel
+ * Copyright (c) 2007 SUSE Linux Products GmbH
+ * Copyright (c) 2007 Tejun Heo <[EMAIL PROTECTED]>
+ *
+ * This file is released under the GPLv2.
  *
  * Please see Documentation/filesystems/sysfs.txt for more information.
  */
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 465902c..c76c540 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -1,5 +1,13 @@
 /*
- * mount.c - operations for initializing and mounting sysfs.
+ * fs/sysfs/symlink.c - operations for initializing and mounting sysfs
+ *
+ * Copyright (c) 2001-3 Patrick Mochel
+ * Copyright (c) 2007 SUSE Linux Products GmbH
+ * Copyright (c) 2007 Tejun Heo <[EMAIL PROTECTED]>
+ *
+ * This file is released under the GPLv2.
+ *
+ * Please see Documentation/filesystems/sysfs.txt for more information.
  */
 
 #define DEBUG 
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index ffa82e9..3eac20c 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -1,5 +1,13 @@
 /*
- * symlink.c - operations for sysfs symlinks.
+ * fs/sysfs/symlink.c - sysfs symlink implementation
+ *
+ * Copyright (c) 2001-3 Patrick Mochel
+ * Copyright (c) 2007 SUSE Linux Products GmbH
+ * Copyright (c) 2007 Tejun Heo <[EMAIL PROTECTED]>
+ *
+ * This file is released under the GPLv2.
+ *
+ * Please see Documentation/filesystems/sysfs.txt for more information.
  */
 
 #include 
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 269c845..f0326f2 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -1,3 +1,13 @@
+/*
+ * fs/sysfs/sysfs.h - sysfs internal header file
+ *
+ * Copyright (c) 2001-3 Patrick Mochel
+ * Copyright (c) 2007 SUSE Linux Products GmbH
+ * Copyright (c) 2007 Tejun Heo <[EMAIL PROTECTED]>
+ *
+ * This file is released under the GPLv2.
+ */
+
 struct sysfs_open_dirent;
 
 /* type-specific structures for sysfs_dirent->s_* union members */
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index db5dd24..149ab62 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -3,6 +3,8 @@
  *
  * Copyright (c) 2001,2002 Patrick Mochel
  * Copyright (c) 2004 Silicon Graphics, Inc.
+ * Copyright (c) 2007 SUSE Linux Products GmbH
+ * Copyright (c) 2007 Tejun Heo <[EMAIL PROTECTED]>
  *
  * Please see Documentation/filesystems/sysfs.txt for more information.
  */
-- 
1.5.3.4

-
To unsubscribe from this list: send the line 

[PATCH 73/75] kobject: update the copyrights

2007-10-12 Thread Greg Kroah-Hartman
I've been hacking on these files for a while now, might as well make it
official...

Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 include/linux/kobject.h |6 --
 lib/kobject.c   |2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 973aa7b..4a0d27f 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -1,8 +1,10 @@
 /*
  * kobject.h - generic kernel object infrastructure.
  *
- * Copyright (c) 2002-2003 Patrick Mochel
- * Copyright (c) 2002-2003 Open Source Development Labs
+ * Copyright (c) 2002-2003 Patrick Mochel
+ * Copyright (c) 2002-2003 Open Source Development Labs
+ * Copyright (c) 2006-2007 Greg Kroah-Hartman <[EMAIL PROTECTED]>
+ * Copyright (c) 2006-2007 Novell Inc.
  *
  * This file is released under the GPLv2.
  *
diff --git a/lib/kobject.c b/lib/kobject.c
index b7e0646..03d4036 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -2,6 +2,8 @@
  * kobject.c - library routines for handling generic kernel objects
  *
  * Copyright (c) 2002-2003 Patrick Mochel <[EMAIL PROTECTED]>
+ * Copyright (c) 2006-2007 Greg Kroah-Hartman <[EMAIL PROTECTED]>
+ * Copyright (c) 2006-2007 Novell Inc.
  *
  * This file is released under the GPLv2.
  *
-- 
1.5.3.4

-
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 72/75] kset: add some kerneldoc to help describe what these strange things are

2007-10-12 Thread Greg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 include/linux/kobject.h |   33 +
 1 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 05cc5b2..973aa7b 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -117,29 +117,30 @@ struct kset_uevent_ops {
  struct kobj_uevent_env *env);
 };
 
-/*
- * struct kset - a set of kobjects of a specific type, belonging
- * to a specific subsystem.
- *
- * All kobjects of a kset should be embedded in an identical 
- * type. This type may have a descriptor, which the kset points
- * to. This allows there to exist sets of objects of the same
- * type in different subsystems.
+/**
+ * struct kset - a set of kobjects of a specific type, belonging to a specific 
subsystem.
  *
- * A subsystem does not have to be a list of only one type 
- * of object; multiple ksets can belong to one subsystem. All 
- * ksets of a subsystem share the subsystem's lock.
+ * A kset defines a group of kobjects.  They can be individually
+ * different "types" but overall these kobjects all want to be grouped
+ * together and operated on in the same manner.  ksets are used to
+ * define the attribute callbacks and other common events that happen to
+ * a kobject.
  *
- * Each kset can support specific event variables; it can
- * supress the event generation or add subsystem specific
- * variables carried with the event.
+ * @ktype: the struct kobj_type for this specific kset
+ * @list: the list of all kobjects for this kset
+ * @list_lock: a lock for iterating over the kobjects
+ * @kobj: the embedded kobject for this kset (recursion, isn't it fun...)
+ * @uevent_ops: the set of uevent operations for this kset.  These are
+ * called whenever a kobject has something happen to it so that the kset
+ * can add new environment variables, or filter out the uevents if so
+ * desired.
  */
 struct kset {
-   struct kobj_type* ktype;
+   struct kobj_type*ktype;
struct list_headlist;
spinlock_t  list_lock;
struct kobject  kobj;
-   struct kset_uevent_ops  * uevent_ops;
+   struct kset_uevent_ops  *uevent_ops;
 };
 
 
-- 
1.5.3.4

-
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 71/75] Driver core: rename ktype_edd and ktype_efivar

2007-10-12 Thread Greg Kroah-Hartman
This makes it a bit more sane when trying to figure out how to clean up
the ktype mess.

Based on a larger patch from Kay Sievers

Cc: Kay Sievers <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/firmware/edd.c |4 ++--
 drivers/firmware/efivars.c |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 0fb730e..6942e06 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -625,13 +625,13 @@ static void edd_release(struct kobject * kobj)
kfree(dev);
 }
 
-static struct kobj_type ktype_edd = {
+static struct kobj_type edd_ktype = {
.release= edd_release,
.sysfs_ops  = _attr_ops,
.default_attrs  = def_attrs,
 };
 
-static decl_subsys(edd,_edd,NULL);
+static decl_subsys(edd, _ktype, NULL);
 
 
 /**
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index bfd2d67..858a7b9 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -402,7 +402,7 @@ static struct attribute *def_attrs[] = {
NULL,
 };
 
-static struct kobj_type ktype_efivar = {
+static struct kobj_type efivar_ktype = {
.release = efivar_release,
.sysfs_ops = _attr_ops,
.default_attrs = def_attrs,
@@ -583,7 +583,7 @@ static struct subsys_attribute *efi_subsys_attrs[] = {
NULL,   /* maybe more in the future? */
 };
 
-static decl_subsys(vars, _efivar, NULL);
+static decl_subsys(vars, _ktype, NULL);
 static decl_subsys(efi, NULL, NULL);
 
 /*
-- 
1.5.3.4

-
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 70/75] Driver core: rename ktype_driver

2007-10-12 Thread Greg Kroah-Hartman
This makes it a bit more sane when trying to figure out how to clean up
the ktype mess.

Based on a larger patch from Kay Sievers

Cc: Kay Sievers <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/base/bus.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 6768a01..9a19b07 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -89,7 +89,7 @@ static void driver_release(struct kobject * kobj)
 */
 }
 
-static struct kobj_type ktype_driver = {
+static struct kobj_type driver_ktype = {
.sysfs_ops  = _sysfs_ops,
.release= driver_release,
 };
@@ -868,7 +868,7 @@ int bus_register(struct bus_type * bus)
 
kobject_set_name(>drivers.kobj, "drivers");
bus->drivers.kobj.parent = >subsys.kobj;
-   bus->drivers.ktype = _driver;
+   bus->drivers.ktype = _ktype;
retval = kset_register(>drivers);
if (retval)
goto bus_drivers_fail;
-- 
1.5.3.4

-
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/


[GIT PATCH] PCI patches for 2.6.23

2007-10-12 Thread Greg KH
Here are a some PCI patches against your 2.6.23 git tree.

Nothing major here, just a number of bugfixes and updates and new
quirks.  See the shortlog below for details.

All of these have been in the -mm tree for a while.

Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6.git/

The full patches will be sent to the linux-pci mailing list, if anyone
wants to see them.

thanks,

greg k-h


 Documentation/DMA-API.txt   |3 +
 Documentation/MSI-HOWTO.txt |   69 +---
 Documentation/kernel-parameters.txt |8 ++
 arch/i386/Kconfig   |5 +
 arch/x86/kernel/pci-dma_32.c|3 +-
 arch/x86/kernel/pci-dma_64.c|1 +
 arch/x86/kernel/reboot_fixups_32.c  |6 +
 arch/x86/pci/acpi.c |  194 -
 arch/x86/pci/common.c   |   19 +++-
 arch/x86/pci/fixup.c|   47 
 arch/x86/pci/i386.c |   13 +++
 arch/x86/pci/irq.c  |   39 +++
 arch/x86/pci/pci.h  |2 +
 arch/x86_64/Kconfig |5 +
 drivers/pci/hotplug/cpqphp_core.c   |2 +-
 drivers/pci/hotplug/cpqphp_ctrl.c   |   74 -
 drivers/pci/hotplug/ibmphp_hpc.c|   57 ++
 drivers/pci/hotplug/pciehp_core.c   |   24 ++---
 drivers/pci/hotplug/pciehp_ctrl.c   |   20 ++--
 drivers/pci/hotplug/pciehp_hpc.c|  203 +-
 drivers/pci/hotplug/pciehp_pci.c|   24 +++--
 drivers/pci/msi.c   |2 +-
 drivers/pci/pci-driver.c|3 +-
 drivers/pci/pci.c   |   20 +++-
 drivers/pci/pci.h   |6 +
 drivers/pci/pcie/Kconfig|9 --
 drivers/pci/pcie/aer/aerdrv.c   |9 ++
 drivers/pci/probe.c |   53 +++---
 drivers/pci/proc.c  |7 +-
 drivers/pci/quirks.c|   43 +---
 drivers/pci/setup-bus.c |5 +
 include/asm-x86/pci.h   |   90 +++
 include/asm-x86/pci_32.h|   58 --
 include/asm-x86/pci_64.h|   56 --
 include/linux/pci.h |7 +-
 include/linux/pci_ids.h |3 +
 include/linux/pci_regs.h|8 +-
 lib/swiotlb.c   |1 +
 38 files changed, 654 insertions(+), 544 deletions(-)

---

Alex Chiang (1):
  PCI: Add missing PCI capability IDs

Auke Kok (3):
  cpqphp: Use PCI_CLASS_REVISION instead of PCI_REVISION_ID for read
  PCI: quirk amd_8131_mmrbc: Omit reading pci revision ID
  PCI: quirk_vt82c586_acpi: Omit reading PCI revision ID

Christoph Hellwig (1):
  pci: hotplug: cpqphp: convert to kthread infrastructure

David Brownell (1):
  dma_free_coherent() needs irqs enabled (sigh)

David Rientjes (2):
  pci: use size stored in proc_dir_entry for proc bus files
  pci: write file size to inode on proc bus file write

Denis V. Lunev (1):
  PCI: pci_get_device call from interrupt in reboot fixups

Gary Hade (5):
  PCI: remove transparent bridge sizing
  PCI: skip ISA ioresource alignment on some systems
  PCI: avoid P2P prefetch window for expansion ROMs
  PCI: use _CRS for PCI resource allocation
  PCI: modify PCI bridge control ISA flag for clarity

Greg Kroah-Hartman (1):
  PCI: merge almost all of pci_32.h and pci_64.h together

Jeff Garzik (2):
  PCI: Add 'nodomains' boot option, and pci_domains_supported global
  PCI: X86: Introduce and enable PCI domain support

Johannes Goecke (1):
  PCI: re-enable onboard sound on "MSI K8T Neo2-FIR"

Juha Laiho (1):
  PCI: i386: Compaq EVO N800c needs PCI bus renumbering

Kenji Kaneshige (7):
  pciehp: remove CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE
  pciehp: remove DBG_XXX_ROUTINE
  pciehp: remove trailing whitespace from pciehp_hpc.c
  pciehp: remove trailing whitespace from pciehp_core.c
  pciehp: remove trailing whitespace from pciehp_ctrl.c
  pciehp: remove trailing whitespace form pciehp_pci.c
  pciehp: minor cleanups for pciehp_hpc.c

Kristen Carlson Accardi (3):
  PCI Hotplug: pciehp: Dont check bridge control on remove
  PCI Hotplug: pciehp: Request control over PCI Express Capability as well 
as Native hotplug
  pci: hotplug: ibmphp: convert to kthread

Mariusz Kozlowski (1):
  PCI Hotplug: cpqphp_ctrl.c: kmalloc + memset conversion to kzalloc

Michael Ellerman (2):
  PCI: Remove no longer correct documentation regarding MSI vector 
assignment
  PCI: Fix incorrect argument order to list_add_tail() in PCI dynamic ID 
code

Randy Dunlap (1):
  pci: implement "pci=noaer"

Roland Dreier (1):
  MSI: Use correct data offset for 32-bit MSI in read_msi_msg()

Thomas Backlund (1):
  i386: add support for picopower irq router

Yoichi Yuasa (1):
  PCI: fix IDE legacy mode resources

vignesh babu (1):
  PCI: 

[PATCH 69/75] Driver core: rename ktype_device

2007-10-12 Thread Greg Kroah-Hartman
This makes it a bit more sane when trying to figure out how to clean up
the ktype mess.

Based on a larger patch from Kay Sievers

Cc: Kay Sievers <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/base/core.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 65de221..c134341 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -108,7 +108,7 @@ static void device_release(struct kobject * kobj)
}
 }
 
-static struct kobj_type ktype_device = {
+static struct kobj_type device_ktype = {
.release= device_release,
.sysfs_ops  = _sysfs_ops,
 };
@@ -118,7 +118,7 @@ static int dev_uevent_filter(struct kset *kset, struct 
kobject *kobj)
 {
struct kobj_type *ktype = get_ktype(kobj);
 
-   if (ktype == _device) {
+   if (ktype == _ktype) {
struct device *dev = to_dev(kobj);
if (dev->uevent_suppress)
return 0;
@@ -405,7 +405,7 @@ static struct device_attribute devt_attr =
  * devices_subsys - structure to be registered with kobject core.
  */
 
-decl_subsys(devices, _device, _uevent_ops);
+decl_subsys(devices, _ktype, _uevent_ops);
 
 
 /**
-- 
1.5.3.4

-
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 68/75] Driver core: rename ktype_class

2007-10-12 Thread Greg Kroah-Hartman
This makes it a bit more sane when trying to figure out how to clean up
the ktype mess.

Based on a larger patch from Kay Sievers

Cc: Kay Sievers <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/base/class.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/base/class.c b/drivers/base/class.c
index 5b9cf06..a863bb0 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -65,13 +65,13 @@ static struct sysfs_ops class_sysfs_ops = {
.store  = class_attr_store,
 };
 
-static struct kobj_type ktype_class = {
+static struct kobj_type class_ktype = {
.sysfs_ops  = _sysfs_ops,
.release= class_release,
 };
 
 /* Hotplug events for classes go to the class_obj subsys */
-static decl_subsys(class, _class, NULL);
+static decl_subsys(class, _ktype, NULL);
 
 
 int class_create_file(struct class * cls, const struct class_attribute * attr)
@@ -323,7 +323,7 @@ static void class_dev_release(struct kobject * kobj)
}
 }
 
-static struct kobj_type ktype_class_device = {
+static struct kobj_type class_device_ktype = {
.sysfs_ops  = _dev_sysfs_ops,
.release= class_dev_release,
 };
@@ -332,7 +332,7 @@ static int class_uevent_filter(struct kset *kset, struct 
kobject *kobj)
 {
struct kobj_type *ktype = get_ktype(kobj);
 
-   if (ktype == _class_device) {
+   if (ktype == _device_ktype) {
struct class_device *class_dev = to_class_dev(kobj);
if (class_dev->class)
return 1;
@@ -452,7 +452,7 @@ static struct kset_uevent_ops class_uevent_ops = {
.uevent =   class_uevent,
 };
 
-static decl_subsys(class_obj, _class_device, _uevent_ops);
+static decl_subsys(class_obj, _device_ktype, _uevent_ops);
 
 
 static int class_device_add_attrs(struct class_device * cd)
-- 
1.5.3.4

-
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 67/75] driver core: remove subsystem_init()

2007-10-12 Thread Greg Kroah-Hartman
There is only one user of it, and it is only a wrapper for kset_init().

Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 Documentation/kobject.txt |1 -
 drivers/base/class.c  |2 +-
 include/linux/kobject.h   |1 -
 lib/kobject.c |5 -
 4 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt
index 5e7aca2..ca86a88 100644
--- a/Documentation/kobject.txt
+++ b/Documentation/kobject.txt
@@ -238,7 +238,6 @@ kobj_set_kset_s(obj,subsys)
 - Assumes that obj->kobj exists, and is a struct kobject.
 - Sets the kset of that kobject to the kset .
 
-void subsystem_init(struct kset *s);
 int subsystem_register(struct kset *s);
 void subsystem_unregister(struct kset *s);
 
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 3e9b04c..5b9cf06 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -861,7 +861,7 @@ int __init classes_init(void)
 
/* ick, this is ugly, the things we go through to keep from showing up
 * in sysfs... */
-   subsystem_init(_obj_subsys);
+   kset_init(_obj_subsys);
if (!class_obj_subsys.kobj.parent)
class_obj_subsys.kobj.parent = _obj_subsys.kobj;
return 0;
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index a8a84fc..05cc5b2 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -217,7 +217,6 @@ extern struct kset hypervisor_subsys;
 #define kobj_set_kset_s(obj,subsys) \
(obj)->kobj.kset = &(subsys)
 
-extern void subsystem_init(struct kset *);
 extern int __must_check subsystem_register(struct kset *);
 extern void subsystem_unregister(struct kset *);
 
diff --git a/lib/kobject.c b/lib/kobject.c
index fc6db6b..b7e0646 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -617,11 +617,6 @@ struct kobject * kset_find_obj(struct kset * kset, const 
char * name)
return ret;
 }
 
-void subsystem_init(struct kset *s)
-{
-   kset_init(s);
-}
-
 int subsystem_register(struct kset *s)
 {
return kset_register(s);
-- 
1.5.3.4

-
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/


static LSM objection

2007-10-12 Thread Kees Cook
Hi,

I just wanted to voice my opinion about the static LSM changes.
(I apologize about being late[1] to the discussion[2] -- I'd only recently
become aware of it.)  I'm personally really against this.  For example,
I want to give people choice about their security protections in Ubuntu,
and I'd like to let them pick the MAC that suits their needs.

Some people want SELinux, some people want AppArmor.  (Yes, I know
AppArmor isn't in mainline yet, but it does seem they're getting closer --
three distros are shipping AppArmor.  The static changes feel motivated
by political rather than technical reason -- though it of course have
technical merit.)  Considering things like SMACK and TOMOYO, it is going
to be very troublesome for distros to have to start building multiple
kernels to support each given MAC that their users want to use.

So, unless this is just re-hashing and you can point me to discussion
points I missed, can someone help me understand the technical issues
around this change?  It sounds like the primary reason for making it
non-modular is performance loss due to call overhead.  Aren't there
other ways to solve this without removing the boot-time module choice?
(Make it unloadable?)

I'm not convinced that the advantages of making it static out-weigh the
benefit of having it as a choice at boot-time.  (I don't really mind
needing a reboot to switch MAC implementations, as long as there is some
benefit from making them unloadable, though it sounds like there are
people would are against making LSMs unloadable too.)

Thanks,

-Kees

/me pops the safety off his fire extinguisher

[1] http://lkml.org/lkml/2007/7/19/228
[2] http://lkml.org/lkml/2007/7/14/91

-- 
Kees Cook
-
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 66/75] sysfs: move sysfs file poll implementation to sysfs_open_dirent

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

Sysfs file poll implementation is scattered over sysfs and kobject.
Event numbering is done in sysfs_dirent but wait itself is done on
kobject.  This not only unecessarily bloats both kobject and
sysfs_dirent but is also buggy - if a sysfs_dirent is removed while
there still are pollers, the associaton betwen the kobject and
sysfs_dirent breaks and kobject may be freed with the pollers still
sleeping on it.

This patch moves whole poll implementation into sysfs_open_dirent.
Each time a sysfs_open_dirent is created, event number restarts from 1
and pollers sleep on sysfs_open_dirent.  As event sequence number is
meaningless without any open file and pollers should have open file
and thus sysfs_open_dirent, this ephemeral event counting works and is
a saner implementation.

This patch fixes the dnagling sleepers bug and reduces the sizes of
kobject and sysfs_dirent by one pointer.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c  |1 -
 fs/sysfs/file.c |   25 +++--
 fs/sysfs/sysfs.h|1 -
 include/linux/kobject.h |1 -
 lib/kobject.c   |1 -
 5 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 4ad9422..e301a12 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -318,7 +318,6 @@ struct sysfs_dirent *sysfs_new_dirent(const char *name, 
umode_t mode, int type)
 
atomic_set(>s_count, 1);
atomic_set(>s_active, 0);
-   atomic_set(>s_event, 1);
 
sd->s_name = name;
sd->s_mode = mode;
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index b13ba94..c05f961 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -62,6 +62,8 @@ static spinlock_t sysfs_open_dirent_lock = SPIN_LOCK_UNLOCKED;
 
 struct sysfs_open_dirent {
atomic_trefcnt;
+   atomic_tevent;
+   wait_queue_head_t   poll;
struct list_headbuffers; /* goes through sysfs_buffer.list */
 };
 
@@ -104,7 +106,7 @@ static int fill_read_buffer(struct dentry * dentry, struct 
sysfs_buffer * buffer
if (!sysfs_get_active_two(attr_sd))
return -ENODEV;
 
-   buffer->event = atomic_read(_sd->s_event);
+   buffer->event = atomic_read(_sd->s_attr.open->event);
count = ops->show(kobj, attr_sd->s_attr.attr, buffer->page);
 
sysfs_put_active_two(attr_sd);
@@ -301,6 +303,8 @@ static int sysfs_get_open_dirent(struct sysfs_dirent *sd,
return -ENOMEM;
 
atomic_set(_od->refcnt, 0);
+   atomic_set(_od->event, 1);
+   init_waitqueue_head(_od->poll);
INIT_LIST_HEAD(_od->buffers);
goto retry;
 }
@@ -443,17 +447,17 @@ static unsigned int sysfs_poll(struct file *filp, 
poll_table *wait)
 {
struct sysfs_buffer * buffer = filp->private_data;
struct sysfs_dirent *attr_sd = filp->f_path.dentry->d_fsdata;
-   struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
+   struct sysfs_open_dirent *od = attr_sd->s_attr.open;
 
/* need parent for the kobj, grab both */
if (!sysfs_get_active_two(attr_sd))
goto trigger;
 
-   poll_wait(filp, >poll, wait);
+   poll_wait(filp, >poll, wait);
 
sysfs_put_active_two(attr_sd);
 
-   if (buffer->event != atomic_read(_sd->s_event))
+   if (buffer->event != atomic_read(>event))
goto trigger;
 
return 0;
@@ -474,8 +478,17 @@ void sysfs_notify(struct kobject *k, char *dir, char *attr)
if (sd && attr)
sd = sysfs_find_dirent(sd, attr);
if (sd) {
-   atomic_inc(>s_event);
-   wake_up_interruptible(>poll);
+   struct sysfs_open_dirent *od;
+
+   spin_lock(_open_dirent_lock);
+
+   od = sd->s_attr.open;
+   if (od) {
+   atomic_inc(>event);
+   wake_up_interruptible(>poll);
+   }
+
+   spin_unlock(_open_dirent_lock);
}
 
mutex_unlock(_mutex);
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 3adce7d..269c845 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -46,7 +46,6 @@ struct sysfs_dirent {
ino_t   s_ino;
umode_t s_mode;
struct iattr*s_iattr;
-   atomic_ts_event;
 };
 
 #define SD_DEACTIVATED_BIASINT_MIN
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 0777b3f..a8a84fc 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -66,7 +66,6 @@ struct kobject {
struct kset * kset;
struct kobj_type* ktype;
struct sysfs_dirent * sd;
-   wait_queue_head_t   poll;
 };
 
 extern int kobject_set_name(struct kobject *, const char *, ...)
diff 

[PATCH 65/75] sysfs: implement sysfs_open_dirent

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

Implement sysfs_open_dirent which represents an open file (attribute)
sysfs_dirent.  A file sysfs_dirent with one or more open files have
one sysfs_dirent and all sysfs_buffers (one for each open instance)
are linked to it.

sysfs_open_dirent doesn't actually do anything yet but will be used to
off-load things which are specific for open file sysfs_dirent from it.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/file.c  |  109 +-
 fs/sysfs/sysfs.h |3 +
 2 files changed, 111 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 3c91a57..b13ba94 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -49,6 +49,22 @@ static struct sysfs_ops subsys_sysfs_ops = {
.store  = subsys_attr_store,
 };
 
+/*
+ * There's one sysfs_buffer for each open file and one
+ * sysfs_open_dirent for each sysfs_dirent with one or more open
+ * files.
+ *
+ * filp->private_data points to sysfs_buffer and
+ * sysfs_dirent->s_attr.open points to sysfs_open_dirent.  s_attr.open
+ * is protected by sysfs_open_dirent_lock.
+ */
+static spinlock_t sysfs_open_dirent_lock = SPIN_LOCK_UNLOCKED;
+
+struct sysfs_open_dirent {
+   atomic_trefcnt;
+   struct list_headbuffers; /* goes through sysfs_buffer.list */
+};
+
 struct sysfs_buffer {
size_t  count;
loff_t  pos;
@@ -57,6 +73,7 @@ struct sysfs_buffer {
struct mutexmutex;
int needs_read_fill;
int event;
+   struct list_headlist;
 };
 
 /**
@@ -237,6 +254,86 @@ sysfs_write_file(struct file *file, const char __user 
*buf, size_t count, loff_t
return len;
 }
 
+/**
+ * sysfs_get_open_dirent - get or create sysfs_open_dirent
+ * @sd: target sysfs_dirent
+ * @buffer: sysfs_buffer for this instance of open
+ *
+ * If @sd->s_attr.open exists, increment its reference count;
+ * otherwise, create one.  @buffer is chained to the buffers
+ * list.
+ *
+ * LOCKING:
+ * Kernel thread context (may sleep).
+ *
+ * RETURNS:
+ * 0 on success, -errno on failure.
+ */
+static int sysfs_get_open_dirent(struct sysfs_dirent *sd,
+struct sysfs_buffer *buffer)
+{
+   struct sysfs_open_dirent *od, *new_od = NULL;
+
+ retry:
+   spin_lock(_open_dirent_lock);
+
+   if (!sd->s_attr.open && new_od) {
+   sd->s_attr.open = new_od;
+   new_od = NULL;
+   }
+
+   od = sd->s_attr.open;
+   if (od) {
+   atomic_inc(>refcnt);
+   list_add_tail(>list, >buffers);
+   }
+
+   spin_unlock(_open_dirent_lock);
+
+   if (od) {
+   kfree(new_od);
+   return 0;
+   }
+
+   /* not there, initialize a new one and retry */
+   new_od = kmalloc(sizeof(*new_od), GFP_KERNEL);
+   if (!new_od)
+   return -ENOMEM;
+
+   atomic_set(_od->refcnt, 0);
+   INIT_LIST_HEAD(_od->buffers);
+   goto retry;
+}
+
+/**
+ * sysfs_put_open_dirent - put sysfs_open_dirent
+ * @sd: target sysfs_dirent
+ * @buffer: associated sysfs_buffer
+ *
+ * Put @sd->s_attr.open and unlink @buffer from the buffers list.
+ * If reference count reaches zero, disassociate and free it.
+ *
+ * LOCKING:
+ * None.
+ */
+static void sysfs_put_open_dirent(struct sysfs_dirent *sd,
+ struct sysfs_buffer *buffer)
+{
+   struct sysfs_open_dirent *od = sd->s_attr.open;
+
+   spin_lock(_open_dirent_lock);
+
+   list_del(>list);
+   if (atomic_dec_and_test(>refcnt))
+   sd->s_attr.open = NULL;
+   else
+   od = NULL;
+
+   spin_unlock(_open_dirent_lock);
+
+   kfree(od);
+}
+
 static int sysfs_open_file(struct inode *inode, struct file *file)
 {
struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
@@ -298,19 +395,29 @@ static int sysfs_open_file(struct inode *inode, struct 
file *file)
buffer->ops = ops;
file->private_data = buffer;
 
+   /* make sure we have open dirent struct */
+   error = sysfs_get_open_dirent(attr_sd, buffer);
+   if (error)
+   goto err_free;
+
/* open succeeded, put active references */
sysfs_put_active_two(attr_sd);
return 0;
 
+ err_free:
+   kfree(buffer);
  err_out:
sysfs_put_active_two(attr_sd);
return error;
 }
 
-static int sysfs_release(struct inode * inode, struct file * filp)
+static int sysfs_release(struct inode *inode, struct file *filp)
 {
+   struct sysfs_dirent *sd = filp->f_path.dentry->d_fsdata;
struct sysfs_buffer *buffer = filp->private_data;
 
+   sysfs_put_open_dirent(sd, buffer);
+
if 

[PATCH 63/75] sysfs: make sysfs_root a regular directory dirent

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

sysfs_root is different from a regular directory dirent in that it's
of type SYSFS_ROOT and doesn't have a name.  These differences aren't
used by anybody and only adds to complexity.  Make sysfs_root a
regular directory dirent.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/inode.c |5 -
 fs/sysfs/mount.c |3 ++-
 fs/sysfs/sysfs.h |9 -
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index b6ac4e6..c40fb9f 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -157,11 +157,6 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, 
struct inode *inode)
 
/* initialize inode according to type */
switch (sysfs_type(sd)) {
-   case SYSFS_ROOT:
-   inode->i_op = _dir_inode_operations;
-   inode->i_fop = _dir_operations;
-   inc_nlink(inode); /* directory, account for "." */
-   break;
case SYSFS_DIR:
inode->i_op = _dir_inode_operations;
inode->i_fop = _dir_operations;
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 28bf359..465902c 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -24,8 +24,9 @@ static const struct super_operations sysfs_ops = {
 };
 
 struct sysfs_dirent sysfs_root = {
+   .s_name = "",
.s_count= ATOMIC_INIT(1),
-   .s_flags= SYSFS_ROOT,
+   .s_flags= SYSFS_DIR,
.s_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
.s_ino  = 1,
 };
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 2a68bfa..60405a6 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -48,11 +48,10 @@ struct sysfs_dirent {
 #define SD_DEACTIVATED_BIASINT_MIN
 
 #define SYSFS_TYPE_MASK0x00ff
-#define SYSFS_ROOT 0x0001
-#define SYSFS_DIR  0x0002
-#define SYSFS_KOBJ_ATTR0x0004
-#define SYSFS_KOBJ_BIN_ATTR0x0008
-#define SYSFS_KOBJ_LINK0x0020
+#define SYSFS_DIR  0x0001
+#define SYSFS_KOBJ_ATTR0x0002
+#define SYSFS_KOBJ_BIN_ATTR0x0004
+#define SYSFS_KOBJ_LINK0x0008
 #define SYSFS_COPY_NAME(SYSFS_DIR | SYSFS_KOBJ_LINK)
 
 #define SYSFS_FLAG_MASK~SYSFS_TYPE_MASK
-- 
1.5.3.4

-
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 64/75] sysfs: move sysfs_dirent->s_children into sysfs_dirent->s_dir

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

Children list head is only meaninful for directory nodes.  Move it
into s_dir.  This doesn't save any space currently but it will with
further changes.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c   |   17 +
 fs/sysfs/inode.c |2 +-
 fs/sysfs/sysfs.h |3 ++-
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 48a3ed4..4ad9422 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -26,7 +26,7 @@ static DEFINE_IDA(sysfs_ino_ida);
  * @sd: sysfs_dirent of interest
  *
  * Link @sd into its sibling list which starts from
- * sd->s_parent->s_children.
+ * sd->s_parent->s_dir.children.
  *
  * Locking:
  * mutex_lock(sysfs_mutex)
@@ -40,9 +40,9 @@ static void sysfs_link_sibling(struct sysfs_dirent *sd)
 
/* Store directory entries in order by ino.  This allows
 * readdir to properly restart without having to add a
-* cursor into the s_children list.
+* cursor into the s_dir.children list.
 */
-   for (pos = _sd->s_children; *pos; pos = &(*pos)->s_sibling) {
+   for (pos = _sd->s_dir.children; *pos; pos = &(*pos)->s_sibling) {
if (sd->s_ino < (*pos)->s_ino)
break;
}
@@ -55,7 +55,7 @@ static void sysfs_link_sibling(struct sysfs_dirent *sd)
  * @sd: sysfs_dirent of interest
  *
  * Unlink @sd from its sibling list which starts from
- * sd->s_parent->s_children.
+ * sd->s_parent->s_dir.children.
  *
  * Locking:
  * mutex_lock(sysfs_mutex)
@@ -64,7 +64,8 @@ static void sysfs_unlink_sibling(struct sysfs_dirent *sd)
 {
struct sysfs_dirent **pos;
 
-   for (pos = >s_parent->s_children; *pos; pos = &(*pos)->s_sibling) {
+   for (pos = >s_parent->s_dir.children; *pos;
+pos = &(*pos)->s_sibling) {
if (*pos == sd) {
*pos = sd->s_sibling;
sd->s_sibling = NULL;
@@ -570,7 +571,7 @@ struct sysfs_dirent *sysfs_find_dirent(struct sysfs_dirent 
*parent_sd,
 {
struct sysfs_dirent *sd;
 
-   for (sd = parent_sd->s_children; sd; sd = sd->s_sibling)
+   for (sd = parent_sd->s_dir.children; sd; sd = sd->s_sibling)
if (!strcmp(sd->s_name, name))
return sd;
return NULL;
@@ -722,7 +723,7 @@ static void __sysfs_remove_dir(struct sysfs_dirent *dir_sd)
 
pr_debug("sysfs %s: removing dir\n", dir_sd->s_name);
sysfs_addrm_start(, dir_sd);
-   pos = _sd->s_children;
+   pos = _sd->s_dir.children;
while (*pos) {
struct sysfs_dirent *sd = *pos;
 
@@ -922,7 +923,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, 
filldir_t filldir)
mutex_lock(_mutex);
 
/* Skip the dentries we have already reported */
-   pos = parent_sd->s_children;
+   pos = parent_sd->s_dir.children;
while (pos && (filp->f_pos > pos->s_ino))
pos = pos->s_sibling;
 
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index c40fb9f..2210cf0 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -127,7 +127,7 @@ static int sysfs_count_nlink(struct sysfs_dirent *sd)
struct sysfs_dirent *child;
int nr = 0;
 
-   for (child = sd->s_children; child; child = child->s_sibling)
+   for (child = sd->s_dir.children; child; child = child->s_sibling)
if (sysfs_type(child) == SYSFS_DIR)
nr++;
 
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 60405a6..42b0327 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -1,6 +1,8 @@
 /* type-specific structures for sysfs_dirent->s_* union members */
 struct sysfs_elem_dir {
struct kobject  *kobj;
+   /* children list starts here and goes through sd->s_sibling */
+   struct sysfs_dirent *children;
 };
 
 struct sysfs_elem_symlink {
@@ -28,7 +30,6 @@ struct sysfs_dirent {
atomic_ts_active;
struct sysfs_dirent *s_parent;
struct sysfs_dirent *s_sibling;
-   struct sysfs_dirent *s_children;
const char  *s_name;
 
union {
-- 
1.5.3.4

-
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 62/75] sysfs: open code sysfs_attach_dentry()

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

sysfs_attach_dentry() now has only one caller and isn't doing much
other than obfuscating the code.  Open code and kill it.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |   20 
 1 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 6ee76a8..48a3ed4 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -332,21 +332,6 @@ struct sysfs_dirent *sysfs_new_dirent(const char *name, 
umode_t mode, int type)
return NULL;
 }
 
-/**
- * sysfs_attach_dentry - associate sysfs_dirent with dentry
- * @sd: target sysfs_dirent
- * @dentry: dentry to associate
- *
- * LOCKING:
- * mutex_lock(sysfs_mutex)
- */
-static void sysfs_attach_dentry(struct sysfs_dirent *sd, struct dentry *dentry)
-{
-   dentry->d_op = _dentry_ops;
-   dentry->d_fsdata = sysfs_get(sd);
-   d_rehash(dentry);
-}
-
 static int sysfs_ilookup_test(struct inode *inode, void *arg)
 {
struct sysfs_dirent *sd = arg;
@@ -696,8 +681,11 @@ static struct dentry * sysfs_lookup(struct inode *dir, 
struct dentry *dentry,
goto out_unlock;
}
 
+   /* instantiate and hash dentry */
+   dentry->d_op = _dentry_ops;
+   dentry->d_fsdata = sysfs_get(sd);
d_instantiate(dentry, inode);
-   sysfs_attach_dentry(sd, dentry);
+   d_rehash(dentry);
 
  out_unlock:
mutex_unlock(_mutex);
-- 
1.5.3.4

-
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 61/75] sysfs: make s_elem an anonymous union

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

Make s_elem an anonymous union.  Prefixing with s_elem makes things
needlessly longer without any advantage.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/bin.c |   14 +++---
 fs/sysfs/dir.c |4 ++--
 fs/sysfs/file.c|   14 +++---
 fs/sysfs/inode.c   |2 +-
 fs/sysfs/symlink.c |4 ++--
 fs/sysfs/sysfs.h   |   10 +-
 6 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 9c8f882..247ea19 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -30,8 +30,8 @@ static int
 fill_read(struct dentry *dentry, char *buffer, loff_t off, size_t count)
 {
struct sysfs_dirent *attr_sd = dentry->d_fsdata;
-   struct bin_attribute *attr = attr_sd->s_elem.bin_attr.bin_attr;
-   struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj;
+   struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr;
+   struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
int rc;
 
/* need attr_sd for attr, its parent for kobj */
@@ -87,8 +87,8 @@ static int
 flush_write(struct dentry *dentry, char *buffer, loff_t offset, size_t count)
 {
struct sysfs_dirent *attr_sd = dentry->d_fsdata;
-   struct bin_attribute *attr = attr_sd->s_elem.bin_attr.bin_attr;
-   struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj;
+   struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr;
+   struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
int rc;
 
/* need attr_sd for attr, its parent for kobj */
@@ -140,8 +140,8 @@ static int mmap(struct file *file, struct vm_area_struct 
*vma)
 {
struct bin_buffer *bb = file->private_data;
struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
-   struct bin_attribute *attr = attr_sd->s_elem.bin_attr.bin_attr;
-   struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj;
+   struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr;
+   struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
int rc;
 
mutex_lock(>mutex);
@@ -167,7 +167,7 @@ static int mmap(struct file *file, struct vm_area_struct 
*vma)
 static int open(struct inode * inode, struct file * file)
 {
struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
-   struct bin_attribute *attr = attr_sd->s_elem.bin_attr.bin_attr;
+   struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr;
struct bin_buffer *bb = NULL;
int error;
 
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index fc615ee..6ee76a8 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -273,7 +273,7 @@ void release_sysfs_dirent(struct sysfs_dirent * sd)
parent_sd = sd->s_parent;
 
if (sysfs_type(sd) == SYSFS_KOBJ_LINK)
-   sysfs_put(sd->s_elem.symlink.target_sd);
+   sysfs_put(sd->s_symlink.target_sd);
if (sysfs_type(sd) & SYSFS_COPY_NAME)
kfree(sd->s_name);
kfree(sd->s_iattr);
@@ -630,7 +630,7 @@ static int create_dir(struct kobject *kobj, struct 
sysfs_dirent *parent_sd,
sd = sysfs_new_dirent(name, mode, SYSFS_DIR);
if (!sd)
return -ENOMEM;
-   sd->s_elem.dir.kobj = kobj;
+   sd->s_dir.kobj = kobj;
 
/* link in */
sysfs_addrm_start(, parent_sd);
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 8f1ebd8..3c91a57 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -73,7 +73,7 @@ struct sysfs_buffer {
 static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * 
buffer)
 {
struct sysfs_dirent *attr_sd = dentry->d_fsdata;
-   struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj;
+   struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
struct sysfs_ops * ops = buffer->ops;
int ret = 0;
ssize_t count;
@@ -88,7 +88,7 @@ static int fill_read_buffer(struct dentry * dentry, struct 
sysfs_buffer * buffer
return -ENODEV;
 
buffer->event = atomic_read(_sd->s_event);
-   count = ops->show(kobj, attr_sd->s_elem.attr.attr, buffer->page);
+   count = ops->show(kobj, attr_sd->s_attr.attr, buffer->page);
 
sysfs_put_active_two(attr_sd);
 
@@ -188,7 +188,7 @@ static int
 flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, 
size_t count)
 {
struct sysfs_dirent *attr_sd = dentry->d_fsdata;
-   struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj;
+   struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
struct sysfs_ops * ops = buffer->ops;
int rc;
 
@@ -196,7 +196,7 @@ flush_write_buffer(struct dentry * dentry, struct 
sysfs_buffer * buffer, size_t
if (!sysfs_get_active_two(attr_sd))
return -ENODEV;
 
-   rc = ops->store(kobj, attr_sd->s_elem.attr.attr, buffer->page, count);
+   rc = 

[PATCH 59/75] sysfs: kill unnecessary NULL pointer check in sysfs_release()

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

In sysfs_release(), sysfs_buffer pointed to by filp->private_data is
guaranteed to exist.  Kill the unnecessary NULL check.  This also
makes the code more consistent with the counterpart in fs/sysfs/bin.c.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/file.c |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 7dc..8f1ebd8 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -311,11 +311,10 @@ static int sysfs_release(struct inode * inode, struct 
file * filp)
 {
struct sysfs_buffer *buffer = filp->private_data;
 
-   if (buffer) {
-   if (buffer->page)
-   free_page((unsigned long)buffer->page);
-   kfree(buffer);
-   }
+   if (buffer->page)
+   free_page((unsigned long)buffer->page);
+   kfree(buffer);
+
return 0;
 }
 
-- 
1.5.3.4

-
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 60/75] sysfs: make bin attr open get active reference of parent too

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

All bin attr operations require active references of itself and its
parent.  There's no reason to allow open when its parent has been
deactivated and allowing it is inconsistent with regular sysfs file.
Use sysfs_get_active_two() in bin attribute open function.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/bin.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index e93fe5e..9c8f882 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -171,8 +171,8 @@ static int open(struct inode * inode, struct file * file)
struct bin_buffer *bb = NULL;
int error;
 
-   /* need attr_sd for attr */
-   if (!sysfs_get_active(attr_sd))
+   /* binary file operations requires both @sd and its parent */
+   if (!sysfs_get_active_two(attr_sd))
return -ENODEV;
 
error = -EACCES;
@@ -193,12 +193,12 @@ static int open(struct inode * inode, struct file * file)
mutex_init(>mutex);
file->private_data = bb;
 
-   /* open succeeded, put active reference */
-   sysfs_put_active(attr_sd);
+   /* open succeeded, put active references */
+   sysfs_put_active_two(attr_sd);
return 0;
 
  err_out:
-   sysfs_put_active(attr_sd);
+   sysfs_put_active_two(attr_sd);
kfree(bb);
return error;
 }
-- 
1.5.3.4

-
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 57/75] sysfs: reposition sysfs_dirent->s_mode.

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

Move s_mode downward such that it's side-by-side with s_iattr which is
used for the same thing.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/sysfs.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 63adbec..6cf61c8 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -39,8 +39,8 @@ struct sysfs_dirent {
}   s_elem;
 
unsigned ints_flags;
-   umode_t s_mode;
ino_t   s_ino;
+   umode_t s_mode;
struct iattr*s_iattr;
atomic_ts_event;
 };
-- 
1.5.3.4

-
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 58/75] sysfs: kill unnecessary sysfs_get() in open paths

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

There's no reason to get an extra reference to sysfs_dirent for an
open file.  Open file has a reference to the dentry which in turn has
a reference to sysfs_dirent.  This is fairly obvious as otherwise open
itself won't be able to access the sysfs_dirent.  Kill the extra
sysfs_get() and matching sysfs_put().

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/bin.c  |4 +---
 fs/sysfs/file.c |6 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index a819a7e..e93fe5e 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -193,9 +193,8 @@ static int open(struct inode * inode, struct file * file)
mutex_init(>mutex);
file->private_data = bb;
 
-   /* open succeeded, put active reference and pin attr_sd */
+   /* open succeeded, put active reference */
sysfs_put_active(attr_sd);
-   sysfs_get(attr_sd);
return 0;
 
  err_out:
@@ -211,7 +210,6 @@ static int release(struct inode * inode, struct file * file)
 
if (bb->mmapped)
sysfs_put_active_two(attr_sd);
-   sysfs_put(attr_sd);
kfree(bb->buffer);
kfree(bb);
return 0;
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 61a8c19..7dc 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -298,9 +298,8 @@ static int sysfs_open_file(struct inode *inode, struct file 
*file)
buffer->ops = ops;
file->private_data = buffer;
 
-   /* open succeeded, put active references and pin attr_sd */
+   /* open succeeded, put active references */
sysfs_put_active_two(attr_sd);
-   sysfs_get(attr_sd);
return 0;
 
  err_out:
@@ -310,11 +309,8 @@ static int sysfs_open_file(struct inode *inode, struct 
file *file)
 
 static int sysfs_release(struct inode * inode, struct file * filp)
 {
-   struct sysfs_dirent *attr_sd = filp->f_path.dentry->d_fsdata;
struct sysfs_buffer *buffer = filp->private_data;
 
-   sysfs_put(attr_sd);
-
if (buffer) {
if (buffer->page)
free_page((unsigned long)buffer->page);
-- 
1.5.3.4

-
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 56/75] sysfs: kill sysfs_update_file()

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

sysfs_update_file() depends on inode->i_mtime but sysfs iondes are now
reclaimable making the reported modification time unreliable.  There's
only one user (pci hotplug) of this notification mechanism and it
reportedly isn't utilized from userland.

Kill sysfs_update_file().

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/pci/hotplug/pci_hotplug_core.c |   60 
 fs/sysfs/file.c|   40 -
 include/linux/sysfs.h  |7 
 3 files changed, 0 insertions(+), 107 deletions(-)

diff --git a/drivers/pci/hotplug/pci_hotplug_core.c 
b/drivers/pci/hotplug/pci_hotplug_core.c
index bd433ef..f0eba53 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -694,66 +694,6 @@ int __must_check pci_hp_change_slot_info(struct 
hotplug_slot *slot,
if ((slot == NULL) || (info == NULL))
return -ENODEV;
 
-   /*
-   * check all fields in the info structure, and update timestamps
-   * for the files referring to the fields that have now changed.
-   */
-   if ((has_power_file(slot) == 0) &&
-   (slot->info->power_status != info->power_status)) {
-   retval = sysfs_update_file(>kobj,
-  _slot_attr_power.attr);
-   if (retval)
-   return retval;
-   }
-
-   if ((has_attention_file(slot) == 0) &&
-   (slot->info->attention_status != info->attention_status)) {
-   retval = sysfs_update_file(>kobj,
-  _slot_attr_attention.attr);
-   if (retval)
-   return retval;
-   }
-
-   if ((has_latch_file(slot) == 0) &&
-   (slot->info->latch_status != info->latch_status)) {
-   retval = sysfs_update_file(>kobj,
-  _slot_attr_latch.attr);
-   if (retval)
-   return retval;
-   }
-
-   if ((has_adapter_file(slot) == 0) &&
-   (slot->info->adapter_status != info->adapter_status)) {
-   retval = sysfs_update_file(>kobj,
-  _slot_attr_presence.attr);
-   if (retval)
-   return retval;
-   }
-
-   if ((has_address_file(slot) == 0) &&
-   (slot->info->address != info->address)) {
-   retval = sysfs_update_file(>kobj,
-  _slot_attr_address.attr);
-   if (retval)
-   return retval;
-   }
-
-   if ((has_max_bus_speed_file(slot) == 0) &&
-   (slot->info->max_bus_speed != info->max_bus_speed)) {
-   retval = sysfs_update_file(>kobj,
-  
_slot_attr_max_bus_speed.attr);
-   if (retval)
-   return retval;
-   }
-
-   if ((has_cur_bus_speed_file(slot) == 0) &&
-   (slot->info->cur_bus_speed != info->cur_bus_speed)) {
-   retval = sysfs_update_file(>kobj,
-  
_slot_attr_cur_bus_speed.attr);
-   if (retval)
-   return retval;
-   }
-
memcpy (slot->info, info, sizeof (struct hotplug_slot_info));
 
return 0;
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 9fdf8da..61a8c19 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -3,7 +3,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -453,44 +452,6 @@ int sysfs_add_file_to_group(struct kobject *kobj,
 }
 EXPORT_SYMBOL_GPL(sysfs_add_file_to_group);
 
-
-/**
- * sysfs_update_file - update the modified timestamp on an object attribute.
- * @kobj: object we're acting for.
- * @attr: attribute descriptor.
- */
-int sysfs_update_file(struct kobject * kobj, const struct attribute * attr)
-{
-   struct sysfs_dirent *victim_sd = NULL;
-   struct dentry *victim = NULL;
-   int rc;
-
-   rc = -ENOENT;
-   victim_sd = sysfs_get_dirent(kobj->sd, attr->name);
-   if (!victim_sd)
-   goto out;
-
-   mutex_lock(_rename_mutex);
-   victim = sysfs_get_dentry(victim_sd);
-   mutex_unlock(_rename_mutex);
-   if (IS_ERR(victim)) {
-   rc = PTR_ERR(victim);
-   victim = NULL;
-   goto out;
-   }
-
-   mutex_lock(>d_inode->i_mutex);
-   victim->d_inode->i_mtime = CURRENT_TIME;
-   fsnotify_modify(victim);
-   mutex_unlock(>d_inode->i_mutex);
-   rc = 0;
- out:
-   dput(victim);
-   sysfs_put(victim_sd);
-   return rc;
-}
-
-
 /**
  * sysfs_chmod_file - update the modified mode value on an object attribute.
  * @kobj: object we're acting for.
@@ -641,4 +602,3 @@ 

[PATCH 55/75] sysfs: clean up header files

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

sysfs is about to go through major overhaul making this a pretty good
opportunity to clean up (out-of-tree changes and pending patches will
need regeneration anyway).  Clean up headers.

* Kill space between * and symbolname.

* Move SYSFS_* type constants and flags into fs/sysfs/sysfs.h.
  They're internal to sysfs.

* Reformat function prototypes and add argument symbol names.

* Make dummy function definition order match that of function
  prototypes.

* Add some comments.

* Reorganize fs/sysfs/sysfs.h according to which file the declared
  variable or feature lives in.

This patch does not introduce any behavior change.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/sysfs.h  |  148 ++--
 include/linux/sysfs.h |  127 +++---
 2 files changed, 149 insertions(+), 126 deletions(-)

diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 791b3ed..63adbec 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -1,20 +1,24 @@
+/* type-specific structures for sysfs_dirent->s_* union members */
 struct sysfs_elem_dir {
-   struct kobject  * kobj;
+   struct kobject  *kobj;
 };
 
 struct sysfs_elem_symlink {
-   struct sysfs_dirent * target_sd;
+   struct sysfs_dirent *target_sd;
 };
 
 struct sysfs_elem_attr {
-   struct attribute* attr;
+   struct attribute*attr;
 };
 
 struct sysfs_elem_bin_attr {
-   struct bin_attribute* bin_attr;
+   struct bin_attribute*bin_attr;
 };
 
 /*
+ * sysfs_dirent - the building block of sysfs hierarchy.  Each and
+ * every sysfs node is represented by single sysfs_dirent.
+ *
  * As long as s_count reference is held, the sysfs_dirent itself is
  * accessible.  Dereferencing s_elem or any other outer entity
  * requires s_active reference.
@@ -22,10 +26,10 @@ struct sysfs_elem_bin_attr {
 struct sysfs_dirent {
atomic_ts_count;
atomic_ts_active;
-   struct sysfs_dirent * s_parent;
-   struct sysfs_dirent * s_sibling;
-   struct sysfs_dirent * s_children;
-   const char  * s_name;
+   struct sysfs_dirent *s_parent;
+   struct sysfs_dirent *s_sibling;
+   struct sysfs_dirent *s_children;
+   const char  *s_name;
 
union {
struct sysfs_elem_dir   dir;
@@ -37,12 +41,31 @@ struct sysfs_dirent {
unsigned ints_flags;
umode_t s_mode;
ino_t   s_ino;
-   struct iattr* s_iattr;
+   struct iattr*s_iattr;
atomic_ts_event;
 };
 
-#define SD_DEACTIVATED_BIASINT_MIN
+#define SD_DEACTIVATED_BIASINT_MIN
 
+#define SYSFS_TYPE_MASK0x00ff
+#define SYSFS_ROOT 0x0001
+#define SYSFS_DIR  0x0002
+#define SYSFS_KOBJ_ATTR0x0004
+#define SYSFS_KOBJ_BIN_ATTR0x0008
+#define SYSFS_KOBJ_LINK0x0020
+#define SYSFS_COPY_NAME(SYSFS_DIR | SYSFS_KOBJ_LINK)
+
+#define SYSFS_FLAG_MASK~SYSFS_TYPE_MASK
+#define SYSFS_FLAG_REMOVED 0x0200
+
+static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
+{
+   return sd->s_flags & SYSFS_TYPE_MASK;
+}
+
+/*
+ * Context structure to be used while adding/removing nodes.
+ */
 struct sysfs_addrm_cxt {
struct sysfs_dirent *parent_sd;
struct inode*parent_inode;
@@ -50,59 +73,47 @@ struct sysfs_addrm_cxt {
int cnt;
 };
 
+/*
+ * mount.c
+ */
 extern struct sysfs_dirent sysfs_root;
+extern struct super_block *sysfs_sb;
 extern struct kmem_cache *sysfs_dir_cachep;
 
-extern struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd);
-extern struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd);
-extern void sysfs_put_active(struct sysfs_dirent *sd);
-extern struct sysfs_dirent *sysfs_get_active_two(struct sysfs_dirent *sd);
-extern void sysfs_put_active_two(struct sysfs_dirent *sd);
-extern void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
- struct sysfs_dirent *parent_sd);
-extern int sysfs_add_one(struct sysfs_addrm_cxt *acxt,
- struct sysfs_dirent *sd);
-extern void sysfs_remove_one(struct sysfs_addrm_cxt *acxt,
-struct sysfs_dirent *sd);
-extern void sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt);
-
-extern struct inode * sysfs_get_inode(struct sysfs_dirent *sd);
-
-extern void release_sysfs_dirent(struct sysfs_dirent * sd);
-extern struct sysfs_dirent *sysfs_find_dirent(struct sysfs_dirent *parent_sd,
-   

[PATCH 54/75] sysfs: fix sysfs_chmod_file() such that it updates sd->s_mode too

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

sysfs_chmod_file() looked and updated only inode of the target file.
Dentry and inode are reclaimable and the update mode data will go away
when the inode is reclaimed.  This patch makes sysfs_chmod_file()
update sd->s_mode too such that the change is permanent.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/file.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index ff93c92..9fdf8da 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -521,10 +521,19 @@ int sysfs_chmod_file(struct kobject *kobj, struct 
attribute *attr, mode_t mode)
}
 
inode = victim->d_inode;
+
mutex_lock(>i_mutex);
+
newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
rc = notify_change(victim, );
+
+   if (rc == 0) {
+   mutex_lock(_mutex);
+   victim_sd->s_mode = newattrs.ia_mode;
+   mutex_unlock(_mutex);
+   }
+
mutex_unlock(>i_mutex);
  out:
dput(victim);
-- 
1.5.3.4

-
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 53/75] sysfs: fix comments of sysfs_add/remove_one()

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

sysfs_add/remove_one() now link and unlink the target dirent into and
from the children list.  Update comments accordingly.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |   10 +++---
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 5d95aa8..fc615ee 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -410,10 +410,8 @@ void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
  * @sd: sysfs_dirent to be added
  *
  * Get @acxt->parent_sd and set sd->s_parent to it and increment
- * nlink of parent inode if @sd is a directory.  @sd is NOT
- * linked into the children list of the parent.  The caller
- * should invoke sysfs_link_sibling() after this function
- * completes if @sd needs to be on the children list.
+ * nlink of parent inode if @sd is a directory and link into the
+ * children list of the parent.
  *
  * This function should be called between calls to
  * sysfs_addrm_start() and sysfs_addrm_finish() and should be
@@ -453,9 +451,7 @@ int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct 
sysfs_dirent *sd)
  * @sd: sysfs_dirent to be added
  *
  * Mark @sd removed and drop nlink of parent inode if @sd is a
- * directory.  @sd is NOT unlinked from the children list of the
- * parent.  The caller is repsonsible for removing @sd from the
- * children list before calling this function.
+ * directory.  @sd is unlinked from the children list.
  *
  * This function should be called between calls to
  * sysfs_addrm_start() and sysfs_addrm_finish() and should be
-- 
1.5.3.4

-
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 52/75] sysfs: spit a warning to users when they try to create a duplicate sysfs file

2007-10-12 Thread Greg Kroah-Hartman
We want to let people know when we create a duplicate sysfs file, as
they need to fix up their code.


Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index da4bb66..5d95aa8 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -428,8 +428,12 @@ void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
  */
 int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
 {
-   if (sysfs_find_dirent(acxt->parent_sd, sd->s_name))
+   if (sysfs_find_dirent(acxt->parent_sd, sd->s_name)) {
+   printk(KERN_WARNING "sysfs: duplicate filename '%s' "
+  "can not be created\n", sd->s_name);
+   WARN_ON(1);
return -EEXIST;
+   }
 
sd->s_parent = sysfs_get(acxt->parent_sd);
 
-- 
1.5.3.4

-
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/75] sysfs: Rewrite sysfs_move_dir in terms of sysfs dirents

2007-10-12 Thread Greg Kroah-Hartman
From: Eric W. Biederman <[EMAIL PROTECTED]>

This patch rewrites sysfs_move_dir to perform it's checks
as much as possible on the underlying sysfs_dirents instead
of the contents of the dcache, making sysfs_move_dir
more like the rest of the sysfs directory modification
code.

Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |   34 ++
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 463c5e3..da4bb66 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -845,56 +845,58 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject 
*new_parent_kobj)
BUG_ON(!sd->s_parent);
new_parent_sd = new_parent_kobj->sd ? new_parent_kobj->sd : _root;
 
+   error = 0;
+   if (sd->s_parent == new_parent_sd)
+   goto out;   /* nothing to move */
+
/* get dentries */
old_dentry = sysfs_get_dentry(sd);
if (IS_ERR(old_dentry)) {
error = PTR_ERR(old_dentry);
-   goto out_dput;
+   goto out;
}
old_parent = old_dentry->d_parent;
 
new_parent = sysfs_get_dentry(new_parent_sd);
if (IS_ERR(new_parent)) {
error = PTR_ERR(new_parent);
-   goto out_dput;
+   goto out;
}
 
-   if (old_parent->d_inode == new_parent->d_inode) {
-   error = 0;
-   goto out_dput;  /* nothing to move */
-   }
 again:
mutex_lock(_parent->d_inode->i_mutex);
if (!mutex_trylock(_parent->d_inode->i_mutex)) {
mutex_unlock(_parent->d_inode->i_mutex);
goto again;
}
+   mutex_lock(_mutex);
 
-   new_dentry = lookup_one_len(kobject_name(kobj), new_parent, 
strlen(kobject_name(kobj)));
-   if (IS_ERR(new_dentry)) {
-   error = PTR_ERR(new_dentry);
+   error = -EEXIST;
+   if (sysfs_find_dirent(new_parent_sd, sd->s_name))
goto out_unlock;
-   } else
-   error = 0;
+
+   error = -ENOMEM;
+   new_dentry = d_alloc_name(new_parent, sd->s_name);
+   if (!new_dentry)
+   goto out_unlock;
+
+   error = 0;
d_add(new_dentry, NULL);
d_move(old_dentry, new_dentry);
dput(new_dentry);
 
/* Remove from old parent's list and insert into new parent's list. */
-   mutex_lock(_mutex);
-
sysfs_unlink_sibling(sd);
sysfs_get(new_parent_sd);
sysfs_put(sd->s_parent);
sd->s_parent = new_parent_sd;
sysfs_link_sibling(sd);
 
-   mutex_unlock(_mutex);
-
  out_unlock:
+   mutex_unlock(_mutex);
mutex_unlock(_parent->d_inode->i_mutex);
mutex_unlock(_parent->d_inode->i_mutex);
- out_dput:
+ out:
dput(new_parent);
dput(old_dentry);
dput(new_dentry);
-- 
1.5.3.4

-
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 51/75] PTY: add kernel parameter to overwrite legacy pty count

2007-10-12 Thread Greg Kroah-Hartman
From: Kay Sievers <[EMAIL PROTECTED]>

Signed-off-by: Kay Sievers <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 Documentation/kernel-parameters.txt |4 
 drivers/char/pty.c  |9 +++--
 include/linux/tty.h |1 -
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index a57c1f2..b3c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1430,6 +1430,10 @@ and is between 256 and 4096 characters. It is defined in 
the file
pt. [PARIDE]
See Documentation/paride.txt.
 
+   pty.legacy_count=
+   [KNL] Number of legacy pty's. Overwrites compiled-in
+   default number.
+
quiet   [KNL] Disable most log messages
 
r128=   [HW,DRM]
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index de14aea..73de771 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -248,14 +248,19 @@ static int pty_bsd_ioctl(struct tty_struct *tty, struct 
file *file,
return -ENOIOCTLCMD;
 }
 
+static int legacy_count = CONFIG_LEGACY_PTY_COUNT;
+module_param(legacy_count, int, 0);
+
 static void __init legacy_pty_init(void)
 {
+   if (legacy_count <= 0)
+   return;
 
-   pty_driver = alloc_tty_driver(NR_PTYS);
+   pty_driver = alloc_tty_driver(legacy_count);
if (!pty_driver)
panic("Couldn't allocate pty driver");
 
-   pty_slave_driver = alloc_tty_driver(NR_PTYS);
+   pty_slave_driver = alloc_tty_driver(legacy_count);
if (!pty_slave_driver)
panic("Couldn't allocate pty slave driver");
 
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 6570719..60478f6 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -21,7 +21,6 @@
  * (Note: the *_driver.minor_start values 1, 64, 128, 192 are
  * hardcoded at present.)
  */
-#define NR_PTYSCONFIG_LEGACY_PTY_COUNT   /* Number of legacy ptys */
 #define NR_UNIX98_PTY_DEFAULT  4096  /* Default maximum for Unix98 ptys */
 #define NR_UNIX98_PTY_MAX  (1 << MINORBITS) /* Absolute limit */
 #define NR_LDISCS  17
-- 
1.5.3.4

-
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/75] sysfs: Remove s_dentry

2007-10-12 Thread Greg Kroah-Hartman
From: Eric W. Biederman <[EMAIL PROTECTED]>

The only uses of s_dentry left are the code that maintains
s_dentry and trivial users that don't actually need it.
So this patch removes the s_dentry maintenance code and
restructures the trivial uses to use something else.

Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c   |   32 
 fs/sysfs/mount.c |1 -
 fs/sysfs/sysfs.h |1 -
 3 files changed, 4 insertions(+), 30 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 1c3dc5d..36b6c79 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -289,22 +289,7 @@ static void sysfs_d_iput(struct dentry * dentry, struct 
inode * inode)
 {
struct sysfs_dirent * sd = dentry->d_fsdata;
 
-   if (sd) {
-   /* sd->s_dentry is protected with sysfs_assoc_lock.
-* This allows sysfs_drop_dentry() to dereference it.
-*/
-   spin_lock(_assoc_lock);
-
-   /* The dentry might have been deleted or another
-* lookup could have happened updating sd->s_dentry to
-* point the new dentry.  Ignore if it isn't pointing
-* to this dentry.
-*/
-   if (sd->s_dentry == dentry)
-   sd->s_dentry = NULL;
-   spin_unlock(_assoc_lock);
-   sysfs_put(sd);
-   }
+   sysfs_put(sd);
iput(inode);
 }
 
@@ -352,9 +337,6 @@ struct sysfs_dirent *sysfs_new_dirent(const char *name, 
umode_t mode, int type)
  * @sd: target sysfs_dirent
  * @dentry: dentry to associate
  *
- * Associate @sd with @dentry.  This is protected by
- * sysfs_assoc_lock to avoid race with sysfs_d_iput().
- *
  * LOCKING:
  * mutex_lock(sysfs_mutex)
  */
@@ -362,12 +344,6 @@ static void sysfs_attach_dentry(struct sysfs_dirent *sd, 
struct dentry *dentry)
 {
dentry->d_op = _dentry_ops;
dentry->d_fsdata = sysfs_get(sd);
-
-   /* protect sd->s_dentry against sysfs_d_iput */
-   spin_lock(_assoc_lock);
-   sd->s_dentry = dentry;
-   spin_unlock(_assoc_lock);
-
d_rehash(dentry);
 }
 
@@ -846,7 +822,7 @@ int sysfs_rename_dir(struct kobject * kobj, const char 
*new_name)
 
/* rename */
d_add(new_dentry, NULL);
-   d_move(sd->s_dentry, new_dentry);
+   d_move(old_dentry, new_dentry);
 
error = 0;
goto out_unlock;
@@ -881,7 +857,7 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject 
*new_parent_kobj)
error = PTR_ERR(old_dentry);
goto out_dput;
}
-   old_parent = sd->s_parent->s_dentry;
+   old_parent = old_dentry->d_parent;
 
new_parent = sysfs_get_dentry(new_parent_sd);
if (IS_ERR(new_parent)) {
@@ -907,7 +883,7 @@ again:
} else
error = 0;
d_add(new_dentry, NULL);
-   d_move(sd->s_dentry, new_dentry);
+   d_move(old_dentry, new_dentry);
dput(new_dentry);
 
/* Remove from old parent's list and insert into new parent's list. */
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 8989cbb..28bf359 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -56,7 +56,6 @@ static int sysfs_fill_super(struct super_block *sb, void 
*data, int silent)
iput(inode);
return -ENOMEM;
}
-   sysfs_root.s_dentry = root;
root->d_fsdata = _root;
sb->s_root = root;
return 0;
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 179e6a2..791b3ed 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -37,7 +37,6 @@ struct sysfs_dirent {
unsigned ints_flags;
umode_t s_mode;
ino_t   s_ino;
-   struct dentry   * s_dentry;
struct iattr* s_iattr;
atomic_ts_event;
 };
-- 
1.5.3.4

-
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/75] sysfs: Rewrite rename in terms of sysfs dirents

2007-10-12 Thread Greg Kroah-Hartman
From: Eric W. Biederman <[EMAIL PROTECTED]>

This patch rewrites sysfs_rename_dir to perform it's checks
as much as possible on the underlying sysfs_dirents instead
of the contents of the dcache.  It turns out that this version
is a little simpler, and a little more like the rest of
the sysfs directory modification code.

tj: fixed double locking of sysfs_mutex

Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |   38 --
 1 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 36b6c79..463c5e3 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -770,7 +770,7 @@ void sysfs_remove_dir(struct kobject * kobj)
 
 int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
 {
-   struct sysfs_dirent *sd;
+   struct sysfs_dirent *sd = kobj->sd;
struct dentry *parent = NULL;
struct dentry *old_dentry = NULL, *new_dentry = NULL;
const char *dup_name = NULL;
@@ -778,63 +778,57 @@ int sysfs_rename_dir(struct kobject * kobj, const char 
*new_name)
 
mutex_lock(_rename_mutex);
 
+   error = 0;
+   if (strcmp(sd->s_name, new_name) == 0)
+   goto out;   /* nothing to rename */
+
/* get the original dentry */
-   sd = kobj->sd;
old_dentry = sysfs_get_dentry(sd);
if (IS_ERR(old_dentry)) {
error = PTR_ERR(old_dentry);
-   goto out_dput;
+   goto out;
}
 
parent = old_dentry->d_parent;
 
/* lock parent and get dentry for new name */
mutex_lock(>d_inode->i_mutex);
+   mutex_lock(_mutex);
 
-   new_dentry = lookup_one_len(new_name, parent, strlen(new_name));
-   if (IS_ERR(new_dentry)) {
-   error = PTR_ERR(new_dentry);
-   goto out_unlock;
-   }
-
-   error = -EINVAL;
-   if (old_dentry == new_dentry)
+   error = -EEXIST;
+   if (sysfs_find_dirent(sd->s_parent, new_name))
goto out_unlock;
 
-   error = -EEXIST;
-   if (new_dentry->d_inode)
+   error = -ENOMEM;
+   new_dentry = d_alloc_name(parent, new_name);
+   if (!new_dentry)
goto out_unlock;
 
/* rename kobject and sysfs_dirent */
error = -ENOMEM;
new_name = dup_name = kstrdup(new_name, GFP_KERNEL);
if (!new_name)
-   goto out_drop;
+   goto out_unlock;
 
error = kobject_set_name(kobj, "%s", new_name);
if (error)
-   goto out_drop;
+   goto out_unlock;
 
-   mutex_lock(_mutex);
dup_name = sd->s_name;
sd->s_name = new_name;
-   mutex_unlock(_mutex);
 
/* rename */
d_add(new_dentry, NULL);
d_move(old_dentry, new_dentry);
 
error = 0;
-   goto out_unlock;
-
- out_drop:
-   d_drop(new_dentry);
  out_unlock:
+   mutex_unlock(_mutex);
mutex_unlock(>d_inode->i_mutex);
- out_dput:
kfree(dup_name);
dput(old_dentry);
dput(new_dentry);
+ out:
mutex_unlock(_rename_mutex);
return error;
 }
-- 
1.5.3.4

-
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/75] sysfs: simply sysfs_get_dentry

2007-10-12 Thread Greg Kroah-Hartman
From: Tejun Heo <[EMAIL PROTECTED]>

Now that we know the sysfs tree structure cannot change under us and
sysfs shadow support is dropped, sysfs_get_dentry() can be simplified
greatly.  It can just look up from the root and there's no need to
retry on failure.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Eric W. Biederman <[EMAIL PROTECTED]>
Cc: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |   91 ++--
 1 files changed, 16 insertions(+), 75 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 9fe83d2..1c3dc5d 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -78,9 +78,8 @@ static void sysfs_unlink_sibling(struct sysfs_dirent *sd)
  * @sd: sysfs_dirent of interest
  *
  * Get dentry for @sd.  Dentry is looked up if currently not
- * present.  This function climbs sysfs_dirent tree till it
- * reaches a sysfs_dirent with valid dentry attached and descends
- * down from there looking up dentry for each step.
+ * present.  This function descends from the root looking up
+ * dentry for each step.
  *
  * LOCKING:
  * mutex_lock(sysfs_rename_mutex)
@@ -90,86 +89,28 @@ static void sysfs_unlink_sibling(struct sysfs_dirent *sd)
  */
 struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd)
 {
-   struct sysfs_dirent *cur;
-   struct dentry *parent_dentry, *dentry;
-   int i, depth;
+   struct dentry *dentry = dget(sysfs_sb->s_root);
 
-   /* Find the first parent which has valid s_dentry and get the
-* dentry.
-*/
-   mutex_lock(_mutex);
- restart0:
-   spin_lock(_assoc_lock);
- restart1:
-   spin_lock(_lock);
-
-   dentry = NULL;
-   depth = 0;
-   cur = sd;
-   while (!cur->s_dentry || !cur->s_dentry->d_inode) {
-   if (cur->s_flags & SYSFS_FLAG_REMOVED) {
-   dentry = ERR_PTR(-ENOENT);
-   depth = 0;
-   break;
-   }
-   cur = cur->s_parent;
-   depth++;
-   }
-   if (!IS_ERR(dentry))
-   dentry = dget_locked(cur->s_dentry);
+   while (dentry->d_fsdata != sd) {
+   struct sysfs_dirent *cur;
+   struct dentry *parent;
 
-   spin_unlock(_lock);
-   spin_unlock(_assoc_lock);
-
-   /* from the found dentry, look up depth times */
-   while (depth--) {
-   /* find and get depth'th ancestor */
-   for (cur = sd, i = 0; cur && i < depth; i++)
+   /* find the first ancestor which hasn't been looked up */
+   cur = sd;
+   while (cur->s_parent != dentry->d_fsdata)
cur = cur->s_parent;
 
-   /* This can happen if tree structure was modified due
-* to move/rename.  Restart.
-*/
-   if (i != depth) {
-   dput(dentry);
-   goto restart0;
-   }
-
-   sysfs_get(cur);
-
-   mutex_unlock(_mutex);
-
/* look it up */
-   parent_dentry = dentry;
-   mutex_lock(_dentry->d_inode->i_mutex);
-   dentry = lookup_one_len_kern(cur->s_name, parent_dentry,
+   parent = dentry;
+   mutex_lock(>d_inode->i_mutex);
+   dentry = lookup_one_len_kern(cur->s_name, parent,
 strlen(cur->s_name));
-   mutex_unlock(_dentry->d_inode->i_mutex);
-   dput(parent_dentry);
-
-   if (IS_ERR(dentry)) {
-   sysfs_put(cur);
-   return dentry;
-   }
+   mutex_unlock(>d_inode->i_mutex);
+   dput(parent);
 
-   mutex_lock(_mutex);
-   spin_lock(_assoc_lock);
-
-   /* This, again, can happen if tree structure has
-* changed and we looked up the wrong thing.  Restart.
-*/
-   if (cur->s_dentry != dentry) {
-   dput(dentry);
-   sysfs_put(cur);
-   goto restart1;
-   }
-
-   spin_unlock(_assoc_lock);
-
-   sysfs_put(cur);
+   if (IS_ERR(dentry))
+   break;
}
-
-   mutex_unlock(_mutex);
return dentry;
 }
 
-- 
1.5.3.4

-
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 45/75] sysfs: Rewrite sysfs_drop_dentry.

2007-10-12 Thread Greg Kroah-Hartman
From: Eric W. Biederman <[EMAIL PROTECTED]>

Currently we find the dentry to drop by looking at sd->s_dentry.
We can just as easily accomplish the same task by looking up the
sysfs inode and finding all of the dentries from there, with the
added bonus that we don't need to play with the sysfs_assoc_lock.

Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |   53 ++---
 1 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 953e843..1af963e 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -565,50 +565,49 @@ void sysfs_remove_one(struct sysfs_addrm_cxt *acxt, 
struct sysfs_dirent *sd)
  * Drop dentry for @sd.  @sd must have been unlinked from its
  * parent on entry to this function such that it can't be looked
  * up anymore.
- *
- * @sd->s_dentry which is protected with sysfs_assoc_lock points
- * to the currently associated dentry but we're not holding a
- * reference to it and racing with dput().  Grab dcache_lock and
- * verify dentry before dropping it.  If @sd->s_dentry is NULL or
- * dput() beats us, no need to bother.
  */
 static void sysfs_drop_dentry(struct sysfs_dirent *sd)
 {
-   struct dentry *dentry = NULL;
struct inode *inode;
+   struct dentry *dentry;
+
+   inode = ilookup(sysfs_sb, sd->s_ino);
+   if (!inode)
+   return;
 
-   /* We're not holding a reference to ->s_dentry dentry but the
-* field will stay valid as long as sysfs_assoc_lock is held.
+   /* Drop any existing dentries associated with sd.
+*
+* For the dentry to be properly freed we need to grab a
+* reference to the dentry under the dcache lock,  unhash it,
+* and then put it.  The playing with the dentry count allows
+* dput to immediately free the dentry  if it is not in use.
 */
-   spin_lock(_assoc_lock);
+repeat:
spin_lock(_lock);
-
-   /* drop dentry if it's there and dput() didn't kill it yet */
-   if (sd->s_dentry && sd->s_dentry->d_inode) {
-   dentry = dget_locked(sd->s_dentry);
+   list_for_each_entry(dentry, >i_dentry, d_alias) {
+   if (d_unhashed(dentry))
+   continue;
+   dget_locked(dentry);
spin_lock(>d_lock);
__d_drop(dentry);
spin_unlock(>d_lock);
+   spin_unlock(_lock);
+   dput(dentry);
+   goto repeat;
}
-
spin_unlock(_lock);
-   spin_unlock(_assoc_lock);
-
-   dput(dentry);
 
/* adjust nlink and update timestamp */
-   inode = ilookup(sysfs_sb, sd->s_ino);
-   if (inode) {
-   mutex_lock(>i_mutex);
+   mutex_lock(>i_mutex);
 
-   inode->i_ctime = CURRENT_TIME;
+   inode->i_ctime = CURRENT_TIME;
+   drop_nlink(inode);
+   if (sysfs_type(sd) == SYSFS_DIR)
drop_nlink(inode);
-   if (sysfs_type(sd) == SYSFS_DIR)
-   drop_nlink(inode);
 
-   mutex_unlock(>i_mutex);
-   iput(inode);
-   }
+   mutex_unlock(>i_mutex);
+
+   iput(inode);
 }
 
 /**
-- 
1.5.3.4

-
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/75] sysfs: Introduce sysfs_rename_mutex

2007-10-12 Thread Greg Kroah-Hartman
From: Eric W. Biederman <[EMAIL PROTECTED]>

Looking carefully at the rename code we have a subtle dependency
that the structure of sysfs not change while we are performing
a rename.  If the parent directory of the object we are renaming
changes while the rename is being performed nasty things could
happen when we go to release our locks.

So introduce a sysfs_rename_mutex to prevent this highly
unlikely theoretical issue.

In addition hold sysfs_rename_mutex over all calls to
sysfs_get_dentry. Allowing sysfs_get_dentry to be simplified
in the future.

Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c   |8 +++-
 fs/sysfs/file.c  |4 
 fs/sysfs/sysfs.h |1 +
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 1af963e..9fe83d2 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -15,6 +15,7 @@
 #include "sysfs.h"
 
 DEFINE_MUTEX(sysfs_mutex);
+DEFINE_MUTEX(sysfs_rename_mutex);
 spinlock_t sysfs_assoc_lock = SPIN_LOCK_UNLOCKED;
 
 static spinlock_t sysfs_ino_lock = SPIN_LOCK_UNLOCKED;
@@ -82,7 +83,7 @@ static void sysfs_unlink_sibling(struct sysfs_dirent *sd)
  * down from there looking up dentry for each step.
  *
  * LOCKING:
- * Kernel thread context (may sleep)
+ * mutex_lock(sysfs_rename_mutex)
  *
  * RETURNS:
  * Pointer to found dentry on success, ERR_PTR() value on error.
@@ -858,6 +859,8 @@ int sysfs_rename_dir(struct kobject * kobj, const char 
*new_name)
const char *dup_name = NULL;
int error;
 
+   mutex_lock(_rename_mutex);
+
/* get the original dentry */
sd = kobj->sd;
old_dentry = sysfs_get_dentry(sd);
@@ -915,6 +918,7 @@ int sysfs_rename_dir(struct kobject * kobj, const char 
*new_name)
kfree(dup_name);
dput(old_dentry);
dput(new_dentry);
+   mutex_unlock(_rename_mutex);
return error;
 }
 
@@ -926,6 +930,7 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject 
*new_parent_kobj)
struct dentry *old_dentry = NULL, *new_dentry = NULL;
int error;
 
+   mutex_lock(_rename_mutex);
BUG_ON(!sd->s_parent);
new_parent_sd = new_parent_kobj->sd ? new_parent_kobj->sd : _root;
 
@@ -982,6 +987,7 @@ again:
dput(new_parent);
dput(old_dentry);
dput(new_dentry);
+   mutex_unlock(_rename_mutex);
return error;
 }
 
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 16f39c3..ff93c92 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -470,7 +470,9 @@ int sysfs_update_file(struct kobject * kobj, const struct 
attribute * attr)
if (!victim_sd)
goto out;
 
+   mutex_lock(_rename_mutex);
victim = sysfs_get_dentry(victim_sd);
+   mutex_unlock(_rename_mutex);
if (IS_ERR(victim)) {
rc = PTR_ERR(victim);
victim = NULL;
@@ -509,7 +511,9 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute 
*attr, mode_t mode)
if (!victim_sd)
goto out;
 
+   mutex_lock(_rename_mutex);
victim = sysfs_get_dentry(victim_sd);
+   mutex_unlock(_rename_mutex);
if (IS_ERR(victim)) {
rc = PTR_ERR(victim);
victim = NULL;
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 77253aa..179e6a2 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -90,6 +90,7 @@ extern int sysfs_setattr(struct dentry *dentry, struct iattr 
*iattr);
 
 extern spinlock_t sysfs_assoc_lock;
 extern struct mutex sysfs_mutex;
+extern struct mutex sysfs_rename_mutex;
 extern struct super_block * sysfs_sb;
 extern const struct file_operations sysfs_dir_operations;
 extern const struct file_operations sysfs_file_operations;
-- 
1.5.3.4

-
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/75] sysfs: Simplify readdir.

2007-10-12 Thread Greg Kroah-Hartman
From: Eric W. Biederman <[EMAIL PROTECTED]>

At some point someone wrote sysfs_readdir to insert a cursor
into the list of sysfs_dirents to ensure that sysfs_readdir would
restart properly.  That works but it is complex code and tends
to be expensive.

The same effect can be achieved by keeping the sysfs_dirents in
inode order and using the inode number as the f_pos.  Then
when we restart we just have to find the first dirent whose inode
number is equal or greater then the last sysfs_dirent we attempted
to return.

Removing the sysfs directory cursor also allows the remove of
all of the mysterious checks for sysfs_type(sd) != 0.   Which
were nonbovious checks to see if a cursor was in a directory list.

tj: offset marker for EOF is changed from UINT_MAX to INT_MAX to avoid
overflow in case offset is 32bit.

Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |  175 ++--
 1 files changed, 44 insertions(+), 131 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index b72b42e..953e843 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -33,10 +33,20 @@ static DEFINE_IDA(sysfs_ino_ida);
 static void sysfs_link_sibling(struct sysfs_dirent *sd)
 {
struct sysfs_dirent *parent_sd = sd->s_parent;
+   struct sysfs_dirent **pos;
 
BUG_ON(sd->s_sibling);
-   sd->s_sibling = parent_sd->s_children;
-   parent_sd->s_children = sd;
+
+   /* Store directory entries in order by ino.  This allows
+* readdir to properly restart without having to add a
+* cursor into the s_children list.
+*/
+   for (pos = _sd->s_children; *pos; pos = &(*pos)->s_sibling) {
+   if (sd->s_ino < (*pos)->s_ino)
+   break;
+   }
+   sd->s_sibling = *pos;
+   *pos = sd;
 }
 
 /**
@@ -659,7 +669,7 @@ struct sysfs_dirent *sysfs_find_dirent(struct sysfs_dirent 
*parent_sd,
struct sysfs_dirent *sd;
 
for (sd = parent_sd->s_children; sd; sd = sd->s_sibling)
-   if (sysfs_type(sd) && !strcmp(sd->s_name, name))
+   if (!strcmp(sd->s_name, name))
return sd;
return NULL;
 }
@@ -811,7 +821,7 @@ static void __sysfs_remove_dir(struct sysfs_dirent *dir_sd)
while (*pos) {
struct sysfs_dirent *sd = *pos;
 
-   if (sysfs_type(sd) && sysfs_type(sd) != SYSFS_DIR)
+   if (sysfs_type(sd) != SYSFS_DIR)
sysfs_remove_one(, sd);
else
pos = &(*pos)->s_sibling;
@@ -976,37 +986,6 @@ again:
return error;
 }
 
-static int sysfs_dir_open(struct inode *inode, struct file *file)
-{
-   struct dentry * dentry = file->f_path.dentry;
-   struct sysfs_dirent * parent_sd = dentry->d_fsdata;
-   struct sysfs_dirent * sd;
-
-   sd = sysfs_new_dirent("_DIR_", 0, 0);
-   if (sd) {
-   mutex_lock(_mutex);
-   sd->s_parent = sysfs_get(parent_sd);
-   sysfs_link_sibling(sd);
-   mutex_unlock(_mutex);
-   }
-
-   file->private_data = sd;
-   return sd ? 0 : -ENOMEM;
-}
-
-static int sysfs_dir_close(struct inode *inode, struct file *file)
-{
-   struct sysfs_dirent * cursor = file->private_data;
-
-   mutex_lock(_mutex);
-   sysfs_unlink_sibling(cursor);
-   mutex_unlock(_mutex);
-
-   release_sysfs_dirent(cursor);
-
-   return 0;
-}
-
 /* Relationship between s_mode and the DT_xxx types */
 static inline unsigned char dt_type(struct sysfs_dirent *sd)
 {
@@ -1017,117 +996,51 @@ static int sysfs_readdir(struct file * filp, void * 
dirent, filldir_t filldir)
 {
struct dentry *dentry = filp->f_path.dentry;
struct sysfs_dirent * parent_sd = dentry->d_fsdata;
-   struct sysfs_dirent *cursor = filp->private_data;
-   struct sysfs_dirent **pos;
+   struct sysfs_dirent *pos;
ino_t ino;
-   int i = filp->f_pos;
 
-   switch (i) {
-   case 0:
-   ino = parent_sd->s_ino;
-   if (filldir(dirent, ".", 1, i, ino, DT_DIR) < 0)
-   break;
+   if (filp->f_pos == 0) {
+   ino = parent_sd->s_ino;
+   if (filldir(dirent, ".", 1, filp->f_pos, ino, DT_DIR) == 0)
filp->f_pos++;
-   i++;
-   /* fallthrough */
-   case 1:
-   if (parent_sd->s_parent)
-   ino = parent_sd->s_parent->s_ino;
-   else
-   ino = parent_sd->s_ino;
-   if (filldir(dirent, "..", 2, i, ino, DT_DIR) < 0)
-   break;
+   }
+   if (filp->f_pos == 1) {
+  

[PATCH 43/75] sysfs: In sysfs_lookup don't open code sysfs_find_dirent

2007-10-12 Thread Greg Kroah-Hartman
From: Eric W. Biederman <[EMAIL PROTECTED]>

This is a small cleanup patch that makes the code just
a little bit cleaner.

Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 fs/sysfs/dir.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 7f4abe1..b72b42e 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -756,9 +756,7 @@ static struct dentry * sysfs_lookup(struct inode *dir, 
struct dentry *dentry,
 
mutex_lock(_mutex);
 
-   for (sd = parent_sd->s_children; sd; sd = sd->s_sibling)
-   if (sysfs_type(sd) && !strcmp(sd->s_name, dentry->d_name.name))
-   break;
+   sd = sysfs_find_dirent(parent_sd, dentry->d_name.name);
 
/* no such entry */
if (!sd)
-- 
1.5.3.4

-
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   8   9   10   >