Re: [ANNOUNCE] qgit-2.1 and qgit-1.5.8

2007-12-31 Thread Boaz Harrosh
On Mon, Dec 31 2007 at 20:07 +0200, "Marco Costalba" <[EMAIL PROTECTED]> wrote:
> On Dec 31, 2007 6:47 PM, Boaz Harrosh <[EMAIL PROTECTED]> wrote:
>> On Mon, Dec 31 2007 at 13:58 +0200, "Marco Costalba" <[EMAIL PROTECTED]> 
>> wrote:
>>> On Dec 31, 2007 11:59 AM, Filippo Zangheri <[EMAIL PROTECTED]> wrote:
 Hi,

 I git-cloned qgit-2.1 from your repository, then ran `qmake qgit.pro`, but 
 `make` gave me errors.
>>> Yes, you need qmake of Qt4 not the Qt3 one.
>>>
>> 
>>
>> A Theoretical question.
>> Is it possible to compile Qt4 app all statically linked and run it on a Qt3 
>> based KDE
>> machine. Some thing like the windows installation, where every thing is 
>> self-contained?
>>
> 
> It's also very practical...I have _only_ KDE 3 installed, not KDE 4 ;-)
> 
> I have both Qt4 and Qt3 development (shared) libraries installed and
> there is absolutely no compatibility problem, the only thing you have
> to remember is when running
> 
> qmake qgit.pro
> 
> the first time, you need to be sure is the Qt4 qmake, not the Qt3.
> Because I have Qt3 qmake in path, not the Qt4 one, I need to
> explicitly give the whole path the first time I configure the sources,
> something like
> 
> /usr/lib/qt4/bin/qmake qgit.pro
> 
> Then no other settings are needed, when you call make, the Makefiles
> are already built by qmake to search for the correct libraries.
> 
> 
> Hope this helps...
> 
> Marco

Thanks because of your help I was brave enough to install qt4 and compile qgit.
It works.

We use it a lot here. When the guys make a mess, and you need to figure what
happened than qgit is your only friend. I intend to hack some extra stuff that
we need often.

Boaz
--
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 8/8] Remove 'TOPDIR' from the Top Makefile

2007-12-31 Thread WANG Cong

TOPDIR is obsolete, thus can be removed.
This patch removes TOPDIR from the top Makefile.

Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: WANG Cong <[EMAIL PROTECTED]>

---

diff --git a/Makefile b/Makefile
index fbb8dfc..c892d14 100644
--- a/Makefile
+++ b/Makefile
@@ -148,15 +148,13 @@ _all: modules
 endif
 
 srctree:= $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
-TOPDIR := $(srctree)
-# FIXME - TOPDIR is obsolete, use srctree/objtree
 objtree:= $(CURDIR)
 src:= $(srctree)
 obj:= $(objtree)
 
 VPATH  := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
 
-export srctree objtree VPATH TOPDIR
+export srctree objtree VPATH
 
 
 # SUBARCH tells the usermode build what the underlying arch is.  That is set
--
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/8] FS: Remove 'TOPDIR' from Makefiles

2007-12-31 Thread WANG Cong

TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all fs/ Makefiles.

Cc: Alexander Viro <[EMAIL PROTECTED]>
Cc: Tim Shimmin <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: WANG Cong <[EMAIL PROTECTED]>

---

diff --git a/fs/smbfs/Makefile b/fs/smbfs/Makefile
index 6673ee8..9b5e92b 100644
--- a/fs/smbfs/Makefile
+++ b/fs/smbfs/Makefile
@@ -34,5 +34,5 @@ proto:
@echo >> proto2.h "struct sock;"
@echo >> proto2.h "struct statfs;"
@echo >> proto2.h ""
-   cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO 
-D__KERNEL__ $(SRC) >> proto2.h
+   cproto -E "gcc -E" -e -v -I $(objtree)/include -DMAKING_PROTO 
-D__KERNEL__ $(SRC) >> proto2.h
mv proto2.h proto.h
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 49e3e7e..d1d3d49 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -1 +1 @@
-include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
+include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
--
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/8] FRV: Remove 'TOPDIR' from Makefiles

2007-12-31 Thread WANG Cong

TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all frv Makefiles.

Cc: David Howells <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: WANG Cong <[EMAIL PROTECTED]>

---

diff --git a/arch/frv/boot/Makefile b/arch/frv/boot/Makefile
index dc6f038..d93f768 100644
--- a/arch/frv/boot/Makefile
+++ b/arch/frv/boot/Makefile
@@ -10,7 +10,7 @@
 
 targets := Image zImage bootpImage
 
-SYSTEM =$(TOPDIR)/$(LINUX)
+SYSTEM =$(objtree)/$(LINUX)
 
 ZTEXTADDR   = 0x0208
 PARAMS_PHYS = 0x0207c000
@@ -45,7 +45,7 @@ zImage:   $(CONFIGURE) compressed/$(LINUX)
 bootpImage: bootp/bootp
$(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
 
-compressed/$(LINUX): $(TOPDIR)/$(LINUX) dep
+compressed/$(LINUX): $(objtree)/$(LINUX) dep
@$(MAKE) -C compressed $(LINUX)
 
 bootp/bootp: zImage initrd
@@ -59,10 +59,10 @@ initrd:
 # installation
 #
 install: $(CONFIGURE) Image
-   sh ./install.sh $(KERNELRELEASE) Image $(TOPDIR)/System.map 
"$(INSTALL_PATH)"
+   sh ./install.sh $(KERNELRELEASE) Image $(objtree)/System.map 
"$(INSTALL_PATH)"
 
 zinstall: $(CONFIGURE) zImage
-   sh ./install.sh $(KERNELRELEASE) zImage $(TOPDIR)/System.map 
"$(INSTALL_PATH)"
+   sh ./install.sh $(KERNELRELEASE) zImage $(objtree)/System.map 
"$(INSTALL_PATH)"
 
 #
 # miscellany
--
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/8] INFINIBAND: Remove 'TOPDIR' from Makefiles

2007-12-31 Thread WANG Cong

TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all infiniband Makefiles.

Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Cc: Roland Dreier <[EMAIL PROTECTED]>
Cc: Sean Hefty <[EMAIL PROTECTED]>
Cc: Hal Rosenstock <[EMAIL PROTECTED]>
Signed-off-by: WANG Cong <[EMAIL PROTECTED]>

---

diff --git a/drivers/infiniband/hw/cxgb3/Makefile 
b/drivers/infiniband/hw/cxgb3/Makefile
index 36b9898..b82286a 100644
--- a/drivers/infiniband/hw/cxgb3/Makefile
+++ b/drivers/infiniband/hw/cxgb3/Makefile
@@ -1,5 +1,5 @@
-EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \
-   -I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core
+EXTRA_CFLAGS += -I$(objtree)/drivers/net/cxgb3 \
+   -I$(objtree)/drivers/infiniband/hw/cxgb3/core
 
 obj-$(CONFIG_INFINIBAND_CXGB3) += iw_cxgb3.o
 
--
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/8] CRIS: Remove 'TOPDIR' from Makefiles

2007-12-31 Thread WANG Cong

TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all Cris Makefiles.

Cc: Mikael Starvik <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: WANG Cong <[EMAIL PROTECTED]>

---

diff --git a/arch/cris/arch-v32/boot/compressed/Makefile 
b/arch/cris/arch-v32/boot/compressed/Makefile
index 9f77eda..8586922 100644
--- a/arch/cris/arch-v32/boot/compressed/Makefile
+++ b/arch/cris/arch-v32/boot/compressed/Makefile
@@ -7,7 +7,7 @@
 target = $(target_compressed_dir)
 src= $(src_compressed_dir)
 
-CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include
+CC = gcc-cris -mlinux -march=v32 -I $(objtree)/include
 CFLAGS = -O2
 LD = gcc-cris -mlinux -march=v32 -nostdlib
 OBJCOPY = objcopy-cris
--
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/8] S390: Remove 'TOPDIR' from Makefiles

2007-12-31 Thread WANG Cong

TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all s390 Makefiles.

Cc: Martin Schwidefsky <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: WANG Cong <[EMAIL PROTECTED]>

---

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 56cb710..a753a71 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -34,4 +34,4 @@ obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)
 #
 # This is just to get the dependencies...
 #
-binfmt_elf32.o:$(TOPDIR)/fs/binfmt_elf.c
+binfmt_elf32.o:$(objtree)/fs/binfmt_elf.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 2/8] MIPS: Remove 'TOPDIR' from Makefiles

2007-12-31 Thread WANG Cong

TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all Mips Makefiles.

Cc: Ralf Baechle <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: WANG Cong <[EMAIL PROTECTED]>

---

diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
index 5332449..5196962 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -12,7 +12,7 @@ endif
 
 MKLASATIMG = mklasatimg
 MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
-KERNEL_IMAGE = $(TOPDIR)/vmlinux
+KERNEL_IMAGE = $(objtree)/vmlinux
 KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
 KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ 
)
 
@@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
-D TIMESTAMP=$(shell date +%s)
 
 $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
-   $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
+   $(CC) -fno-pic $(HEAD_DEFINES) -I$(objtree)/include -c -o $@ $<
 
 OBJECTS = head.o kImage.o
 
--
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/8] UML: Remove 'TOPDIR' from Makefiles

2007-12-31 Thread WANG Cong

TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all UML Makefiles.

Cc: Jeff Dike <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: WANG Cong <[EMAIL PROTECTED]>

---

diff --git a/arch/um/Makefile b/arch/um/Makefile
index ba6813a..57491af 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -158,7 +158,7 @@ ifneq ($(KBUILD_SRC),)
$(Q)mkdir -p $(objtree)/include/asm-um
$(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir 
$@))-$(SUBARCH)$(suffix $@) $@
 else
-   $(Q)cd $(TOPDIR)/$(dir $@) ; \
+   $(Q)cd $(objtree)/$(dir $@) ; \
ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@)
 endif
 
@@ -168,7 +168,7 @@ ifneq ($(KBUILD_SRC),)
$(Q)mkdir -p $(objtree)/include/asm-um
$(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch
 else
-   $(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch
+   $(Q)cd $(objtree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch
 endif
 
 $(objtree)/$(ARCH_DIR)/include:
diff --git a/arch/um/sys-ppc/Makefile b/arch/um/sys-ppc/Makefile
index a9814a7..a3cfae7 100644
--- a/arch/um/sys-ppc/Makefile
+++ b/arch/um/sys-ppc/Makefile
@@ -6,7 +6,7 @@ OBJ = built-in.o
 OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \
ptrace_user.o sysrq.o
 
-EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(TOPDIR)/arch/ppc/kernel
+EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(objtree)/arch/ppc/kernel
 
 all: $(OBJ)
 
@@ -22,25 +22,25 @@ sigcontext.o: sigcontext.c
 
 semaphore.c:
rm -f $@
-   ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@
+   ln -s $(objtree)/arch/ppc/kernel/$@ $@
 
 checksum.S:
rm -f $@
-   ln -s $(TOPDIR)/arch/ppc/lib/$@ $@
+   ln -s $(objtree)/arch/ppc/lib/$@ $@
 
 mk_defs.c:
rm -f $@
-   ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@
+   ln -s $(objtree)/arch/ppc/kernel/$@ $@
 
 ppc_defs.head:
rm -f $@
-   ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@
+   ln -s $(objtree)/arch/ppc/kernel/$@ $@
 
 ppc_defs.h: mk_defs.c ppc_defs.head \
-   $(TOPDIR)/include/asm-ppc/mmu.h \
-   $(TOPDIR)/include/asm-ppc/processor.h \
-   $(TOPDIR)/include/asm-ppc/pgtable.h \
-   $(TOPDIR)/include/asm-ppc/ptrace.h
+   $(objtree)/include/asm-ppc/mmu.h \
+   $(objtree)/include/asm-ppc/processor.h \
+   $(objtree)/include/asm-ppc/pgtable.h \
+   $(objtree)/include/asm-ppc/ptrace.h
 #  $(CC) $(CFLAGS) -S mk_defs.c
cp ppc_defs.head ppc_defs.h
 # for bk, this way we can write to the file even if it's not checked out
@@ -56,13 +56,13 @@ ppc_defs.h: mk_defs.c ppc_defs.head \
 
 checksum.o: checksum.S
rm -f asm
-   ln -s $(TOPDIR)/include/asm-ppc asm
+   ln -s $(objtree)/include/asm-ppc asm
$(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c 
$< -o $*.o
rm -f asm
 
 misc.o: misc.S ppc_defs.h
rm -f asm
-   ln -s $(TOPDIR)/include/asm-ppc asm
+   ln -s $(objtree)/include/asm-ppc asm
$(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c 
$< -o $*.o
rm -f asm
 
diff --git a/arch/x86/Makefile_32 b/arch/x86/Makefile_32
--
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/8] Remove 'TOPDIR' from Makefiles

2007-12-31 Thread WANG Cong

TOPDIR is obsolete, use srctree or objtree instead.

This patch set removes all the TOPDIR use in the whole
source tree and finally drops it in the top Makefile.
They're against the current linus-tree.

Note that Patch [8/8] should be applied _after_ all the
previous patches are applied.

Regards.

Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Cc: Andrew Morton <[EMAIL PROTECTED]>


--
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: [RFC] [patch 1/2] add non_init_kernel_text_address

2007-12-31 Thread Srinivasa Ds

Rusty Russell wrote:



Subject: Don't report discarded init pages as kernel text.

Current code could cause a bug in symbol_put_addr() if an arch used
kmalloc module text: we might think the symbol belongs to the core
kernel.

The downside is that this might make backtraces through (discarded)
init functions harder to read on some archs, but we already have that
issue for modules and noone has complained.



Thanks Rusty,  This patch fixes my problem.
Tested-by: Srinivasa DS <[EMAIL PROTECTED]>




--
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 25/26] atl1: add NAPI support

2007-12-31 Thread Joonwoo Park
2008/1/1, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> From: Jay Cliburn <[EMAIL PROTECTED]>
>
> Add support for NAPI, styled after the e1000 NAPI implementation.  That we
> follow the e1000 for NAPI shouldn't come as much of a surprise, since the
> entire atl1 driver is based heavily upon it.
>
> Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
> ---
>  drivers/net/Kconfig |   14 
>  drivers/net/atlx/atl1.c |  151 
> +--
>  drivers/net/atlx/atl1.h |   20 ++
>  drivers/net/atlx/atlx.h |7 ++-
>  4 files changed, 186 insertions(+), 6 deletions(-)
>
> +   if ((!tx_cleaned && (work_done == 0)) ||
> +   !netif_running(poll_dev)) {
> +quit_polling:
> +   netif_rx_complete(poll_dev, napi);
> +
> +   if (!test_bit(__ATL1_DOWN, >flags))
> +   atlx_irq_enable(adapter);
> +   }

Hi Jay,
if buget == work_done is true, you should not call netif_rx_complete.
Searching recent netdev mailbox would be help.

Thanks.
Joonwoo
--
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] Force UNIX domain sockets to be built in

2007-12-31 Thread Theodore Tso
On Tue, Jan 01, 2008 at 04:45:21AM +0100, Bodo Eggert wrote:
> > udev-free != embedded.
> 
> But UNIX=m == waste RAM and have an effectively b0rken system until the 
> module is loaded. 

Well, the system isn't necessarily totally broken.  If you don't use
udev, then system will be crippled, but not totally broken.  Then
again, besides udev, packages such as dbus, gdm, and acpid all use
Unix Domain Sockets --- not to mention cups, avahi-daemon, bluez,
emacsclient, and any X program when the DISPLAY is :0.0.

The question is whether the size of the Unix domain sockets support is
worth the complexity of yet another config option that we expose to
the user.  For the embedded world, OK, maybe they want to save 14k of
non-swappable memory.  But for the non-embedded world, given the 117k
mandatory memory usage of sysfs, or the 124k memory usage of the core
networking stack, never mind the 3 megabytes of memory used by objects
in the kernel subdirectory, it's not clear that it's worth worrying
over 14k of memory, especially when many Unix programs assume
that Unix Domain Sockets are present.

- Ted
--
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] Force UNIX domain sockets to be built in

2007-12-31 Thread Bodo Eggert
On Mon, 31 Dec 2007, David Miller wrote:
> From: Bodo Eggert <[EMAIL PROTECTED]>

> > The big question is: Is there any non-embedded system where you have
> > to aim for a small kernel image?
> 
> One some platforms, due to bootloader restrictions or whatever,
> there are hard limits on how large the main kernel image can be.
> 
> On sparc64 for example the limit is around 6.5MB

That would be about the size of a complete rescue system. I don't think we 
need to worry about unix sockets there, do we?

> But this "big question" isn't the important issue, in fact it's
> tangental and has no bearing on the final decision we make
> here.
> 
> Rather, choice is, and taking choice away is bad.  I may have a reason
> to make AF_UNIX modular, I might not, but either way taking that
> option away from me is not the right thing to do.

_You_'ll still have the option, because you have selected EMBEDDED=y 
(otherwise, you'd miss all other valuable options to cripple your kernel), 
while the folks that just care for a working systems will have what they'd 
select anyway without being bothered with useless questions.
-- 
Top 100 things you don't want the sysadmin to say:
5. Just add yourself to the password file and make a directory...
--
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] Force UNIX domain sockets to be built in

2007-12-31 Thread David Miller
From: Bodo Eggert <[EMAIL PROTECTED]>
Date: Tue, 1 Jan 2008 04:45:21 +0100 (CET)

> The big question is: Is there any non-embedded system where you have
> to aim for a small kernel image?

One some platforms, due to bootloader restrictions or whatever,
there are hard limits on how large the main kernel image can be.

On sparc64 for example the limit is around 6.5MB

But this "big question" isn't the important issue, in fact it's
tangental and has no bearing on the final decision we make
here.

Rather, choice is, and taking choice away is bad.  I may have a reason
to make AF_UNIX modular, I might not, but either way taking that
option away from me is not the right thing to do.
--
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] Force UNIX domain sockets to be built in

2007-12-31 Thread Bodo Eggert
On Mon, 31 Dec 2007, Al Viro wrote:
> On Mon, Dec 31, 2007 at 03:03:20PM +0100, Bodo Eggert wrote:
> > On Mon, 31 Dec 2007, David Miller wrote:
> > > From: Bodo Eggert <[EMAIL PROTECTED]>

> > > > As suggested by Adrian Bunk, UNIX domain sockets should always be built 
> > > > in 
> > > > on normal systems. This is especially true since udev needs these 
> > > > sockets
> > > > and fails to run if UNIX=m.
> > > > 
> > > > Signed-Off-By: Bodo Eggert <[EMAIL PROTECTED]>
> > > 
> > > People who use udev can make sure they have it built into their kernel
> > > if they have such a dependency.
> > > 
> > > Not everyone uses udev, and therefore needs AF_UNIX non-modular.
> > 
> > That's why I kept this option for embedded folks.
> > 
> > Is there any benefit for non-embedded systems from having UNIX=m?
> 
> udev-free != embedded.

But UNIX=m == waste RAM and have an effectively b0rken system until the 
module is loaded. It would be silly to do this unless you have a very small 
space for the kernel image and some free space for storing the needed 
modules. The big question is: Is there any non-embedded system where you 
have to aim for a small kernel image?

-- 
Fun things to slip into your budget
Half a million dollars for consultants to design a web site that was being
done by an intern in his spare time.
--
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][RFC] Simple tamper-proof device filesystem.

2007-12-31 Thread Tetsuo Handa
Hello.

Thank you for reviewing.

Serge E. Hallyn wrote:
> > This time, I'm implementing this filesystem as an extension to tmpfs
> > because what this filesystem does are nothing but check filename and
> > its attributes in addition to what tmpfs does.
> 
> To integrate this nicer into tmpfs, at least define TMPFS_IS_MAC as 1
> and TMPFS_NOT_MAC as 0 and pass those values instead of just 1 and 0.
> 
Question to everybody:
  Not all users need this extension, so I'm worrying that integrating
  this extension into tmpfs increases memory usage needlessly.
  May I implement this filesystem as an extension to tmpfs
  provided that users can enable/disable this extension via kernel config?

> Again, I should think you'd actually want to take blkdev_open() from
> fs/block_dev.c and chrdev_open() from fs/char_dev.c.  Surely your
> method of grabbing it here is not acceptable for upstream code.
I see.

Regards.
--
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: SATA kernel-buffered read VERY slow (not raid, Promise TX300 card); 2.6.23.1(vanilla)

2007-12-31 Thread Alan Cox
> rate began falling and at 128k block-reads-at-a-time or larger, it drops 
> below
> 20MB/s (again, only on buffered SATA).   It's hard to imagine what would
> slow down buffered SATA reads but not ATA and SCSI reads of the same
> size.  I'm using the 'cfq' scheduler with everything running at default

Try disabling NCQ - see if you've got a drive with the 'NCQ = no
readahead' flaw.

> priorities, but again, why only SATA slowness?  It seems that at the driver
> level, using direct reads, the SATA disk has the highest read rate (near
> 80MB/s). 

Beats me - something is wrong that your setup triggers - could be
firmware funnies or Linux ones. 

> The only way I could tell before was using hdparm to read the 
> parameters.
> Since that doesn't work, it's hard to tell if they are set correctly, 
> but given

hdparm supports identify to read modes on drives with libata. The one
thing you cannot do is force modes right now.

> More importantly, how does one set parameters for acoustic and power
> saving parameters?  Some of my disks are used as 'backup' devices for my

hdparm or blktool

> other computers.  With the ATA disks, they were kept "spun down" when not
> being used (only used, 'normally', in early AM hours).

Well for backup devices you can use the fact SATA is hot/warm plug.

> Another new "problem" (not as important) -- even though SATA disks are
> called with "sdX", my ATA disks that *were* at hda-hdc are now at hde-hdg.

NOTABUG - your BIOS has decided to move them from the legacy addresses so
they move from hda-d to e-g.

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


[PATCH 22/26] atl1: update netpoll

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Rename atl1_poll_controller() to atl1_netpoll() and update to conform with
the current vendor driver version 1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 997c83c..f09928d 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2691,11 +2691,14 @@ static int atl1_resume(struct pci_dev *pdev)
 #endif
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
-static void atl1_poll_controller(struct net_device *netdev)
+static void atl1_netpoll(struct net_device *netdev)
 {
-   disable_irq(netdev->irq);
+   struct atl1_adapter *adapter = netdev_priv(netdev);
+
+   disable_irq(adapter->pdev->irq);
atl1_intr(netdev->irq, netdev);
-   enable_irq(netdev->irq);
+   atl1_clean_tx_irq(adapter);
+   enable_irq(adapter->pdev->irq);
 }
 #endif
 
@@ -2796,7 +2799,7 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
netdev->tx_timeout = _tx_timeout;
netdev->watchdog_timeo = 5 * HZ;
 #ifdef CONFIG_NET_POLL_CONTROLLER
-   netdev->poll_controller = atl1_poll_controller;
+   netdev->poll_controller = atl1_netpoll;
 #endif
netdev->vlan_rx_register = atlx_vlan_rx_register;
 
-- 
1.5.3.3

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


[PATCH 26/26] atl1: remove experimental tag and clean up comments

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

All major netdevice functionality is now present in the atl1 driver.  As
a result, remove the EXPERIMENTAL Kconfig tag in the main driver, but leave
it in the NAPI driver.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/Kconfig |4 ++--
 drivers/net/atlx/atl1.c |8 ++--
 drivers/net/atlx/atl1.h |2 +-
 drivers/net/atlx/atlx.c |5 ++---
 drivers/net/atlx/atlx.h |5 ++---
 5 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 095629f..638b90d 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2361,8 +2361,8 @@ config QLA3XXX
  will be called qla3xxx.
 
 config ATL1
-   tristate "Attansic L1 Gigabit Ethernet support (EXPERIMENTAL)"
-   depends on PCI && EXPERIMENTAL
+   tristate "Attansic L1 Gigabit Ethernet support"
+   depends on PCI
select CRC32
select MII
help
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 10bccf6..411cd82 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -1,7 +1,7 @@
 /*
  * Copyright(c) 2005 - 2006 Attansic Corporation. All rights reserved.
  * Copyright(c) 2006 - 2007 Chris Snook <[EMAIL PROTECTED]>
- * Copyright(c) 2006 Jay Cliburn <[EMAIL PROTECTED]>
+ * Copyright(c) 2006 - 2007 Jay Cliburn <[EMAIL PROTECTED]>
  *
  * Derived from Intel e1000 driver
  * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
@@ -31,13 +31,9 @@
  * Chris Snook <[EMAIL PROTECTED]>
  * Jay Cliburn <[EMAIL PROTECTED]>
  *
- * This version is adapted from the Attansic reference driver for
- * inclusion in the Linux kernel.  It is currently under heavy development.
- * A very incomplete list of things that need to be dealt with:
+ * This version is adapted from the Attansic reference driver.
  *
  * TODO:
- * Wake on LAN.
- * Add more ethtool functions.
  * Fix abstruse irq enable/disable condition described here:
  * http://marc.theaimsgroup.com/?l=linux-netdev=116398508500553=2
  *
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h
index a1757a9..82129be 100644
--- a/drivers/net/atlx/atl1.h
+++ b/drivers/net/atlx/atl1.h
@@ -1,7 +1,7 @@
 /*
  * Copyright(c) 2005 - 2006 Attansic Corporation. All rights reserved.
  * Copyright(c) 2006 - 2007 Chris Snook <[EMAIL PROTECTED]>
- * Copyright(c) 2006 Jay Cliburn <[EMAIL PROTECTED]>
+ * Copyright(c) 2006 - 2007 Jay Cliburn <[EMAIL PROTECTED]>
  *
  * Derived from Intel e1000 driver
  * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
diff --git a/drivers/net/atlx/atlx.c b/drivers/net/atlx/atlx.c
index 9cc9441..fb3dd7a 100644
--- a/drivers/net/atlx/atlx.c
+++ b/drivers/net/atlx/atlx.c
@@ -1,8 +1,7 @@
-/* atlx.c -- common functions for Attansic network drivers
- *
+/*
  * Copyright(c) 2005 - 2006 Attansic Corporation. All rights reserved.
  * Copyright(c) 2006 - 2007 Chris Snook <[EMAIL PROTECTED]>
- * Copyright(c) 2006 Jay Cliburn <[EMAIL PROTECTED]>
+ * Copyright(c) 2006 - 2007 Jay Cliburn <[EMAIL PROTECTED]>
  * Copyright(c) 2007 Atheros Corporation. All rights reserved.
  *
  * Derived from Intel e1000 driver
diff --git a/drivers/net/atlx/atlx.h b/drivers/net/atlx/atlx.h
index 18021d9..3c39b27 100644
--- a/drivers/net/atlx/atlx.h
+++ b/drivers/net/atlx/atlx.h
@@ -1,8 +1,7 @@
-/* atlx_hw.h -- common hardware definitions for Attansic network drivers
- *
+/*
  * Copyright(c) 2005 - 2006 Attansic Corporation. All rights reserved.
  * Copyright(c) 2006 - 2007 Chris Snook <[EMAIL PROTECTED]>
- * Copyright(c) 2006 Jay Cliburn <[EMAIL PROTECTED]>
+ * Copyright(c) 2006 - 2007 Jay Cliburn <[EMAIL PROTECTED]>
  * Copyright(c) 2007 Atheros Corporation. All rights reserved.
  *
  * Derived from Intel e1000 driver
-- 
1.5.3.3

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


[PATCH 14/26] atl1: move stray defines to header file

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Move some stray defines out to a header file.  Improve indentation from
ghastly to horrid.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   29 -
 drivers/net/atlx/atl1.h |6 ++
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 9c86ef4..f40cc6e 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -217,12 +217,6 @@ static s32 atl1_read_phy_reg(struct atl1_hw *hw, u16 
reg_addr, u16 *phy_data)
return ATLX_ERR_PHY;
 }
 
-#define CUSTOM_SPI_CS_SETUP2
-#define CUSTOM_SPI_CLK_HI  2
-#define CUSTOM_SPI_CLK_LO  2
-#define CUSTOM_SPI_CS_HOLD 2
-#define CUSTOM_SPI_CS_HI   3
-
 static bool atl1_spi_read(struct atl1_hw *hw, u32 addr, u32 *buf)
 {
int i;
@@ -232,17 +226,18 @@ static bool atl1_spi_read(struct atl1_hw *hw, u32 addr, 
u32 *buf)
iowrite32(addr, hw->hw_addr + REG_SPI_ADDR);
 
value = SPI_FLASH_CTRL_WAIT_READY |
-   (CUSTOM_SPI_CS_SETUP & SPI_FLASH_CTRL_CS_SETUP_MASK) <<
-   SPI_FLASH_CTRL_CS_SETUP_SHIFT | (CUSTOM_SPI_CLK_HI &
-SPI_FLASH_CTRL_CLK_HI_MASK) <<
-   SPI_FLASH_CTRL_CLK_HI_SHIFT | (CUSTOM_SPI_CLK_LO &
-  SPI_FLASH_CTRL_CLK_LO_MASK) <<
-   SPI_FLASH_CTRL_CLK_LO_SHIFT | (CUSTOM_SPI_CS_HOLD &
-  SPI_FLASH_CTRL_CS_HOLD_MASK) <<
-   SPI_FLASH_CTRL_CS_HOLD_SHIFT | (CUSTOM_SPI_CS_HI &
-   SPI_FLASH_CTRL_CS_HI_MASK) <<
-   SPI_FLASH_CTRL_CS_HI_SHIFT | (1 & SPI_FLASH_CTRL_INS_MASK) <<
-   SPI_FLASH_CTRL_INS_SHIFT;
+   (CUSTOM_SPI_CS_SETUP & SPI_FLASH_CTRL_CS_SETUP_MASK) <<
+   SPI_FLASH_CTRL_CS_SETUP_SHIFT |
+   (CUSTOM_SPI_CLK_HI & SPI_FLASH_CTRL_CLK_HI_MASK) <<
+   SPI_FLASH_CTRL_CLK_HI_SHIFT |
+   (CUSTOM_SPI_CLK_LO & SPI_FLASH_CTRL_CLK_LO_MASK) <<
+   SPI_FLASH_CTRL_CLK_LO_SHIFT |
+   (CUSTOM_SPI_CS_HOLD & SPI_FLASH_CTRL_CS_HOLD_MASK) <<
+   SPI_FLASH_CTRL_CS_HOLD_SHIFT |
+   (CUSTOM_SPI_CS_HI & SPI_FLASH_CTRL_CS_HI_MASK) <<
+   SPI_FLASH_CTRL_CS_HI_SHIFT |
+   (1 & SPI_FLASH_CTRL_INS_MASK) <<
+   SPI_FLASH_CTRL_INS_SHIFT;
 
iowrite32(value, hw->hw_addr + REG_SPI_FLASH_CTRL);
 
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h
index 8198f82..3db9a34 100644
--- a/drivers/net/atlx/atl1.h
+++ b/drivers/net/atlx/atl1.h
@@ -335,6 +335,12 @@ extern const struct ethtool_ops atl1_ethtool_ops;
 
 #define ATL1_EEDUMP_LEN48
 
+#define CUSTOM_SPI_CS_SETUP2
+#define CUSTOM_SPI_CLK_HI  2
+#define CUSTOM_SPI_CLK_LO  2
+#define CUSTOM_SPI_CS_HOLD 2
+#define CUSTOM_SPI_CS_HI   3
+
 /* Statistics counters collected by the MAC */
 struct stats_msg_block {
/* rx */
-- 
1.5.3.3

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


[PATCH 20/26] atl1: update change mtu

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Update atl1_change_mtu() to conform with the current vendor driver version
1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   39 ++-
 1 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 972de34..7d84a51 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2438,32 +2438,37 @@ static void atl1_reset_task(struct work_struct *work)
  * atl1_change_mtu - Change the Maximum Transfer Unit
  * @netdev: network interface device structure
  * @new_mtu: new value for maximum frame size
- *
- * Returns 0 on success, negative on failure
  */
 static int atl1_change_mtu(struct net_device *netdev, int new_mtu)
 {
struct atl1_adapter *adapter = netdev_priv(netdev);
-   int old_mtu = netdev->mtu;
-   int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
+   struct atl1_hw *hw = >hw;
 
-   if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
-   (max_frame > MAX_JUMBO_FRAME_SIZE)) {
-   dev_warn(>pdev->dev, "invalid MTU setting\n");
+   if ((new_mtu < 40) || (new_mtu > (ETH_DATA_LEN + VLAN_HLEN)))
return -EINVAL;
-   }
 
-   adapter->hw.max_frame_size = max_frame;
-   adapter->hw.tx_jumbo_task_th = (max_frame + 7) >> 3;
-   adapter->rx_buffer_len = (max_frame + 7) & ~7;
-   adapter->hw.rx_jumbo_th = adapter->rx_buffer_len / 8;
+   if (hw->max_frame_size != new_mtu) {
+   while (test_and_set_bit(__ATL1_RESETTING, >flags))
+   msleep(1);
 
-   netdev->mtu = new_mtu;
-   if ((old_mtu != new_mtu) && netif_running(netdev)) {
-   atl1_down(adapter);
-   atl1_up(adapter);
-   }
+   if (netif_running(netdev))
+   atl1_down(adapter);
+
+   netdev->mtu = new_mtu;
+   adapter->hw.max_frame_size = new_mtu;
+   adapter->hw.tx_jumbo_task_th = (new_mtu + ETH_HLEN +
+   ETH_FCS_LEN + VLAN_HLEN + 7) >> 3;
+   adapter->rx_buffer_len = (new_mtu + ETH_HLEN +
+   ETH_FCS_LEN + VLAN_HLEN + 7) & ~7;
+   adapter->hw.rx_jumbo_th = adapter->rx_buffer_len / 8;
 
+   if (netif_running(netdev))
+   atl1_up(adapter);
+   else
+   atl1_reset(adapter);
+
+   clear_bit(__ATL1_RESETTING, >flags);
+   }
return 0;
 }
 
-- 
1.5.3.3

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


[PATCH 21/26] atl1: update atl1_close

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Update atl1_close() to conform with current vendor driver version 1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 7d84a51..997c83c 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2558,6 +2558,18 @@ err_open:
return err;
 }
 
+static void atl1_free_irq(struct atl1_adapter *adapter)
+{
+   struct net_device *netdev = adapter->netdev;
+
+   free_irq(adapter->pdev->irq, netdev);
+
+#ifdef CONFIG_PCI_MSI
+   if (adapter->have_msi)
+   pci_disable_msi(adapter->pdev);
+#endif
+}
+
 /*
  * atl1_close - Disables a network interface
  * @netdev: network interface device structure
@@ -2572,7 +2584,9 @@ err_open:
 static int atl1_close(struct net_device *netdev)
 {
struct atl1_adapter *adapter = netdev_priv(netdev);
+
atl1_down(adapter);
+   atl1_free_irq(adapter);
atl1_free_ring_resources(adapter);
return 0;
 }
-- 
1.5.3.3

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


[PATCH 18/26] atl1: make function static

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Make atl1_reset() a static function.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 6432956..7697e80 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2351,12 +2351,13 @@ static void atl1_phy_config(unsigned long data)
clear_bit(0, >cfg_phy);
 }
 
-int atl1_reset(struct atl1_adapter *adapter)
+static int atl1_reset(struct atl1_adapter *adapter)
 {
-   int ret;
-   ret = atl1_reset_hw(>hw);
-   if (ret)
-   return ret;
+   int retval;
+
+   retval = atl1_reset_hw(>hw);
+   if (retval)
+   return retval;
return atl1_init_hw(>hw);
 }
 
-- 
1.5.3.3

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


[PATCH 16/26] atl1: modernize check link function

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Update atl1_check_link() to conform with the current vendor driver version
1.2.40.2.  Clean up vertical spacing, indentation, and remove dead code.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   65 +++---
 drivers/net/atlx/atl1.h |1 +
 2 files changed, 22 insertions(+), 44 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index db6e76c..abed547 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -1094,6 +1094,7 @@ static void atl1_setup_mac_ctrl(struct atl1_adapter 
*adapter)
u32 value;
struct atl1_hw *hw = >hw;
struct net_device *netdev = adapter->netdev;
+
/* Config MAC CTRL Register */
value = MAC_CTRL_TX_EN | MAC_CTRL_RX_EN;
/* duplex */
@@ -1101,8 +1102,8 @@ static void atl1_setup_mac_ctrl(struct atl1_adapter 
*adapter)
value |= MAC_CTRL_DUPLX;
/* speed */
value |= ((u32) ((SPEED_1000 == adapter->link_speed) ?
-MAC_CTRL_SPEED_1000 : MAC_CTRL_SPEED_10_100) <<
- MAC_CTRL_SPEED_SHIFT);
+   MAC_CTRL_SPEED_1000 : MAC_CTRL_SPEED_10_100) <<
+   MAC_CTRL_SPEED_SHIFT);
/* flow control */
value |= (MAC_CTRL_TX_FLOW | MAC_CTRL_RX_FLOW);
/* PAD & CRC */
@@ -1113,10 +1114,6 @@ static void atl1_setup_mac_ctrl(struct atl1_adapter 
*adapter)
/* vlan */
if (adapter->vlgrp)
value |= MAC_CTRL_RMV_VLAN;
-   /* rx checksum
-  if (adapter->rx_csum)
-  value |= MAC_CTRL_RX_CHKSUM_EN;
-*/
/* filter mode */
value |= MAC_CTRL_BC_EN;
if (netdev->flags & IFF_PROMISC)
@@ -1131,7 +1128,7 @@ static u32 atl1_check_link(struct atl1_adapter *adapter)
 {
struct atl1_hw *hw = >hw;
struct net_device *netdev = adapter->netdev;
-   u32 ret_val;
+   u32 val, retval;
u16 speed, duplex, phy_data;
int reconfig = 0;
 
@@ -1143,6 +1140,10 @@ static u32 atl1_check_link(struct atl1_adapter *adapter)
if (netif_carrier_ok(netdev)) {
/* old link state: Up */
dev_info(>pdev->dev, "link is down\n");
+   val = ioread32(hw->hw_addr + REG_MAC_CTRL);
+   val &= ~MAC_CTRL_RX_EN;
+   iowrite32(val, hw->hw_addr + REG_MAC_CTRL);
+   ioread32(hw->hw_addr + REG_MAC_CTRL);
adapter->link_speed = SPEED_0;
netif_carrier_off(netdev);
netif_stop_queue(netdev);
@@ -1151,15 +1152,12 @@ static u32 atl1_check_link(struct atl1_adapter *adapter)
}
 
/* Link Up */
-   ret_val = atl1_get_speed_and_duplex(hw, , );
-   if (ret_val)
-   return ret_val;
+   retval = atl1_get_speed_and_duplex(hw, , );
+   clear_bit(0, >force_ps);
+   if (retval)
+   return retval;
 
switch (hw->media_type) {
-   case MEDIA_TYPE_1000M_FULL:
-   if (speed != SPEED_1000 || duplex != FULL_DUPLEX)
-   reconfig = 1;
-   break;
case MEDIA_TYPE_100M_FULL:
if (speed != SPEED_100 || duplex != FULL_DUPLEX)
reconfig = 1;
@@ -1180,8 +1178,8 @@ static u32 atl1_check_link(struct atl1_adapter *adapter)
 
/* link result is our setting */
if (!reconfig) {
-   if (adapter->link_speed != speed
-   || adapter->link_duplex != duplex) {
+   if (adapter->link_speed != speed ||
+   adapter->link_duplex != duplex) {
adapter->link_speed = speed;
adapter->link_duplex = duplex;
atl1_setup_mac_ctrl(adapter);
@@ -1201,39 +1199,18 @@ static u32 atl1_check_link(struct atl1_adapter *adapter)
 
/* change original link status */
if (netif_carrier_ok(netdev)) {
+   val = ioread32(hw->hw_addr + REG_MAC_CTRL);
+   val &= ~MAC_CTRL_RX_EN;
adapter->link_speed = SPEED_0;
+   iowrite32(val, hw->hw_addr + REG_MAC_CTRL);
+   ioread32(hw->hw_addr + REG_MAC_CTRL);
netif_carrier_off(netdev);
netif_stop_queue(netdev);
}
 
-   if (hw->media_type != MEDIA_TYPE_AUTO_SENSOR &&
-   hw->media_type != MEDIA_TYPE_1000M_FULL) {
-   switch (hw->media_type) {
-   case MEDIA_TYPE_100M_FULL:
-   phy_data = MII_CR_FULL_DUPLEX | MII_CR_SPEED_100 |
-  MII_CR_RESET;
-   break;
-   case MEDIA_TYPE_100M_HALF:
-   phy_data = MII_CR_SPEED_100 | MII_CR_RESET;
-   break;
-   case MEDIA_TYPE_10M_FULL:
- 

[PATCH 12/26] atl1: refactor atl1_probe

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Refactor atl1_probe to conform with current vendor driver version 1.2.40.2.
Also reorder functions to minimize the need for forward declarations.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c | 1397 +++
 drivers/net/atlx/atl1.h |   21 +-
 2 files changed, 691 insertions(+), 727 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index e96f706..d38f26f 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -101,17 +101,681 @@ static const struct pci_device_id atl1_pci_tbl[] = {
 MODULE_DEVICE_TABLE(pci, atl1_pci_tbl);
 
 /*
+ * Reset the transmit and receive units; mask and clear all interrupts.
+ * hw - Struct containing variables accessed by shared code
+ * return : 0  or  idle status (if error)
+ */
+static s32 atl1_reset_hw(struct atl1_hw *hw)
+{
+   struct pci_dev *pdev = hw->back->pdev;
+   u32 icr;
+   int i;
+
+   /*
+* Issue Soft Reset to the MAC.  This will reset the chip's
+* transmit, receive, DMA.  It will not effect
+* the current PCI configuration.  The global reset bit is self-
+* clearing, and should clear within a microsecond.
+*/
+   iowrite32(MASTER_CTRL_SOFT_RST, hw->hw_addr + REG_MASTER_CTRL);
+   ioread32(hw->hw_addr + REG_MASTER_CTRL);
+
+   /* delay about 1ms */
+   msleep(1);
+
+   /* wait at least 10ms for idle */
+   for (i = 0; i < 10; i++) {
+   icr = ioread32(hw->hw_addr + REG_IDLE_STATUS);
+   if (!icr)
+   break;
+   /* delay 1 ms */
+   msleep(1);
+   cpu_relax();
+   }
+
+   if (icr) {
+   dev_dbg(>dev, "ICR = 0x%x\n", icr);
+   return icr;
+   }
+
+   return 0;
+}
+
+/* function about EEPROM
+ *
+ * check_eeprom_exist
+ * return 0 if eeprom exist
+ */
+static int atl1_check_eeprom_exist(struct atl1_hw *hw)
+{
+   u32 value;
+
+   value = ioread32(hw->hw_addr + REG_SPI_FLASH_CTRL);
+   if (value & SPI_FLASH_CTRL_EN_VPD) {
+   value &= ~SPI_FLASH_CTRL_EN_VPD;
+   iowrite32(value, hw->hw_addr + REG_SPI_FLASH_CTRL);
+   }
+
+   value = ioread16(hw->hw_addr + REG_PCIE_CAP_LIST);
+   return ((value & 0xFF00) == 0x6C00) ? 0 : 1;
+}
+
+static bool atl1_read_eeprom(struct atl1_hw *hw, u32 offset, u32 *p_value)
+{
+   int i;
+   u32 control;
+
+   if (offset & 3)
+   /* address do not align */
+   return false;
+
+   iowrite32(0, hw->hw_addr + REG_VPD_DATA);
+   control = (offset & VPD_CAP_VPD_ADDR_MASK) << VPD_CAP_VPD_ADDR_SHIFT;
+   iowrite32(control, hw->hw_addr + REG_VPD_CAP);
+   ioread32(hw->hw_addr + REG_VPD_CAP);
+
+   for (i = 0; i < 10; i++) {
+   msleep(2);
+   control = ioread32(hw->hw_addr + REG_VPD_CAP);
+   if (control & VPD_CAP_VPD_FLAG)
+   break;
+   }
+   if (control & VPD_CAP_VPD_FLAG) {
+   *p_value = ioread32(hw->hw_addr + REG_VPD_DATA);
+   return true;
+   }
+   /* timeout */
+   return false;
+}
+
+/*
+ * Reads the value from a PHY register
+ * hw - Struct containing variables accessed by shared code
+ * reg_addr - address of the PHY register to read
+ */
+static s32 atl1_read_phy_reg(struct atl1_hw *hw, u16 reg_addr, u16 *phy_data)
+{
+   u32 val;
+   int i;
+
+   val = ((u32) (reg_addr & MDIO_REG_ADDR_MASK)) << MDIO_REG_ADDR_SHIFT |
+   MDIO_START | MDIO_SUP_PREAMBLE | MDIO_RW | MDIO_CLK_25_4 <<
+   MDIO_CLK_SEL_SHIFT;
+   iowrite32(val, hw->hw_addr + REG_MDIO_CTRL);
+   ioread32(hw->hw_addr + REG_MDIO_CTRL);
+
+   for (i = 0; i < MDIO_WAIT_TIMES; i++) {
+   udelay(2);
+   val = ioread32(hw->hw_addr + REG_MDIO_CTRL);
+   if (!(val & (MDIO_START | MDIO_BUSY)))
+   break;
+   }
+   if (!(val & (MDIO_START | MDIO_BUSY))) {
+   *phy_data = (u16) val;
+   return 0;
+   }
+   return ATLX_ERR_PHY;
+}
+
+#define CUSTOM_SPI_CS_SETUP2
+#define CUSTOM_SPI_CLK_HI  2
+#define CUSTOM_SPI_CLK_LO  2
+#define CUSTOM_SPI_CS_HOLD 2
+#define CUSTOM_SPI_CS_HI   3
+
+static bool atl1_spi_read(struct atl1_hw *hw, u32 addr, u32 *buf)
+{
+   int i;
+   u32 value;
+
+   iowrite32(0, hw->hw_addr + REG_SPI_DATA);
+   iowrite32(addr, hw->hw_addr + REG_SPI_ADDR);
+
+   value = SPI_FLASH_CTRL_WAIT_READY |
+   (CUSTOM_SPI_CS_SETUP & SPI_FLASH_CTRL_CS_SETUP_MASK) <<
+   SPI_FLASH_CTRL_CS_SETUP_SHIFT | (CUSTOM_SPI_CLK_HI &
+SPI_FLASH_CTRL_CLK_HI_MASK) <<
+   SPI_FLASH_CTRL_CLK_HI_SHIFT | (CUSTOM_SPI_CLK_LO &
+  SPI_FLASH_CTRL_CLK_LO_MASK) <<
+   

[PATCH 03/26] atl1: fix broken TSO

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

The L1 tx packet descriptor expects TCP Header Length to be expressed as a
number of 32-bit dwords.  The atl1 driver uses tcp_hdrlen() to populate the
field, but tcp_hdrlen() returns the header length in bytes, not in dwords.
Add a shift to convert tcp_hdrlen() to dwords when we write it to the tpd.

Also, some of our bit assignments are made to the wrong tpd words.  Change
those to the correct words.

Finally, since all this fixes TSO, enable TSO by default.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   29 +++--
 1 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 0df3f32..4e98c16 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -36,7 +36,6 @@
  * A very incomplete list of things that need to be dealt with:
  *
  * TODO:
- * Fix TSO; tx performance is horrible with TSO enabled.
  * Wake on LAN.
  * Add more ethtool functions.
  * Fix abstruse irq enable/disable condition described here:
@@ -1308,8 +1307,8 @@ static int atl1_tso(struct atl1_adapter *adapter, struct 
sk_buff *skb,
tso->tsopl |= 1 << TSO_PARAM_ETHTYPE_SHIFT;
 
tso->tsopl |= (iph->ihl &
-   CSUM_PARAM_IPHL_MASK) << CSUM_PARAM_IPHL_SHIFT;
-   tso->tsopl |= (tcp_hdrlen(skb) &
+   TSO_PARAM_IPHL_MASK) << TSO_PARAM_IPHL_SHIFT;
+   tso->tsopl |= ((tcp_hdrlen(skb) >> 2) &
TSO_PARAM_TCPHDRLEN_MASK) <<
TSO_PARAM_TCPHDRLEN_SHIFT;
tso->tsopl |= (skb_shinfo(skb)->gso_size &
@@ -1472,8 +1471,8 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, 
int count,
tpd->desc.tso.tsopl = descr->tso.tsopl;
tpd->buffer_addr = cpu_to_le64(buffer_info->dma);
tpd->desc.data = descr->data;
-   tpd->desc.csum.csumpu |= (cpu_to_le16(buffer_info->length) &
-   CSUM_PARAM_BUFLEN_MASK) << CSUM_PARAM_BUFLEN_SHIFT;
+   tpd->desc.tso.tsopu |= (cpu_to_le16(buffer_info->length) &
+   TSO_PARAM_BUFLEN_MASK) << TSO_PARAM_BUFLEN_SHIFT;
 
val = (descr->tso.tsopl >> TSO_PARAM_SEGMENT_SHIFT) &
TSO_PARAM_SEGMENT_MASK;
@@ -1481,7 +1480,7 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, 
int count,
tpd->desc.tso.tsopl |= 1 << TSO_PARAM_HDRFLAG_SHIFT;
 
if (j == (count - 1))
-   tpd->desc.csum.csumpl |= 1 << CSUM_PARAM_EOP_SHIFT;
+   tpd->desc.tso.tsopl |= 1 << TSO_PARAM_EOP_SHIFT;
 
if (++tpd_next_to_use == tpd_ring->count)
tpd_next_to_use = 0;
@@ -1574,9 +1573,9 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct 
net_device *netdev)
vlan_tag = vlan_tx_tag_get(skb);
vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) |
((vlan_tag >> 9) & 0x8);
-   param.csum.csumpl |= 1 << CSUM_PARAM_INSVLAG_SHIFT;
-   param.csum.csumpu |= (vlan_tag & CSUM_PARAM_VALANTAG_MASK) <<
-   CSUM_PARAM_VALAN_SHIFT;
+   param.tso.tsopl |= 1 << TSO_PARAM_INSVLAG_SHIFT;
+   param.tso.tsopu |= (vlan_tag & TSO_PARAM_VLANTAG_MASK) <<
+   TSO_PARAM_VLAN_SHIFT;
}
 
tso = atl1_tso(adapter, skb, );
@@ -1595,8 +1594,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct 
net_device *netdev)
}
}
 
-   val = (param.csum.csumpl >> CSUM_PARAM_SEGMENT_SHIFT) &
-   CSUM_PARAM_SEGMENT_MASK;
+   val = (param.tso.tsopl >> TSO_PARAM_SEGMENT_SHIFT) &
+   TSO_PARAM_SEGMENT_MASK;
atl1_tx_map(adapter, skb, 1 == val);
atl1_tx_queue(adapter, count, );
netdev->trans_start = jiffies;
@@ -2091,13 +2090,7 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
netdev->features = NETIF_F_HW_CSUM;
netdev->features |= NETIF_F_SG;
netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
-
-   /*
-* FIXME - Until tso performance gets fixed, disable the feature.
-* Enable it with ethtool -K if desired.
-*/
-   /* netdev->features |= NETIF_F_TSO; */
-
+   netdev->features |= NETIF_F_TSO;
netdev->features |= NETIF_F_LLTX;
 
/*
-- 
1.5.3.3

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


[PATCH 15/26] atl1: tidy up ring management

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Check for null pointers and such in ring handling functions.  Make
needlessly global functions static.  Clean up some comments and indentation.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   20 +++-
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index f40cc6e..db6e76c 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -141,8 +141,7 @@ static s32 atl1_reset_hw(struct atl1_hw *hw)
return 0;
 }
 
-/* function about EEPROM
- *
+/*
  * check_eeprom_exist
  * return 0 if eeprom exist
  */
@@ -166,7 +165,7 @@ static bool atl1_read_eeprom(struct atl1_hw *hw, u32 
offset, u32 *p_value)
u32 control;
 
if (offset & 3)
-   /* address do not align */
+   /* unaligned address */
return false;
 
iowrite32(0, hw->hw_addr + REG_VPD_DATA);
@@ -417,7 +416,7 @@ static void atl1_hash_set(struct atl1_hw *hw, u32 
hash_value)
 * bit BitArray[hash_value]. So we figure out what register
 * the bit is in, read it, OR in the new bit, then write
 * back the new value.  The register is determined by the
-* upper 7 bits of the hash value and the bit within that
+* upper bit of the hash value, and the bits within that
 * register are determined by the lower 5 bits of the value.
 */
hash_reg = (hash_value >> 31) & 0x1;
@@ -439,9 +438,9 @@ static s32 atl1_write_phy_reg(struct atl1_hw *hw, u32 
reg_addr, u16 phy_data)
u32 val;
 
val = ((u32) (phy_data & MDIO_DATA_MASK)) << MDIO_DATA_SHIFT |
-   (reg_addr & MDIO_REG_ADDR_MASK) << MDIO_REG_ADDR_SHIFT |
-   MDIO_SUP_PREAMBLE |
-   MDIO_START | MDIO_CLK_25_4 << MDIO_CLK_SEL_SHIFT;
+   (reg_addr & MDIO_REG_ADDR_MASK) << MDIO_REG_ADDR_SHIFT |
+   MDIO_SUP_PREAMBLE | MDIO_START |
+   MDIO_CLK_25_4 << MDIO_CLK_SEL_SHIFT;
iowrite32(val, hw->hw_addr + REG_MDIO_CTRL);
ioread32(hw->hw_addr + REG_MDIO_CTRL);
 
@@ -872,7 +871,7 @@ static int atl1_mii_ioctl(struct net_device *netdev, struct 
ifreq *ifr, int cmd)
  *
  * Return 0 on success, negative on failure
  */
-s32 atl1_setup_ring_resources(struct atl1_adapter *adapter)
+static s32 atl1_setup_ring_resources(struct atl1_adapter *adapter)
 {
struct atl1_tpd_ring *tpd_ring = >tpd_ring;
struct atl1_rfd_ring *rfd_ring = >rfd_ring;
@@ -987,6 +986,9 @@ static void atl1_clean_rx_ring(struct atl1_adapter *adapter)
unsigned long size;
unsigned int i;
 
+   if (!rfd_ring->buffer_info || !rfd_ring->desc)
+   return;
+
/* Free all the Rx ring sk_buffs */
for (i = 0; i < rfd_ring->count; i++) {
buffer_info = _ring->buffer_info[i];
@@ -1060,7 +1062,7 @@ static void atl1_clean_tx_ring(struct atl1_adapter 
*adapter)
  *
  * Free all transmit software resources
  */
-void atl1_free_ring_resources(struct atl1_adapter *adapter)
+static void atl1_free_ring_resources(struct atl1_adapter *adapter)
 {
struct pci_dev *pdev = adapter->pdev;
struct atl1_tpd_ring *tpd_ring = >tpd_ring;
-- 
1.5.3.3

--
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 25/26] atl1: add NAPI support

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Add support for NAPI, styled after the e1000 NAPI implementation.  That we
follow the e1000 for NAPI shouldn't come as much of a surprise, since the
entire atl1 driver is based heavily upon it.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/Kconfig |   14 
 drivers/net/atlx/atl1.c |  151 +--
 drivers/net/atlx/atl1.h |   20 ++
 drivers/net/atlx/atlx.h |7 ++-
 4 files changed, 186 insertions(+), 6 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index d9107e5..095629f 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2371,6 +2371,20 @@ config ATL1
  To compile this driver as a module, choose M here.  The module
  will be called atl1.
 
+config ATL1_NAPI
+   bool "Use Rx Polling (NAPI) (EXPERIMENTAL)"
+   depends on ATL1 && EXPERIMENTAL
+   help
+ NAPI is a new driver API designed to reduce CPU and interrupt load
+ when the driver is receiving lots of packets from the card. It is
+ still somewhat experimental and thus not yet enabled by default.
+
+ If your estimated Rx load is 10kpps or more, or if the card will be
+ deployed on potentially unfriendly networks (e.g. in a firewall),
+ then say Y here.
+
+ If in doubt, say N.
+
 endif # NETDEV_1000
 
 #
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 237622e..10bccf6 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -756,7 +756,16 @@ static void atl1_set_mac_addr(struct atl1_hw *hw)
 
 static int atl1_alloc_queues(struct atl1_adapter *adapter)
 {
-   /* temporary placeholder function for NAPI */
+#ifdef CONFIG_ATL1_NAPI
+   int size;
+
+   size = sizeof(struct net_device) * adapter->num_rx_queues;
+   adapter->polling_netdev = kmalloc(size, GFP_KERNEL);
+   if (!adapter->polling_netdev)
+   return -ENOMEM;
+
+   memset(adapter->polling_netdev, 0, size);
+#endif
 
return 0;
 }
@@ -770,6 +779,9 @@ static int __devinit atl1_sw_init(struct atl1_adapter 
*adapter)
struct atl1_hw *hw = >hw;
struct net_device *netdev = adapter->netdev;
int err;
+#ifdef CONFIG_ATL1_NAPI
+   int i;
+#endif
 
hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
hw->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
@@ -818,6 +830,14 @@ static int __devinit atl1_sw_init(struct atl1_adapter 
*adapter)
return -ENOMEM;
}
 
+#ifdef CONFIG_ATL1_NAPI
+   for (i = 0; i < adapter->num_rx_queues; i++) {
+   adapter->polling_netdev[i].priv = adapter;
+   dev_hold(>polling_netdev[i]);
+   set_bit(__LINK_STATE_START, >polling_netdev[i].state);
+   }
+#endif
+
spin_lock_init(>lock);
spin_lock_init(>mb_lock);
set_bit(__ATL1_DOWN, >flags);
@@ -1698,7 +1718,12 @@ next:
return num_alloc;
 }
 
+#ifdef CONFIG_ATL1_NAPI
+static void atl1_clean_rx_irq(struct atl1_adapter *adapter, int *work_done,
+   int work_to_do)
+#else
 static void atl1_clean_rx_irq(struct atl1_adapter *adapter)
+#endif
 {
struct net_device *netdev = adapter->netdev;
int i, count;
@@ -1768,6 +1793,11 @@ chk_rrd:
break;
}
 rrd_ok:
+#ifdef CONFIG_ATL1_NAPI
+   if (*work_done >= work_to_do)
+   break;
+   (*work_done)++;
+#endif
/* clean alloc flag for bad rrd */
atl1_clean_alloc_flag(adapter, rrd, 0);
 
@@ -1808,6 +1838,16 @@ rrd_ok:
atl1_rx_checksum(adapter, rrd, skb);
skb->protocol = eth_type_trans(skb, adapter->netdev);
 
+#ifdef CONFIG_ATL1_NAPI
+   if (adapter->vlgrp && (rrd->pkt_flg & PACKET_FLAG_VLAN_INS)) {
+   u16 vlan_tag = (rrd->vlan_tag >> 4) |
+   ((rrd->vlan_tag & 7) << 13) |
+   ((rrd->vlan_tag & 8) << 9);
+   vlan_hwaccel_receive_skb(skb, adapter->vlgrp, vlan_tag);
+   } else
+   netif_receive_skb(skb);
+
+#else
if (adapter->vlgrp && (rrd->pkt_flg & PACKET_FLAG_VLAN_INS)) {
u16 vlan_tag = (rrd->vlan_tag >> 4) |
((rrd->vlan_tag & 7) << 13) |
@@ -1815,6 +1855,7 @@ rrd_ok:
vlan_hwaccel_rx(skb, adapter->vlgrp, vlan_tag);
} else
netif_rx(skb);
+#endif
 
/* let protocol layer free skb */
buffer_info->skb = NULL;
@@ -1837,6 +1878,9 @@ static bool atl1_clean_tx_irq(struct atl1_adapter 
*adapter)
struct atl1_buffer *buffer_info;
u16 sw_tpd_next_to_clean;
u16 cmb_tpd_next_to_clean;
+#ifdef CONFIG_ATL1_NAPI
+   unsigned int count = 0;
+#endif
 

[PATCH 24/26] atl1: update wake-on-lan

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Update wake-on-lan to conform with the current vendor driver version
1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |  140 ---
 1 files changed, 84 insertions(+), 56 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index b89201e..237622e 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -1457,22 +1457,6 @@ static u32 atl1_configure(struct atl1_adapter *adapter)
return value;
 }
 
-/*
- * When ACPI resume on some VIA MotherBoard, the Interrupt Disable bit/0x400
- * on PCI Command register is disable.
- * The function enable this bit.
- * Brackett, 2006/03/15
- */
-static void atl1_via_workaround(struct atl1_adapter *adapter)
-{
-   unsigned long value;
-
-   value = ioread16(adapter->hw.hw_addr + PCI_COMMAND);
-   if (value & PCI_COMMAND_INTX_DISABLE)
-   value &= ~PCI_COMMAND_INTX_DISABLE;
-   iowrite32(value, adapter->hw.hw_addr + PCI_COMMAND);
-}
-
 static void atl1_inc_smb(struct atl1_adapter *adapter)
 {
struct stats_msg_block *smb = adapter->smb.smb;
@@ -2607,65 +2591,97 @@ static int atl1_suspend(struct pci_dev *pdev, 
pm_message_t state)
struct net_device *netdev = pci_get_drvdata(pdev);
struct atl1_adapter *adapter = netdev_priv(netdev);
struct atl1_hw *hw = >hw;
+   u16 speed, duplex;
u32 ctrl = 0;
u32 wufc = adapter->wol;
+   int retval;
 
netif_device_detach(netdev);
-   if (netif_running(netdev))
+   if (netif_running(netdev)) {
+   WARN_ON(test_bit(__ATL1_RESETTING, >flags));
atl1_down(adapter);
+   }
+
+   retval = pci_save_state(pdev);
+   if (retval)
+   return retval;
 
-   atl1_read_phy_reg(hw, MII_BMSR, (u16 *) & ctrl);
-   atl1_read_phy_reg(hw, MII_BMSR, (u16 *) & ctrl);
+   atl1_read_phy_reg(hw, MII_BMSR, (u16 *) );
+   atl1_read_phy_reg(hw, MII_BMSR, (u16 *) );
if (ctrl & BMSR_LSTATUS)
wufc &= ~ATLX_WUFC_LNKC;
 
-   /* reduce speed to 10/100M */
-   if (wufc) {
-   /* if resume, let driver to re- setup link */
-   hw->phy_configured = false;
-   atl1_set_mac_addr(hw);
-   atlx_set_multi(netdev);
+   if ((ctrl & BMSR_LSTATUS) && wufc) {
+   retval = atl1_get_speed_and_duplex(hw, , );
+   if (retval) {
+   dev_printk(KERN_DEBUG, >pdev->dev,
+   "speed/duplex error during suspend\n");
+   goto wol_dis;
+   }
 
ctrl = 0;
/* turn on magic packet wol */
if (wufc & ATLX_WUFC_MAG)
ctrl = WOL_MAGIC_EN | WOL_MAGIC_PME_EN;
 
-   /* turn on Link change WOL */
-   if (wufc & ATLX_WUFC_LNKC)
-   ctrl |= (WOL_LINK_CHG_EN | WOL_LINK_CHG_PME_EN);
iowrite32(ctrl, hw->hw_addr + REG_WOL_CTRL);
 
-   /* turn on all-multi mode if wake on multicast is enabled */
-   ctrl = ioread32(hw->hw_addr + REG_MAC_CTRL);
-   ctrl &= ~MAC_CTRL_DBG;
-   ctrl &= ~MAC_CTRL_PROMIS_EN;
-   if (wufc & ATLX_WUFC_MC)
-   ctrl |= MAC_CTRL_MC_ALL_EN;
-   else
-   ctrl &= ~MAC_CTRL_MC_ALL_EN;
+   ctrl = MAC_CTRL_RX_EN;
+   ctrl |= ((u32) ((speed == SPEED_1000) ? MAC_CTRL_SPEED_1000 :
+   MAC_CTRL_SPEED_10_100) << MAC_CTRL_SPEED_SHIFT);
+
+   if (duplex == FULL_DUPLEX)
+   ctrl |= (((u32) adapter->hw.preamble_len &
+   MAC_CTRL_PRMLEN_MASK) <<
+   MAC_CTRL_PRMLEN_SHIFT);
 
-   /* turn on broadcast mode if wake on-BC is enabled */
-   if (wufc & ATLX_WUFC_BC)
+   if (adapter->vlgrp)
+   ctrl |= MAC_CTRL_RMV_VLAN;
+
+   if (wufc & ATLX_WUFC_MAG)
ctrl |= MAC_CTRL_BC_EN;
-   else
-   ctrl &= ~MAC_CTRL_BC_EN;
 
-   /* enable RX */
-   ctrl |= MAC_CTRL_RX_EN;
iowrite32(ctrl, hw->hw_addr + REG_MAC_CTRL);
-   pci_enable_wake(pdev, PCI_D3hot, 1);
-   pci_enable_wake(pdev, PCI_D3cold, 1);
-   } else {
-   iowrite32(0, hw->hw_addr + REG_WOL_CTRL);
-   pci_enable_wake(pdev, PCI_D3hot, 0);
-   pci_enable_wake(pdev, PCI_D3cold, 0);
+
+   ctrl = ioread32(hw->hw_addr + REG_PCIE_PHY_MISC1);
+   ctrl |= PCIE_PHY_MISC1_FORCE_RCV_DET;
+   iowrite32(ctrl, hw->hw_addr + REG_PCIE_PHY_MISC1);
+   ioread32(hw->hw_addr + REG_PCIE_PHY_MISC1);
+   hw->phy_configured = false;
+  

[PATCH 08/26] atl1: additional DMA engine configuration

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Add DMA engine configuration tweaks per current vendor atl1 driver version
1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   10 ++
 drivers/net/atlx/atlx.h |6 ++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index c93cf19..fb0a0af 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -666,6 +666,7 @@ static u32 atl1_configure(struct atl1_adapter *adapter)
 {
struct atl1_hw *hw = >hw;
u32 value;
+   u16 x;
 
/* clear interrupt status */
iowrite32(0x, adapter->hw.hw_addr + REG_ISR);
@@ -797,6 +798,15 @@ static u32 atl1_configure(struct atl1_adapter *adapter)
iowrite32(value, hw->hw_addr + REG_RXQ_CTRL);
 
/* config DMA Engine */
+   value = ioread32(hw->hw_addr + REG_DEVICE_CTRL);
+   x = (value >> DEVICE_CTRL_MAX_PAYLOAD_SHIFT) &
+   DEVICE_CTRL_MAX_PAYLOAD_MASK;
+   if (x < hw->dmaw_block)
+   hw->dmaw_block = x;
+   x = (value >> DEVICE_CTRL_MAX_RREQ_SZ_SHIFT) &
+   DEVICE_CTRL_MAX_RREQ_SZ_MASK;
+   if (x < hw->dmar_block)
+   hw->dmar_block = x;
value = u32) hw->dmar_block) & DMA_CTRL_DMAR_BURST_LEN_MASK)
<< DMA_CTRL_DMAR_BURST_LEN_SHIFT) |
u32) hw->dmaw_block) & DMA_CTRL_DMAW_BURST_LEN_MASK)
diff --git a/drivers/net/atlx/atlx.h b/drivers/net/atlx/atlx.h
index 3be7c09..43b8531 100644
--- a/drivers/net/atlx/atlx.h
+++ b/drivers/net/atlx/atlx.h
@@ -53,6 +53,12 @@ MODULE_VERSION(ATLX_DRIVER_VERSION);
 
 #define REG_PCIE_CAP_LIST  0x58
 
+#define REG_DEVICE_CTRL0x60
+#define DEVICE_CTRL_MAX_PAYLOAD_MASK   0x7
+#define DEVICE_CTRL_MAX_PAYLOAD_SHIFT  5
+#define DEVICE_CTRL_MAX_RREQ_SZ_MASK   0x7
+#define DEVICE_CTRL_MAX_RREQ_SZ_SHIFT  12
+
 #define REG_VPD_CAP0x6C
 #define VPD_CAP_ID_MASK0xFF
 #define VPD_CAP_ID_SHIFT   0
-- 
1.5.3.3

--
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 00/26] atl1: divide and modernize

2007-12-31 Thread jacliburn

Hello Jeff,

Happy New Year to you and all.

In preparation for a future atl2 driver for the Atheros L2 10/100 chip,
we propose to move the existing atl1 driver to a new directory
(drivers/net/atlx), then split out functions and definitions that both
atl1 and atl2 can share.  The final structure will look like this:

directory or file   status
=== ==
drivers/net/atl1/   deleted
drivers/net/atlx/   new
drivers/net/atlx/atl1.c atl1-specific functions
drivers/net/atlx/atl1.h atl1-specific definitions
drivers/net/atlx/atlx.c atl1-atl2 shared functions
drivers/net/atlx/atlx.h atl1-atl2 shared definitions

The first two patches submitted in this patchset accomplish the relocation
by movng the atl1 driver -- lock, stock, and barrel -- over to
drivers/net/atlx, then splitting out shareable functions and definitions.
Some transitory hackery will be present until the atl2 merge.  Please
overlook it for now.

The remaining 24 patches bring the atl1 driver up to par with the current
vendor driver version 1.2.40.2.  NAPI support is included and it seems
to work, but it needs to be scrutinized by an experienced eye.  I had a
hard time finding much current NAPI documentation, so I just hacked at
it by looking at the e1000 driver.

Patch 02/26 is too large for LKML, so it's available at:

ftp://ftp.hogchain.net/pub/linux/attansic/atlx

Or, alternatively, the whole shebang can be pulled from:

git://git.hogchain.net/home/jcliburn/netdev-2.6.git atl1-for-jeff


Table of contents:
---
0001-atl1-relocate-atl1-driver-to-drivers-net-atlx.patch
0002-atl1-move-common-functions-to-atlx-files.patch
0003-atl1-fix-broken-TSO.patch
0004-atl1-add-ethtool-register-dump.patch
0005-atl1-print-debug-info-if-rrd-error.patch
0006-atl1-update-initialization-parameters.patch
0007-atl1-clarify-max-rx-frame-size.patch
0008-atl1-additional-DMA-engine-configuration.patch
0009-atl1-refactor-tx-processing.patch
0010-atl1-use-csum_start.patch
0011-atl1-refactor-initialization-and-startup.patch
0012-atl1-refactor-atl1_probe.patch
0013-atl1-refactor-interrupt-handling.patch
0014-atl1-move-stray-defines-to-header-file.patch
0015-atl1-tidy-up-ring-management.patch
0016-atl1-modernize-check-link-function.patch
0017-atl1-update-phy-config-function.patch
0018-atl1-make-function-static.patch
0019-atl1-modernize-down-up-functions.patch
0020-atl1-update-change-mtu.patch
0021-atl1-update-atl1_close.patch
0022-atl1-update-netpoll.patch
0023-atl1-update-shutdown-and-remove-functions.patch
0024-atl1-update-wake-on-lan.patch
0025-atl1-add-NAPI-support.patch
0026-atl1-remove-experimental-tag-and-clean-up-comments.patch


Summary diffstat:
---
 drivers/net/Kconfig |   18 +-
 drivers/net/Makefile|2 +-
 drivers/net/atl1/Makefile   |2 -
 drivers/net/atl1/atl1.h |  286 ---
 drivers/net/atl1/atl1_ethtool.c |  505 --
 drivers/net/atl1/atl1_hw.c  |  720 
 drivers/net/atl1/atl1_hw.h  |  946 --
 drivers/net/atl1/atl1_main.c| 2453 --
 drivers/net/atl1/atl1_param.c   |  203 ---
 drivers/net/atlx/Makefile   |1 +
 drivers/net/atlx/atl1.c | 3648 +++
 drivers/net/atlx/atl1.h |  849 +
 drivers/net/atlx/atlx.c |  433 +
 drivers/net/atlx/atlx.h |  533 ++
 14 files changed, 5481 insertions(+), 5118 deletions(-)
 delete mode 100644 drivers/net/atl1/Makefile
 delete mode 100644 drivers/net/atl1/atl1.h
 delete mode 100644 drivers/net/atl1/atl1_ethtool.c
 delete mode 100644 drivers/net/atl1/atl1_hw.c
 delete mode 100644 drivers/net/atl1/atl1_hw.h
 delete mode 100644 drivers/net/atl1/atl1_main.c
 delete mode 100644 drivers/net/atl1/atl1_param.c
 create mode 100644 drivers/net/atlx/Makefile
 create mode 100644 drivers/net/atlx/atl1.c
 create mode 100644 drivers/net/atlx/atl1.h
 create mode 100644 drivers/net/atlx/atlx.c
 create mode 100644 drivers/net/atlx/atlx.h

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


[PATCH 23/26] atl1: update shutdown and remove functions

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Update shutdown and remove functions to conform with the current vendor
driver version 1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   31 +++
 1 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index f09928d..b89201e 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2591,6 +2591,16 @@ static int atl1_close(struct net_device *netdev)
return 0;
 }
 
+static void atl1_force_ps(struct atl1_hw *hw)
+{
+   atl1_write_phy_reg(hw, MII_DBG_ADDR, 0);
+   atl1_write_phy_reg(hw, MII_DBG_DATA, 0x124E);
+   atl1_write_phy_reg(hw, MII_DBG_ADDR, 2);
+   atl1_write_phy_reg(hw, MII_DBG_DATA, 0x3000);
+   atl1_write_phy_reg(hw, MII_DBG_ADDR, 3);
+   atl1_write_phy_reg(hw, MII_DBG_DATA, 0);
+}
+
 #ifdef CONFIG_PM
 static int atl1_suspend(struct pci_dev *pdev, pm_message_t state)
 {
@@ -2878,12 +2888,7 @@ err_request_regions:
 static void __devexit atl1_remove(struct pci_dev *pdev)
 {
struct net_device *netdev = pci_get_drvdata(pdev);
-   struct atl1_adapter *adapter;
-   /* Device not available. Return. */
-   if (!netdev)
-   return;
-
-   adapter = netdev_priv(netdev);
+   struct atl1_adapter *adapter = netdev_priv(netdev);
 
/*
 * Some atl1 boards lack persistent storage for their MAC, and get it
@@ -2896,21 +2901,31 @@ static void __devexit atl1_remove(struct pci_dev *pdev)
atl1_set_mac_addr(>hw);
}
 
-   iowrite16(0, adapter->hw.hw_addr + REG_PHY_ENABLE);
+   set_bit(__ATL1_DOWN, >flags);
+   del_timer_sync(>watchdog_timer);
+   del_timer_sync(>phy_config_timer);
+   flush_scheduled_work();
unregister_netdev(netdev);
+   atl1_force_ps(>hw);
pci_iounmap(pdev, adapter->hw.hw_addr);
pci_release_regions(pdev);
free_netdev(netdev);
pci_disable_device(pdev);
 }
 
+static void atl1_shutdown(struct pci_dev *pdev)
+{
+   atl1_suspend(pdev, PMSG_SUSPEND);
+}
+
 static struct pci_driver atl1_driver = {
.name = ATLX_DRIVER_NAME,
.id_table = atl1_pci_tbl,
.probe = atl1_probe,
.remove = __devexit_p(atl1_remove),
.suspend = atl1_suspend,
-   .resume = atl1_resume
+   .resume = atl1_resume,
+   .shutdown = atl1_shutdown
 };
 
 /*
-- 
1.5.3.3

--
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 11/26] atl1: refactor initialization and startup

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Refactor atl1 initialization and startup to conform with the current
vendor driver version 1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |  507 ---
 drivers/net/atlx/atl1.h |   10 +-
 drivers/net/atlx/atlx.c |1 +
 drivers/net/atlx/atlx.h |   21 ++-
 4 files changed, 284 insertions(+), 255 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 31aad9f..e96f706 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -568,39 +568,6 @@ static u32 atl1_check_link(struct atl1_adapter *adapter)
return 0;
 }
 
-/*
- * atl1_change_mtu - Change the Maximum Transfer Unit
- * @netdev: network interface device structure
- * @new_mtu: new value for maximum frame size
- *
- * Returns 0 on success, negative on failure
- */
-static int atl1_change_mtu(struct net_device *netdev, int new_mtu)
-{
-   struct atl1_adapter *adapter = netdev_priv(netdev);
-   int old_mtu = netdev->mtu;
-   int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
-
-   if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
-   (max_frame > MAX_JUMBO_FRAME_SIZE)) {
-   dev_warn(>pdev->dev, "invalid MTU setting\n");
-   return -EINVAL;
-   }
-
-   adapter->hw.max_frame_size = max_frame;
-   adapter->hw.tx_jumbo_task_th = (max_frame + 7) >> 3;
-   adapter->rx_buffer_len = (max_frame + 7) & ~7;
-   adapter->hw.rx_jumbo_th = adapter->rx_buffer_len / 8;
-
-   netdev->mtu = new_mtu;
-   if ((old_mtu != new_mtu) && netif_running(netdev)) {
-   atl1_down(adapter);
-   atl1_up(adapter);
-   }
-
-   return 0;
-}
-
 static void set_flow_ctrl_old(struct atl1_adapter *adapter)
 {
u32 hi, lo, value;
@@ -1043,6 +1010,7 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter,
 static u16 atl1_alloc_rx_buffers(struct atl1_adapter *adapter)
 {
struct atl1_rfd_ring *rfd_ring = >rfd_ring;
+   struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
struct page *page;
unsigned long offset;
@@ -1052,7 +1020,7 @@ static u16 atl1_alloc_rx_buffers(struct atl1_adapter 
*adapter)
u16 rfd_next_to_use, next_next;
struct rx_free_desc *rfd_desc;
 
-   next_next = rfd_next_to_use = atomic_read(_ring->next_to_use);
+   next_next = rfd_next_to_use = (u16) atomic_read(_ring->next_to_use);
if (++next_next == rfd_ring->count)
next_next = 0;
buffer_info = _ring->buffer_info[rfd_next_to_use];
@@ -1079,7 +1047,7 @@ static u16 atl1_alloc_rx_buffers(struct atl1_adapter 
*adapter)
 * the 14 byte MAC header is removed
 */
skb_reserve(skb, NET_IP_ALIGN);
-
+   skb->dev = netdev;
buffer_info->alloced = 1;
buffer_info->skb = skb;
buffer_info->length = (u16) adapter->rx_buffer_len;
@@ -1767,28 +1735,6 @@ static void atl1_phy_config(unsigned long data)
spin_unlock_irqrestore(>lock, flags);
 }
 
-/*
- * Orphaned vendor comment left intact here:
- * 
- * If TPD Buffer size equal to 0, PCIE DMAR_TO_INT
- * will assert. We do soft reset <0x1400=1> according
- * with the SPEC. BUT, it seemes that PCIE or DMA
- * state-machine will not be reset. DMAR_TO_INT will
- * assert again and again.
- * 
- */
-static void atl1_tx_timeout_task(struct work_struct *work)
-{
-   struct atl1_adapter *adapter =
-   container_of(work, struct atl1_adapter, tx_timeout_task);
-   struct net_device *netdev = adapter->netdev;
-
-   netif_device_detach(netdev);
-   atl1_down(adapter);
-   atl1_up(adapter);
-   netif_device_attach(netdev);
-}
-
 int atl1_reset(struct atl1_adapter *adapter)
 {
int ret;
@@ -1798,48 +1744,40 @@ int atl1_reset(struct atl1_adapter *adapter)
return atl1_init_hw(>hw);
 }
 
-s32 atl1_up(struct atl1_adapter *adapter)
+static s32 atl1_up(struct atl1_adapter *adapter)
 {
struct net_device *netdev = adapter->netdev;
int err;
-   int irq_flags = IRQF_SAMPLE_RANDOM;
+   u32 retval;
 
/* hardware has been reset, we need to reload some things */
+   err = atl1_init_hw(>hw);
+   if (err) {
+   err = -EIO;
+   return err;
+   }
+
atlx_set_multi(netdev);
atl1_init_ring_ptrs(adapter);
atlx_restore_vlan(adapter);
err = atl1_alloc_rx_buffers(adapter);
if (unlikely(!err))
-   /* no RX BUFFER allocated */
+   /* no rx buffer allocated */
return -ENOMEM;
 
if (unlikely(atl1_configure(adapter))) {
err = -EIO;
-   goto err_up;
-   }
-
-   err = pci_enable_msi(adapter->pdev);
-   if (err) {
-   dev_info(>pdev->dev,
-   "Unable to enable 

[PATCH 17/26] atl1: update phy config function

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Update atl1_phy_config() to conform with current vendor driver version
1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index abed547..6432956 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2344,11 +2344,11 @@ static void atl1_phy_config(unsigned long data)
unsigned long flags;
 
spin_lock_irqsave(>lock, flags);
-   adapter->phy_timer_pending = false;
atl1_write_phy_reg(hw, MII_ADVERTISE, hw->mii_autoneg_adv_reg);
atl1_write_phy_reg(hw, MII_ATLX_CR, hw->mii_1000t_ctrl_reg);
atl1_write_phy_reg(hw, MII_BMCR, MII_CR_RESET | MII_CR_AUTO_NEG_EN);
spin_unlock_irqrestore(>lock, flags);
+   clear_bit(0, >cfg_phy);
 }
 
 int atl1_reset(struct atl1_adapter *adapter)
-- 
1.5.3.3

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


[PATCH 09/26] atl1: refactor tx processing

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Refactor tx processing to use a less convoluted tx packet descriptor and
to conform generally with the vendor's current version 1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |  265 +--
 drivers/net/atlx/atl1.h |  201 +++-
 2 files changed, 246 insertions(+), 220 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index fb0a0af..b0c3273 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -1288,8 +1288,6 @@ static void atl1_intr_tx(struct atl1_adapter *adapter)
dev_kfree_skb_irq(buffer_info->skb);
buffer_info->skb = NULL;
}
-   tpd->buffer_addr = 0;
-   tpd->desc.data = 0;
 
if (++sw_tpd_next_to_clean == tpd_ring->count)
sw_tpd_next_to_clean = 0;
@@ -1311,48 +1309,69 @@ static u16 atl1_tpd_avail(struct atl1_tpd_ring 
*tpd_ring)
 }
 
 static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb,
-struct tso_param *tso)
+   struct tx_packet_desc *ptpd)
 {
-   /* We enter this function holding a spinlock. */
-   u8 ipofst;
+   /* spinlock held */
+   u8 hdr_len, ip_off;
+   u32 real_len;
int err;
 
if (skb_shinfo(skb)->gso_size) {
if (skb_header_cloned(skb)) {
err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
if (unlikely(err))
-   return err;
+   return -1;
}
 
if (skb->protocol == ntohs(ETH_P_IP)) {
struct iphdr *iph = ip_hdr(skb);
 
-   iph->tot_len = 0;
+   real_len = (((unsigned char *)iph - skb->data) +
+   ntohs(iph->tot_len));
+   if (real_len < skb->len)
+   pskb_trim(skb, real_len);
+   hdr_len = (skb_transport_offset(skb) + tcp_hdrlen(skb));
+   if (skb->len == hdr_len) {
+   iph->check = 0;
+   tcp_hdr(skb)->check =
+   ~csum_tcpudp_magic(iph->saddr,
+   iph->daddr, tcp_hdrlen(skb),
+   IPPROTO_TCP, 0);
+   ptpd->word3 |= (iph->ihl & TPD_IPHL_MASK) <<
+   TPD_IPHL_SHIFT;
+   ptpd->word3 |= ((tcp_hdrlen(skb) >> 2) &
+   TPD_TCPHDRLEN_MASK) <<
+   TPD_TCPHDRLEN_SHIFT;
+   ptpd->word3 |= 1 << TPD_IP_CSUM_SHIFT;
+   ptpd->word3 |= 1 << TPD_TCP_CSUM_SHIFT;
+   return 1;
+   }
+
iph->check = 0;
tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
-   iph->daddr, 0, IPPROTO_TCP, 0);
-   ipofst = skb_network_offset(skb);
-   if (ipofst != ETH_HLEN) /* 802.3 frame */
-   tso->tsopl |= 1 << TSO_PARAM_ETHTYPE_SHIFT;
-
-   tso->tsopl |= (iph->ihl &
-   TSO_PARAM_IPHL_MASK) << TSO_PARAM_IPHL_SHIFT;
-   tso->tsopl |= ((tcp_hdrlen(skb) >> 2) &
-   TSO_PARAM_TCPHDRLEN_MASK) <<
-   TSO_PARAM_TCPHDRLEN_SHIFT;
-   tso->tsopl |= (skb_shinfo(skb)->gso_size &
-   TSO_PARAM_MSS_MASK) << TSO_PARAM_MSS_SHIFT;
-   tso->tsopl |= 1 << TSO_PARAM_IPCKSUM_SHIFT;
-   tso->tsopl |= 1 << TSO_PARAM_TCPCKSUM_SHIFT;
-   tso->tsopl |= 1 << TSO_PARAM_SEGMENT_SHIFT;
-   return true;
+   iph->daddr, 0, IPPROTO_TCP, 0);
+   ip_off = (unsigned char *)iph -
+   (unsigned char *) skb_network_header(skb);
+   if (ip_off == 8) /* 802.3-SNAP frame */
+   ptpd->word3 |= 1 << TPD_ETHTYPE_SHIFT;
+   else if (ip_off != 0)
+   return -2;
+
+   ptpd->word3 |= (iph->ihl & TPD_IPHL_MASK) <<
+   TPD_IPHL_SHIFT;
+   ptpd->word3 |= ((tcp_hdrlen(skb) >> 2) &
+   TPD_TCPHDRLEN_MASK) << TPD_TCPHDRLEN_SHIFT;
+   ptpd->word3 |= (skb_shinfo(skb)->gso_size &
+   TPD_MSS_MASK) << TPD_MSS_SHIFT;
+   

[PATCH 07/26] atl1: clarify max rx frame size

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

When we initially set max rx frame size, we don't explicitly allow room for
the VLAN header; it's done later in a somewhat obscure fashion.  Let's make
it clear from the top that we've allowed enough room for the VLAN header.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 695dcbc..c93cf19 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -113,7 +113,7 @@ static int __devinit atl1_sw_init(struct atl1_adapter 
*adapter)
struct atl1_hw *hw = >hw;
struct net_device *netdev = adapter->netdev;
 
-   hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
+   hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
hw->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
 
adapter->wol = 0;
@@ -744,8 +744,8 @@ static u32 atl1_configure(struct atl1_adapter *adapter)
/* set Interrupt Clear Timer */
iowrite16(adapter->ict, hw->hw_addr + REG_CMBDISDMA_TIMER);
 
-   /* set MTU, 4 : VLAN */
-   iowrite32(hw->max_frame_size + 4, hw->hw_addr + REG_MTU);
+   /* set MTU size */
+   iowrite32(hw->max_frame_size, hw->hw_addr + REG_MTU);
 
/* jumbo size & rrd retirement timer */
value = (((u32) hw->rx_jumbo_th & RXQ_JMBOSZ_TH_MASK)
-- 
1.5.3.3

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


[PATCH 10/26] atl1: use csum_start

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Use skb->csum_start for tx checksum offload preparation.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index b0c3273..31aad9f 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -1376,16 +1376,17 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, 
struct sk_buff *skb,
u8 css, cso;
 
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
-   cso = skb_transport_offset(skb);
-   css = cso + skb->csum_offset;
-   if (unlikely(cso & 0x1)) {
+   css = (u8) (skb->csum_start - skb_headroom(skb));
+   cso = css + (u8) skb->csum_offset;
+   if (unlikely(css & 0x1)) {
+   /* L1 hardware requires an even number here */
dev_printk(KERN_DEBUG, >pdev->dev,
"payload offset not an even number\n");
return -1;
}
-   ptpd->word3 |= (cso & TPD_PLOADOFFSET_MASK) <<
+   ptpd->word3 |= (css & TPD_PLOADOFFSET_MASK) <<
TPD_PLOADOFFSET_SHIFT;
-   ptpd->word3 |= (css & TPD_CCSUMOFFSET_MASK) <<
+   ptpd->word3 |= (cso & TPD_CCSUMOFFSET_MASK) <<
TPD_CCSUMOFFSET_SHIFT;
ptpd->word3 |= 1 << TPD_CUST_CSUM_EN_SHIFT;
return true;
-- 
1.5.3.3

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


[PATCH 04/26] atl1: add ethtool register dump

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Add the ethtool register dump option to the atl1 driver.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   53 +++
 drivers/net/atlx/atl1.h |1 +
 2 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 4e98c16..239641f 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2513,6 +2513,57 @@ static int atl1_set_wol(struct net_device *netdev,
return 0;
 }
 
+static int atl1_get_regs_len(struct net_device *netdev)
+{
+   return ATL1_REG_COUNT * sizeof(u32);
+}
+
+static void atl1_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
+   void *p)
+{
+   struct atl1_adapter *adapter = netdev_priv(netdev);
+   struct atl1_hw *hw = >hw;
+   unsigned int i;
+   u32 *regbuf = p;
+
+   for (i = 0; i < ATL1_REG_COUNT; i++) {
+   /*
+* This switch statement avoids reserved regions
+* of register space.
+*/
+   switch (i) {
+   case 6 ... 9:
+   case 14:
+   case 29 ... 31:
+   case 34 ... 63:
+   case 75 ... 127:
+   case 136 ... 1023:
+   case 1027 ... 1087:
+   case 1091 ... 1151:
+   case 1194 ... 1195:
+   case 1200 ... 1201:
+   case 1206 ... 1213:
+   case 1216 ... 1279:
+   case 1290 ... 1311:
+   case 1323 ... 1343:
+   case 1358 ... 1359:
+   case 1368 ... 1375:
+   case 1378 ... 1383:
+   case 1388 ... 1391:
+   case 1393 ... 1395:
+   case 1402 ... 1403:
+   case 1410 ... 1471:
+   case 1522 ... 1535:
+   /* reserved region; don't read it */
+   regbuf[i] = 0;
+   break;
+   default:
+   /* unreserved region */
+   regbuf[i] = ioread32(hw->hw_addr + (i * sizeof(u32)));
+   }
+   }
+}
+
 static void atl1_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
 {
@@ -2703,6 +2754,8 @@ const struct ethtool_ops atl1_ethtool_ops = {
.get_drvinfo= atl1_get_drvinfo,
.get_wol= atl1_get_wol,
.set_wol= atl1_set_wol,
+   .get_regs_len   = atl1_get_regs_len,
+   .get_regs   = atl1_get_regs,
.get_ringparam  = atl1_get_ringparam,
.set_ringparam  = atl1_set_ringparam,
.get_pauseparam = atl1_get_pauseparam,
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h
index 538948d..30c5a8d 100644
--- a/drivers/net/atlx/atl1.h
+++ b/drivers/net/atlx/atl1.h
@@ -584,6 +584,7 @@ enum atl1_dma_req_block {
 #define ATL1_DEFAULT_RFD   512
 #define ATL1_MIN_RFD   128
 #define ATL1_MAX_RFD   2048
+#define ATL1_REG_COUNT 1538
 
 #define ATL1_GET_DESC(R, i, type)  (&(((type *)((R)->desc))[i]))
 #define ATL1_RFD_DESC(R, i)ATL1_GET_DESC(R, i, struct rx_free_desc)
-- 
1.5.3.3

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


[PATCH 13/26] atl1: refactor interrupt handling

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Refactor interrupt handling to conform with the current vendor driver
version 1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |  196 ++-
 drivers/net/atlx/atl1.h |   25 +-
 drivers/net/atlx/atlx.c |2 +-
 3 files changed, 114 insertions(+), 109 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index d38f26f..9c86ef4 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -1740,12 +1740,11 @@ next:
return num_alloc;
 }
 
-static void atl1_intr_rx(struct atl1_adapter *adapter)
+static void atl1_clean_rx_irq(struct atl1_adapter *adapter)
 {
+   struct net_device *netdev = adapter->netdev;
int i, count;
-   u16 length;
-   u16 rrd_next_to_clean;
-   u32 value;
+   u16 length, rrd_next_to_clean;
struct atl1_rfd_ring *rfd_ring = >rfd_ring;
struct atl1_rrd_ring *rrd_ring = >rrd_ring;
struct atl1_buffer *buffer_info;
@@ -1754,7 +1753,7 @@ static void atl1_intr_rx(struct atl1_adapter *adapter)
 
count = 0;
 
-   rrd_next_to_clean = atomic_read(_ring->next_to_clean);
+   rrd_next_to_clean = (u16) atomic_read(_ring->next_to_clean);
 
while (1) {
rrd = ATL1_RRD_DESC(rrd_ring, rrd_next_to_clean);
@@ -1795,6 +1794,7 @@ chk_rrd:
/* bad rrd */
dev_printk(KERN_DEBUG, >pdev->dev,
"bad RRD\n");
+
/* see if update RFD index */
if (rrd->num_buf > 1)
atl1_update_rfd_index(adapter, rrd);
@@ -1823,13 +1823,18 @@ rrd_ok:
count++;
 
if (unlikely(rrd->pkt_flg & PACKET_FLAG_ERR)) {
-   if (!(rrd->err_flg &
-   (ERR_FLAG_IP_CHKSUM | ERR_FLAG_L4_CHKSUM
-   | ERR_FLAG_LEN))) {
-   /* packet error, don't need upstream */
-   buffer_info->alloced = 0;
-   rrd->xsz.valid = 0;
-   continue;
+   if (rrd->err_flg & (ERR_FLAG_CRC | ERR_FLAG_TRUNC |
+   ERR_FLAG_CODE | ERR_FLAG_OV)) {
+   if (!(netdev->flags & IFF_PROMISC)) {
+   /* packet error, don't need upstream */
+   buffer_info->alloced = 0;
+   rrd->xsz.valid = 0;
+   dev_printk(KERN_DEBUG,
+   >pdev->dev,
+   "rrd error flag 0x%08X\n",
+   rrd->err_flg);
+   continue;
+   }
}
}
 
@@ -1862,33 +1867,13 @@ rrd_ok:
}
 
atomic_set(_ring->next_to_clean, rrd_next_to_clean);
-
atl1_alloc_rx_buffers(adapter);
 
-   /* update mailbox ? */
-   if (count) {
-   u32 tpd_next_to_use;
-   u32 rfd_next_to_use;
-
-   spin_lock(>mb_lock);
-
-   tpd_next_to_use = atomic_read(>tpd_ring.next_to_use);
-   rfd_next_to_use =
-   atomic_read(>rfd_ring.next_to_use);
-   rrd_next_to_clean =
-   atomic_read(>rrd_ring.next_to_clean);
-   value = ((rfd_next_to_use & MB_RFD_PROD_INDX_MASK) <<
-   MB_RFD_PROD_INDX_SHIFT) |
-((rrd_next_to_clean & MB_RRD_CONS_INDX_MASK) <<
-   MB_RRD_CONS_INDX_SHIFT) |
-((tpd_next_to_use & MB_TPD_PROD_INDX_MASK) <<
-   MB_TPD_PROD_INDX_SHIFT);
-   iowrite32(value, adapter->hw.hw_addr + REG_MAILBOX);
-   spin_unlock(>mb_lock);
-   }
+   if (count)
+   atl1_update_mailbox(adapter);
 }
 
-static void atl1_intr_tx(struct atl1_adapter *adapter)
+static bool atl1_clean_tx_irq(struct atl1_adapter *adapter)
 {
struct atl1_tpd_ring *tpd_ring = >tpd_ring;
struct atl1_buffer *buffer_info;
@@ -1905,7 +1890,7 @@ static void atl1_intr_tx(struct atl1_adapter *adapter)
buffer_info = _ring->buffer_info[sw_tpd_next_to_clean];
if (buffer_info->dma) {
pci_unmap_page(adapter->pdev, buffer_info->dma,
-  buffer_info->length, PCI_DMA_TODEVICE);
+   buffer_info->length, PCI_DMA_TODEVICE);
buffer_info->dma = 0;
}
 
@@ -1922,6 +1907,11 @@ static void atl1_intr_tx(struct atl1_adapter *adapter)
if (netif_queue_stopped(adapter->netdev)
&& 

[PATCH 19/26] atl1: modernize down/up functions

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Update atl1_down() and atl1_up() to conform with the current vendor driver
version 1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   21 -
 drivers/net/atlx/atl1.h |1 -
 drivers/net/atlx/atlx.c |2 +-
 3 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 7697e80..972de34 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2388,7 +2388,6 @@ static s32 atl1_up(struct atl1_adapter *adapter)
}
 
clear_bit(__ATL1_DOWN, >flags);
-   mod_timer(>watchdog_timer, jiffies + (4 * HZ));
retval = ioread32(>hw + REG_MASTER_CTRL);
retval |= MASTER_CTRL_MANUAL_INT;
iowrite32(retval, >hw + REG_MASTER_CTRL);
@@ -2401,21 +2400,18 @@ void atl1_down(struct atl1_adapter *adapter)
 {
struct net_device *netdev = adapter->netdev;
 
-   del_timer_sync(>watchdog_timer);
-   del_timer_sync(>phy_config_timer);
-   adapter->phy_timer_pending = false;
-
-   atlx_irq_disable(adapter);
-   free_irq(adapter->pdev->irq, netdev);
-   pci_disable_msi(adapter->pdev);
+   set_bit(__ATL1_DOWN, >flags);
+   netif_stop_queue(netdev);
atl1_reset_hw(>hw);
adapter->cmb.cmb->int_stats = 0;
-
+   msleep(1);
+   atlx_irq_disable(adapter);
+   del_timer_sync(>watchdog_timer);
+   del_timer_sync(>phy_config_timer);
+   clear_bit(0, >cfg_phy);
+   netif_carrier_off(netdev);
adapter->link_speed = SPEED_0;
adapter->link_duplex = -1;
-   netif_carrier_off(netdev);
-   netif_stop_queue(netdev);
-
atl1_clean_tx_ring(adapter);
atl1_clean_rx_ring(adapter);
 }
@@ -2821,7 +2817,6 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
init_timer(>phy_config_timer);
adapter->phy_config_timer.function = _phy_config;
adapter->phy_config_timer.data = (unsigned long)adapter;
-   adapter->phy_timer_pending = false;
 
INIT_WORK(>reset_task, atl1_reset_task);
INIT_WORK(>link_chg_task, atlx_link_chg_task);
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h
index 1f245e0..5187f74 100644
--- a/drivers/net/atlx/atl1.h
+++ b/drivers/net/atlx/atl1.h
@@ -790,7 +790,6 @@ struct atl1_adapter {
struct work_struct link_chg_task;
struct timer_list watchdog_timer;
struct timer_list phy_config_timer;
-   bool phy_timer_pending;
unsigned long cfg_phy;
 
/* all descriptor rings' memory */
diff --git a/drivers/net/atlx/atlx.c b/drivers/net/atlx/atlx.c
index 18c2d7e..9cc9441 100644
--- a/drivers/net/atlx/atlx.c
+++ b/drivers/net/atlx/atlx.c
@@ -91,7 +91,6 @@ static void atlx_check_for_link(struct atlx_adapter *adapter)
u16 phy_data = 0;
 
spin_lock(>lock);
-   adapter->phy_timer_pending = false;
atlx_read_phy_reg(>hw, MII_BMSR, _data);
atlx_read_phy_reg(>hw, MII_BMSR, _data);
spin_unlock(>lock);
@@ -104,6 +103,7 @@ static void atlx_check_for_link(struct atlx_adapter 
*adapter)
dev_info(>pdev->dev, "%s link is down\n",
netdev->name);
adapter->link_speed = SPEED_0;
+   clear_bit(0, >hw.force_ps);
netif_carrier_off(netdev);
netif_stop_queue(netdev);
}
-- 
1.5.3.3

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


[PATCH 01/26] atl1: relocate atl1 driver to /drivers/net/atlx

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

In preparation for a future Atheros L2 NIC driver (called atl2), relocate
the atl1 driver into a new /drivers/net/atlx directory that will ultimately
be shared with the future atl2 driver.

Signed-off-by: Chris Snook <[EMAIL PROTECTED]>
Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/Makefile  |2 +-
 drivers/net/{atl1 => atlx}/Makefile   |0 
 drivers/net/{atl1 => atlx}/atl1.h |0 
 drivers/net/{atl1 => atlx}/atl1_ethtool.c |0 
 drivers/net/{atl1 => atlx}/atl1_hw.c  |0 
 drivers/net/{atl1 => atlx}/atl1_hw.h  |0 
 drivers/net/{atl1 => atlx}/atl1_main.c|0 
 drivers/net/{atl1 => atlx}/atl1_param.c   |0 
 8 files changed, 1 insertions(+), 1 deletions(-)
 rename drivers/net/{atl1 => atlx}/Makefile (100%)
 rename drivers/net/{atl1 => atlx}/atl1.h (100%)
 rename drivers/net/{atl1 => atlx}/atl1_ethtool.c (100%)
 rename drivers/net/{atl1 => atlx}/atl1_hw.c (100%)
 rename drivers/net/{atl1 => atlx}/atl1_hw.h (100%)
 rename drivers/net/{atl1 => atlx}/atl1_main.c (100%)
 rename drivers/net/{atl1 => atlx}/atl1_param.c (100%)

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 0e5fde4..14acf84 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -13,7 +13,7 @@ obj-$(CONFIG_CHELSIO_T1) += chelsio/
 obj-$(CONFIG_CHELSIO_T3) += cxgb3/
 obj-$(CONFIG_EHEA) += ehea/
 obj-$(CONFIG_BONDING) += bonding/
-obj-$(CONFIG_ATL1) += atl1/
+obj-$(CONFIG_ATL1) += atlx/
 obj-$(CONFIG_GIANFAR) += gianfar_driver.o
 obj-$(CONFIG_TEHUTI) += tehuti.o
 
diff --git a/drivers/net/atl1/Makefile b/drivers/net/atlx/Makefile
similarity index 100%
rename from drivers/net/atl1/Makefile
rename to drivers/net/atlx/Makefile
diff --git a/drivers/net/atl1/atl1.h b/drivers/net/atlx/atl1.h
similarity index 100%
rename from drivers/net/atl1/atl1.h
rename to drivers/net/atlx/atl1.h
diff --git a/drivers/net/atl1/atl1_ethtool.c b/drivers/net/atlx/atl1_ethtool.c
similarity index 100%
rename from drivers/net/atl1/atl1_ethtool.c
rename to drivers/net/atlx/atl1_ethtool.c
diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atlx/atl1_hw.c
similarity index 100%
rename from drivers/net/atl1/atl1_hw.c
rename to drivers/net/atlx/atl1_hw.c
diff --git a/drivers/net/atl1/atl1_hw.h b/drivers/net/atlx/atl1_hw.h
similarity index 100%
rename from drivers/net/atl1/atl1_hw.h
rename to drivers/net/atlx/atl1_hw.h
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atlx/atl1_main.c
similarity index 100%
rename from drivers/net/atl1/atl1_main.c
rename to drivers/net/atlx/atl1_main.c
diff --git a/drivers/net/atl1/atl1_param.c b/drivers/net/atlx/atl1_param.c
similarity index 100%
rename from drivers/net/atl1/atl1_param.c
rename to drivers/net/atlx/atl1_param.c
-- 
1.5.3.3

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


[PATCH 06/26] atl1: update initialization parameters

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Update initialization parameters to match the current vendor driver
version 1.2.40.2.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 262d3ca..695dcbc 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -136,20 +136,20 @@ static int __devinit atl1_sw_init(struct atl1_adapter 
*adapter)
hw->rfd_fetch_gap = 1;
hw->rx_jumbo_th = adapter->rx_buffer_len / 8;
hw->rx_jumbo_lkah = 1;
-   hw->rrd_ret_timer = 16;
-   hw->tpd_burst = 4;
+   hw->rrd_ret_timer = 4;  /* 8 us */
+   hw->tpd_burst = 8;
hw->tpd_fetch_th = 16;
-   hw->txf_burst = 0x100;
+   hw->txf_burst = 0x200;
hw->tx_jumbo_task_th = (hw->max_frame_size + 7) >> 3;
hw->tpd_fetch_gap = 1;
hw->rcb_value = atl1_rcb_64;
hw->dma_ord = atl1_dma_ord_enh;
-   hw->dmar_block = atl1_dma_req_256;
-   hw->dmaw_block = atl1_dma_req_256;
+   hw->dmar_block = atl1_dma_req_1024;
+   hw->dmaw_block = atl1_dma_req_1024;
hw->cmb_rrd = 4;
hw->cmb_tpd = 4;
-   hw->cmb_rx_timer = 1;   /* about 2us */
-   hw->cmb_tx_timer = 1;   /* about 2us */
+   hw->cmb_rx_timer = 2;   /* about 4us */
+   hw->cmb_tx_timer = 256; /* about 512us */
hw->smb_timer = 10; /* about 200ms */
 
spin_lock_init(>lock);
-- 
1.5.3.3

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


[PATCH 05/26] atl1: print debug info if rrd error

2007-12-31 Thread jacliburn
From: Jay Cliburn <[EMAIL PROTECTED]>

Add some debug dev_printks if we encounter a bad receive return descriptor.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>
---
 drivers/net/atlx/atl1.c |   21 -
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 239641f..262d3ca 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -1127,7 +1127,26 @@ static void atl1_intr_rx(struct atl1_adapter *adapter)
if (likely(rrd->xsz.valid)) {   /* packet valid */
 chk_rrd:
/* check rrd status */
-   if (likely(rrd->num_buf == 1))
+   if (rrd->num_buf != 1) {
+   dev_printk(KERN_DEBUG, >pdev->dev,
+   "rx_buf_len = %d\n",
+   adapter->rx_buffer_len);
+   dev_printk(KERN_DEBUG, >pdev->dev,
+   "RRD num_buf = %d\n",
+   rrd->num_buf);
+   dev_printk(KERN_DEBUG, >pdev->dev,
+   "RRD pkt_len = %d\n",
+   rrd->xsz.xsum_sz.pkt_size);
+   dev_printk(KERN_DEBUG, >pdev->dev,
+   "RRD pkt_flg = 0x%08X\n",
+   rrd->pkt_flg);
+   dev_printk(KERN_DEBUG, >pdev->dev,
+   "RRD err_flg = 0x%08X\n",
+   rrd->err_flg);
+   dev_printk(KERN_DEBUG, >pdev->dev,
+   "RRD vlan_tag = 0x%08X\n",
+   rrd->vlan_tag);
+   } else
goto rrd_ok;
 
/* rrd seems to be bad */
-- 
1.5.3.3

--
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: SATA kernel-buffered read VERY slow (not raid, Promise TX300 card); 2.6.23.1(vanilla)

2007-12-31 Thread Holger Hoffstaette
On Mon, 31 Dec 2007 16:19:26 -0800, Linda Walsh wrote:

> [snip]
> Another new "problem" (not as important) -- even though SATA disks are
> called with "sdX", my ATA disks that *were* at hda-hdc are now at hde-hdg.
> Devices hda-hdd are not populated in my dev directory on bootup.  Of

I think this is because the Promise SATA card also has one or more PATA
channels, so if the card is activated it takes precedence over your old
controller. But it should only be one channel, not four?
As for the other problem - I plan on adding such a card to one of my
systems during the week and might be able to contribute some findings.

Holger


--
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 1/2] ssb: add 'ssb_pcihost_set_power_state' function

2007-12-31 Thread Michael Buesch
On Tuesday 01 January 2008 01:16:46 Miguel Botón wrote:
> This patch adds the 'ssb_pcihost_set_power_state' function.
> 
> This function allows us to set the power state of a PCI device
> (for example b44 ethernet device). 
> 
> Signed-off-by: Miguel Botón <[EMAIL PROTECTED]>

Acked-by: Michael Buesch <[EMAIL PROTECTED]>

> 
> diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
> index a21ab29..aa70fd0 100644
> --- a/include/linux/ssb/ssb.h
> +++ b/include/linux/ssb/ssb.h
> @@ -349,6 +349,13 @@ static inline void ssb_pcihost_unregister(struct 
> pci_driver *driver)
>  {
>   pci_unregister_driver(driver);
>  }
> +
> +static inline
> +void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
> +{
> + if (sdev->bus->bustype == SSB_BUSTYPE_PCI)
> + pci_set_power_state(sdev->bus->host_pci, state);
> +}
>  #endif /* CONFIG_SSB_PCIHOST */
>  
>  
> 



-- 
Greetings Michael.
--
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: Recursive variable `KBUILD_CFLAGS' references itself (eventually).

2007-12-31 Thread Sam Ravnborg
On Mon, Dec 31, 2007 at 11:10:21AM -0500, Dave Jones wrote:
> On Mon, Dec 31, 2007 at 02:16:19PM +0100, Sam Ravnborg wrote:
> 
>  > > Trying to do a 32bit build on a 64bit machine.
>  > > I did..
>  > >   make ARCH=i386 oldconfig
>  > >   make ARCH=i386 arch/x86/
>  > 
>  > Walking through my mailbox I found this one.
>  > I did not get similar reports and I cannot reproduce it.
>  > Do you continue to see this or had it been fixed somehow?
> 
> Still happens for me with the latest tree from git.
> 
> $ make ARCH=i386 arch/x86/
>   HOSTCC  scripts/kconfig/conf.o
>   HOSTLD  scripts/kconfig/conf
> scripts/kconfig/conf -s arch/x86/Kconfig
>   CHK include/linux/version.h
>   CHK include/linux/utsrelease.h
>   UPD include/linux/utsrelease.h
>   CALLscripts/checksyscalls.sh
> /mnt/raid0/src/linux-2.6/arch/x86/Makefile_32:43: *** Recursive variable 
> `KBUILD_CFLAGS' references itself (eventually).  Stop.
> make: *** [arch/x86/] Error 2

Can reproduce it now. Will take a look tomorrow.

Sam
--
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: SATA kernel-buffered read VERY slow (not raid, Promise TX300 card); 2.6.23.1(vanilla)

2007-12-31 Thread Robert Hancock

Linda Walsh wrote:

Robert Hancock wrote:
Have you tried using a different block size to see how that effects 
the results? There might be some funny interaction there.


   There is some interaction with the large block size (but only on the 
SATA
disk).  Counts were adjusted to keep the read near 2G (~2x physical 
memory).

 From 1k-16k block sizes, I got into the low-mid 40MB/s on buffered SATA
(compared to 50-60MB/s on ATA & SCSI).  Starting at 32k-64k, the read
rate began falling and at 128k block-reads-at-a-time or larger, it drops 
below

20MB/s (again, only on buffered SATA).   It's hard to imagine what would
slow down buffered SATA reads but not ATA and SCSI reads of the same
size.  I'm using the 'cfq' scheduler with everything running at default
priorities, but again, why only SATA slowness?  It seems that at the driver
level, using direct reads, the SATA disk has the highest read rate (near
80MB/s).
   It would certainly be perverse to have faster driver & device 
performance

equate to lower buffered I/O.


Not too sure on that one. I suspect one might have to trace the actual 
requests being received at the driver level somehow with buffered reads 
in order to diagnose what's going on there..





I wanted to use the newer pata support in the SATA lib, but
got frustrated "real fast" by the lack of disk-parameter support
in the new pata library (hdparm is mostly broken; and the SCSI
utils aren't really intended for ATA(or SATA?) disks using the
SCSI interface.


It's somewhat intentional that some of the hdparm commands (like for 
settting transfer modes, enable/disable DMA, etc.) don't work with 
libata. Most of them aren't necessary at all as correct DMA settings, 
etc. should always be set automatically (if not, please report as a bug).

---
   The only way I could tell before was using hdparm to read the 
parameters.
Since that doesn't work, it's hard to tell if they are set correctly, 
but given

the high performance at the device driver level, I'm guessing the params
are set correctly.


The settings in use should be reported in dmesg.






Since SATA's use ATA-7 (or at least the Seagate disk I
acquired seems to), shouldn't most of the hdparm commands
be functional on the SATA hardware as much as they would
be on PATA?  Or...maybe said a different way, is there
an "sdparm" that is to SATA what hdparm is to PATA?


It's the same libata code, so the same applies to some of the hdparm 
commands not being implemented, as above.

---
   Hmm... might be nice as an "RFE" to at least have the 'read-status'
commands work to see what the params are set to.
   More importantly, how does one set parameters for acoustic and power
saving parameters?  Some of my disks are used as 'backup' devices for my
other computers.  With the ATA disks, they were kept "spun down" when not
being used (only used, 'normally', in early AM hours).


I believe those hdparm commands for power-save and AAM are supposed to 
work (they just issue an ATA command to the disk). The ones that aren't 
implemented are the ones that actually commanded the IDE layer, like DMA 
on/off.




   Another new "problem" (not as important) -- even though SATA disks are
called with "sdX", my ATA disks that *were* at hda-hdc are now at hde-hdg.
Devices hda-hdd are not populated in my dev directory on bootup.  Of course
this throws off boot-scripts that set diskparams by "hd" and not
by label (using hdparm).  Seems like the SATA disks are suffering a partial
identity problem -- seeming to reserve hda-hdd, but using the "sd" disk 
names.

Is that a known problem?  If not, I'll add it to my queue for bug-filing...


Could be a udev problem, as it's what does the device naming..

--
Robert Hancock  Saskatoon, SK, Canada
To email, remove "nospam" from [EMAIL PROTECTED]
Home Page: http://www.roberthancock.com/

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


[PATCH 1/2] ssb: add 'ssb_pcihost_set_power_state' function

2007-12-31 Thread Miguel Botón
This patch adds the 'ssb_pcihost_set_power_state' function.

This function allows us to set the power state of a PCI device
(for example b44 ethernet device). 

Signed-off-by: Miguel Botón <[EMAIL PROTECTED]>

diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index a21ab29..aa70fd0 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -349,6 +349,13 @@ static inline void ssb_pcihost_unregister(struct 
pci_driver *driver)
 {
pci_unregister_driver(driver);
 }
+
+static inline
+void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
+{
+   if (sdev->bus->bustype == SSB_BUSTYPE_PCI)
+   pci_set_power_state(sdev->bus->host_pci, state);
+}
 #endif /* CONFIG_SSB_PCIHOST */
 
 

-- 
Miguel Botón
--
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/2] b44: power down PHY when interface down

2007-12-31 Thread Miguel Botón
This is just this patch (http://lkml.org/lkml/2007/7/1/51) but adapted
to the 'b44' ssb driver.

Signed-off-by: Miguel Botón <[EMAIL PROTECTED]>

diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 49e9172..ea2a2b5 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -128,6 +128,8 @@ static void b44_init_rings(struct b44 *);
 #define B44_FULL_RESET 1
 #define B44_FULL_RESET_SKIP_PHY2
 #define B44_PARTIAL_RESET  3
+#define B44_CHIP_RESET_FULL4
+#define B44_CHIP_RESET_PARTIAL 5
 
 static void b44_init_hw(struct b44 *, int);
 
@@ -1259,7 +1261,7 @@ static void b44_clear_stats(struct b44 *bp)
 }
 
 /* bp->lock is held. */
-static void b44_chip_reset(struct b44 *bp)
+static void b44_chip_reset(struct b44 *bp, int reset_kind)
 {
struct ssb_device *sdev = bp->sdev;
 
@@ -1281,6 +1283,13 @@ static void b44_chip_reset(struct b44 *bp)
ssb_device_enable(bp->sdev, 0);
b44_clear_stats(bp);
 
+   /*
+* Don't enable PHY if we are doing a partial reset
+* we are probably going to power down
+*/
+   if (reset_kind == B44_CHIP_RESET_PARTIAL)
+   return;
+
switch (sdev->bus->bustype) {
case SSB_BUSTYPE_SSB:
bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
@@ -1316,7 +1325,14 @@ static void b44_chip_reset(struct b44 *bp)
 static void b44_halt(struct b44 *bp)
 {
b44_disable_ints(bp);
-   b44_chip_reset(bp);
+   /* reset PHY */
+   b44_phy_reset(bp);
+   /* power down PHY */
+   printk(KERN_INFO PFX "%s: powering down PHY\n", bp->dev->name);
+   bw32(bp, B44_MAC_CTRL, MAC_CTRL_PHY_PDOWN);
+   /* now reset the chip, but without enabling the MAC
+* part of it. This has to be done _after_ we shut down the PHY */
+   b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
 }
 
 /* bp->lock is held. */
@@ -1365,7 +1381,7 @@ static void b44_init_hw(struct b44 *bp, int reset_kind)
 {
u32 val;
 
-   b44_chip_reset(bp);
+   b44_chip_reset(bp, B44_CHIP_RESET_FULL);
if (reset_kind == B44_FULL_RESET) {
b44_phy_reset(bp);
b44_setup_phy(bp);
@@ -1422,7 +1438,7 @@ static int b44_open(struct net_device *dev)
err = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev);
if (unlikely(err < 0)) {
napi_disable(>napi);
-   b44_chip_reset(bp);
+   b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
b44_free_rings(bp);
b44_free_consistent(bp);
goto out;
@@ -2188,7 +2204,7 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
/* Chip reset provides power to the b44 MAC & PCI cores, which
 * is necessary for MAC register access.
 */
-   b44_chip_reset(bp);
+   b44_chip_reset(bp, B44_CHIP_RESET_FULL);
 
printk(KERN_INFO "%s: Broadcom 44xx/47xx 10/100BaseT Ethernet %s\n",
   dev->name, print_mac(mac, dev->dev_addr));
@@ -2212,6 +2228,7 @@ static void __devexit b44_remove_one(struct ssb_device 
*sdev)
unregister_netdev(dev);
ssb_bus_may_powerdown(sdev->bus);
free_netdev(dev);
+   ssb_pcihost_set_power_state(sdev, PCI_D3hot);
ssb_set_drvdata(sdev, NULL);
 }
 
@@ -2240,6 +2257,7 @@ static int b44_suspend(struct ssb_device *sdev, 
pm_message_t state)
b44_setup_wol(bp);
}
 
+   ssb_pcihost_set_power_state(sdev, PCI_D3hot);
return 0;
 }
 

-- 
Miguel Botón
--
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: SATA kernel-buffered read VERY slow (not raid, Promise TX300 card); 2.6.23.1(vanilla)

2007-12-31 Thread Linda Walsh

Robert Hancock wrote:
Have you tried using a different block size to see how that effects 
the results? There might be some funny interaction there.


   There is some interaction with the large block size (but only on the 
SATA

disk).  Counts were adjusted to keep the read near 2G (~2x physical memory).
From 1k-16k block sizes, I got into the low-mid 40MB/s on buffered SATA
(compared to 50-60MB/s on ATA & SCSI).  Starting at 32k-64k, the read
rate began falling and at 128k block-reads-at-a-time or larger, it drops 
below

20MB/s (again, only on buffered SATA).   It's hard to imagine what would
slow down buffered SATA reads but not ATA and SCSI reads of the same
size.  I'm using the 'cfq' scheduler with everything running at default
priorities, but again, why only SATA slowness?  It seems that at the driver
level, using direct reads, the SATA disk has the highest read rate (near
80MB/s). 

   It would certainly be perverse to have faster driver & device 
performance

equate to lower buffered I/O.



I wanted to use the newer pata support in the SATA lib, but
got frustrated "real fast" by the lack of disk-parameter support
in the new pata library (hdparm is mostly broken; and the SCSI
utils aren't really intended for ATA(or SATA?) disks using the
SCSI interface.


It's somewhat intentional that some of the hdparm commands (like for 
settting transfer modes, enable/disable DMA, etc.) don't work with 
libata. Most of them aren't necessary at all as correct DMA settings, 
etc. should always be set automatically (if not, please report as a bug).

---
   The only way I could tell before was using hdparm to read the 
parameters.
Since that doesn't work, it's hard to tell if they are set correctly, 
but given

the high performance at the device driver level, I'm guessing the params
are set correctly.




Since SATA's use ATA-7 (or at least the Seagate disk I
acquired seems to), shouldn't most of the hdparm commands
be functional on the SATA hardware as much as they would
be on PATA?  Or...maybe said a different way, is there
an "sdparm" that is to SATA what hdparm is to PATA?


It's the same libata code, so the same applies to some of the hdparm 
commands not being implemented, as above.

---
   Hmm... might be nice as an "RFE" to at least have the 'read-status'
commands work to see what the params are set to. 


   More importantly, how does one set parameters for acoustic and power
saving parameters?  Some of my disks are used as 'backup' devices for my
other computers.  With the ATA disks, they were kept "spun down" when not
being used (only used, 'normally', in early AM hours).

   Another new "problem" (not as important) -- even though SATA disks are
called with "sdX", my ATA disks that *were* at hda-hdc are now at hde-hdg.
Devices hda-hdd are not populated in my dev directory on bootup.  Of course
this throws off boot-scripts that set diskparams by "hd" and not
by label (using hdparm).  Seems like the SATA disks are suffering a partial
identity problem -- seeming to reserve hda-hdd, but using the "sd" disk 
names.

Is that a known problem?  If not, I'll add it to my queue for bug-filing...

thanks,
Linda

 


--
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] alsa: fix compilation warning in GCC

2007-12-31 Thread Miguel Botón
This is just a little patch to shut up GCC.

'snd_shutdown_f_ops' is not a pointer so its address will never be NULL.
GCC will complain because 'fops_get' will do an unnecessary check because
'_shutdown_f_ops' is always true.

Signed-off-by: Miguel Botón <[EMAIL PROTECTED]>

diff --git a/sound/core/init.c b/sound/core/init.c
index 48d38a7..2215ba8 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -340,8 +340,8 @@ int snd_card_disconnect(struct snd_card *card)
list_add(>shutdown_list, _files);
spin_unlock(_lock);
 
-   fops_get(_shutdown_f_ops);
mfile->file->f_op = _shutdown_f_ops;
+   fops_get(mfile->file->f_op);

mfile = mfile->next;
}

-- 
Miguel Botón
--
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] x86: provide a DMI based port 0x80 I/O delay override

2007-12-31 Thread H. Peter Anvin

Alan Cox wrote:

However, assuming a bus clock of 6 MHz should be safe (167 ns).


Agreed - or ISA timings directly. Boxes using WD80x3 are not going to
have a TSC so might as well stick with port 0x80 as they have done just
fine for the past 15 years.

None of this really helps with *memory-mapped* 8390, though, since 
memory mapped writes can be posted.  Putting any IOIO transaction in the 


ISA isn't posted only PCI.

PCI 8390 clones seem to be a mix of ASICs and 8390x chips with
some quite disgusting FPGA glue logic.



ISA isn't posted no, but on several chipsets the upstream PCI bus will 
post MMIO writes to ISA space regardless of the spec.


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


Re: [PATCH] x86: provide a DMI based port 0x80 I/O delay override

2007-12-31 Thread Alan Cox
> However, assuming a bus clock of 6 MHz should be safe (167 ns).

Agreed - or ISA timings directly. Boxes using WD80x3 are not going to
have a TSC so might as well stick with port 0x80 as they have done just
fine for the past 15 years.

> None of this really helps with *memory-mapped* 8390, though, since 
> memory mapped writes can be posted.  Putting any IOIO transaction in the 

ISA isn't posted only PCI.

PCI 8390 clones seem to be a mix of ASICs and 8390x chips with
some quite disgusting FPGA glue logic.

Alan
--
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: getting rid of filp search in fs_may_remount_ro()

2007-12-31 Thread Dave Hansen
On Mon, 2007-12-31 at 11:54 -0800, Dave Hansen wrote:
> On Wed, 2007-12-26 at 15:12 +0100, Christoph Hellwig wrote:
> > Btw, I just noticed in current -mm fs_may_remount_ro() is still around
> > and not replaced by ther per-sb writers count.  That surely sounds like
> > some kind of mismerge..
> 
> I was actually leaving that for later.  Getting rid of the filp search
> is a great benefit of the r/o bind patches, but it isn't strictly
> necessary and it doesn't really hurt anything to keep it.
> 
> The reason that it was contentious was that we need some way to be able
> to do an sb-to-mount mapping.  When remounting the sb, we need to
> determine whether *any* of the mounts of that sb have any writers.
> 
> We don't currently have any mechanisms to do direct lookups from sb to
> mount.  The only alternative I can see right now is to walk over all
> tasks, then walk over all vfs namespaces, and walk each mount tree to
> see if any mounts are of the sb we're looking for.  This needs to be
> done while already holding the mnt_writers[] locks so that no new mnt
> writers can come in.
> 
> *THAT* is going to be a heavyweight operation.  I need to go look in
> detail at how the mount trees are kept, and we'll need some kind of
> mechanism to keep track of which vfs namespaces we've looked at during
> the search so we don't search them twice. 
> 
> Can you think of a simpler way to do it?

Here's one blatantly untested idea I have.  The idea is to keep track if
anyone might be writing to a mnt.  We keep track on a flag in the mnt.
When we set the flag, we increment a counter in the sb and decrement
when the flag is cleared.

We can't simply look at mnt->__mnt_writers because there might be
"checked-out" writers in the mnt_writers[] array.  We also have to keep
new writers from coming in while we do this, so we use the spinlocks in
the mnt_writers[] array for exclusion.  This is a pretty heavyweight
lock, but it only gets used at rw->ro transitions.

-- Dave

--- ./fs/file_table.c.orig  2007-12-31 11:14:59.0 -0800
+++ ./fs/file_table.c   2007-12-31 14:38:19.0 -0800
@@ -376,26 +376,12 @@
 
 int fs_may_remount_ro(struct super_block *sb)
 {
-   struct file *file;
-
-   /* Check that no files are currently opened for writing. */
-   file_list_lock();
-   list_for_each_entry(file, >s_files, f_u.fu_list) {
-   struct inode *inode = file->f_path.dentry->d_inode;
-
-   /* File with pending delete? */
-   if (inode->i_nlink == 0)
-   goto too_bad;
-
-   /* Writeable file? */
-   if (S_ISREG(inode->i_mode) && (file->f_mode & FMODE_WRITE))
-   goto too_bad;
-   }
-   file_list_unlock();
-   return 1; /* Tis' cool bro. */
-too_bad:
-   file_list_unlock();
-   return 0;
+   int ret = 1;
+   lock_mnt_writers();
+   if (atomic_read(>__s_mnt_writers))
+   ret = 0;
+   unlock_mnt_writers();
+   return ret;
 }
 
 void __init files_init(unsigned long mempages)
--- ./fs/namespace.c.orig   2007-12-31 13:52:36.0 -0800
+++ ./fs/namespace.c2007-12-31 14:53:56.0 -0800
@@ -138,7 +138,7 @@
 }
 fs_initcall(init_mnt_writers);
 
-static void mnt_unlock_cpus(void)
+void mnt_unlock_cpus(void)
 {
int cpu;
struct mnt_writer *cpu_writer;
@@ -149,6 +149,22 @@
}
 }
 
+static void mark_mnt_has_writer(struct vfsmount *mnt)
+{
+   if (!test_and_set_bit(ilog2(MNT_MAY_HAVE_WRITERS), >mnt_flags))
+   atomic_inc(>mnt_sb->s_possible_mnt_writers);
+}
+
+static void check_mnt_for_writers(struct vfsmount *mnt)
+{
+   int bitnr = ilog2(MNT_MAY_HAVE_WRITERS);
+
+   if (atomic_read(>__mnt_writers))
+   mark_mnt_has_writer(mnt);
+   else if (test_and_clear_bit(bitnr, >mnt_flags))
+   atomic_dec(>mnt_sb->s_possible_mnt_writers);
+}
+
 static inline void __clear_mnt_count(struct mnt_writer *cpu_writer)
 {
if (!cpu_writer->mnt)
@@ -199,6 +215,7 @@
}
use_cpu_writer_for_mount(cpu_writer, mnt);
cpu_writer->count++;
+   mark_mnt_has_writer(mnt);
 out:
spin_unlock(_writer->lock);
put_cpu_var(mnt_writers);
@@ -215,11 +232,33 @@
cpu_writer = _cpu(mnt_writers, cpu);
spin_lock(_writer->lock);
__clear_mnt_count(cpu_writer);
+   /*
+* __mnt_writers may temporarily hit zero
+* (and trigger MNT_MAY_HAVE_WRITERS to get
+* cleared), but it will get set again if
+* and when another mnt_writer[] has an
+* entry for that mnt later in this loop.
+*/
+   check_mnt_has_writers(cpu_writer->mnt);
cpu_writer->mnt = NULL;
}
 }
 
 /*
+ * This is just an external interface.  I want
+ * to use the long names in here, but leave the
+ * simpler names for external users.
+ 

[PATCH] [2.6.24] Add PPC nvram ioctls to compat_ioctl

2007-12-31 Thread Olof Johansson
Fix the following console warning when running 'nvsetenv', and makes
setting of new variables work again:

ioctl32(nvsetenv:4022): Unknown cmd fd(3) cmd(20007043){t:'p';sz:0}
arg(0003) on /dev/nvram

That's the IOC_NVRAM_SYNC call.


Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>

diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index e8b7c3a..7be6765 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -113,6 +113,10 @@
 #include 
 #endif
 
+#ifdef CONFIG_PPC
+#include 
+#endif
+
 static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
  unsigned long arg, struct file *f)
 {
@@ -2859,6 +2863,13 @@ IGNORE_IOCTL(FBIOGETCMAP32)
 IGNORE_IOCTL(FBIOSCURSOR32)
 IGNORE_IOCTL(FBIOGCURSOR32)
 #endif
+
+#ifdef CONFIG_PPC
+/* PPC-specific NVRAM IOCTLs */
+COMPATIBLE_IOCTL(OBSOLETE_PMAC_NVRAM_GET_OFFSET)
+COMPATIBLE_IOCTL(IOC_NVRAM_GET_OFFSET)
+COMPATIBLE_IOCTL(IOC_NVRAM_SYNC)
+#endif
 };
 
 #define IOCTL_HASHSIZE 256
--
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 -mm] crypto: scatterwalk.h needs sched.h

2007-12-31 Thread Herbert Xu
On Mon, Dec 31, 2007 at 10:05:39AM -0800, Randy Dunlap wrote:
> From: Randy Dunlap <[EMAIL PROTECTED]>
> 
> When CONFIG_PREEMPT_NONE=y, scatterwalk.h still uses cond_resched()
> so it needs to include sched.h:

Thanks.  This is already in cryptodev-2.6.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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] Force UNIX domain sockets to be built in

2007-12-31 Thread Jan Engelhardt

On Dec 31 2007 18:43, Patrick Mau wrote:
>
>May I ask something that might be obvious for most of the
>development community:
>
>Modules have to be loaded in seperate pages, right ?

That seems to be the case, judging from /proc/modules always ending in 000,
meaning each module is aligned at 0x1000 (4096, a page on i386).

Additionally, it looks like 48% of all kernel symbols (from System.map)
are aligned to 16 byte boundaries (what a waste! ;-))
--
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 1/2] configfs: dir.c fix possible recursive locking

2007-12-31 Thread Joel Becker
On Wed, Dec 26, 2007 at 12:09:57PM +0900, Joonwoo Park wrote:
> configfs_register_subsystem() with default_groups triggers recursive locking.
> it seems that mutex_lock_nested is needed.

Thanks for the work, I've added these to my tree.

Joel

> =
> [ INFO: possible recursive locking detected ]
> 2.6.24-rc6 #141
> -
> swapper/1 is trying to acquire lock:
>  (>s_type->i_mutex_key#3){--..}, at: [] 
> configfs_attach_group+0x4f/0x190
> 
> but task is already holding lock:
>  (>s_type->i_mutex_key#3){--..}, at: [] 
> configfs_register_subsystem+0x55/0x130
> 
> other info that might help us debug this:
> 1 lock held by swapper/1:
>  #0:  (>s_type->i_mutex_key#3){--..}, at: [] 
> configfs_register_subsystem+0x55/0x130
> 
> stack backtrace:
> Pid: 1, comm: swapper Not tainted 2.6.24-rc6 #141
>  [] show_trace_log_lvl+0x1a/0x30
>  [] show_trace+0x12/0x20
>  [] dump_stack+0x6e/0x80
>  [] __lock_acquire+0xe62/0x1120
>  [] lock_acquire+0x82/0xa0
>  [] mutex_lock_nested+0x98/0x2e0
>  [] configfs_attach_group+0x4f/0x190
>  [] configfs_register_subsystem+0xc6/0x130
>  [] init_netconsole+0x2b6/0x300
>  [] kernel_init+0x142/0x320
>  [] kernel_thread_helper+0x7/0x14
>  ===
> 
> Signed-off-by: Joonwoo Park <[EMAIL PROTECTED]>
> ---
>  fs/configfs/dir.c |5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
> index 50ed691..a48dc7d 100644
> --- a/fs/configfs/dir.c
> +++ b/fs/configfs/dir.c
> @@ -546,7 +546,7 @@ static int populate_groups(struct config_group *group)
>* That said, taking our i_mutex is closer to mkdir
>* emulation, and shouldn't hurt.
>*/
> - mutex_lock(>d_inode->i_mutex);
> + mutex_lock_nested(>d_inode->i_mutex, I_MUTEX_CHILD);
>  
>   for (i = 0; group->default_groups[i]; i++) {
>   new_group = group->default_groups[i];
> @@ -1405,7 +1405,8 @@ int configfs_register_subsystem(struct 
> configfs_subsystem *subsys)
>   sd = configfs_sb->s_root->d_fsdata;
>   link_group(to_config_group(sd->s_element), group);
>  
> - mutex_lock(_sb->s_root->d_inode->i_mutex);
> + mutex_lock_nested(_sb->s_root->d_inode->i_mutex,
> + I_MUTEX_PARENT);
>  
>   name.name = group->cg_item.ci_name;
>   name.len = strlen(name.name);
> ---
> 
> Thanks.
> Joonwoo
> 

-- 

"One of the symptoms of an approaching nervous breakdown is the
 belief that one's work is terribly important."
 - Bertrand Russell 

Joel Becker
Principal Software Developer
Oracle
E-mail: [EMAIL PROTECTED]
Phone: (650) 506-8127
--
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.24-rc6-mm1 - git-lblnet.patch and networking horkage

2007-12-31 Thread Paul Moore
On Monday 31 December 2007 4:46:09 pm James Morris wrote:
> On Mon, 31 Dec 2007, Paul Moore wrote:
> > I'm pretty certain this is an uninitialized value problem now and not a
> > use-after-free issue.  The invalid/garbage ->iif value seems to only
> > happen on packets that are generated locally and sent back into the stack
> > for local consumption, e.g. loopback.  These local packets also need to
> > have been cloned at some point, either on the output or input path.
>
> I think we need to find out exactly what's happening, first.

The more I've looked at the code this afternoon, I'm certain this is the case.  
I've also been running a patched kernel (using option #2 from below) and all 
of the skbs coming up the stack have valid ->iif values.  Granted, I haven't 
examined the code from the avahi daemon or the tcl test cases and traced the 
entire code path through the kernel but I _am_ certain that at some point in 
that code path the packet is cloned and due to a problem in skb_clone() 
the ->iif field is not copied correctly causing the problems we have all 
seen.

How much smoke needs to be coming from the gun? :)

> > The problem appears to be a skb_clone() function which does not clear the
> > skb structure properly and fails to copy the ->iif value from the
> > original skb to the cloned skb.  From what I can tell, there are two
> > possible solutions to this problem:
> >
> >  1. Clear all of the cloned skb fields in skb_clone() via memset()
>
> Sounds like it's not going to fly for performance reasons in any case.

That was my gut feeling.  I was also a little unsure where exactly the correct 
placement should be for the memset() call.

> >  2. Copy the ->iif field in __copy_skb_header()
>
> Seems valid.

Okay, I'll stick with this approach.  I'll post a patch backed against 
net-2.6.25 tomorrow as an RFC to see if anyone on netdev has any strong 
feelings.  If no one complains, I'll add it to the lblnet git tree.

-- 
paul moore
linux security @ hp
--
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] x86: provide a DMI based port 0x80 I/O delay override

2007-12-31 Thread H. Peter Anvin

Alan Cox wrote:
What about HP PCLan 16/TP+ cards? I have one that runs 24/7 in a 486 box 
(2.6.20.6 kernel) and one spare. It has some VLSI HP chip and also ST-NIC 
DP83902AV - is that a good candidate for testing?


What are you trying to test. The documentation explicitly says you need
the delays and that the delays are in bus clocks not microseconds. That
means the existing code is correct and it needs a delay dependant on the
ISA bus clock frequency (somewhere between 6 and 12MHz). Note that the
delay depends on the bus clock frequency not time.

We don't do overclocking, we don't support overclocking, please do not
overclock your ethernet chip.



However, assuming a bus clock of 6 MHz should be safe (167 ns).

4 bus clocks would be 667 ns, or we can round it up to 1 ms to deal with 
bus delay effects.


None of this really helps with *memory-mapped* 8390, though, since 
memory mapped writes can be posted.  Putting any IOIO transaction in the 
middle has the effect of flushing the posting queues; an MMIO read would 
  also work.  The WD80x3 cards were memory-mapped, in particular (and 
were some of the very first cards supported by Linux.)


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


Re: 2.6.24-rc6-mm1 - git-lblnet.patch and networking horkage

2007-12-31 Thread James Morris
On Mon, 31 Dec 2007, Paul Moore wrote:

> I'm pretty certain this is an uninitialized value problem now and not a 
> use-after-free issue.  The invalid/garbage ->iif value seems to only happen 
> on packets that are generated locally and sent back into the stack for local 
> consumption, e.g. loopback.  These local packets also need to have been 
> cloned at some point, either on the output or input path.

I think we need to find out exactly what's happening, first.

> The problem appears to be a skb_clone() function which does not clear the skb 
> structure properly and fails to copy the ->iif value from the original skb to 
> the cloned skb.  From what I can tell, there are two possible solutions to 
> this problem:
> 
>  1. Clear all of the cloned skb fields in skb_clone() via memset()

Sounds like it's not going to fly for performance reasons in any case.

>  2. Copy the ->iif field in __copy_skb_header()

Seems valid.


- James
-- 
James Morris
<[EMAIL PROTECTED]>
--
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] x86: provide a DMI based port 0x80 I/O delay override

2007-12-31 Thread Alan Cox
> What about HP PCLan 16/TP+ cards? I have one that runs 24/7 in a 486 box 
> (2.6.20.6 kernel) and one spare. It has some VLSI HP chip and also ST-NIC 
> DP83902AV - is that a good candidate for testing?

What are you trying to test. The documentation explicitly says you need
the delays and that the delays are in bus clocks not microseconds. That
means the existing code is correct and it needs a delay dependant on the
ISA bus clock frequency (somewhere between 6 and 12MHz). Note that the
delay depends on the bus clock frequency not time.

We don't do overclocking, we don't support overclocking, please do not
overclock your ethernet chip.

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


IDE/ACPI related hibernation regression: Second attempt fails

2007-12-31 Thread Mikko Vinni
Hi,

I noticed my ancient laptop (HP nx9005) fails to hibernate (suspend to disk) 
more than once while running recent 2.6.24-rc kernels. First hibernation 
succeeds happily, but when I try to do it again after resuming, the machine 
hangs immediately after the familiar two pops from the speakers."Hanging" in 
this case means that none of the usual keys work (e.g. Caps Lock led doesn't 
toggle), but alt-sysrq-b does reboot the laptop.

I tried my skills at bisecting and found that reverting the following patch 
allows my laptop to hibernate two (and probably more) times in a row 
successfully, both in X and from console:

commit 5e32132befa5d2cefadf3141fee0bbb40cd11f0e
Author: Shaohua Li <[EMAIL PROTECTED]>
Date:   Thu Oct 11 23:53:58 2007 +0200

ide: hook ACPI _PSx method to IDE power on/off

ACPI spec defines the sequence of IDE power on/off:
Powering down:
Call _GTM.
Power down drive (calls _PS3 method and turns off power planes).
Powering up:
Power up drive (calls _PS0 method if present and turns on power planes).
Call _STM passing info from _GTM (possibly modified), with ID data from
each drive.
Initialize the channel.
May modify the results of _GTF.
For each drive:
Call _GTF.
Execute task file (possibly modified).
This patch adds the missed _PS0/_PS3 methods call.

Signed-off-by: Shaohua Li <[EMAIL PROTECTED]>
Acked-by: Len Brown <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>


Here is the dmesg of the failing kernel after the first hibernation. I have no 
output from the second hibernation attempt with that kernel. After reverting 
the above-mentioned commit, these two lines won't appear in the output anymore:

  ACPI: Cannot set device to a higher-powered state than parent
  ACPI: Cannot set device to a higher-powered state than parent

Dmesg of the failing kernel after first hibernation (version is untouched 
e697789d64f8748cb219d7f5c413c512953802cc, i.e. current 2.6.24-rc6):

[0.00] Linux version 2.6.24-rcx-qaz ([EMAIL PROTECTED]) (gcc version 
4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 Mon Dec 31 19:26:59 
EET 2007
[0.00] BIOS-provided physical RAM map:
[0.00]  BIOS-e820:  - 0009f800 (usable)
[0.00]  BIOS-e820: 0009f800 - 000a (reserved)
[0.00]  BIOS-e820: 000d - 0010 (reserved)
[0.00]  BIOS-e820: 0010 - 1def (usable)
[0.00]  BIOS-e820: 1def - 1deff000 (ACPI data)
[0.00]  BIOS-e820: 1deff000 - 1df0 (ACPI NVS)
[0.00]  BIOS-e820: 1df0 - 1e00 (reserved)
[0.00]  BIOS-e820: fffc - 0001 (reserved)
[0.00] 0MB HIGHMEM available.
[0.00] 478MB LOWMEM available.
[0.00] Entering add_active_range(0, 0, 122608) 0 entries of 256 used
[0.00] Zone PFN ranges:
[0.00]   DMA 0 -> 4096
[0.00]   Normal   4096 ->   122608
[0.00]   HighMem122608 ->   122608
[0.00] Movable zone start PFN for each node
[0.00] early_node_map[1] active PFN ranges
[0.00] 0:0 ->   122608
[0.00] On node 0 totalpages: 122608
[0.00]   DMA zone: 32 pages used for memmap
[0.00]   DMA zone: 0 pages reserved
[0.00]   DMA zone: 4064 pages, LIFO batch:0
[0.00]   Normal zone: 925 pages used for memmap
[0.00]   Normal zone: 117587 pages, LIFO batch:31
[0.00]   HighMem zone: 0 pages used for memmap
[0.00]   Movable zone: 0 pages used for memmap
[0.00] DMI 2.3 present.
[0.00] ACPI: RSDP 000F7290, 0014 (r0 PTLTD )
[0.00] ACPI: RSDT 1DEF8B70, 0030 (r1 PTLTDRSDT604  LTP  
  0)
[0.00] ACPI: FACP 1DEFEE2B, 0074 (r1 ATIRaptor604 ATI 
F4240)
[0.00] ACPI: DSDT 1DEF8BA0, 628B (r1ATI U1_M1535  604 MSFT  
10D)
[0.00] ACPI: FACS 1DEFFFC0, 0040
[0.00] ACPI: BOOT 1DEFEE9F, 0028 (r1 PTLTD  $SBFTBL$  604  LTP  
  1)
[0.00] ACPI: SSDT 1DEFEEC7, 0139 (r1 PTLTD  POWERNOW  604  LTP  
  1)
[0.00] ATI board detected. Disabling timer routing over 8254.
[0.00] ACPI: PM-Timer IO Port: 0x8008
[0.00] Allocating PCI resources starting at 2000 (gap: 
1e00:e1fc)
[0.00] swsusp: Registered nosave memory region: 0009f000 - 
000a
[0.00] swsusp: Registered nosave memory region: 000a - 
000d
[0.00] swsusp: Registered nosave memory region: 000d - 
0010
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 121651
[0.00] Kernel command line: 
root=UUID=ce8db9f7-6377-48a5-b22e-0a86e05348d6 ro single 

Re: [linux-usb-devel] 2.6.24-rc3-mm1: usb mouse doesn't work

2007-12-31 Thread Alan Stern
On Fri, 23 Nov 2007, Kirill A. Shutemov wrote:

> On [Thu, 22.11.2007 21:51], Alan Stern wrote:
> > On Thu, 22 Nov 2007, Marin Mitov wrote:
> > 
> > > > > > I've had some strangenesses with USB lately.  Sometimes running 
> > > > > > `lsusb'
> > > > > > makes the USB system notice a newly attached device.
> > > > >
> > > > > No. But I have new messages in dmesg:
> > > > >
> > > > > uhci_hcd :00:1d.3: FGR not stopped yet!
> > > > > uhci_hcd :00:1d.2: FGR not stopped yet!
> > > > > uhci_hcd :00:1d.1: FGR not stopped yet!
> > > > > uhci_hcd :00:1d.0: FGR not stopped yet!
> > > > >
> > > > > > Is that "FGR not stopped yet!" messgae new behaviour?
> > > > >
> > > > > It is a new message since 2.6.24-rc3. I have never try -mm tree 
> > > > > before.
> > > >
> > > > These messages could indicate a timing problem.  You can see the code
> > > > that writes the messages near the end of wakeup_rh() in
> > > > drivers/usb/host/uhci-hcd.c.
> > > >
> > > > The message gets written if the controller hardware hasn't turned off a
> > > > particular bit after a 4-us delay.  If the udelay() function wasn't
> > > > working right, it could cause this problem.
> > > 
> > > udelay() _is_ OK for 2.6.24-rc3, so it is not the cause of the problem
> > 
> > But is it OK for 2.6.24-rc3-mm1?  Kirill said specifically that 
> > 2.6.24-rc3 does not display the message but 2.6.24-rc3-mm1 does.
> 
> How can I test it?

Any progress?  How about more recent kernels?

Alan Stern

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


[x86] get rid of checkpatch.pl complains on apm_32.c

2007-12-31 Thread Cyrill Gorcunov
This patch eliminates most of code-style errors
discovered by checkpatch.pl on arch/x86/kernel/apm_32.c

Signed-off-by: Cyrill Gorcunov <[EMAIL PROTECTED]>
---
Any comments are welcome


 arch/x86/kernel/apm_32.c |  368 +-
 1 files changed, 197 insertions(+), 171 deletions(-)

diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 3492a00..1ddf785 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -323,7 +323,7 @@ extern int (*console_blank_hook)(int);
 /*
  * Ignore suspend events for this amount of time after a resume
  */
-#define DEFAULT_BOUNCE_INTERVAL(3 * HZ)
+#define DEFAULT_BOUNCE_INTERVAL(3 * HZ)
 
 /*
  * Maximum number of events stored
@@ -335,7 +335,7 @@ extern int (*console_blank_hook)(int);
  */
 struct apm_user {
int magic;
-   struct apm_user *   next;
+   struct apm_user *next;
unsigned intsuser: 1;
unsigned intwriter: 1;
unsigned intreader: 1;
@@ -371,44 +371,44 @@ struct apm_user {
 static struct {
unsigned long   offset;
unsigned short  segment;
-}  apm_bios_entry;
-static int clock_slowed;
-static int idle_threshold __read_mostly = 
DEFAULT_IDLE_THRESHOLD;
-static int idle_period __read_mostly = DEFAULT_IDLE_PERIOD;
-static int set_pm_idle;
-static int suspends_pending;
-static int standbys_pending;
-static int ignore_sys_suspend;
-static int ignore_normal_resume;
-static int bounce_interval __read_mostly = 
DEFAULT_BOUNCE_INTERVAL;
-
-static int debug __read_mostly;
-static int smp __read_mostly;
-static int apm_disabled = -1;
+} apm_bios_entry;
+static int clock_slowed;
+static int idle_threshold __read_mostly = DEFAULT_IDLE_THRESHOLD;
+static int idle_period __read_mostly = DEFAULT_IDLE_PERIOD;
+static int set_pm_idle;
+static int suspends_pending;
+static int standbys_pending;
+static int ignore_sys_suspend;
+static int ignore_normal_resume;
+static int bounce_interval __read_mostly = DEFAULT_BOUNCE_INTERVAL;
+
+static int debug __read_mostly;
+static int smp __read_mostly;
+static int apm_disabled = -1;
 #ifdef CONFIG_SMP
-static int power_off;
+static int power_off;
 #else
-static int power_off = 1;
+static int power_off = 1;
 #endif
 #ifdef CONFIG_APM_REAL_MODE_POWER_OFF
-static int realmode_power_off = 1;
+static int realmode_power_off = 1;
 #else
-static int realmode_power_off;
+static int realmode_power_off;
 #endif
 #ifdef CONFIG_APM_ALLOW_INTS
-static int allow_ints = 1;
+static int allow_ints = 1;
 #else
-static int allow_ints;
+static int allow_ints;
 #endif
-static int broken_psr;
+static int broken_psr;
 
 static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
 static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
-static struct apm_user *   user_list;
+static struct apm_user *user_list;
 static DEFINE_SPINLOCK(user_list_lock);
 static const struct desc_structbad_bios_desc = { { { 0, 0x00409200 } } 
};
 
-static const char  driver_version[] = "1.16ac";/* no spaces */
+static const char driver_version[] = "1.16ac"; /* no spaces */
 
 static struct task_struct *kapmd_task;
 
@@ -416,7 +416,7 @@ static struct task_struct *kapmd_task;
  * APM event names taken from the APM 1.2 specification. These are
  * the message codes that the BIOS uses to tell us about events
  */
-static const char *const apm_event_name[] = {
+static const char * const apm_event_name[] = {
"system standby",
"system suspend",
"normal resume",
@@ -434,14 +434,14 @@ static const char *   const apm_event_name[] = {
 
 typedef struct lookup_t {
int key;
-   char *  msg;
+   char*msg;
 } lookup_t;
 
 /*
  * The BIOS returns a set of standard error codes in AX when the
  * carry flag is set.
  */
- 
+
 static const lookup_t error_table[] = {
 /* N/A { APM_SUCCESS,  "Operation succeeded" }, */
{ APM_DISABLED, "Power management disabled" },
@@ -471,24 +471,25 @@ static const lookup_t error_table[] = {
  * Write a meaningful log entry to the kernel log in the event of
  * an APM error.
  */
- 
+
 static void apm_error(char *str, int err)
 {
-   int i;
+   int i;
 
for (i = 0; i < ERROR_COUNT; i++)
-   if (error_table[i].key == err) break;
+   if (error_table[i].key == err)
+   break;
if (i < ERROR_COUNT)
printk(KERN_NOTICE "apm: %s: %s\n", str, error_table[i].msg);
else
printk(KERN_NOTICE 

Re: [PATCH] x86: provide a DMI based port 0x80 I/O delay override

2007-12-31 Thread Ondrej Zary
On Monday 31 December 2007 16:56:00 Alan Cox wrote:
> > Okay. Am about to go stuff my face with new years celebrations but will
> > definitely try to make that old WD8003 hickup.
>
> Have fun. Is it an 8390 or an 83905 ?
>

What about HP PCLan 16/TP+ cards? I have one that runs 24/7 in a 486 box 
(2.6.20.6 kernel) and one spare. It has some VLSI HP chip and also ST-NIC 
DP83902AV - is that a good candidate for testing?

I also have WD8013EP with DP8390DV chip - that's probably even better.

-- 
Ondrej Zary
--
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: kexec refuses to boot latest -mm

2007-12-31 Thread Dhaval Giani
On Mon, Dec 31, 2007 at 10:06:58AM -0500, Vivek Goyal wrote:
> On Sat, Dec 29, 2007 at 11:11:13AM +0530, Dhaval Giani wrote:
> > On Fri, Dec 28, 2007 at 09:27:39AM -0500, Vivek Goyal wrote:
> > > On Fri, Dec 28, 2007 at 06:15:32PM +0530, Dhaval Giani wrote:
> > > > Hi Vivek,
> > > > 
> > > > I can't seem to get the latest -mm (2.6.24-rc6-mm1) to boot with
> > > > kexec. It just gets stuck at "Starting new kernel".
> > > > 
> > > > It does boot normally when booted as the first kernel.
> > > > 
> > > > Any hints debugging? (x86 architecture)
> > > 
> > > I generally try few things.
> > > 
> > > - Specify earlyprintk= parameter for second kernel and see if control
> > >   is reaching to second kernel.
> > > 
> > > - Otherwise specify --console-serial parameter on "kexec -l" commandline
> > >   and it should display a message "I am in purgatory" on serial console.
> > >   This will just mean that control has reached at least till purgatory.
> > > 
> > 
> > Ok, so it reaches till here. I get "I'm in purgatory" on the console.
> > 
> 
> Ok. So it atleast reaches till purgatory. My hunch is that it also reaches
> the second kernel but dies early in that kernel before any message can
> be printed on screen.
> 
> Can you put some "outb()" messages on serial console in start_kernel() in
> second kernel and see up to what point do you reach.
> 
> My 2.6.24-rc6-mm1 kernel panics during boot on 32bit box. Let me try it on
> 64 bit box.
> 

Apply the hotfixes :-)

-- 
regards,
Dhaval
--
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.24-rc6-mm1

2007-12-31 Thread Torsten Kaiser
On Dec 30, 2007 4:34 AM, Torsten Kaiser <[EMAIL PROTECTED]> wrote:
> On Dec 30, 2007 2:30 AM, Herbert Xu <[EMAIL PROTECTED]> wrote:
> > On Sat, Dec 29, 2007 at 05:51:13PM +0100, Torsten Kaiser wrote:
> > >
> > > > > The cause, why I am resending this: I just got a crash with
> > > > > 2.6.24-rc6-mm1, again looking network related:
> > > > >
> > > > > [93436.933356] WARNING: at include/net/dst.h:165 dst_release()
> > > > > [93436.936685] Pid: 8079, comm: konqueror Not tainted 2.6.24-rc6-mm1 
> > > > > #11
> > > > > [93436.939292]
> > > > > [93436.939293] Call Trace:
> > > > > [93436.939304]  [] skb_release_all+0xdd/0x110
> > > > > [93436.939307]  [] __kfree_skb+0x11/0xa0
> > > > > [93436.939309]  [] kfree_skb+0x17/0x30
> > > > > [93436.939312]  [] unix_release_sock+0x128/0x250
> > > > > [93436.939315]  [] unix_release+0x21/0x30
> > > > > [93436.939318]  [] sock_release+0x24/0x90
> > > > > [93436.939320]  [] sock_close+0x26/0x50
> > > > > [93436.939324]  [] __fput+0xc1/0x230
> > > > > [93436.939327]  [] fput+0x16/0x20
> > > > > [93436.939329]  [] filp_close+0x56/0x90
> > > > > [93436.939331]  [] sys_close+0xa6/0x110
> > > > > [93436.939335]  [] 
> > > > > system_call_after_swapgs+0x7b/0x80
> > >
> > > >From code inspection I would blame the patch "[SKBUFF]: Free old skb
> > > properly in skb_morph" from Herbert Xu. (CC added)
> >
> > I doubt it.  skb_morph is only used on IP fragments so I don't see how
> > you could attribute an error from a Unix domain socket to this patch.
>
> That's why I wrote that I do not know much about the network core...
>
> > In any case, Unix socket packets should not have a dst at all so the
> > very fact that you're in that path means that you have some sort of
> > memory corruption.
>
> ... I did not know about the fact that there should not have been an dst.
>
> Its just that this warning was the first nice clue about the memory
> corruption related to networking that I see since 2.6.24-rc3-mm2.
> The time of the patch (Mon, 26 Nov 2007 15:11:19) even fits into the
> window between -rc3-mm1 and -rc3-mm2.
>
> I doubt that the memory corruption is a hardware problem, because the
> system in question is using ECC ram and I did not see any messages
> about corrected/detected errors.
>
> > Is this the very first OOPS/warning that you see? If not you should
> > ignore all but the very first one as that may have left your system
> > in an inconsistent state which may render all subsequent OOPSes and
> > warnings useless.
>
> I looked into the log in question and the only other warning was a
> circular locking dependency that lockdep detected around 1.5 hour
> before this warning.
>
> As reported in my original mail immeadeatly after the warning the
> system OOPSed and hang:
> [93436.947241] general protection fault:  [1] SMP
> -> first OOPS
> [93436.947243] last sysfs file:
> /sys/devices/pci:00/:00:0f.0/:01:00.1/irq
> [93436.947245] CPU 1
> [93436.947246] Modules linked in: radeon drm nfsd exportfs w83792d
> ipv6 tuner tea5767 tda8290 tuner_xc2
> 028 tda9887 tuner_simple mt20xx tea5761 tvaudio msp3400 bttv ir_common
> compat_ioctl32 videobuf_dma_sg v
> ideobuf_core btcx_risc tveeprom usbhid videodev v4l2_common hid
> v4l1_compat pata_amd sg i2c_nforce2
> [93436.947257] Pid: 8079, comm: konqueror Not tainted 2.6.24-rc6-mm1 #11
> -> not tainted by a previous OOPS
>
> [93436.947259] RIP: 0010:[]  []
> skb_drop_list+0x18/0x30
> [93436.947262] RSP: 0018:810005f4fda8  EFLAGS: 00010286
> [93436.947263] RAX: ab1ed5ca5b74e7de RBX: ab1ed5ca5b74e7de RCX: 
> d135
> [93436.947265] RDX: 81011d089a80 RSI: 0001 RDI: 
> 81011d089a88
> [93436.947266] RBP: 810005f4fdb8 R08: 0001 R09: 
> 0006
> [93436.947268] R10:  R11:  R12: 
> 8100de02c500
> [93436.947269] R13: 81011c188a00 R14: 0001 R15: 
> 81011c189198
> [93436.947271] FS:  7fb5bde0d700() GS:81007ff22000()
> knlGS:
> [93436.947273] CS:  0010 DS:  ES:  CR0: 8005003b
> [93436.947274] CR2: 7fb5bdd76000 CR3: 664d5000 CR4: 
> 06e0
> [93436.947276] DR0:  DR1:  DR2: 
> 
> [93436.947277] DR3:  DR6: 0ff0 DR7: 
> 0400
> [93436.947279] Process konqueror (pid: 8079, threadinfo
> 810005f4e000, task 8100a1dec000)
> [93436.947281] Stack:  810005f4fdd8 810116c86140
> 810005f4fdd8 805314ae
> [93436.947284]  810116c86140 8100de02c500 810005f4fdf8
> 80531cf0
> [93436.947286]  8100de02c500 81011c188b48 810005f4fe18
> 80531311
> [93436.947288] Call Trace:
> [93436.947290]  [] skb_release_data+0x5e/0xa0
> [93436.947293]  [] skb_release_all+0xa0/0x110
> [93436.947295]  [] __kfree_skb+0x11/0xa0
> [93436.947297]  [] kfree_skb+0x17/0x30
> [93436.947299]  [] unix_release_sock+0x128/0x250
> [93436.947302]  [] 

Re: 2.6.24-rc6-mm1 (driver core/sysfs)

2007-12-31 Thread Randy Dunlap
On Sat, 22 Dec 2007 23:30:56 -0800 Andrew Morton wrote:

> 
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24-rc6/2.6.24-rc6-mm1/


With CONFIG_BLOCK=n:

  LD  drivers/block/built-in.o
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/base/core.c: In function 
'device_add_class_symlinks':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/base/core.c:707: error: 'part_type' 
undeclared (first use in this function)
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/base/core.c: In function 
'device_remove_class_symlinks':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/base/core.c:746: error: 'part_type' 
undeclared (first use in this function)
make[3]: *** [drivers/base/core.o] Error 1


and that is after fixing (in some sense) the first CONFIG_BLOCK=n
problem with the patch below.  Please test lots of configs.
and/or use 'make randconfig' (automated, scripted, e.g., etc.).
maybe check Documentation/SubmitChecklist.  :)

---

From: Randy Dunlap <[EMAIL PROTECTED]>

Parts of driver core use blk_lookup_devt() when CONFIG_BLOCK=n,
so provide an short inline version of it for that case.

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 include/linux/genhd.h |7 +++
 1 file changed, 7 insertions(+)

--- linux-2.6.24-rc6-mm1.orig/include/linux/genhd.h
+++ linux-2.6.24-rc6-mm1/include/linux/genhd.h
@@ -10,6 +10,7 @@
  */
 
 #include 
+#include 
 
 #ifdef CONFIG_BLOCK
 
@@ -443,6 +444,12 @@ static inline struct block_device *bdget
 
 static inline void printk_all_partitions(void) { }
 
+static inline dev_t blk_lookup_devt(const char *name)
+{
+   dev_t devt = MKDEV(0, 0);
+   return devt;
+}
+
 #endif /* CONFIG_BLOCK */
 
 #endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.24-rc6-mm1 - git-lblnet.patch and networking horkage

2007-12-31 Thread Paul Moore
On Monday 31 December 2007 12:13:32 pm Paul Moore wrote:
> On Wednesday 26 December 2007 4:52:03 pm James Morris wrote:
> > On Thu, 26 Dec 2007, Paul Moore wrote:
> > > As James said I'm away right now and computer access is limited.
> > > However, I'm stuck in the airport right now and spent some time looking
> > > at the code ... Based on what has been found so far I wonder if the
> > > problem isn't a race but a problem of skb->iif never being initialized
> > > correctly?  To my untrained eye it looks like __netdev_alloc_skb()
> > > should be setting skb->iif (like it does for skb->dev) but it currently
> > > doesn't.
> >
> > ->iif will be zeroed during skb allocation, then set during
> > netif_receive_skb().
>
> I was able to reproduce this bug this morning by running avahi as James did
> and did a little more digging.  I don't have a fix yet, but thought I would
> pass along what I've found in case this triggers a moment of clarity to
> someone out there ...
>
> The skb->iif value appears to be messed up as early as netif_receive_skb(),
> in my case it is set to 196611 (trust me, I don't have that many interfaces
> in my test machine) which causes the ->iif initialization code in
> netif_receive_skb() to be skipped because ->iif is greater than zero.  This
> particular packet is locally generated and locally consumed.
>
> Hopefully I'll have a fix later this afternoon but if someone has a bright
> idea I'd love to hear it ...

[NOTE: I added netdev to this thread to gather some input.  @netdev folks, the 
problem is that the skb->iif field contains garbage in some cases which is 
causing problems for some new SELinux network code.  The exact problem 
probably isn't too important for this discussion, what is important is that 
the skb->iif field contains a non-zero garbage value some of the time on 
incoming packets.]

I'm pretty certain this is an uninitialized value problem now and not a 
use-after-free issue.  The invalid/garbage ->iif value seems to only happen 
on packets that are generated locally and sent back into the stack for local 
consumption, e.g. loopback.  These local packets also need to have been 
cloned at some point, either on the output or input path.

The problem appears to be a skb_clone() function which does not clear the skb 
structure properly and fails to copy the ->iif value from the original skb to 
the cloned skb.  From what I can tell, there are two possible solutions to 
this problem:

 1. Clear all of the cloned skb fields in skb_clone() via memset()
 2. Copy the ->iif field in __copy_skb_header()

I don't have a good enough understanding of all the details involving skb 
memory management to know if option #1 is a Good Idea or not, but option #2 
seems much simpler and solves the problem of garbage in the ->iif field.  My 
preference is to go with option #2 but before I submit a patch does anyone 
think this is the wrong solution?

-- 
paul moore
linux security @ hp
--
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: Can't disconnect a USB sound device and connect another

2007-12-31 Thread Alan Stern
On Tue, 25 Dec 2007, Andrew Morton wrote:

> On Sun, 23 Dec 2007 23:36:11 +0100 Victor Hahn <[EMAIL PROTECTED]> wrote:
> 
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> > 
> > ... because it causes lsusb to freeze and gives me this in 
> > /var/log/messages:
> 
> Has this always happened, or is it something we introduced in a recent
> kernel?
> 
> > Dec 23 23:27:04 cabrio kernel: usb 2-2: USB disconnect, address 5
> > Dec 23 23:27:04 cabrio kernel: PGD 110f2067 PUD 110f3067 PMD 0
> > Dec 23 23:27:04 cabrio kernel: CPU 0
> > Dec 23 23:27:04 cabrio kernel: Modules linked in: videodev v4l2_common 
> > v4l1_compat snd_rtctimer binfmt_misc rfcomm l2cap bluetooth capability 
> > commoncap ppdev powernow_k8 cpufreq_userspace cpufreq_stats 
> > cpufreq_powersave 
> > cpufreq_ondemand freq_table cpufreq_conservative video output sbs container 
> > dock ac battery ext3 jbd mbcache aes_x86_64 ipv6 it87 hwmon_vid parport_pc 
> > lp 
> > parport loop snd_mpu401 snd_mpu401_uart snd_usb_audio snd_pcm_oss 
> > snd_mixer_oss snd_pcm snd_seq_dummy snd_page_alloc snd_usb_lib snd_hwdep 
> > snd_seq_oss analog gameport snd_seq_midi snd_rawmidi snd_seq_midi_event 
> > snd_seq snd_timer snd_seq_device snd psmouse button soundcore serio_raw 
> > i2c_nforce2 k8temp i2c_core pcspkr af_packet shpchp pci_hotplug evdev xfs 
> > sha256 twofish_x86_64 twofish_common cbc blkcipher sg ide_cd cdrom sd_mod 
> > usbhid hid sata_nv 8139too floppy ata_generic 8139cp mii libata scsi_mod 
> > amd74xx ide_core forcedeth ehci_hcd ohci_hcd usbcore dm_crypt dm_mirror 
> > dm_snapshot dm_mod thermal processor fan fuse
> > Dec 23 23:27:04 cabrio kernel: Pid: 2052, comm: khubd Not tainted 2.6.23.11 
> > #1
> > Dec 23 23:27:04 cabrio kernel: RIP: 0010:[_end+130488219/2130651808]  
> > [_end+130488219/2130651808] :snd:snd_ctl_dev_disconnect+0x6b/0xb0
> > Dec 23 23:27:04 cabrio kernel: RSP: 0018:810037bfdc40  EFLAGS: 00010282
> > Dec 23 23:27:04 cabrio kernel: RAX:  RBX: 00100100 
> > RCX: 0018
> > Dec 23 23:27:04 cabrio kernel: RDX: 00020004 RSI: 001d 
> > RDI: 810013e98c08
> > Dec 23 23:27:04 cabrio kernel: RBP: 8100394631a8 R08: 810037bfc000 
> > R09: 
> > Dec 23 23:27:04 cabrio kernel: R10:  R11: 88281910 
> > R12: 810039463000
> > Dec 23 23:27:04 cabrio kernel: R13: 810039463168 R14:  
> > R15: 810039463000
> > Dec 23 23:27:04 cabrio kernel: FS:  2b24912551e0() 
> > GS:80533000
> > () knlGS:f74b16c0
> > Dec 23 23:27:04 cabrio kernel: CS:  0010 DS: 0018 ES: 0018 CR0: 
> > 8005003b
> > Dec 23 23:27:04 cabrio kernel: CR2: 00100100 CR3: 110f1000 
> > CR4: 06e0
> > Dec 23 23:27:04 cabrio kernel: DR0:  DR1:  
> > DR2: 
> > Dec 23 23:27:04 cabrio kernel: DR3:  DR6: 0ff0 
> > DR7: 0400
> > Dec 23 23:27:04 cabrio kernel: Process khubd (pid: 2052, threadinfo 
> > 810037bfc000, task 81003d67d0c0)
> > Dec 23 23:27:04 cabrio kernel: Stack:   810038850d00 
> > 810039463000 810039463150
> > Dec 23 23:27:04 cabrio kernel:   88281e69 
> > 810038850d00 882821ac
> > Dec 23 23:27:04 cabrio kernel:    
> > 810039463000 8100394631e0
> > Dec 23 23:27:04 cabrio kernel: Call Trace:
> > Dec 23 23:27:04 cabrio kernel:  
> > [_end+130500873/2130651808] :snd:snd_device_disconnect+0x59/0x90
> > Dec 23 23:27:04 cabrio kernel:  
> > [_end+130501708/2130651808] :snd:snd_device_disconnect_all+0x3c/0x70
> > Dec 23 23:27:04 cabrio kernel:  
> > [_end+130481675/2130651808] :snd:snd_card_disconnect+0x15b/0x1a0
> > Dec 23 23:27:04 cabrio kernel:  
> > [_end+131093678/2130651808] :snd_usb_audio:usb_audio_disconnect+0xae/0x1a0
> > Dec 23 23:27:04 cabrio kernel:  
> > [_end+128211869/2130651808] :usbcore:usb_unbind_interface+0x6d/0xe0
> > Dec 23 23:27:04 cabrio kernel:  [__device_release_driver+130/192] 
> > __device_release_driver+0x82/0xc0
> > Dec 23 23:27:04 cabrio kernel:  [device_release_driver+51/96] 
> > device_release_driver+0x33/0x60
> > Dec 23 23:27:04 cabrio kernel:  [bus_remove_device+118/176] 
> > bus_remove_device+0x76/0xb0
> > Dec 23 23:27:04 cabrio kernel:  [device_del+417/736] device_del+0x1a1/0x2e0
> > Dec 23 23:27:04 cabrio kernel:  
> > [_end+128198657/2130651808] :usbcore:usb_disable_device+0x91/0x110
> > Dec 23 23:27:04 cabrio kernel:  
> > [_end+128179466/2130651808] :usbcore:usb_disconnect+0xaa/0x150
> > Dec 23 23:27:04 cabrio kernel:  
> > [_end+128181649/2130651808] :usbcore:hub_thread+0x401/0xe30
> > Dec 23 23:27:04 cabrio kernel:  [thread_return+87/1463] 
> > thread_return+0x57/0x5b7
> > Dec 23 23:27:04 cabrio kernel:  [autoremove_wake_function+0/48] 
> > autoremove_wake_function+0x0/0x30
> > Dec 23 23:27:04 cabrio kernel:  
> > [_end+128180624/2130651808] 

Re: [RFC][PATCH] byteorder: introduce le32_add_cpu & friends to core

2007-12-31 Thread Marcin Slusarz
On Mon, Dec 31, 2007 at 11:38:01AM -0800, Mark Fasheh wrote:
> On Sun, Dec 30, 2007 at 08:06:34PM +0100, Marcin Slusarz wrote:
> > There are many places where these functions would be useful.
> > (just look at: grep -r 'cpu_to_[ble12346]*([ble12346]*_to_cpu.*[-+]' 
> > linux-src/)
> > What do you think?
> > 
> > ps: this patch depends on http://lkml.org/lkml/2007/12/25/35
> > --
> > 
> > add inline functions which add native byte order variable to
> > little/big endian variable to core header and as an example
> > convert ext3 to use them
> 
> You might want to note where you got these functions from in your message.
Yes, my mistake, sorry about that.

> Also, it would be easier to follow these changes if you had broken things up
> into two patches - one which moved stuff from ocfs2 into generic helpers and
> a 2nd one to convert ext3.
Will do (tomorrow).

> Looking into my crystal ball, I see a bunch of "convert to using byteorder
> math macros" patches coming down the pipe. Since we're talking about disk
> fields where a mistake could be costly, I suggest that any patch more than a
> couple of lines should be tested by the submitter with sparse. A statement
> that sparse didn't produce any new warnings (with the patch applied) could
> be included in the description.
Good idea. Thanks.

Marcin
--
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][RFC] Simple tamper-proof device filesystem.

2007-12-31 Thread Serge E. Hallyn
Quoting Tetsuo Handa ([EMAIL PROTECTED]):
> Hello.
> 
> Thank you for attending discussion for previous posting
> (starting from http://lkml.org/lkml/2007/12/16/23 ).
> 
> The previous posting was for feasibility test to know
> whether this kind of trivial filesystem is acceptable for mainline.
> 
> Now, it seems that there is a little chance for accepting.
> Therefore I rebased the patch using the -mm tree.
> 
> Regards.
> --
> Subject: Simple tamper-proof device filesystem.
> 
> The goal of this filesystem is to guarantee that
> "applications using well-known device locations under /dev
> get the device they want" (e.g. an application that accesses /dev/null can
> always get a character special device with major=1 and minor=3).
> 
> This idea sounds silly? Indeed, if you think the root can do whatever
> he/she wants do do. But this filesystem makes sense when used with
> access control mechanisms like MAC (mandatory access control).
> I want to use this filesystem in case where a process with root privilege was
> hijacked but the behavior of the hijacked process is still restricted by MAC.
> 
> Why not use FUSE?
> 
>   Because /dev has to be available through the lifetime of the kernel.
>   It is not acceptable if /dev stops working due to SIGKILL or OOM-killer.
> 
> Why not use SELinux?
> 
>   Because SELinux doesn't guarantee filename and its attribute.
>   As far as I know, no MAC implementation can handle filename and its 
> attribute.
>   I guess this is because
> 
> Filename and its attributes pairs are conventionally considered as
> constant and reliable.
> 
> It makes the MAC's policy syntax complicated to describe this attribute
> enforcement information in MAC's policy.
> 
>   I want to add functionality that the MACs are missing.
>   Instead of adding this functionality per MAC,
>   I propose to add it as ground work, to be combined with any MAC.
> 
> Why not drop CAP_MKNOD?
> 
>   Dropping CAP_MKNOD is not enough for emulating this filesystem because
>   a process can still rename()/unlink() to break filename and its attributes
>   handling (e.g. mv /dev/sda1 /dev/sda1.tmp; mv /dev/sda2 /dev/sda1;
>   mv /dev/sda1.tmp /dev/sda2 or unlink /dev/null; touch /dev/null ).
> 
> This time, I'm implementing this filesystem as an extension to tmpfs
> because what this filesystem does are nothing but check filename and
> its attributes in addition to what tmpfs does.
> 
> Signed-off-by: Tetsuo Handa <[EMAIL PROTECTED]>
> ---
>  fs/ramfs/inode.c   |  101 -
>  fs/ramfs/syaoran.h | 1066 
> +
>  2 files changed, 1160 insertions(+), 7 deletions(-)
> 
> --- linux-2.6-mm.orig/fs/ramfs/inode.c
> +++ linux-2.6-mm/fs/ramfs/inode.c
> @@ -35,6 +35,7 @@
>  #include 
>  #include 
>  #include "internal.h"
> +#include "syaoran.h"
> 
>  /* some random number */
>  #define RAMFS_MAGIC  0x858458f6
> @@ -49,7 +50,8 @@ static struct backing_dev_info ramfs_bac
> BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | 
> BDI_CAP_EXEC_MAP,
>  };
> 
> -struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev)
> +struct inode *__ramfs_get_inode(struct super_block *sb, int mode, dev_t dev,
> + const int mac)
>  {
>   struct inode * inode = new_inode(sb);
> 
> @@ -65,10 +67,19 @@ struct inode *ramfs_get_inode(struct sup
>   switch (mode & S_IFMT) {
>   default:
>   init_special_inode(inode, mode, dev);
> + if (mac) {
> + if (S_ISBLK(mode))
> + inode->i_fop = _def_blk_fops;
> + else if (S_ISCHR(mode))
> + inode->i_fop = _def_chr_fops;
> + inode->i_op = _file_inode_operations;
> + }
>   break;
>   case S_IFREG:
>   inode->i_op = _file_inode_operations;
>   inode->i_fop = _file_operations;
> + if (mac)
> + inode->i_op = _file_inode_operations;
>   break;
>   case S_IFDIR:
>   inode->i_op = _dir_inode_operations;
> @@ -79,12 +90,19 @@ struct inode *ramfs_get_inode(struct sup
>   break;
>   case S_IFLNK:
>   inode->i_op = _symlink_inode_operations;
> + if (mac)
> + inode->i_op = _symlink_inode_operations;
>   break;
>   }
>   }
>   return inode;
>  }
> 
> +struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev)
> +{
> + return __ramfs_get_inode(sb, mode, dev, 0);
> +}
> +
>  /*
>   * File creation. Allocate an inode, and we're done..
>   */
> @@ -92,9 +110,17 @@ struct inode *ramfs_get_inode(struct sup
>  static int
>  

getting rid of filp search in fs_may_remount_ro()

2007-12-31 Thread Dave Hansen
On Wed, 2007-12-26 at 15:12 +0100, Christoph Hellwig wrote:
> Btw, I just noticed in current -mm fs_may_remount_ro() is still around
> and not replaced by ther per-sb writers count.  That surely sounds like
> some kind of mismerge..

I was actually leaving that for later.  Getting rid of the filp search
is a great benefit of the r/o bind patches, but it isn't strictly
necessary and it doesn't really hurt anything to keep it.

The reason that it was contentious was that we need some way to be able
to do an sb-to-mount mapping.  When remounting the sb, we need to
determine whether *any* of the mounts of that sb have any writers.

We don't currently have any mechanisms to do direct lookups from sb to
mount.  The only alternative I can see right now is to walk over all
tasks, then walk over all vfs namespaces, and walk each mount tree to
see if any mounts are of the sb we're looking for.  This needs to be
done while already holding the mnt_writers[] locks so that no new mnt
writers can come in.

*THAT* is going to be a heavyweight operation.  I need to go look in
detail at how the mount trees are kept, and we'll need some kind of
mechanism to keep track of which vfs namespaces we've looked at during
the search so we don't search them twice. 

Can you think of a simpler way to do it?

-- Dave

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


Re: [RFC][PATCH] byteorder: introduce le32_add_cpu & friends to core

2007-12-31 Thread Mark Fasheh
On Mon, Dec 31, 2007 at 09:17:32AM +, Christoph Hellwig wrote:
> > be32_add is shorter than be32_add_cpu but I think it's not clear
> > whether second parameter is in native byte order or not.
> 
> Then again adding foreing endian values doesn't make much sense.
> 
> If you insist on your naming please make sure to convert ocfs and xfs
> to your naming.

Personally, I'd rather stick with the (IMHO) more descriptive name - btw,
the ones he picked don't require any extra conversion in Ocfs2.
--Mark

--
Mark Fasheh
Principal Software Developer, Oracle
[EMAIL PROTECTED]
--
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: [RFC][PATCH] byteorder: introduce le32_add_cpu & friends to core

2007-12-31 Thread Mark Fasheh
On Sun, Dec 30, 2007 at 08:06:34PM +0100, Marcin Slusarz wrote:
> There are many places where these functions would be useful.
> (just look at: grep -r 'cpu_to_[ble12346]*([ble12346]*_to_cpu.*[-+]' 
> linux-src/)
> What do you think?
> 
> ps: this patch depends on http://lkml.org/lkml/2007/12/25/35
> --
> 
> add inline functions which add native byte order variable to
> little/big endian variable to core header and as an example
> convert ext3 to use them

You might want to note where you got these functions from in your message.

Also, it would be easier to follow these changes if you had broken things up
into two patches - one which moved stuff from ocfs2 into generic helpers and
a 2nd one to convert ext3.

Looking into my crystal ball, I see a bunch of "convert to using byteorder
math macros" patches coming down the pipe. Since we're talking about disk
fields where a mistake could be costly, I suggest that any patch more than a
couple of lines should be tested by the submitter with sparse. A statement
that sparse didn't produce any new warnings (with the patch applied) could
be included in the description.
--Mark

--
Mark Fasheh
Principal Software Developer, Oracle
[EMAIL PROTECTED]
--
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] Force UNIX domain sockets to be built in

2007-12-31 Thread Al Viro
On Mon, Dec 31, 2007 at 03:03:20PM +0100, Bodo Eggert wrote:
> On Mon, 31 Dec 2007, David Miller wrote:
> > From: Bodo Eggert <[EMAIL PROTECTED]>
> 
> > > As suggested by Adrian Bunk, UNIX domain sockets should always be built 
> > > in 
> > > on normal systems. This is especially true since udev needs these sockets
> > > and fails to run if UNIX=m.
> > > 
> > > Signed-Off-By: Bodo Eggert <[EMAIL PROTECTED]>
> > 
> > People who use udev can make sure they have it built into their kernel
> > if they have such a dependency.
> > 
> > Not everyone uses udev, and therefore needs AF_UNIX non-modular.
> 
> That's why I kept this option for embedded folks.
> 
> Is there any benefit for non-embedded systems from having UNIX=m?

udev-free != embedded.
--
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] ocfs2: convert byte order of constant instead of variable

2007-12-31 Thread Mark Fasheh
On Tue, Dec 25, 2007 at 03:52:59PM +0100, Marcin Slusarz wrote:
> convert byte order of constant instead of variable
> it will be done at compile time (vs run time)
> remove unused le32_and_cpu

Ok, this looks good. I'll put it in ocfs2.git later today.
--Mark

--
Mark Fasheh
Principal Software Developer, Oracle
[EMAIL PROTECTED]
--
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: [usb regression] Re: [PATCH 2.6.24-rc3] Fix /proc/net breakage

2007-12-31 Thread Greg KH
On Mon, Dec 31, 2007 at 12:49:52PM -0500, Alan Stern wrote:
> On Sun, 30 Dec 2007, Greg KH wrote:
> 
> > > It looks like Greg misused the debugfs API -- which is ironic, because
> > > he wrote debugfs in the first place!  :-)
> > 
> > Oh crap, sorry, I did mess that up :(
> > 
> > > Let me know if this patch fixes the problem.  If it does, I'll submit 
> > > it to Greg with all the proper accoutrements.
> > 
> > This isn't going to work if CONFIG_DEBUGFS is not enabled either :(
> 
> Why not?  The debugging files won't be created, true, but the driver
> should work just fine regardless.  This is exactly the way uhci-hcd
> behaves, and it hasn't caused any problems.

Ok, you are right, it was late and after some wine and I shouldn't have
been responding to email :)

I'll rework this, and send out a patch tonight or tomorrow when I get a
chance (am on the road right now).  We should only care about NULL being
returned here, that's the only "real" error.

And in thinking about it some more, I should go audit all the debugfs
callers to make sure they are doing something sane too, it shouldn't be
this complex at all...

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/


Re: [PATCH 0/3 -mm] kexec jump -v8

2007-12-31 Thread Vivek Goyal
On Sat, Dec 29, 2007 at 10:00:44AM +0800, Huang, Ying wrote:
> On Fri, 2007-12-28 at 16:33 -0500, Vivek Goyal wrote:
> > On Fri, Dec 21, 2007 at 03:33:19PM +0800, Huang, Ying wrote:
> > > This patchset provides an enhancement to kexec/kdump. It implements
> > > the following features:
> > > 
> > > - Backup/restore memory used both by the original kernel and the
> > >   kexeced kernel.
> > > 
> > > - Jumping between the original kernel and the kexeced kernel.
> > > 
> > > - Read/write memory image of the kexeced kernel in the original kernel
> > >   and write memory image of the original kernel in the kexeced
> > >   kernel. This can be used as a communication method between the
> > >   kexeced kernel and the original kernel.
> > > 
> > > 
> > > The features of this patchset can be used as follow:
> > > 
> > > - Kernel/system debug through making system snapshot. You can make
> > >   system snapshot, jump back, do some thing and make another system
> > >   snapshot.
> > > 
> > 
> > How do you differentiate between whether a core is resumable or not.
> > IOW, how do you know the generated /proc/vmcore has been generated after
> > a real crash hence can't be resumed (using krestore) or it has been 
> > generated because of hibernation/debug purposes and can be resumed?
> > 
> > I think you might have to add an extra ELF NOTE to vmcore which can help
> > decide whether kernel memory snapshot is resumable or not.
> 
> The current solution is as follow:
> 
> 1. The original kernel will set %edi to jump back entry if resumable and
> set %edi to 0 if not.
> 
> 2. The purgatory of loaded kernel will check %edi, if it is not zero,
> the string "jump_back_entry=" will be appended to
> kernel command line parameter.
> 
> 3. In kexeced kernel, if there is "jump_back_entry="
> in /proc/cmdline, the previous kernel is resumable, otherwise not.
> 

Ok. But If I copy the /proc/vmcore to disk. Then I reboot the system 
and boot back into a kernel which is supposed to resume the hibernated
image. This kernel will not have any command line option jump_back_entry.
I  need to resume using krestore tool. How will a krestore tool decide that
image one wants to restore is a core file or a hibernated image?

In this context I thought an PT_NOTE might be useful.

> As for ELF NOTE, in fact, the ELF NOTE does not work for resumable
> kernel. Because the contents of source page and destination page is
> swapped during kexec, and the kernel access the destination page
> directly during parsing ELF NOTE. All memory that is swapped need to be
> accessed via the backup pages map (image->head). I think these
> information can be exchanged between two kernels via kernel command line
> or /proc/kimgcore.
> 

Why should we exchange backup page map information between two kernels?
What data has been swapped and how to restore it back should be known
to the kernel who did it. I think the memory info and address of ELF
headers we can still pass to second kernel the same way we do for
/proc/vmcore. The only difference is that purgatory shall have to modify 
the command line to reflect the new address of ELF headers just before
jumping to new kernel (because of swapping).

We can also modify the actual ELF headers in purgatory to reflect the
right data (because of swapping) and new kernel will not have to know
anything about swapping.

So I thought of following sequence.

Lets say there is production kernel A and there is helper kernel B (B
will save the hibernated image of A).

- Boot into A.
- Load kernel B using --load-preserve-context.
- This load operation can also create the Elf headers.   
- Kexec -e will start hibernation of A. Pages shall be swapped. Control
  will be transferred to purgatory.
- Purgatory will readjust the ELF headers and command line based on 
  the swapping done and jump to new kernel.
- New kernel will retrieve the elf headers and export the memory of
  hibernated kernel through /proc/vmcore.

Hence there is no need to communicate swapped pages map between two
kernels.


> > [..]
> > > 2. Build an initramfs image contains kexec-tool, or download the
> > >pre-built initramfs image, called rootfs.gz in following text.
> > > 
> > > 3. Boot kernel compiled in step 1.
> > > 
> > > 4. Load kernel compiled in step 1 with /sbin/kexec. If You want to use
> > >"krestore" tool, the --elf64-core-headers should be specified in
> > >command line of /sbin/kexec. The shell command line can be as
> > >follow:
> > > 
> > >/sbin/kexec --load-jump-back /boot/bzImage --mem-min=0x10
> > >  --mem-max=0xff --elf64-core-headers --initrd=rootfs.gz
> > > 
> > 
> > How about a different name like "--load-preserve-context". This will
> > just mean that kexec need to preserve the context while kexeing to 
> > image being loaded. Combination of --load-jump-back and
> > --load-jump-back-helper is becoming little confusing.
> 
> Yes, this is better. I will change it.
> 
> > > 5. Boot the kexeced kernel with following 

[PATCH -mm] gpio: fix x86 build problem: gpio_keys

2007-12-31 Thread Randy Dunlap
On Mon, 31 Dec 2007 10:40:27 -0800 David Brownell wrote:

> On Monday 31 December 2007, Randy Dunlap wrote:
> >   CC  drivers/input/keyboard/gpio_keys.o
> > In file included from 
> > /local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c:27:
> > include2/asm/gpio.h:4:18: error: gpio.h: No such file or directory
> 
> Find whatever broken patch selected (on x86_64)
> 
>CONFIG_GENERIC_GPIO=y
> 
> without actually providing that support (by providing  and
> an implementation backing it up).  That's the patch which broke those
> various GPIO-dependant drivers.

OK, thanks for the direction.

---

From: Randy Dunlap <[EMAIL PROTECTED]>

X86_RDC321X is X86_32, so make it depend on X86_32 so that
X86_64 random configs don't try to build RDC and fail.

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 arch/x86/Kconfig |1 +
 1 file changed, 1 insertion(+)

--- linux-2.6.24-rc6-mm1.orig/arch/x86/Kconfig
+++ linux-2.6.24-rc6-mm1/arch/x86/Kconfig
@@ -297,6 +297,7 @@ config X86_ES7000
 
 config X86_RDC321X
bool "RDC R-321x SoC"
+   depends on X86_32
select M486
select X86_REBOOTFIXUPS
select GENERIC_GPIO
--
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: [v4l-dvb-maintainer] 2.6.24-rc6-mm1 (build problem: v4l / i2c)

2007-12-31 Thread Michael Krufky
Michael Krufky wrote:
> Randy Dunlap wrote:
>   
>>   MODPOST 120 modules
>> ERROR: "i2c_attach_client" [drivers/media/video/v4l2-common.ko] undefined!
>> make[2]: *** [__modpost] Error 1
>>
>> ---
>> ~Randy
>> desserts:  http://www.xenotime.net/linux/recipes/
>> 
>
> I fixed this problem in this changeset:
>
> http://linuxtv.org/hg/v4l-dvb/rev/64e0c78821c4
Hmm, I apologize -- I think this was an unrelated issue.  Sorry for the
confusion.

-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: [PATCH] Force UNIX domain sockets to be built in

2007-12-31 Thread Michael Buesch
On Monday 31 December 2007 19:37:43 Torsten Kaiser wrote:
> The base problem is that there already are many options to break
> external modules. (CONFIG_MODULES=n ;) )

Exactly. There already are enough ways to break external modules.
No need to introduce more. ;)

> The question I can't answer in this context is: Do distributions want
> to support external modules?
> Only if yes, your argument is valid. But then they could just disable
> this feature and prevent this kind of bugreports.

That's my point. Nobody will risk bugs to save a few bytes of memory.

-- 
Greetings Michael.
--
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: [v4l-dvb-maintainer] 2.6.24-rc6-mm1 (build problem: v4l / i2c)

2007-12-31 Thread Michael Krufky
Randy Dunlap wrote:
>   MODPOST 120 modules
> ERROR: "i2c_attach_client" [drivers/media/video/v4l2-common.ko] undefined!
> make[2]: *** [__modpost] Error 1
>
> ---
> ~Randy
> desserts:  http://www.xenotime.net/linux/recipes/

I fixed this problem in this changeset:

http://linuxtv.org/hg/v4l-dvb/rev/64e0c78821c4

Mauro, can you send this upstream?

for mm:  here is the raw patch:

http://linuxtv.org/hg/v4l-dvb/raw-rev/64e0c78821c4

Regards,

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: asm-x86/msr.h for sanitized headers: clean it or punt it

2007-12-31 Thread Mike Frysinger
Use __asm__ and __volatile__ in code that is exported to userspace.  Wrap
kernel functions with __KERNEL__ so they get scrubbed.

Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]>
---
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
index ba4b314..664a2fa 100644
--- a/include/asm-x86/msr.h
+++ b/include/asm-x86/msr.h
@@ -191,38 +191,6 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 
msr_no, u32 l, u32 h)
 
 #define wrmsrl(msr,val) wrmsr(msr,(__u32)((__u64)(val)),((__u64)(val))>>32)
 
-/* wrmsr with exception handling */
-#define wrmsr_safe(msr,a,b) ({ int ret__;  \
-   asm volatile("2: wrmsr ; xorl %0,%0\n"  \
-"1:\n\t"   \
-".section .fixup,\"ax\"\n\t"   \
-"3:  movl %4,%0 ; jmp 1b\n\t"  \
-".previous\n\t"\
-".section __ex_table,\"a\"\n"  \
-"   .align 8\n\t"  \
-"   .quad  2b,3b\n\t"  \
-".previous"\
-: "=a" (ret__) \
-: "c" (msr), "0" (a), "d" (b), "i" (-EFAULT)); \
-   ret__; })
-
-#define checking_wrmsrl(msr,val) wrmsr_safe(msr,(u32)(val),(u32)((val)>>32))
-
-#define rdmsr_safe(msr,a,b) \
-   ({ int ret__;   \
- asm volatile ("1:   rdmsr\n"  \
-   "2:\n"  \
-   ".section .fixup,\"ax\"\n"  \
-   "3:   movl %4,%0\n" \
-   " jmp 2b\n" \
-   ".previous\n"   \
-   ".section __ex_table,\"a\"\n"   \
-   " .align 8\n"   \
-   " .quad 1b,3b\n"\
-   ".previous":"=" (ret__), "=a"(*(a)), "=d"(*(b)) \
-   :"c"(msr), "i"(-EIO), "0"(0));  \
- ret__; })
-
 #define rdtsc(low,high) \
  __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
 
@@ -230,17 +198,17 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 
msr_no, u32 l, u32 h)
  __asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")
 
 #define rdtscp(low,high,aux) \
- asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" 
(aux))
+ __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), 
"=c" (aux))
 
 #define rdtscll(val) do { \
  unsigned int __a,__d; \
- asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); \
+ __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d)); \
  (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
 } while(0)
 
 #define rdtscpll(val, aux) do { \
  unsigned long __a, __d; \
- asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" 
(aux)); \
+ __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), 
"=c" (aux)); \
  (val) = (__d << 32) | __a; \
 } while (0)
 
@@ -253,6 +221,7 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 
msr_no, u32 l, u32 h)
  : "=a" (low), "=d" (high) \
  : "c" (counter))
 
+
 static inline void cpuid(int op, unsigned int *eax, unsigned int *ebx,
 unsigned int *ecx, unsigned int *edx)
 {
@@ -320,6 +289,40 @@ static inline unsigned int cpuid_edx(unsigned int op)
return edx;
 }
 
+#ifdef __KERNEL__
+
+/* wrmsr with exception handling */
+#define wrmsr_safe(msr,a,b) ({ int ret__;  \
+   asm volatile("2: wrmsr ; xorl %0,%0\n"  \
+"1:\n\t"   \
+".section .fixup,\"ax\"\n\t"   \
+"3:  movl %4,%0 ; jmp 1b\n\t"  \
+".previous\n\t"\
+".section __ex_table,\"a\"\n"  \
+"   .align 8\n\t"  \
+"   .quad  2b,3b\n\t"  \
+".previous"\
+: "=a" (ret__) \
+: "c" (msr), "0" (a), "d" (b), "i" (-EFAULT)); \
+   ret__; })
+
+#define checking_wrmsrl(msr,val) wrmsr_safe(msr,(u32)(val),(u32)((val)>>32))
+
+#define rdmsr_safe(msr,a,b) \
+   ({ int ret__;   \
+ asm volatile ("1:   rdmsr\n"  \
+   "2:\n"  \
+   ".section 

[PATCH] Warn about attempts to register/unregister devices during system suspend

2007-12-31 Thread Alan Stern
This patch (as1030) prints warning messages in the system log when
drivers try to register or unregister devices during a system sleep
transition.  These actions are now illegal and will either fail or
block (likely leading to deadlock).

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>

---

This patch applies on top of
gregkh-driver-pm-acquire-device-locks-prior-to-suspending.patch.  The
new locking arrangement can cause deadlocks or other errors if drivers
try to do the wrong thing.  With this patch we should easily be able to
tell where the problems are.

Alan Stern


Index: usb-2.6/drivers/base/core.c
===
--- usb-2.6.orig/drivers/base/core.c
+++ usb-2.6/drivers/base/core.c
@@ -789,8 +789,11 @@ int device_add(struct device *dev)
int error;
 
error = pm_sleep_lock();
-   if (error)
+   if (error) {
+   dev_warn(dev, "Illegal %s during suspend\n", __FUNCTION__);
+   dump_stack();
return error;
+   }
 
dev = get_device(dev);
if (!dev || !strlen(dev->bus_id)) {
@@ -953,6 +956,13 @@ void device_del(struct device * dev)
struct device * parent = dev->parent;
struct class_interface *class_intf;
 
+   if (pm_sleep_lock()) {
+   dev_warn(dev, "Illegal %s during suspend\n", __FUNCTION__);
+   dump_stack();
+   } else {
+   pm_sleep_unlock();
+   }
+
if (parent)
klist_del(>knode_parent);
if (MAJOR(dev->devt))

--
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.24-rc6-mm1 (build problem: gpio_keys)

2007-12-31 Thread David Brownell
On Monday 31 December 2007, Randy Dunlap wrote:
>   CC  drivers/input/keyboard/gpio_keys.o
> In file included from 
> /local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c:27:
> include2/asm/gpio.h:4:18: error: gpio.h: No such file or directory

Find whatever broken patch selected (on x86_64)

   CONFIG_GENERIC_GPIO=y

without actually providing that support (by providing  and
an implementation backing it up).  That's the patch which broke those
various GPIO-dependant drivers.

- Dave


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


Re: [PATCH] Force UNIX domain sockets to be built in

2007-12-31 Thread Torsten Kaiser
On Dec 31, 2007 6:18 PM, Michael Buesch <[EMAIL PROTECTED]> wrote:
> On Monday 31 December 2007 17:38:03 Alan Cox wrote:
> > On Mon, 31 Dec 2007 17:17:19 +0100
> > "Torsten Kaiser" <[EMAIL PROTECTED]> wrote:
> >
> > > a) this could be disabled during development if you want this
> > > b) this would even only affect development if you add new code that
> > > now needs a EXPORT_SYMBOL that was removed on an earlier build. And
> > > right now this would also need to trigger a rerun of depmod. And the
> > > same trigger could redo this garbage collect.
> > >
> > > Or am I missing something obvious?
> >
> > Development is not a phase seperate from use or distribution. A lot of
> > module testers for distributions will not be compiling their own modules
> > but loading in ones to test provided by their vendor - which may of
> > course then need different ksyms

I understand that point.
I just always assumed that kernel tests meant 'please test this patch'
and doing the compile yourself.

But I'm not convinced be the following:
> As an example, the whole purpose wireless-compat package is
> to load latest bleeding edge wireless stuff into a distribution kernel.
> So people are not required to recompile their kernels for using
> drivers that support their hardware.
> And guess what, it is used a _lot_. And lots of bugs are found with it.
> It increases our testing community a lot.

This looks more like a "regular" out-of-tree module for the purpose of
the suggested symbol garbage collector.
And for that case I already a 'don't use it then'-note.

The base problem is that there already are many options to break
external modules. (CONFIG_MODULES=n ;) )
Or in the case of this wireless module: CONFIG_CRYPTO_ARC4=n
(Without 'arc4' ieee80211_wep_init() will fail, that will fail
ieee80211_register_hw() and so no mac80211 driver could be loaded)

> So, all this wouldn't work, if kernel symbols could randomly get
> nuked by some "garbage collector".
>
> In practice, no distribution would use symbol garbage collection, as the
> only benefit from it would be an increased level of bugreports.

The question I can't answer in this context is: Do distributions want
to support external modules?
Only if yes, your argument is valid. But then they could just disable
this feature and prevent this kind of bugreports.

Torsten
--
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: Bad escriptions in Kconfig

2007-12-31 Thread Bodo Eggert
On Mon, 31 Dec 2007, Douglas Gilbert wrote:
> Matthew Wilcox wrote:
> > On Mon, Dec 31, 2007 at 10:16:43AM -0500, Douglas Gilbert wrote:
> >> Bodo Eggert wrote:

(Kicking netdev from CC)

> >>> ---
> >>> SCSI target support (SCSI_TGT) [N/m/y/?] (NEW) ?
> >>>
> >>> If you want to use SCSI target mode drivers enable this option.
> >>> If you choose M, the module will be called scsi_tgt.
> >>> ---
> >>>
> >>> What TF is a SCSI target mode, what is a target mode driver?
> >> Heard of google :-)
> >>
> >> For explanations of SCSI (and other storage) terminology
> >> reference could be made to SAM-3 or SAM-4 drafts (because
> >> the real standards cost money) at www.t10.org .
> >>
> >> Perhaps many other subsections in the kernel could have
> >> similar references.
> > 
> > I think that's an appalling idea.  Someone's trying to configure their
> > kernel, not research hundreds of new ideas on the internet.  Here's a
> > better description:
> > 
> > help
> >   The SCSI target code allows your computer to appear as a SCSI
> >   device.  This is useful in a SAN or NAS environment where you
> >   want other computers to be able to treat this computer as a disc.
> > 
> >   To compile this driver as a module, choose M here: the module
> >   will be called scsi_tgt.
> 
> Appalling or not, it is more accurate to define a SCSI target
> properly than equate it to a direct access logical unit (i.e.
> a disk).

Yes, but calling the current text a "help text" would be even less accurate.
Can you create a helpfull text without being incorrect?
-- 
Field experience is something you don't get until just after you need it.
--
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] x86: provide a DMI based port 0x80 I/O delay override

2007-12-31 Thread Robert Hancock

Alan Cox wrote:

"You plug in PCI DEBUG card and it overclocks your machine" is bad
scenario.. (I don't know if it does... can PCI card emulate ISA timings?)


Easily. Its a bit more restricted by later spec revisions but it can halt
your box of a week or two if it wants. Video cards used to pull this
stunt for marketing benchmark numbers.


The drivers, specifically (the old "don't check if the command FIFO is 
full before writing, just write anyway and if it's full let the whole 
PCI bus stall while the FIFO empties out" trick).


I rather doubt any of those PCI POST debug cards would bother to 
accurately emulate the ISA timings of normal port 0x80 accesses, 
however. Most likely if you plug those in, port 0x80 accesses suddenly 
become lots faster now that the writes are completing on the PCI bus 
before ever hitting ISA/LPC..


--
Robert Hancock  Saskatoon, SK, Canada
To email, remove "nospam" from [EMAIL PROTECTED]
Home Page: http://www.roberthancock.com/

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


Re: [PATCH] x86: provide a DMI based port 0x80 I/O delay override

2007-12-31 Thread H. Peter Anvin

Alan Cox wrote:

On Sun, 30 Dec 2007 16:23:20 -0800
"H. Peter Anvin" <[EMAIL PROTECTED]> wrote:

continuing to investigate for a cause.  It would be nice if it were a 
BIOS-fixable problem.  It would be even nicer if the BIOS were GPL...

If it was an SMM trap, I would expect it to be trapped in the SuperIO chip.


Many SuperIO chips do port 0x80, but they do it over the LPC and they do
it in hardware to the parallel port data lines. The timings posted for
0x80 on his box are really a bit fast for LPC.


Ah, that would eliminate the SuperIO chip.

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


RE: [PATCH] sh: sh7712 clock support

2007-12-31 Thread Andrew Murray
Hello,

Yes you are correct. Here is an updated patch. Happy New Year.

---
From: Andrew Murray <[EMAIL PROTECTED]>

This patch provides specific clock support for the SH7712. (This is my first 
ever patch, so apologies if I've not followed the procedure correctly!)

Signed-off-by: Andrew Murray <[EMAIL PROTECTED]>
---
diff -uprN -x sh-2.6/Documentation/dontdiff 
sh-2.6/arch/sh/kernel/cpu/sh3/clock-sh7712.c 
sh-2.6-devel/arch/sh/kernel/cpu/sh3/clock-sh7712.c
--- sh-2.6/arch/sh/kernel/cpu/sh3/clock-sh7712.c1970-01-01 
01:00:00.0 +0100
+++ sh-2.6-devel/arch/sh/kernel/cpu/sh3/clock-sh7712.c  2007-12-31 
15:04:51.0 +
@@ -0,0 +1,71 @@
+/*
+ * arch/sh/kernel/cpu/sh3/clock-sh7712.c
+ *
+ * SH7712 support for the clock framework
+ *
+ *  Copyright (C) 2007  Andrew Murray <[EMAIL PROTECTED]>
+ *
+ * Based on arch/sh/kernel/cpu/sh3/clock-sh3.c
+ *  Copyright (C) 2005  Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int multipliers[] = { 1, 2, 3 };
+static int divisors[]= { 1, 2, 3, 4, 6 };
+
+static void master_clk_init(struct clk *clk)
+{
+   int frqcr = ctrl_inw(FRQCR);
+   int idx = (frqcr & 0x0300) >> 8;
+
+   clk->rate *= multipliers[idx];
+}
+
+static struct clk_ops sh7712_master_clk_ops = {
+   .init   = master_clk_init,
+};
+
+static void module_clk_recalc(struct clk *clk)
+{
+   int frqcr = ctrl_inw(FRQCR);
+   int idx = frqcr & 0x0007;
+
+   clk->rate = clk->parent->rate / divisors[idx];
+}
+
+static struct clk_ops sh7712_module_clk_ops = {
+   .recalc = module_clk_recalc,
+};
+
+static void cpu_clk_recalc(struct clk *clk)
+{
+   int frqcr = ctrl_inw(FRQCR);
+   int idx = (frqcr & 0x0030) >> 4;
+
+   clk->rate = clk->parent->rate / divisors[idx];
+}
+
+static struct clk_ops sh7712_cpu_clk_ops = {
+   .recalc = cpu_clk_recalc,
+};
+
+static struct clk_ops *sh7712_clk_ops[] = {
+   _master_clk_ops,
+   _module_clk_ops,
+   _cpu_clk_ops,
+};
+
+void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
+{
+   if (idx < ARRAY_SIZE(sh7712_clk_ops))
+   *ops = sh7712_clk_ops[idx];
+}
+
diff -uprN -x sh-2.6/Documentation/dontdiff 
sh-2.6/arch/sh/kernel/cpu/sh3/Makefile 
sh-2.6-devel/arch/sh/kernel/cpu/sh3/Makefile
--- sh-2.6/arch/sh/kernel/cpu/sh3/Makefile  2007-12-31 14:47:32.0 
+
+++ sh-2.6-devel/arch/sh/kernel/cpu/sh3/Makefile2007-12-31 
15:01:15.0 +
@@ -22,5 +22,6 @@ clock-$(CONFIG_CPU_SUBTYPE_SH7706):= cl
 clock-$(CONFIG_CPU_SUBTYPE_SH7709) := clock-sh7709.o
 clock-$(CONFIG_CPU_SUBTYPE_SH7710) := clock-sh7710.o
 clock-$(CONFIG_CPU_SUBTYPE_SH7720) := clock-sh7710.o
+clock-$(CONFIG_CPU_SUBTYPE_SH7712) := clock-sh7712.o
 
 obj-y  += $(clock-y)
diff -uprN -x sh-2.6/Documentation/dontdiff 
sh-2.6/include/asm-sh/cpu-sh3/freq.h sh-2.6-devel/include/asm-sh/cpu-sh3/freq.h
--- sh-2.6/include/asm-sh/cpu-sh3/freq.h2007-12-31 14:47:47.0 
+
+++ sh-2.6-devel/include/asm-sh/cpu-sh3/freq.h  2007-12-31 15:02:30.0 
+
@@ -10,7 +10,12 @@
 #ifndef __ASM_CPU_SH3_FREQ_H
 #define __ASM_CPU_SH3_FREQ_H
 
+#ifdef CONFIG_CPU_SUBTYPE_SH7712
+#define FRQCR  0xA415FF80
+#else
 #define FRQCR  0xff80
+#endif
+
 #define MIN_DIVISOR_NR 0
 #define MAX_DIVISOR_NR 4


-Original Message-
From: Paul Mundt [mailto:[EMAIL PROTECTED] 
Sent: 31 December 2007 16:50
To: Andrew Murray
Cc: [EMAIL PROTECTED]; linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sh: sh7712 clock support

On Mon, Dec 31, 2007 at 04:32:25PM -, Andrew Murray wrote:
> +static void bus_clk_init(struct clk *clk)
> +{
> + clk->rate = CONFIG_SH_PCLK_FREQ;
> +}
> +
> +static struct clk_ops sh7712_bus_clk_ops = {
> + .init   = bus_clk_init,
> +};
> +
This shouldn't be necessary, the bus clk already references the master
clk as its parent, and inherits the rate from there. If you have no
recalc work to do, then you should be able to just leave this out
altogether. If you actually need this dummy init, then something is
broken with the upper layer, which we should fix ;-)

Patch looks fine otherwise. Tidy this up and I'll apply it.


Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.17.8 - Release Date: 24/12/2007 00:00
 

Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.17.8 - Release Date: 24/12/2007 00:00
 
  


sh7712clocksupportpatch2
Description: sh7712clocksupportpatch2


Re: 2.6.24-rc6-mm1 (build problem: gpio/W1)

2007-12-31 Thread Randy Dunlap
  CC  drivers/w1/masters/w1-gpio.o
In file included from 
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c:19:
include2/asm/gpio.h:4:18: error: gpio.h: No such file or directory
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c: In function 
'w1_gpio_write_bit_dir':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c:26: error: 
implicit declaration of function 'gpio_direction_input'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c:28: error: 
implicit declaration of function 'gpio_direction_output'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c: In function 
'w1_gpio_write_bit_val':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c:35: error: 
implicit declaration of function 'gpio_set_value'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c: In function 
'w1_gpio_read_bit':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c:42: error: 
implicit declaration of function 'gpio_get_value'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c: In function 
'w1_gpio_probe':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c:58: error: 
implicit declaration of function 'gpio_request'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/w1/masters/w1-gpio.c:82: error: 
implicit declaration of function 'gpio_free'
make[4]: *** [drivers/w1/masters/w1-gpio.o] Error 1

---
~Randy
desserts:  http://www.xenotime.net/linux/recipes/



config-w1-gpio
Description: Binary data


Re: 2.6.24-rc6-mm1 (build problem: v4l / i2c)

2007-12-31 Thread Randy Dunlap
  MODPOST 120 modules
ERROR: "i2c_attach_client" [drivers/media/video/v4l2-common.ko] undefined!
make[2]: *** [__modpost] Error 1

---
~Randy
desserts:  http://www.xenotime.net/linux/recipes/



config-v4l-i2c
Description: Binary data


Re: 2.6.24-rc6-mm1 (build problem: gpio_keys)

2007-12-31 Thread Randy Dunlap
  CC  drivers/input/keyboard/gpio_keys.o
In file included from 
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c:27:
include2/asm/gpio.h:4:18: error: gpio.h: No such file or directory
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c: In 
function 'gpio_keys_isr':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c:40: 
error: implicit declaration of function 'gpio_to_irq'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c:42: 
error: implicit declaration of function 'gpio_get_value'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c: In 
function 'gpio_keys_probe':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c:81: 
error: implicit declaration of function 'gpio_request'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c:88: 
error: implicit declaration of function 'gpio_direction_input'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/input/keyboard/gpio_keys.c:93: 
error: implicit declaration of function 'gpio_free'
make[4]: *** [drivers/input/keyboard/gpio_keys.o] Error 1

  CC  drivers/leds/leds-gpio.o
In file included from 
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c:18:
include2/asm/gpio.h:4:18: error: gpio.h: No such file or directory
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c: In function 
'gpio_led_work':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c:34: error: implicit 
declaration of function 'gpio_set_value_cansleep'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c: In function 
'gpio_led_set':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c:60: error: implicit 
declaration of function 'gpio_set_value'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c: In function 
'gpio_led_probe':
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c:85: error: implicit 
declaration of function 'gpio_cansleep'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c:90: error: implicit 
declaration of function 'gpio_request'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c:94: error: implicit 
declaration of function 'gpio_direction_output'
/local/linsrc/linux-2.6.24-rc6-mm1/drivers/leds/leds-gpio.c:100: error: 
implicit declaration of function 'gpio_free'
make[3]: *** [drivers/leds/leds-gpio.o] Error 1


---
~Randy
desserts:  http://www.xenotime.net/linux/recipes/



config-gpio-keys
Description: Binary data


Re: asm-x86/msr.h for sanitized headers: clean it or punt it

2007-12-31 Thread H. Peter Anvin

Mike Frysinger wrote:

---

Use __asm__ and __volatile__ in code that is exported to userspace.  Wrap
kernel functions with __KERNEL__ so they get scrubbed.

Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]>
---
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
index ba4b314..ffb9319 100644
--- a/include/asm-x86/msr.h
+++ b/include/asm-x86/msr.h
@@ -193,7 +193,7 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 
msr_no, u32 l, u32 h)
 
 /* wrmsr with exception handling */

 #define wrmsr_safe(msr,a,b) ({ int ret__;  \
-   asm volatile("2: wrmsr ; xorl %0,%0\n"\
+   __asm__ __volatile__("2: wrmsr ; xorl %0,%0\n"\
 "1:\n\t" \
 ".section .fixup,\"ax\"\n\t"   \
 "3:  movl %4,%0 ; jmp 1b\n\t"\


rdmsr_safe/wrmsr_safe are definitely kernel-only.

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


asm-x86/byteorder.h: clean up for userspace

2007-12-31 Thread Mike Frysinger
Since asm-x86/byteorder.h is exported to userspace, use __asm__ rather than
asm in its code.

Signed-Off-By: Mike Frysinger <[EMAIL PROTECTED]>
---
diff --git a/include/asm-x86/byteorder.h b/include/asm-x86/byteorder.h
index 1f2d6d5..fe2f2e5 100644
--- a/include/asm-x86/byteorder.h
+++ b/include/asm-x86/byteorder.h
@@ -30,13 +30,13 @@ static __inline__ __attribute_const__ __u64 
___arch__swab64(__u64 val)
} v;
v.u = val;
 #ifdef CONFIG_X86_BSWAP
-   asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
+   __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
: "=r" (v.s.a), "=r" (v.s.b)
: "0" (v.s.a), "1" (v.s.b));
 #else
v.s.a = ___arch__swab32(v.s.a);
v.s.b = ___arch__swab32(v.s.b);
-   asm("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" 
(v.s.b));
+   __asm__("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" 
(v.s.b));
 #endif
return v.u;
 }
--
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: asm-x86/msr.h for sanitized headers: clean it or punt it

2007-12-31 Thread Mike Frysinger
On Monday 31 December 2007, Andi Kleen wrote:
> > can you enumerate which functions need to actually go to userspace then ?
> >  the
>
> rdtscl/rdtscll/rdpmc primarily

i'll just mark out the useless C funcs then

> > __KERNEL__ markings are a crapshoot at the moment.  you must also be
> > jumping through hoops in order to use the header in the first place since
> > the vanilla one wont compile out of the box.
>
> At least the 64bit one or older 32bit one works without hoops. Agreed that
> the paravirt changes destroyed it on newer 32bit though. That's an
> unfortunate regression.

i dont see how when the exported code has prototypes with "u32" types in them.
but at any rate ...
---
Use __asm__ and __volatile__ in code that is exported to userspace.  Wrap
kernel functions with __KERNEL__ so they get scrubbed.

Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]>
---
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
index ba4b314..ffb9319 100644
--- a/include/asm-x86/msr.h
+++ b/include/asm-x86/msr.h
@@ -193,7 +193,7 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 
msr_no, u32 l, u32 h)
 
 /* wrmsr with exception handling */
 #define wrmsr_safe(msr,a,b) ({ int ret__;  \
-   asm volatile("2: wrmsr ; xorl %0,%0\n"  \
+   __asm__ __volatile__("2: wrmsr ; xorl %0,%0\n"  \
 "1:\n\t"   \
 ".section .fixup,\"ax\"\n\t"   \
 "3:  movl %4,%0 ; jmp 1b\n\t"  \
@@ -210,7 +210,7 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 
msr_no, u32 l, u32 h)
 
 #define rdmsr_safe(msr,a,b) \
({ int ret__;   \
- asm volatile ("1:   rdmsr\n"  \
+ __asm__ __volatile__ ("1:   rdmsr\n"  \
"2:\n"  \
".section .fixup,\"ax\"\n"  \
"3:   movl %4,%0\n" \
@@ -230,17 +230,17 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 
msr_no, u32 l, u32 h)
  __asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")
 
 #define rdtscp(low,high,aux) \
- asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" 
(aux))
+ __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), 
"=c" (aux))
 
 #define rdtscll(val) do { \
  unsigned int __a,__d; \
- asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); \
+ __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d)); \
  (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
 } while(0)
 
 #define rdtscpll(val, aux) do { \
  unsigned long __a, __d; \
- asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" 
(aux)); \
+ __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), 
"=c" (aux)); \
  (val) = (__d << 32) | __a; \
 } while (0)
 
@@ -320,6 +320,7 @@ static inline unsigned int cpuid_edx(unsigned int op)
return edx;
 }
 
+#ifdef __KERNEL__
 #ifdef CONFIG_SMP
 void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
 void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
@@ -343,6 +344,7 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 
msr_no, u32 l, u32 h)
return wrmsr_safe(msr_no, l, h);
 }
 #endif  /* CONFIG_SMP */
+#endif  /* __KERNEL__ */
 #endif  /* __ASSEMBLY__ */
 
 #endif  /* !__i386__ */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [ANNOUNCE] qgit-2.1 and qgit-1.5.8

2007-12-31 Thread Marco Costalba
On Dec 31, 2007 6:47 PM, Boaz Harrosh <[EMAIL PROTECTED]> wrote:
> On Mon, Dec 31 2007 at 13:58 +0200, "Marco Costalba" <[EMAIL PROTECTED]> 
> wrote:
> > On Dec 31, 2007 11:59 AM, Filippo Zangheri <[EMAIL PROTECTED]> wrote:
> >> Hi,
> >>
> >> I git-cloned qgit-2.1 from your repository, then ran `qmake qgit.pro`, but 
> >> `make` gave me errors.
> >
> > Yes, you need qmake of Qt4 not the Qt3 one.
> >
> 
>
> A Theoretical question.
> Is it possible to compile Qt4 app all statically linked and run it on a Qt3 
> based KDE
> machine. Some thing like the windows installation, where every thing is 
> self-contained?
>

It's also very practical...I have _only_ KDE 3 installed, not KDE 4 ;-)

I have both Qt4 and Qt3 development (shared) libraries installed and
there is absolutely no compatibility problem, the only thing you have
to remember is when running

qmake qgit.pro

the first time, you need to be sure is the Qt4 qmake, not the Qt3.
Because I have Qt3 qmake in path, not the Qt4 one, I need to
explicitly give the whole path the first time I configure the sources,
something like

/usr/lib/qt4/bin/qmake qgit.pro

Then no other settings are needed, when you call make, the Makefiles
are already built by qmake to search for the correct libraries.


Hope this helps...

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