WMI: initialize wmi_blocks.list even if ACPI is disabled

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=96b5a46e2a72dc1829370c87053e0cd558d58bc0
Commit: 96b5a46e2a72dc1829370c87053e0cd558d58bc0
Parent: 2c1582699872d38682b136b1446953ee351bc7e1
Author: Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 20:52:01 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 20:52:01 2008 -0800

WMI: initialize wmi_blocks.list even if ACPI is disabled

Even if we don't want to register the WMI driver, we should initialize
the wmi_blocks list to be empty, since we don't want the wmi helper
functions to oops just because that basic list has not even been set up.

With this, "find_guid()" will happily return "not found" rather than
oopsing all over the place, and the callers will then just automatically
return false or AE_NOT_FOUND as appropriate.

Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/acpi/wmi.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/wmi.c b/drivers/acpi/wmi.c
index 36b84ab..457ed3d 100644
--- a/drivers/acpi/wmi.c
+++ b/drivers/acpi/wmi.c
@@ -673,11 +673,11 @@ static int __init acpi_wmi_init(void)
 {
acpi_status result;
 
+   INIT_LIST_HEAD(&wmi_blocks.list);
+
if (acpi_disabled)
return -ENODEV;
 
-   INIT_LIST_HEAD(&wmi_blocks.list);
-
result = acpi_bus_register_driver(&acpi_wmi_driver);
 
if (result < 0) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: vdso_install fix

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2c1582699872d38682b136b1446953ee351bc7e1
Commit: 2c1582699872d38682b136b1446953ee351bc7e1
Parent: 31f1de46b90ad360a16e7af3e277d104961df923
Author: Roland McGrath <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 14:38:51 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 20:50:09 2008 -0800

x86: vdso_install fix

The makefile magic for installing the 32-bit vdso images on disk had a
little error.  A single-line change would fix that bug, but this does a
little more to reduce the error-prone duplication of this bit of
makefile variable magic.

Signed-off-by: Roland McGrath <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/x86/vdso/Makefile |   22 --
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index d28dda5..f385a4b 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -7,7 +7,7 @@ VDSO32-$(CONFIG_X86_32) := y
 VDSO32-$(CONFIG_COMPAT):= y
 
 vdso-install-$(VDSO64-y)   += vdso.so
-vdso-install-$(VDSO32-y)   += $(vdso32-y:=.so)
+vdso-install-$(VDSO32-y)   += $(vdso32-images)
 
 
 # files to link into the vdso
@@ -63,6 +63,8 @@ vdso32.so-$(CONFIG_X86_32)+= int80
 vdso32.so-$(CONFIG_COMPAT) += syscall
 vdso32.so-$(VDSO32-y)  += sysenter
 
+vdso32-images  = $(vdso32.so-y:%=vdso32-%.so)
+
 CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)
 VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -Wl,-soname=linux-gate.so.1
 
@@ -71,21 +73,21 @@ VDSO_LDFLAGS_vdso32.lds = -m elf_i386 
-Wl,-soname=linux-gate.so.1
 override obj-dirs = $(dir $(obj)) $(obj)/vdso32/
 
 targets += vdso32/vdso32.lds
-targets += $(vdso32.so-y:%=vdso32-%.so.dbg) $(vdso32.so-y:%=vdso32-%.so)
+targets += $(vdso32-images) $(vdso32-images:=.dbg)
 targets += vdso32/note.o $(vdso32.so-y:%=vdso32/%.o)
 
-extra-y+= $(vdso32.so-y:%=vdso32-%.so)
+extra-y+= $(vdso32-images)
 
-$(obj)/vdso32.o: $(vdso32.so-y:%=$(obj)/vdso32-%.so)
+$(obj)/vdso32.o: $(vdso32-images:%=$(obj)/%)
 
 KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS))
-$(vdso32.so-y:%=$(obj)/vdso32-%.so.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
-$(vdso32.so-y:%=$(obj)/vdso32-%.so.dbg): asflags-$(CONFIG_X86_64) += -m32
+$(vdso32-images:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
+$(vdso32-images:%=$(obj)/%.dbg): asflags-$(CONFIG_X86_64) += -m32
 
-$(vdso32.so-y:%=$(obj)/vdso32-%.so.dbg): $(obj)/vdso32-%.so.dbg: FORCE \
-$(obj)/vdso32/vdso32.lds \
-$(obj)/vdso32/note.o \
-$(obj)/vdso32/%.o
+$(vdso32-images:%=$(obj)/%.dbg): $(obj)/vdso32-%.so.dbg: FORCE \
+$(obj)/vdso32/vdso32.lds \
+$(obj)/vdso32/note.o \
+$(obj)/vdso32/%.o
$(call if_changed,vdso)
 
 # Make vdso32-*-syms.lds from each image, and then make sure they match.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


mempolicy: silently restrict nodemask to allowed nodes

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=31f1de46b90ad360a16e7af3e277d104961df923
Commit: 31f1de46b90ad360a16e7af3e277d104961df923
Parent: 1a510089849ff9f70b654659bf976a6baf3a4833
Author: KOSAKI Motohiro <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 12 13:30:22 2008 +0900
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 20:48:29 2008 -0800

mempolicy: silently restrict nodemask to allowed nodes

Kosaki Motohito noted that "numactl --interleave=all ..." failed in the
presence of memoryless nodes.  This patch attempts to fix that problem.

Some background:

numactl --interleave=all calls set_mempolicy(2) with a fully populated
[out to MAXNUMNODES] nodemask.  set_mempolicy() [in do_set_mempolicy()]
calls contextualize_policy() which requires that the nodemask be a
subset of the current task's mems_allowed; else EINVAL will be returned.

A task's mems_allowed will always be a subset of node_states[N_HIGH_MEMORY]
i.e., nodes with memory.  So, a fully populated nodemask will be
declared invalid if it includes memoryless nodes.

  NOTE:  the same thing will occur when running in a cpuset
 with restricted mem_allowed--for the same reason:
 node mask contains dis-allowed nodes.

mbind(2), on the other hand, just masks off any nodes in the nodemask
that are not included in the caller's mems_allowed.

In each case [mbind() and set_mempolicy()], mpol_check_policy() will
complain [again, resulting in EINVAL] if the nodemask contains any
memoryless nodes.  This is somewhat redundant as mpol_new() will remove
memoryless nodes for interleave policy, as will bind_zonelist()--called
by mpol_new() for BIND policy.

Proposed fix:

1) modify contextualize_policy logic to:
   a) remember whether the incoming node mask is empty.
   b) if not, restrict the nodemask to allowed nodes, as is
  currently done in-line for mbind().  This guarantees
  that the resulting mask includes only nodes with memory.

  NOTE:  this is a [benign, IMO] change in behavior for
 set_mempolicy().  Dis-allowed nodes will be
 silently ignored, rather than returning an error.

   c) fold this code into mpol_check_policy(), replace 2 calls to
  contextualize_policy() to call mpol_check_policy() directly
  and remove contextualize_policy().

2) In existing mpol_check_policy() logic, after "contextualization":
   a) MPOL_DEFAULT:  require that in coming mask "was_empty"
   b) MPOL_{BIND|INTERLEAVE}:  require that contextualized nodemask
  contains at least one node.
   c) add a case for MPOL_PREFERRED:  if in coming was not empty
  and resulting mask IS empty, user specified invalid nodes.
  Return EINVAL.
   c) remove the now redundant check for memoryless nodes

3) remove the now redundant masking of policy nodes for interleave
   policy from mpol_new().

4) Now that mpol_check_policy() contextualizes the nodemask, remove
   the in-line nodes_and() from sys_mbind().  I believe that this
   restores mbind() to the behavior before the memoryless-nodes
   patch series.  E.g., we'll no longer treat an invalid nodemask
   with MPOL_PREFERRED as local allocation.

[ Patch history:

  v1 -> v2:
   - Communicate whether or not incoming node mask was empty to
 mpol_check_policy() for better error checking.
   - As suggested by David Rientjes, remove the now unused
 cpuset_nodes_subset_current_mems_allowed() from cpuset.h

  v2 -> v3:
   - As suggested by Kosaki Motohito, fold the "contextualization"
 of policy nodemask into mpol_check_policy().  Looks a little
 cleaner. ]

Signed-off-by:  Lee Schermerhorn <[EMAIL PROTECTED]>
Signed-off-by:  KOSAKI Motohiro <[EMAIL PROTECTED]>
Tested-by:  KOSAKI Motohiro <[EMAIL PROTECTED]>
Acked-by:   David Rientjes <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/cpuset.h |3 --
 mm/mempolicy.c |   61 ---
 2 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index f8c9a27..0a26be3 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -26,8 +26,6 @@ extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
 #define cpuset_current_mems_allowed (current->mems_allowed)
 void cpuset_init_current_mems_allowed(void);
 void cpuset_update_task_memory_state(void);
-#define cpuset_nodes_subset_current_mems_allowed(nodes) \
-   nodes_subset((nodes), current->mems_allowed)
 int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl);
 
 extern int __cpuset_zone_allowed_sof

[IA64] Fix build for sim_defconfig

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=10d0aa3c0a03dd04227ab3a4958563d84276d02e
Commit: 10d0aa3c0a03dd04227ab3a4958563d84276d02e
Parent: 19af35546de68c872dcb687613e0902a602cb20e
Author: Tony Luck <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 13:23:46 2008 -0800
Committer:  Tony Luck <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 13:23:46 2008 -0800

[IA64] Fix build for sim_defconfig

Commit bdc807871d58285737d50dc6163d0feb72cb0dc2 broke the build
for this config because the sim_defconfig selects CONFIG_HZ=250
but include/asm-ia64/param.h has an ifdef for the simulator to
force HZ to 32.  So we ended up with a kernel/timeconst.h set
for HZ=250 ... which then failed the check for the right HZ
value and died with:

Drop the #ifdef magic from param.h and make force CONFIG_HZ=32
directly for the simulator.

Signed-off-by: Tony Luck <[EMAIL PROTECTED]>
---
 arch/ia64/Kconfig|7 +++
 include/asm-ia64/param.h |   10 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 2d4fcd0..dff9edf 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -232,7 +232,14 @@ config PGTABLE_4
 
 endchoice
 
+if IA64_HP_SIM
+config HZ
+   default 32
+endif
+
+if !IA64_HP_SIM
 source kernel/Kconfig.hz
+endif
 
 config IA64_BRL_EMU
bool
diff --git a/include/asm-ia64/param.h b/include/asm-ia64/param.h
index 49c62dd..0964c32 100644
--- a/include/asm-ia64/param.h
+++ b/include/asm-ia64/param.h
@@ -19,15 +19,7 @@
 #define MAXHOSTNAMELEN 64  /* max length of hostname */
 
 #ifdef __KERNEL__
-# ifdef CONFIG_IA64_HP_SIM
-  /*
-   * Yeah, simulating stuff is slow, so let us catch some breath between
-   * timer interrupts...
-   */
-#  define HZ 32
-# else
-#  define HZ   CONFIG_HZ
-# endif
+# define HZCONFIG_HZ
 # define USER_HZ   HZ
 # define CLOCKS_PER_SECHZ  /* frequency at which times() counts */
 #else
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Be more robust about bad arguments in get_user_pages()

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=900cf086fd2fbad07f72f4575449e0d0958f860f
Commit: 900cf086fd2fbad07f72f4575449e0d0958f860f
Parent: b1292b17dc03fcd90f3301974cea1b7c61371ba5
Author: Jonathan Corbet <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 16:17:33 2008 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 20:44:44 2008 -0800

Be more robust about bad arguments in get_user_pages()

So I spent a while pounding my head against my monitor trying to figure
out the vmsplice() vulnerability - how could a failure to check for
*read* access turn into a root exploit? It turns out that it's a buffer
overflow problem which is made easy by the way get_user_pages() is
coded.

In particular, "len" is a signed int, and it is only checked at the
*end* of a do {} while() loop.  So, if it is passed in as zero, the loop
will execute once and decrement len to -1.  At that point, the loop will
proceed until the next invalid address is found; in the process, it will
likely overflow the pages array passed in to get_user_pages().

I think that, if get_user_pages() has been asked to grab zero pages,
that's what it should do.  Thus this patch; it is, among other things,
enough to block the (already fixed) root exploit and any others which
might be lurking in similar code.  I also think that the number of pages
should be unsigned, but changing the prototype of this function probably
requires some more careful review.

Signed-off-by: Jonathan Corbet <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/memory.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index e5628a5..717aa0e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -989,6 +989,8 @@ int get_user_pages(struct task_struct *tsk, struct 
mm_struct *mm,
int i;
unsigned int vm_flags;
 
+   if (len <= 0)
+   return 0;
/* 
 * Require read or write permissions.
 * If 'force' is set, we only require the "MAY" flags.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


mlx4_core: Fix build break (missing include)

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29c271123dc7895a9f77d3e61e747b2a052d0a2a
Commit: 29c271123dc7895a9f77d3e61e747b2a052d0a2a
Parent: cc13e442952a347f7e217eeaee4778485394f1be
Author: Olof Johansson <[EMAIL PROTECTED]>
AuthorDate: Sun Feb 10 20:22:57 2008 -0600
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 14:19:42 2008 -0800

mlx4_core: Fix build break (missing include)

Commit 313abe55 ("mlx4_core: For 64-bit systems, vmap() kernel queue
buffers") caused this to pop up on powerpc allyesconfig, looks like a
missing include file:

drivers/net/mlx4/alloc.c: In function 'mlx4_buf_alloc':
drivers/net/mlx4/alloc.c:162: error: implicit declaration of function 
'vmap'
drivers/net/mlx4/alloc.c:162: error: 'VM_MAP' undeclared (first use in 
this function)
drivers/net/mlx4/alloc.c:162: error: (Each undeclared identifier is 
reported only once
drivers/net/mlx4/alloc.c:162: error: for each function it appears in.)
drivers/net/mlx4/alloc.c:162: warning: assignment makes pointer from 
integer without a cast
drivers/net/mlx4/alloc.c: In function 'mlx4_buf_free':
drivers/net/mlx4/alloc.c:187: error: implicit declaration of function 
'vunmap'

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/net/mlx4/alloc.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/mlx4/alloc.c b/drivers/net/mlx4/alloc.c
index 521dc03..75ef9d0 100644
--- a/drivers/net/mlx4/alloc.c
+++ b/drivers/net/mlx4/alloc.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "mlx4.h"
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Add Matt to MAINTAINERS as a SLAB allocator maintainer

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c76d118ecc5fcac7c823fb428676860dba0fdd20
Commit: c76d118ecc5fcac7c823fb428676860dba0fdd20
Parent: a17b7a398d5c20ccbcb11f98dc2a76a6f07934ad
Author: Pekka Enberg <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 23:52:47 2008 +0200
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 20:42:49 2008 -0800

Add Matt to MAINTAINERS as a SLAB allocator maintainer

Matt is already the maintainer of SLOB which is one of the "SLAB" 
allocators in
the kernel so add him to MAINTAINERS.

Signed-off-by: Pekka Enberg <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 MAINTAINERS |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index c40f0ae..6680ec4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3561,6 +3561,8 @@ P:Christoph Lameter
 M: [EMAIL PROTECTED]
 P: Pekka Enberg
 M: [EMAIL PROTECTED]
+P: Matt Mackall
+M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 S: Maintained
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sata_mv: platform driver allocs dma without create

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fbf14e2f2d674e6a2ff0fb2aa569e7f6687483a3
Commit: fbf14e2f2d674e6a2ff0fb2aa569e7f6687483a3
Parent: 4194645079ca15679bf7e5b00e71561cf6864761
Author: Byron Bradley <[EMAIL PROTECTED]>
AuthorDate: Sun Feb 10 21:17:30 2008 +
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 14:30:10 2008 -0500

sata_mv: platform driver allocs dma without create

When the sata_mv driver is used as a platform driver,
mv_create_dma_pools() is never called so it fails when trying
to alloc in mv_pool_start().

Signed-off-by: Byron Bradley <[EMAIL PROTECTED]>
Acked-by: Mark Lord <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/sata_mv.c |   44 
 1 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index f5333ce..04b5717 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -2881,6 +2881,26 @@ done:
return rc;
 }
 
+static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
+{
+   hpriv->crqb_pool   = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
+MV_CRQB_Q_SZ, 0);
+   if (!hpriv->crqb_pool)
+   return -ENOMEM;
+
+   hpriv->crpb_pool   = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
+MV_CRPB_Q_SZ, 0);
+   if (!hpriv->crpb_pool)
+   return -ENOMEM;
+
+   hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
+MV_SG_TBL_SZ, 0);
+   if (!hpriv->sg_tbl_pool)
+   return -ENOMEM;
+
+   return 0;
+}
+
 /**
  *  mv_platform_probe - handle a positive probe of an soc Marvell
  *  host
@@ -2934,6 +2954,10 @@ static int mv_platform_probe(struct platform_device 
*pdev)
hpriv->base = ioremap(res->start, res->end - res->start + 1);
hpriv->base -= MV_SATAHC0_REG_BASE;
 
+   rc = mv_create_dma_pools(hpriv, &pdev->dev);
+   if (rc)
+   return rc;
+
/* initialize adapter */
rc = mv_init_host(host, chip_soc);
if (rc)
@@ -3070,26 +3094,6 @@ static void mv_print_info(struct ata_host *host)
   scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx");
 }
 
-static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
-{
-   hpriv->crqb_pool   = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
-MV_CRQB_Q_SZ, 0);
-   if (!hpriv->crqb_pool)
-   return -ENOMEM;
-
-   hpriv->crpb_pool   = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
-MV_CRPB_Q_SZ, 0);
-   if (!hpriv->crpb_pool)
-   return -ENOMEM;
-
-   hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
-MV_SG_TBL_SZ, 0);
-   if (!hpriv->sg_tbl_pool)
-   return -ENOMEM;
-
-   return 0;
-}
-
 /**
  *  mv_pci_init_one - handle a positive probe of a PCI Marvell host
  *  @pdev: PCI device found
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pata_ninja32: setup changes

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4194645079ca15679bf7e5b00e71561cf6864761
Commit: 4194645079ca15679bf7e5b00e71561cf6864761
Parent: 8397248d4662d77296889529c911e2182151afa9
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 15:25:10 2008 +
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 14:30:07 2008 -0500

pata_ninja32: setup changes

Forcibly set more of the configuration at init time. This seems to fix at
least one problem reported. We don't know what most of these bits do, but
we do know what windows stuffs there.

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/pata_ninja32.c |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/pata_ninja32.c b/drivers/ata/pata_ninja32.c
index 1c1b835..15dd649 100644
--- a/drivers/ata/pata_ninja32.c
+++ b/drivers/ata/pata_ninja32.c
@@ -17,6 +17,7 @@
  * Base + 0x00 IRQ Status
  * Base + 0x01 IRQ control
  * Base + 0x02 Chipset control
+ * Base + 0x03 Unknown
  * Base + 0x04 VDMA and reset control + wait bits
  * Base + 0x08 BMIMBA
  * Base + 0x0C DMA Length
@@ -174,8 +175,12 @@ static int ninja32_init_one(struct pci_dev *dev, const 
struct pci_device_id *id)
ata_std_ports(&ap->ioaddr);
 
iowrite8(0x05, base + 0x01);/* Enable interrupt lines */
-   iowrite8(0xB3, base + 0x02);/* Burst, ?? setup */
-   iowrite8(0x00, base + 0x04);/* WAIT0 ? */
+   iowrite8(0xBE, base + 0x02);/* Burst, ?? setup */
+   iowrite8(0x01, base + 0x03);/* Unknown */
+   iowrite8(0x20, base + 0x04);/* WAIT0 */
+   iowrite8(0x8f, base + 0x05);/* Unknown */
+   iowrite8(0xa4, base + 0x1c);/* Unknown */
+   iowrite8(0x83, base + 0x1d);/* BMDMA control: WAIT0 */
/* FIXME: Should we disable them at remove ? */
return ata_host_activate(host, dev->irq, ata_interrupt,
 IRQF_SHARED, &ninja32_sht);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pata_legacy: typo fix

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8397248d4662d77296889529c911e2182151afa9
Commit: 8397248d4662d77296889529c911e2182151afa9
Parent: c9544bcb4c7df07555e4b22d297c5705738da09d
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 15:23:38 2008 +
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 14:30:06 2008 -0500

pata_legacy: typo fix

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/pata_legacy.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 333dc15..6c59969 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -127,7 +127,7 @@ static int opti82c611a; /* Opti82c611A on 
primary 1, sec 2, both 3 */
 static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */
 static int qdi;/* Set to probe QDI controllers */
 static int winbond;/* Set to probe Winbond controllers,
-   give I/O port if non stdanard */
+   give I/O port if non standard */
 static int autospeed;  /* Chip present which snoops speed changes */
 static int pio_mask = 0x1F;/* PIO range for autospeed devices */
 static int iordy_mask = 0x;/* Use iordy if available */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pata_amd: Note in the module description it handles Nvidia

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c9544bcb4c7df07555e4b22d297c5705738da09d
Commit: c9544bcb4c7df07555e4b22d297c5705738da09d
Parent: 8f71efe25f8718200027b547a3e749ae3300fe60
Author: Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 15:22:39 2008 +
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 14:30:04 2008 -0500

pata_amd: Note in the module description it handles Nvidia

This has confused a few people so fix it

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/pata_amd.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 761a666..ea567e2 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -772,7 +772,7 @@ static void __exit amd_exit(void)
 }
 
 MODULE_AUTHOR("Alan Cox");
-MODULE_DESCRIPTION("low-level driver for AMD PATA IDE");
+MODULE_DESCRIPTION("low-level driver for AMD and Nvidia PATA IDE");
 MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, amd);
 MODULE_VERSION(DRV_VERSION);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sata_mv: fix loop with last port

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f71efe25f8718200027b547a3e749ae3300fe60
Commit: 8f71efe25f8718200027b547a3e749ae3300fe60
Parent: 4055dee7f525a702a060ea08a3fb9f045317355f
Author: Yinghai Lu <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 15:06:17 2008 -0800
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 14:30:01 2008 -0500

sata_mv: fix loop with last port

commit f351b2d638c3cb0b95adde3549b7bfaf3f991dfa
sata_mv: Support SoC controllers

cause panic:

scsi 4:0:0:0: Direct-Access ATA  HITACHI HDS7225S V44O PQ: 0 ANSI: 5
sd 4:0:0:0: [sde] 488390625 512-byte hardware sectors (250056 MB)
sd 4:0:0:0: [sde] Write Protect is off
sd 4:0:0:0: [sde] Mode Sense: 00 3a 00 00
sd 4:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't 
support DPO or FUA
sd 4:0:0:0: [sde] 488390625 512-byte hardware sectors (250056 MB)
sd 4:0:0:0: [sde] Write Protect is off
sd 4:0:0:0: [sde] Mode Sense: 00 3a 00 00
sd 4:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't 
support DPO or FUA
 sde:<1>BUG: unable to handle kernel NULL pointer dereference at 
001a
IP: [] mv_interrupt+0x21c/0x4cc
PGD 0
Oops:  [1] SMP
CPU 3
Modules linked in:
Pid: 0, comm: swapper Not tainted 2.6.24-smp-08636-g0afc2ed-dirty #26
RIP: 0010:[]  [] 
mv_interrupt+0x21c/0x4cc
RSP: :8102050bbec8  EFLAGS: 00010297
RAX: 0008 RBX:  RCX: 0003
RDX: 8000 RSI: 0286 RDI: 8102035180e0
RBP: 0001 R08: 0003 R09: 8102036613e0
R10: 0002 R11: 8061474c R12: 8102035bf828
R13: 0008 R14: 81020348ece8 R15: c20002cb2000
FS:  () GS:810405025700() knlGS:
CS:  0010 DS: 0018 ES: 0018 CR0: 8005003b
CR2: 001a CR3: 00201000 CR4: 06e0
DR0:  DR1:  DR2: 
DR3:  DR6: 0ff0 DR7: 0400
Process swapper (pid: 0, threadinfo 810405094000, task 8102050b28c0)
Stack:  0001000c 000204220400 00110002 81020348eda8
 0001 8102035f2cc0  
 0018   80269ee8
Call Trace:
   [] ? handle_IRQ_event+0x25/0x53
 [] ? handle_fasteoi_irq+0x90/0xc8
 [] ? do_IRQ+0xf1/0x15f
 [] ? default_idle+0x0/0x55
 [] ? ret_from_intr+0x0/0xa
   [] ? lapic_next_event+0x0/0xa
 [] ? default_idle+0x31/0x55
 [] ? default_idle+0x2c/0x55
 [] ? default_idle+0x0/0x55
 [] ? cpu_idle+0x92/0xb8

Code: 41 14 85 c0 89 44 24 14 0f 84 9d 02 00 00 f7 d0 01 d6 41 89 d5 89 41 
14 8b 41 14 89 34 24 e9 7e 02 00 00 49 63 c5 49 8b 5c c6 48  43 1a 80 4c 8b 
a3 20 37 00 00 0f 85 62 02 00 00 31 c9 41 83
RIP  [] mv_interrupt+0x21c/0x4cc
 RSP 
CR2: 001a
---[ end trace 2583b5f7a5350584 ]---
Kernel panic - not syncing: Aiee, killing interrupt handler!

last_port already include port0 base.
this patch change use last_port directly, and move pp assignment later.

Signed-off-by: Yinghai Lu <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/sata_mv.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 080b836..f5333ce 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1716,14 +1716,16 @@ static void mv_host_intr(struct ata_host *host, u32 
relevant, unsigned int hc)
VPRINTK("ENTER, hc%u relevant=0x%08x HC IRQ cause=0x%08x\n",
hc, relevant, hc_irq_cause);
 
-   for (port = port0; port < port0 + last_port; port++) {
+   for (port = port0; port < last_port; port++) {
struct ata_port *ap = host->ports[port];
-   struct mv_port_priv *pp = ap->private_data;
+   struct mv_port_priv *pp;
int have_err_bits, hard_port, shift;
 
if ((!ap) || (ap->flags & ATA_FLAG_DISABLED))
continue;
 
+   pp = ap->private_data;
+
shift = port << 1;  /* (port * 2) */
if (port >= MV_PORTS_PER_HC) {
shift++;/* skip bit 8 in the HC Main IRQ reg */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libata: ignore deverr on SETXFER if mode is configured

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4055dee7f525a702a060ea08a3fb9f045317355f
Commit: 4055dee7f525a702a060ea08a3fb9f045317355f
Parent: 7585eb1b7cf4bbace37ce18500809140c8eeccc3
Author: Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 10:34:08 2008 +0900
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 14:29:47 2008 -0500

libata: ignore deverr on SETXFER if mode is configured

Some controllers (VIA CX700) raise device error on SETXFER even after
mode configuration succeeded.  Update ata_dev_set_mode() such that
device error is ignored if transfer mode is configured correctly.  To
implement this, device is revalidated even after device error on
SETXFER.

This fixes kernel bugzilla bug 8563.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Cc: Alan Cox <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-core.c |   48 ++--
 1 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3011919..004dae4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3048,6 +3048,8 @@ int ata_down_xfermask_limit(struct ata_device *dev, 
unsigned int sel)
 static int ata_dev_set_mode(struct ata_device *dev)
 {
struct ata_eh_context *ehc = &dev->link->eh_context;
+   const char *dev_err_whine = "";
+   int ign_dev_err = 0;
unsigned int err_mask;
int rc;
 
@@ -3057,41 +3059,57 @@ static int ata_dev_set_mode(struct ata_device *dev)
 
err_mask = ata_dev_set_xfermode(dev);
 
+   if (err_mask & ~AC_ERR_DEV)
+   goto fail;
+
+   /* revalidate */
+   ehc->i.flags |= ATA_EHI_POST_SETMODE;
+   rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0);
+   ehc->i.flags &= ~ATA_EHI_POST_SETMODE;
+   if (rc)
+   return rc;
+
/* Old CFA may refuse this command, which is just fine */
if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id))
-   err_mask &= ~AC_ERR_DEV;
+   ign_dev_err = 1;
 
/* Some very old devices and some bad newer ones fail any kind of
   SET_XFERMODE request but support PIO0-2 timings and no IORDY */
if (dev->xfer_shift == ATA_SHIFT_PIO && !ata_id_has_iordy(dev->id) &&
dev->pio_mode <= XFER_PIO_2)
-   err_mask &= ~AC_ERR_DEV;
+   ign_dev_err = 1;
 
/* Early MWDMA devices do DMA but don't allow DMA mode setting.
   Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */
if (dev->xfer_shift == ATA_SHIFT_MWDMA &&
dev->dma_mode == XFER_MW_DMA_0 &&
(dev->id[63] >> 8) & 1)
-   err_mask &= ~AC_ERR_DEV;
+   ign_dev_err = 1;
 
-   if (err_mask) {
-   ata_dev_printk(dev, KERN_ERR, "failed to set xfermode "
-  "(err_mask=0x%x)\n", err_mask);
-   return -EIO;
-   }
+   /* if the device is actually configured correctly, ignore dev err */
+   if (dev->xfer_mode == ata_xfer_mask2mode(ata_id_xfermask(dev->id)))
+   ign_dev_err = 1;
 
-   ehc->i.flags |= ATA_EHI_POST_SETMODE;
-   rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0);
-   ehc->i.flags &= ~ATA_EHI_POST_SETMODE;
-   if (rc)
-   return rc;
+   if (err_mask & AC_ERR_DEV) {
+   if (!ign_dev_err)
+   goto fail;
+   else
+   dev_err_whine = " (device error ignored)";
+   }
 
DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
dev->xfer_shift, (int)dev->xfer_mode);
 
-   ata_dev_printk(dev, KERN_INFO, "configured for %s\n",
-  ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)));
+   ata_dev_printk(dev, KERN_INFO, "configured for %s%s\n",
+  ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
+  dev_err_whine);
+
return 0;
+
+ fail:
+   ata_dev_printk(dev, KERN_ERR, "failed to set xfermode "
+  "(err_mask=0x%x)\n", err_mask);
+   return -EIO;
 }
 
 /**
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pata_via: fix SATA cable detection on cx700

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7585eb1b7cf4bbace37ce18500809140c8eeccc3
Commit: 7585eb1b7cf4bbace37ce18500809140c8eeccc3
Parent: 19af35546de68c872dcb687613e0902a602cb20e
Author: Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 10:18:53 2008 +0900
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 14:29:42 2008 -0500

pata_via: fix SATA cable detection on cx700

The first port of cx700 is SATA.  Fix cable detection.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/pata_via.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index 39627ab..d119a68 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -84,6 +84,7 @@ enum {
VIA_BAD_ID  = 0x100, /* Has wrong vendor ID (0x1107) */
VIA_BAD_AST = 0x200, /* Don't touch Address Setup Timing */
VIA_NO_ENABLES  = 0x400, /* Has no enablebits */
+   VIA_SATA_PATA   = 0x800, /* SATA/PATA combined configuration */
 };
 
 /*
@@ -100,7 +101,7 @@ static const struct via_isa_bridge {
{ "vx800",  PCI_DEVICE_ID_VIA_VX800,0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
{ "vt8237s",PCI_DEVICE_ID_VIA_8237S,0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
{ "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
-   { "cx700",  PCI_DEVICE_ID_VIA_CX700,0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
+   { "cx700",  PCI_DEVICE_ID_VIA_CX700,0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST | VIA_SATA_PATA },
{ "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST | VIA_NO_ENABLES},
{ "vt8237a",PCI_DEVICE_ID_VIA_8237A,0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
{ "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | 
VIA_BAD_AST },
@@ -172,6 +173,9 @@ static int via_cable_detect(struct ata_port *ap) {
if (via_cable_override(pdev))
return ATA_CBL_PATA40_SHORT;
 
+   if ((config->flags & VIA_SATA_PATA) && ap->port_no == 0)
+   return ATA_CBL_SATA;
+
/* Early chips are 40 wire */
if ((config->flags & VIA_UDMA) < VIA_UDMA_66)
return ATA_CBL_PATA40;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Make topology fallback macros reference their arguments.

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=271cad6d7e91ff8eea18976311692f99cd667ad3
Commit: 271cad6d7e91ff8eea18976311692f99cd667ad3
Parent: 81772fea4110f7ce8083d52503c9c4ddaa50f75b
Author: Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 20:03:17 2008 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 20:37:29 2008 -0800

Make topology fallback macros reference their arguments.

This avoids warnings with unreferenced variables in the !NUMA case.

Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/asm-generic/topology.h |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index 5d9d70c..342a2a0 100644
--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -30,19 +30,19 @@
 /* Other architectures wishing to use this simple topology API should fill
in the below functions as appropriate in their own  file. */
 #ifndef cpu_to_node
-#define cpu_to_node(cpu)   (0)
+#define cpu_to_node(cpu)   ((void)(cpu),0)
 #endif
 #ifndef parent_node
-#define parent_node(node)  (0)
+#define parent_node(node)  ((void)(node),0)
 #endif
 #ifndef node_to_cpumask
-#define node_to_cpumask(node)  (cpu_online_map)
+#define node_to_cpumask(node)  ((void)node, cpu_online_map)
 #endif
 #ifndef node_to_first_cpu
-#define node_to_first_cpu(node)(0)
+#define node_to_first_cpu(node)((void)(node),0)
 #endif
 #ifndef pcibus_to_node
-#define pcibus_to_node(node)   (-1)
+#define pcibus_to_node(bus)((void)(bus), -1)
 #endif
 
 #ifndef pcibus_to_cpumask
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: remove over noisy debug printk

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=81772fea4110f7ce8083d52503c9c4ddaa50f75b
Commit: 81772fea4110f7ce8083d52503c9c4ddaa50f75b
Parent: cc13e442952a347f7e217eeaee4778485394f1be
Author: Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Sun Feb 10 23:57:36 2008 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 11:24:24 2008 -0800

x86: remove over noisy debug printk

pageattr-test.c contains a noisy debug printk that people reported.
The condition under which it prints (randomly tapping into a mem_map[]
hole and not being able to c_p_a() there) is valid behavior and not
interesting to report.

Remove it.

Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr-test.c |7 ---
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c
index ed82016..75f1b10 100644
--- a/arch/x86/mm/pageattr-test.c
+++ b/arch/x86/mm/pageattr-test.c
@@ -40,7 +40,6 @@ struct split_state {
 static int print_split(struct split_state *s)
 {
long i, expected, missed = 0;
-   int printed = 0;
int err = 0;
 
s->lpg = s->gpg = s->spg = s->exec = 0;
@@ -53,12 +52,6 @@ static int print_split(struct split_state *s)
 
pte = lookup_address(addr, &level);
if (!pte) {
-   if (!printed) {
-   dump_pagetable(addr);
-   printk(KERN_INFO "CPA %lx no pte level %d\n",
-   addr, level);
-   printed = 1;
-   }
missed++;
i++;
continue;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: fix make V=1

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fab1e310d3f97bb9403ac68e181fd3e654a755c7
Commit: fab1e310d3f97bb9403ac68e181fd3e654a755c7
Parent: 19af35546de68c872dcb687613e0902a602cb20e
Author: Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 14:26:26 2008 +0100
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 17:43:54 2008 +0100

kbuild: fix make V=1

When make -s support were added to filechk to
combination created with make V=1 were not
covered.
Fix it by explicitly cover this case too.

Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
Cc: Mike Frysinger <[EMAIL PROTECTED]>
---
 init/Makefile  |1 +
 scripts/Kbuild.include |3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/init/Makefile b/init/Makefile
index c5f157c..4a243df 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -27,6 +27,7 @@ $(obj)/version.o: include/linux/compile.h
 # mkcompile_h will make sure to only update the
 # actual file if its content has changed.
 
+   chk_compile.h = :
  quiet_chk_compile.h = echo '  CHK $@'
 silent_chk_compile.h = :
 include/linux/compile.h: FORCE
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index da3559e..d64e6ba 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -39,10 +39,13 @@ escsq = $(subst $(squote),'\$(squote)',$1)
 # - If they are equal no change, and no timestamp update
 # - stdin is piped in from the first prerequisite ($<) so one has
 #   to specify a valid file as first prerequisite (often the kbuild file)
+   chk_filechk = :
  quiet_chk_filechk = echo '  CHK $@'
 silent_chk_filechk = :
+   upd_filechk = :
  quiet_upd_filechk = echo '  UPD $@'
 silent_upd_filechk = :
+
 define filechk
$(Q)set -e; \
$($(quiet)chk_filechk); \
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


selinux: support 64-bit capabilities

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b68e418c445e8a468634d0a7ca2fb63bbaa74028
Commit: b68e418c445e8a468634d0a7ca2fb63bbaa74028
Parent: 19af35546de68c872dcb687613e0902a602cb20e
Author: Stephen Smalley <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 11:21:04 2008 -0500
Committer:  James Morris <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 20:30:02 2008 +1100

selinux: support 64-bit capabilities

Fix SELinux to handle 64-bit capabilities correctly, and to catch
future extensions of capabilities beyond 64 bits to ensure that SELinux
is properly updated.

Signed-off-by:  Stephen Smalley <[EMAIL PROTECTED]>
Signed-off-by: James Morris <[EMAIL PROTECTED]>
---
 security/selinux/hooks.c |   21 +++--
 security/selinux/include/av_perm_to_string.h |3 +++
 security/selinux/include/av_permissions.h|3 +++
 security/selinux/include/class_to_string.h   |1 +
 security/selinux/include/flask.h |1 +
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index e5ed075..44f16d9 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1272,12 +1272,18 @@ static int task_has_perm(struct task_struct *tsk1,
SECCLASS_PROCESS, perms, NULL);
 }
 
+#if CAP_LAST_CAP > 63
+#error Fix SELinux to handle capabilities > 63.
+#endif
+
 /* Check whether a task is allowed to use a capability. */
 static int task_has_capability(struct task_struct *tsk,
   int cap)
 {
struct task_security_struct *tsec;
struct avc_audit_data ad;
+   u16 sclass;
+   u32 av = CAP_TO_MASK(cap);
 
tsec = tsk->security;
 
@@ -1285,8 +1291,19 @@ static int task_has_capability(struct task_struct *tsk,
ad.tsk = tsk;
ad.u.cap = cap;
 
-   return avc_has_perm(tsec->sid, tsec->sid,
-   SECCLASS_CAPABILITY, CAP_TO_MASK(cap), &ad);
+   switch (CAP_TO_INDEX(cap)) {
+   case 0:
+   sclass = SECCLASS_CAPABILITY;
+   break;
+   case 1:
+   sclass = SECCLASS_CAPABILITY2;
+   break;
+   default:
+   printk(KERN_ERR
+  "SELinux:  out of range capability %d\n", cap);
+   BUG();
+   }
+   return avc_has_perm(tsec->sid, tsec->sid, sclass, av, &ad);
 }
 
 /* Check whether a task is allowed to use a system operation. */
diff --git a/security/selinux/include/av_perm_to_string.h 
b/security/selinux/include/av_perm_to_string.h
index 399f868..d569669 100644
--- a/security/selinux/include/av_perm_to_string.h
+++ b/security/selinux/include/av_perm_to_string.h
@@ -132,6 +132,9 @@
S_(SECCLASS_CAPABILITY, CAPABILITY__LEASE, "lease")
S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_WRITE, "audit_write")
S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_CONTROL, "audit_control")
+   S_(SECCLASS_CAPABILITY, CAPABILITY__SETFCAP, "setfcap")
+   S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_OVERRIDE, "mac_override")
+   S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_ADMIN, "mac_admin")
S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_READ, 
"nlmsg_read")
S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_WRITE, 
"nlmsg_write")
S_(SECCLASS_NETLINK_FIREWALL_SOCKET, NETLINK_FIREWALL_SOCKET__NLMSG_READ, 
"nlmsg_read")
diff --git a/security/selinux/include/av_permissions.h 
b/security/selinux/include/av_permissions.h
index 84c9abc..75b4131 100644
--- a/security/selinux/include/av_permissions.h
+++ b/security/selinux/include/av_permissions.h
@@ -533,6 +533,9 @@
 #define CAPABILITY__LEASE 0x1000UL
 #define CAPABILITY__AUDIT_WRITE   0x2000UL
 #define CAPABILITY__AUDIT_CONTROL 0x4000UL
+#define CAPABILITY__SETFCAP   0x8000UL
+#define CAPABILITY2__MAC_OVERRIDE 0x0001UL
+#define CAPABILITY2__MAC_ADMIN0x0002UL
 #define NETLINK_ROUTE_SOCKET__IOCTL   0x0001UL
 #define NETLINK_ROUTE_SOCKET__READ0x0002UL
 #define NETLINK_ROUTE_SOCKET__WRITE   0x0004UL
diff --git a/security/selinux/include/class_to_string.h 
b/security/selinux/include/class_to_string.h
index b1b0d1d..bd813c3 100644
--- a/security/selinux/include/class_to_string.h
+++ b/security/selinux/include/class_to_string.h
@@ -71,3 +71,4 @@
 S_(NULL)
 S_(NULL)
 S_("peer")
+S_("capability2")
diff --git a/security/selinux/include/flask.h b/security/selinux/include/flask.h
index 09e9dd2..febf886 100644
--- a/security/selinux/include/flask.h
+++ b/security/selinux/include/flask.h
@@ -51,6 +51,7 @@
 #define SECCLASS_DCCP_SOCKET 60
 #define SECCLASS_MEMPROTECT  61
 #define SECCLASS_PEER   

Prevent IDE boot ops on NUMA system

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1f07e988290fc45932f5028c9e2a862c37a57336
Commit: 1f07e988290fc45932f5028c9e2a862c37a57336
Parent: 0c0d61ca93d111c521182c0909e478fa709e05c6
Author: Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 01:35:20 2008 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 09:20:50 2008 -0800

Prevent IDE boot ops on NUMA system

Without this patch a Opteron test system here oopses at boot with
current git.

Calling to_pci_dev() on a NULL pointer gives a negative value so the
following NULL pointer check never triggers and then an illegal address
is referenced.  Check the unadjusted original device pointer for NULL
instead.

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

diff --git a/include/linux/ide.h b/include/linux/ide.h
index 23fad89..a3b69c1 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1295,7 +1295,7 @@ static inline void ide_dump_identify(u8 *id)
 static inline int hwif_to_node(ide_hwif_t *hwif)
 {
struct pci_dev *dev = to_pci_dev(hwif->dev);
-   return dev ? pcibus_to_node(dev->bus) : -1;
+   return hwif->dev ? pcibus_to_node(dev->bus) : -1;
 }
 
 static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


SUNPRC: Fix printk format warning

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bb50c8012cbd85b8e105584b32e4d5a2d335dcef
Commit: bb50c8012cbd85b8e105584b32e4d5a2d335dcef
Parent: fbb7878c1a2ee40a1e983bf20f3dd3a80255dcf2
Author: Roland Dreier <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 16:02:04 2008 -0800
Committer:  J. Bruce Fields <[EMAIL PROTECTED]>
CommitDate: Sun Feb 10 18:11:22 2008 -0500

SUNPRC: Fix printk format warning

net/sunrpc/xprtrdma/svc_rdma_sendto.c:160: warning: format '%llx'
expects type 'long long unsigned int', but argument 3 has type 'u64'

Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
Signed-off-by: J. Bruce Fields <[EMAIL PROTECTED]>
---
 net/sunrpc/xprtrdma/svc_rdma_sendto.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c 
b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index 3e32194..0598b22 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -159,7 +159,8 @@ static int send_write(struct svcxprt_rdma *xprt, struct 
svc_rqst *rqstp,
BUG_ON(sge_count >= 32);
dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, "
"write_len=%d, xdr_sge=%p, sge_count=%d\n",
-   rmr, to, xdr_off, write_len, xdr_sge, sge_count);
+   rmr, (unsigned long long)to, xdr_off,
+   write_len, xdr_sge, sge_count);
 
ctxt = svc_rdma_get_context(xprt);
ctxt->count = 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


nfsd: clean up svc_reserve_auth()

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fbb7878c1a2ee40a1e983bf20f3dd3a80255dcf2
Commit: fbb7878c1a2ee40a1e983bf20f3dd3a80255dcf2
Parent: c64e80d55db81df22a7f25b75ab4ba4c55db4749
Author: J. Bruce Fields <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 23:10:21 2008 -0500
Committer:  J. Bruce Fields <[EMAIL PROTECTED]>
CommitDate: Sun Feb 10 18:11:16 2008 -0500

nfsd: clean up svc_reserve_auth()

This is a void function attempting to return the return value from
another void function, which seems harmless but extremely weird, and
apparently makes some compilers complain.

While we're there, clean up a little (e.g. the switch statement had a
minor style problem and seemed overkill as long as there's only one
case).

Thanks to Trond for noticing this.

Signed-off-by: J. Bruce Fields <[EMAIL PROTECTED]>
Cc: Trond Myklebust <[EMAIL PROTECTED]>
---
 include/linux/sunrpc/svc.h |   13 +
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 64c7710..64c9755 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -409,16 +409,13 @@ char *   svc_print_addr(struct svc_rqst *, 
char *, size_t);
  * for all cases without actually generating the checksum, so we just use a
  * static value.
  */
-static inline void
-svc_reserve_auth(struct svc_rqst *rqstp, int space)
+static inline void svc_reserve_auth(struct svc_rqst *rqstp, int space)
 {
-   int added_space = 0;
+   int added_space = 0;
 
-   switch(rqstp->rq_authop->flavour) {
-   case RPC_AUTH_GSS:
-   added_space = RPC_MAX_AUTH_SIZE;
-   }
-   return svc_reserve(rqstp, space + added_space);
+   if (rqstp->rq_authop->flavour)
+   added_space = RPC_MAX_AUTH_SIZE;
+   svc_reserve(rqstp, space + added_space);
 }
 
 #endif /* SUNRPC_SVC_H */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


NLM: don't requeue block if it was invalidated while GRANT_MSG was in flight

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c64e80d55db81df22a7f25b75ab4ba4c55db4749
Commit: c64e80d55db81df22a7f25b75ab4ba4c55db4749
Parent: 9706501e43a80ce48b319214a0a9e562deded35b
Author: Jeff Layton <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 11:34:13 2008 -0500
Committer:  J. Bruce Fields <[EMAIL PROTECTED]>
CommitDate: Sun Feb 10 18:09:36 2008 -0500

NLM: don't requeue block if it was invalidated while GRANT_MSG was in flight

It's possible for lockd to catch a SIGKILL while a GRANT_MSG callback
is in flight. If this happens we don't want lockd to insert the block
back into the nlm_blocked list.

This helps that situation, but there's still a possible race. Fixing
that will mean adding real locking for nlm_blocked.

Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
Signed-off-by: J. Bruce Fields <[EMAIL PROTECTED]>
---
 fs/lockd/svclock.c |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 82db7b3..fe9bdb4 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -795,6 +795,17 @@ static void nlmsvc_grant_callback(struct rpc_task *task, 
void *data)
 
dprintk("lockd: GRANT_MSG RPC callback\n");
 
+   /* if the block is not on a list at this point then it has
+* been invalidated. Don't try to requeue it.
+*
+* FIXME: it's possible that the block is removed from the list
+* after this check but before the nlmsvc_insert_block. In that
+* case it will be added back. Perhaps we need better locking
+* for nlm_blocked?
+*/
+   if (list_empty(&block->b_list))
+   return;
+
/* Technically, we should down the file semaphore here. Since we
 * move the block towards the head of the queue only, no harm
 * can be done, though. */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


NLM: don't reattempt GRANT_MSG when there is already an RPC in flight

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9706501e43a80ce48b319214a0a9e562deded35b
Commit: 9706501e43a80ce48b319214a0a9e562deded35b
Parent: 90bd17c87821fe0e055e0f9a7446c2875f31eb4c
Author: Jeff Layton <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 11:34:12 2008 -0500
Committer:  J. Bruce Fields <[EMAIL PROTECTED]>
CommitDate: Sun Feb 10 18:09:36 2008 -0500

NLM: don't reattempt GRANT_MSG when there is already an RPC in flight

With the current scheme in nlmsvc_grant_blocked, we can end up with more
than one GRANT_MSG callback for a block in flight. Right now, we requeue
the block unconditionally so that a GRANT_MSG callback is done again in
30s. If the client is unresponsive, it can take more than 30s for the
call already in flight to time out.

There's no benefit to having more than one GRANT_MSG RPC queued up at a
time, so put it on the list with a timeout of NLM_NEVER before doing the
RPC call. If the RPC call submission fails, we requeue it with a short
timeout. If it works, then nlmsvc_grant_callback will end up requeueing
it with a shorter timeout after it completes.

Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
Signed-off-by: J. Bruce Fields <[EMAIL PROTECTED]>
---
 fs/lockd/svclock.c |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 2f4d8fa..82db7b3 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -763,11 +763,20 @@ callback:
dprintk("lockd: GRANTing blocked lock.\n");
block->b_granted = 1;
 
-   /* Schedule next grant callback in 30 seconds */
-   nlmsvc_insert_block(block, 30 * HZ);
+   /* keep block on the list, but don't reattempt until the RPC
+* completes or the submission fails
+*/
+   nlmsvc_insert_block(block, NLM_NEVER);
 
-   /* Call the client */
-   nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, &nlmsvc_grant_ops);
+   /* Call the client -- use a soft RPC task since nlmsvc_retry_blocked
+* will queue up a new one if this one times out
+*/
+   error = nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG,
+   &nlmsvc_grant_ops);
+
+   /* RPC submission failed, wait a bit and retry */
+   if (error < 0)
+   nlmsvc_insert_block(block, 10 * HZ);
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


NLM: have server-side RPC clients default to soft RPC tasks

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=90bd17c87821fe0e055e0f9a7446c2875f31eb4c
Commit: 90bd17c87821fe0e055e0f9a7446c2875f31eb4c
Parent: 031fd3aa20fcf6d1862ea7814ee8b2caf36c0d78
Author: Jeff Layton <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 11:34:11 2008 -0500
Committer:  J. Bruce Fields <[EMAIL PROTECTED]>
CommitDate: Sun Feb 10 18:09:36 2008 -0500

NLM: have server-side RPC clients default to soft RPC tasks

Now that it no longer does an RPC ping, lockd always ends up queueing
an RPC task for the GRANT_MSG callback. But, it also requeues the block
for later attempts. Since these are hard RPC tasks, if the client we're
calling back goes unresponsive the GRANT_MSG callbacks can stack up in
the RPC queue.

Fix this by making server-side RPC clients default to soft RPC tasks.
lockd requeues the block anyway, so this should be OK.

Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
Signed-off-by: J. Bruce Fields <[EMAIL PROTECTED]>
---
 fs/lockd/host.c |   11 +--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 00063ee..f1ef49f 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -243,11 +243,18 @@ nlm_bind_host(struct nlm_host *host)
.program= &nlm_program,
.version= host->h_version,
.authflavor = RPC_AUTH_UNIX,
-   .flags  = (RPC_CLNT_CREATE_HARDRTRY |
-  RPC_CLNT_CREATE_NOPING |
+   .flags  = (RPC_CLNT_CREATE_NOPING |
   RPC_CLNT_CREATE_AUTOBIND),
};
 
+   /*
+* lockd retries server side blocks automatically so we want
+* those to be soft RPC calls. Client side calls need to be
+* hard RPC tasks.
+*/
+   if (!host->h_server)
+   args.flags |= RPC_CLNT_CREATE_HARDRTRY;
+
clnt = rpc_create(&args);
if (!IS_ERR(clnt))
host->h_rpcclnt = clnt;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


NLM: set RPC_CLNT_CREATE_NOPING for NLM RPC clients

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=031fd3aa20fcf6d1862ea7814ee8b2caf36c0d78
Commit: 031fd3aa20fcf6d1862ea7814ee8b2caf36c0d78
Parent: 551e4fb2465b87de9d4aa1669b27d624435443bb
Author: Jeff Layton <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 11:34:10 2008 -0500
Committer:  J. Bruce Fields <[EMAIL PROTECTED]>
CommitDate: Sun Feb 10 18:09:36 2008 -0500

NLM: set RPC_CLNT_CREATE_NOPING for NLM RPC clients

It's currently possible for an unresponsive NLM client to completely
lock up a server's lockd. The scenario is something like this:

1) client1 (or a process on the server) takes a lock on a file
2) client2 tries to take a blocking lock on the same file and
   awaits the callback
3) client2 goes unresponsive (plug pulled, network partition, etc)
4) client1 releases the lock

...at that point the server's lockd will try to queue up a GRANT_MSG
callback for client2, but first it requeues the block with a timeout of
30s. nlm_async_call will attempt to bind the RPC client to client2 and
will call rpc_ping. rpc_ping entails a sync RPC call and if client2 is
unresponsive it will take around 60s for that to time out. Once it times
out, it's already time to retry the block and the whole process repeats.

Once in this situation, nlmsvc_retry_blocked will never return until
the host starts responding again. lockd won't service new calls.

Fix this by skipping the RPC ping on NLM RPC clients. This makes
nlm_async_call return quickly when called.

Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
Signed-off-by: J. Bruce Fields <[EMAIL PROTECTED]>
---
 fs/lockd/host.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index ca6b16f..00063ee 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -244,6 +244,7 @@ nlm_bind_host(struct nlm_host *host)
.version= host->h_version,
.authflavor = RPC_AUTH_UNIX,
.flags  = (RPC_CLNT_CREATE_HARDRTRY |
+  RPC_CLNT_CREATE_NOPING |
   RPC_CLNT_CREATE_AUTOBIND),
};
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: remove stale comment from ide-lib.c

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=467390a2a50493332ddc21eb806094b1829c1161
Commit: 467390a2a50493332ddc21eb806094b1829c1161
Parent: e1771e20c8be601d1cc9364d45f907a0433dbbd5
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:15 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:15 2008 +0100

ide: remove stale comment from ide-lib.c

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-lib.c |9 -
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 1ff676c..29e2c97 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -21,15 +21,6 @@
 #include 
 #include 
 
-/*
- * IDE library routines. These are plug in code that most 
- * drivers can use but occasionally may be weird enough
- * to want to do their own thing with
- *
- * Add common non I/O op stuff here. Make sure it has proper
- * kernel-doc function headers or your patch will be rejected
- */
-
 static const char *udma_str[] =
 { "UDMA/16", "UDMA/25",  "UDMA/33",  "UDMA/44",
   "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" };
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: fix comment in init_irq()

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e1771e20c8be601d1cc9364d45f907a0433dbbd5
Commit: e1771e20c8be601d1cc9364d45f907a0433dbbd5
Parent: 428009422584cb8ded31397740ade88a36fc8172
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:15 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:15 2008 +0100

ide: fix comment in init_irq()

APUS support is gone...

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index d6d3330..4a2cb28 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1051,7 +1051,7 @@ static int init_irq (ide_hwif_t *hwif)
int sa = 0;
 #if defined(__mc68000__)
sa = IRQF_SHARED;
-#endif /* __mc68000__ || CONFIG_APUS */
+#endif /* __mc68000__ */
 
if (IDE_CHIPSET_IS_PCI(hwif->chipset))
sa = IRQF_SHARED;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: ide_init_port() bugfix

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=428009422584cb8ded31397740ade88a36fc8172
Commit: 428009422584cb8ded31397740ade88a36fc8172
Parent: 395d8ef5bebe547a80737692f9789d2e36da16f2
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:15 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:15 2008 +0100

ide: ide_init_port() bugfix

On Sunday 10 February 2008, Atsushi Nemoto wrote:
> On Sun, 06 Jan 2008 18:03:10 +0100, Bartlomiej Zolnierkiewicz <[EMAIL 
PROTECTED]> wrote:
> > +   /* reset DMA masks only for SFF-style DMA controllers */
> > +   if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base 
== 0)
> > +   hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask 
= 0;
>
> It might be too late, but "host_flags && IDE_HFLAGS_NO_DMA" seems
> wrong for me.

Fix regression caused by commmit c413b9b94d9a8e7548cc4b2e04b7df0439ce76fd
("ide: add struct ide_port_info instances to legacy host drivers").

Reported-by: Atsushi Nemoto <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 6daea89..d6d3330 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1355,7 +1355,7 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int 
port,
hwif->ultra_mask = d->udma_mask;
 
/* reset DMA masks only for SFF-style DMA controllers */
-   if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
+   if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;
 
if (d->host_flags & IDE_HFLAG_RQSIZE_256)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8e882ba111bb52fbb42c34a265afb97ddd4fcea1
Commit: 8e882ba111bb52fbb42c34a265afb97ddd4fcea1
Parent: 7b56a937a17d21a266dd0a24053f951f3a92e428
Author: Sergei Shtylyov <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:14 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:14 2008 +0100

ide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option

Introduce new option CONFIG_BLK_DEV_IDEDMA_SFF for non-PCI SFF-8038i 
compatible
bus mastering IDE controllers (which there are a few known), thus fixing a 
hack
made for Palmchip BK3710 controller...

Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Cc: Anton Salnikov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/Kconfig   |9 +++--
 drivers/ide/ide-dma.c |   14 +++---
 include/linux/ide.h   |9 -
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index d2c4f06..df752e6 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -378,6 +378,9 @@ config BLK_DEV_IDEPNP
  would like the kernel to automatically detect and activate
  it, say Y here.
 
+config BLK_DEV_IDEDMA_SFF
+   bool
+
 if PCI
 
 comment "PCI IDE chipsets support"
@@ -459,6 +462,7 @@ config BLK_DEV_RZ1000
 config BLK_DEV_IDEDMA_PCI
bool
select BLK_DEV_IDEPCI
+   select BLK_DEV_IDEDMA_SFF
 
 config BLK_DEV_AEC62XX
tristate "AEC62XX chipset support"
@@ -999,7 +1003,7 @@ config BLK_DEV_Q40IDE
 config BLK_DEV_PALMCHIP_BK3710
tristate "Palmchip bk3710 IDE controller support"
depends on ARCH_DAVINCI
-   select BLK_DEV_IDEDMA_PCI
+   select BLK_DEV_IDEDMA_SFF
help
  Say Y here if you want to support the onchip IDE controller on the
  TI DaVinci SoC
@@ -1107,7 +,8 @@ config BLK_DEV_UMC8672
 endif
 
 config BLK_DEV_IDEDMA
-   def_bool BLK_DEV_IDEDMA_PCI || BLK_DEV_IDEDMA_PMAC || 
BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
+   def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \
+BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
 
 config IDE_ARCH_OBSOLETE_INIT
def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || 
M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index a4bb328..d0e7b53 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -198,7 +198,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
 
 EXPORT_SYMBOL_GPL(ide_build_sglist);
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 /**
  * ide_build_dmatable  -   build IDE DMA table
  *
@@ -316,7 +316,7 @@ void ide_destroy_dmatable (ide_drive_t *drive)
 
 EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 /**
  * config_drive_for_dma-   attempt to activate IDE DMA
  * @drive: the drive to place in DMA mode
@@ -424,7 +424,7 @@ void ide_dma_host_set(ide_drive_t *drive, int on)
 }
 
 EXPORT_SYMBOL_GPL(ide_dma_host_set);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF  */
 
 /**
  * ide_dma_off_quietly -   Generic DMA kill
@@ -474,7 +474,7 @@ void ide_dma_on(ide_drive_t *drive)
drive->hwif->dma_host_set(drive, 1);
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 /**
  * ide_dma_setup   -   begin a DMA phase
  * @drive: target device
@@ -591,7 +591,7 @@ static int __ide_dma_test_irq(ide_drive_t *drive)
 }
 #else
 static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
 
 int __ide_dma_bad_drive (ide_drive_t *drive)
 {
@@ -840,7 +840,7 @@ void ide_check_dma_crc(ide_drive_t *drive)
ide_dma_on(drive);
 }
 
-#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
+#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 void ide_dma_lost_irq (ide_drive_t *drive)
 {
printk("%s: DMA interrupt recovery\n", drive->name);
@@ -1002,4 +1002,4 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base)
 }
 
 EXPORT_SYMBOL_GPL(ide_setup_dma);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
+#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index acec99d..40a01c3 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -998,8 +998,7 @@ extern int __ide_pci_register_driver(struct pci_driver 
*driver, struct module *o
 void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, 
u8 *);
 void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
 
-/* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */
-#if defined(CONFIG_BLK_DEV_IDEPCI) && defined(

ide-disk: fix flush requests (take 2)

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=395d8ef5bebe547a80737692f9789d2e36da16f2
Commit: 395d8ef5bebe547a80737692f9789d2e36da16f2
Parent: 8e882ba111bb52fbb42c34a265afb97ddd4fcea1
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:14 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:14 2008 +0100

ide-disk: fix flush requests (take 2)

commit 813a0eb233ee67d7166241a8b389b6a76f2247f9
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
Date:   Fri Jan 25 22:17:10 2008 +0100

ide: switch idedisk_prepare_flush() to use REQ_TYPE_ATA_TASKFILE 
requests

...

broke flush requests.

Allocating IDE command structure on the stack for flush requests is not
a very brilliant idea:

- idedisk_prepare_flush() only prepares the request and it doesn't wait
  for it to be completed

- there are can be multiple flush requests queued in the queue

Fix the problem (per hints from James Bottomley) by:
- dynamically allocating ide_task_t instance using kmalloc(..., GFP_ATOMIC)
- adding new taskfile flag (IDE_TFLAG_DYN)
- calling kfree() in ide_end_drive_command() if IDE_TFLAG_DYN is set
  (while at it rename 'args' to 'task' and fix whitespace damage)

[ This will be fixed properly before 2.6.25 but this bug is rather
  critical and the proper solution requires some more work + testing. ]

Thanks to Sebastian Siewior and Christoph Hellwig for reporting the
problem and testing patches (extra thanks to Sebastian for bisecting
it to the guilty commmit).

Tested-by: Sebastian Siewior <[EMAIL PROTECTED]>
Cc: Christoph Hellwig <[EMAIL PROTECTED]>
Cc: James Bottomley <[EMAIL PROTECTED]>
Cc: Jens Axboe <[EMAIL PROTECTED]>
Cc: Tejun Heo <[EMAIL PROTECTED]>
Cc: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-disk.c |   18 +++---
 drivers/ide/ide-io.c   |   16 ++--
 include/linux/ide.h|2 ++
 3 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 3c69822..aed8b31 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -590,20 +590,24 @@ static ide_proc_entry_t idedisk_proc[] = {
 static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
 {
ide_drive_t *drive = q->queuedata;
-   ide_task_t task;
+   ide_task_t *task = kmalloc(sizeof(*task), GFP_ATOMIC);
 
-   memset(&task, 0, sizeof(task));
+   /* FIXME: map struct ide_taskfile on rq->cmd[] */
+   BUG_ON(task == NULL);
+
+   memset(task, 0, sizeof(*task));
if (ide_id_has_flush_cache_ext(drive->id) &&
(drive->capacity64 >= (1UL << 28)))
-   task.tf.command = WIN_FLUSH_CACHE_EXT;
+   task->tf.command = WIN_FLUSH_CACHE_EXT;
else
-   task.tf.command = WIN_FLUSH_CACHE;
-   task.tf_flags   = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
-   task.data_phase = TASKFILE_NO_DATA;
+   task->tf.command = WIN_FLUSH_CACHE;
+   task->tf_flags   = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE |
+  IDE_TFLAG_DYN;
+   task->data_phase = TASKFILE_NO_DATA;
 
rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
rq->cmd_flags |= REQ_SOFTBARRIER;
-   rq->special = &task;
+   rq->special = task;
 }
 
 /*
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index e41383f..7153796 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -361,17 +361,21 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 
err)
spin_unlock_irqrestore(&ide_lock, flags);
 
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
-   ide_task_t *args = (ide_task_t *) rq->special;
+   ide_task_t *task = (ide_task_t *)rq->special;
+
if (rq->errors == 0)
-   rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
-   
-   if (args) {
-   struct ide_taskfile *tf = &args->tf;
+   rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT);
+
+   if (task) {
+   struct ide_taskfile *tf = &task->tf;
 
tf->error = err;
tf->status = stat;
 
-   ide_tf_read(drive, args);
+   ide_tf_read(drive, task);
+
+   if (task->tf_flags & IDE_TFLAG_DYN)
+   kfree(task);
}
} else if (blk_pm_request(rq)) {
struct request_pm_state *pm = rq->data;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 40a01c3..23fad89 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@

bast-ide: build fix

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7b56a937a17d21a266dd0a24053f951f3a92e428
Commit: 7b56a937a17d21a266dd0a24053f951f3a92e428
Parent: 31cb2120270cb43403428de67d8cb5caeb58dfd2
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:14 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:14 2008 +0100

bast-ide: build fix

On Saturday 09 February 2008, Adrian Bunk wrote:
> Commit 9e016a719209d95338e314b46c3012cc7feaaeec causes the following
> compile error:
>
> <--  snip  -->
>
> ...
>   CC  drivers/ide/arm/bast-ide.o
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/arm/bast-ide.c: In 
function 'bastide_register':
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/arm/bast-ide.c:31: 
error: 'hwif' redeclared as different kind of symbol
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/arm/bast-ide.c:29: 
error: previous definition of 'hwif' was here
> make[4]: *** [drivers/ide/arm/bast-ide.o] Error 1
>
> <--  snip  -->

Remove 'ide_hwif_t **hwif' argument from bastide_register()
(together with write-only ifs[]).

Cc: Adrian Bunk <[EMAIL PROTECTED]>
Cc: Russell King <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/bast-ide.c |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c
index 0e7574c..161d30c 100644
--- a/drivers/ide/arm/bast-ide.c
+++ b/drivers/ide/arm/bast-ide.c
@@ -21,12 +21,7 @@
 #include 
 #include 
 
-/* list of registered interfaces */
-static ide_hwif_t *ifs[2];
-
-static int __init
-bastide_register(unsigned int base, unsigned int aux, int irq,
-ide_hwif_t **hwif)
+static int __init bastide_register(unsigned int base, unsigned int aux, int 
irq)
 {
ide_hwif_t *hwif;
hw_regs_t hw;
@@ -76,8 +71,9 @@ static int __init bastide_init(void)
 
printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n");
 
-   bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0, &ifs[0]);
-   bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1, &ifs[1]);
+   bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0);
+   bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1);
+
return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide-tape: remove never executed code

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=31cb2120270cb43403428de67d8cb5caeb58dfd2
Commit: 31cb2120270cb43403428de67d8cb5caeb58dfd2
Parent: 56efa7b0e437808d367a92f7820b3aba930c230d
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:14 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:14 2008 +0100

ide-tape: remove never executed code

rq->cmd[0] is never set to REQ_IDETAPE_READ_BUFFER so remove
REQ_IDETAPE_READ_BUFFER handling from idetape_create_write_cmd()
and the define itself.

Then remove no longer used idetape_create_read_buffer_cmd()
and IDETAPE_RETRIEVE_FAULTY_BLOCK define.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-tape.c |   34 --
 1 files changed, 0 insertions(+), 34 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 49dd2e7..0598ecf 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -466,9 +466,6 @@ static void ide_tape_put(struct ide_tape_obj *tape)
 /* 0 = no tape is loaded, so we don't rewind after ejecting */
 #define IDETAPE_MEDIUM_PRESENT 9
 
-/* A define for the READ BUFFER command */
-#define IDETAPE_RETRIEVE_FAULTY_BLOCK  6
-
 /* Some defines for the SPACE command */
 #define IDETAPE_SPACE_OVER_FILEMARK1
 #define IDETAPE_SPACE_TO_EOD   3
@@ -490,7 +487,6 @@ enum {
REQ_IDETAPE_PC2 = (1 << 1), /* packet command (second stage) */
REQ_IDETAPE_READ= (1 << 2),
REQ_IDETAPE_WRITE   = (1 << 3),
-   REQ_IDETAPE_READ_BUFFER = (1 << 4),
 };
 
 /* Error codes returned in rq->errors to the higher part of the driver. */
@@ -1523,29 +1519,6 @@ static void idetape_create_read_cmd(idetape_tape_t 
*tape, idetape_pc_t *pc,
set_bit(PC_DMA_RECOMMENDED, &pc->flags);
 }
 
-static void idetape_create_read_buffer_cmd(idetape_tape_t *tape,
-   idetape_pc_t *pc, struct idetape_bh *bh)
-{
-   int size = 32768;
-   struct idetape_bh *p = bh;
-
-   idetape_init_pc(pc);
-   pc->c[0] = READ_BUFFER;
-   pc->c[1] = IDETAPE_RETRIEVE_FAULTY_BLOCK;
-   pc->c[7] = size >> 8;
-   pc->c[8] = size & 0xff;
-   pc->callback = &idetape_pc_callback;
-   pc->bh = bh;
-   atomic_set(&bh->b_count, 0);
-   pc->buffer = NULL;
-   while (p) {
-   atomic_set(&p->b_count, 0);
-   p = p->b_reqnext;
-   }
-   pc->request_transfer = size;
-   pc->buffer_size = size;
-}
-
 static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
unsigned int length, struct idetape_bh *bh)
 {
@@ -1655,13 +1628,6 @@ static ide_startstop_t idetape_do_request(ide_drive_t 
*drive,
 (struct idetape_bh *)rq->special);
goto out;
}
-   if (rq->cmd[0] & REQ_IDETAPE_READ_BUFFER) {
-   tape->postpone_cnt = 0;
-   pc = idetape_next_pc_storage(drive);
-   idetape_create_read_buffer_cmd(tape, pc,
-   (struct idetape_bh *)rq->special);
-   goto out;
-   }
if (rq->cmd[0] & REQ_IDETAPE_PC1) {
pc = (idetape_pc_t *) rq->buffer;
rq->cmd[0] &= ~(REQ_IDETAPE_PC1);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: fix ide/legacy/gayle.c compilation

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56efa7b0e437808d367a92f7820b3aba930c230d
Commit: 56efa7b0e437808d367a92f7820b3aba930c230d
Parent: 7eb43fd2fa4a55faee97d4c84b336d2138075926
Author: Adrian Bunk <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:14 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:14 2008 +0100

ide: fix ide/legacy/gayle.c compilation

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Cc: Geert Uytterhoeven <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/legacy/gayle.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 9d3851d..b7d8109 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -94,7 +94,7 @@ static int gayle_ack_intr_a1200(ide_hwif_t *hwif)
 
 static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
 unsigned long ctl, unsigned long irq_port,
-ide_ack_intr_t *ack_intr);
+ide_ack_intr_t *ack_intr)
 {
int i;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: remove stale version number

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eba8ff946177ca38dfde0bf1d8ce0703c45c49b9
Commit: eba8ff946177ca38dfde0bf1d8ce0703c45c49b9
Parent: cfa2771bc511017159ea076965fe385101e03798
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:13 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:13 2008 +0100

ide: remove stale version number

On Thursday 03 January 2008, Robert Hancock wrote:

[...]

> How about getting rid of this stupid thing in drivers/ide/ide.c:
>
> #define   REVISION"Revision: 7.00alpha2"
>
> which is used in:
>
> printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
>
> It's been 7.00alpha2 for god knows how long, so clearly this version
> number is not useful..

Cc: Robert Hancock <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index ad0e995..4a8952a 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -44,8 +44,6 @@
  *  inspiration from lots of linux users, esp.  [EMAIL PROTECTED]
  */
 
-#defineREVISION"Revision: 7.00alpha2"
-
 #define _IDE_C /* Tell ide.h it's really us */
 
 #include 
@@ -1618,7 +1616,7 @@ static int __init ide_init(void)
 {
int ret;
 
-   printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
+   printk(KERN_INFO "Uniform Multi-Platform E-IDE driver\n");
system_bus_speed = ide_system_bus_speed();
 
printk(KERN_INFO "ide: Assuming %dMHz system bus speed "
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide-cd: replace ntohs with generic byteorder macro be16_to_cpu

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7eb43fd2fa4a55faee97d4c84b336d2138075926
Commit: 7eb43fd2fa4a55faee97d4c84b336d2138075926
Parent: eba8ff946177ca38dfde0bf1d8ce0703c45c49b9
Author: Borislav Petkov <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:13 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:13 2008 +0100

ide-cd: replace ntohs with generic byteorder macro be16_to_cpu

Signed-off-by: Borislav Petkov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-cd.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 5e42c19..354c91d 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1555,7 +1555,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct 
request_sense *sense)
if (stat)
return stat;
 
-   toc->hdr.toc_length = ntohs (toc->hdr.toc_length);
+   toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length);
 
if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) {
toc->hdr.first_track = BCD2BIN(toc->hdr.first_track);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pdc202xx_old: always enable burst mode

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cfa2771bc511017159ea076965fe385101e03798
Commit: cfa2771bc511017159ea076965fe385101e03798
Parent: c79b60ddf6ff0e884c09cecbbddd656f7bf277a3
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:13 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:13 2008 +0100

pdc202xx_old: always enable burst mode

Alan has noticed that distros always enabled burst mode
(+ datasheet confirms that it is the right thing to do).

Thus fix pdc202xx_old host driver to do it unconditionally
and remove no longer needed CONFIG_PDC202XX_BURST option.

Cc: Alan Cox <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/Kconfig|   17 -
 drivers/ide/pci/pdc202xx_old.c |   22 --
 2 files changed, 0 insertions(+), 39 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 043c34a..d2c4f06 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -688,23 +688,6 @@ config BLK_DEV_PDC202XX_OLD
 
  If unsure, say N.
 
-config PDC202XX_BURST
-   bool "Special UDMA Feature"
-   depends on BLK_DEV_PDC202XX_OLD
-   help
- This option causes the pdc202xx driver to enable UDMA modes on the
- PDC202xx even when the PDC202xx BIOS has not done so.
-
- It was originally designed for the PDC20246/Ultra33, whose BIOS will
- only setup UDMA on the first two PDC20246 cards.  It has also been
- used successfully on a PDC20265/Ultra100, allowing use of UDMA modes
- when the PDC20265 BIOS has been disabled (for faster boot up).
-
- Please read the comments at the top of
- .
-
- If unsure, say N.
-
 config BLK_DEV_PDC202XX_NEW
tristate "PROMISE PDC202{68|69|70|71|75|76|77} support"
select BLK_DEV_IDEDMA_PCI
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index da43297..150422e 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -3,26 +3,6 @@
  *  Copyright (C) 2006-2007MontaVista Software, Inc.
  *  Copyright (C) 2007 Bartlomiej Zolnierkiewicz
  *
- *  Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
- *  compiled into the kernel if you have more than one card installed.
- *  Note that BIOS v1.29 is reported to fix the problem.  Since this is
- *  safe chipset tuning, including this support is harmless
- *
- *  Promise Ultra66 cards with BIOS v1.11 this
- *  compiled into the kernel if you have more than one card installed.
- *
- *  Promise Ultra100 cards.
- *
- *  The latest chipset code will support the following ::
- *  Three Ultra33 controllers and 12 drives.
- *  8 are UDMA supported and 4 are limited to DMA mode 2 multi-word.
- *  The 8/4 ratio is a BIOS code limit by promise.
- *
- *  UNLESS you enable "CONFIG_PDC202XX_BURST"
- *
- */
-
-/*
  *  Portions Copyright (C) 1999 Promise Technology, Inc.
  *  Author: Frank Tiernan ([EMAIL PROTECTED])
  *  Released under terms of General Public License
@@ -344,7 +324,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, 
unsigned long dmabase)
(primary_mode & 1) ? "MASTER" : "PCI",
(secondary_mode & 1) ? "MASTER" : "PCI" );
 
-#ifdef CONFIG_PDC202XX_BURST
if (!(udma_speed_flag & 1)) {
printk(KERN_INFO "%s: FORCING BURST BIT 0x%02x->0x%02x ",
hwif->cds->name, udma_speed_flag,
@@ -352,7 +331,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, 
unsigned long dmabase)
outb(udma_speed_flag | 1, dmabase | 0x1f);
printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN");
}
-#endif /* CONFIG_PDC202XX_BURST */
 
ide_setup_dma(hwif, dmabase);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


palm_bk3710: use struct ide_port_info

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c79b60ddf6ff0e884c09cecbbddd656f7bf277a3
Commit: c79b60ddf6ff0e884c09cecbbddd656f7bf277a3
Parent: c92a7f1d8254fabd99df33af59094935fc2cfe32
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:13 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:13 2008 +0100

palm_bk3710: use struct ide_port_info

* Factor out cable detection to palm_bk3710_cable_detect().

* Add palm_bk3710_init_hwif() (->init_hwif method implementation).

* Remove needless ->quirkproc initialization.

* Add missing ->pio_mask initialization.

* Use ATA_* defines for setting ->{ultra,mwdma}_mask.

* Add 'struct ide_port_info palm_bk3710_port_info' and pass it to
  ide_device_add().  Then remove open-coded 'hwif' initialization.

Cc: Anton Salnikov <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/palm_bk3710.c |   33 +++--
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 8e40bdb..8e1f6bd 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -311,6 +311,28 @@ static void __devinit palm_bk3710_chipinit(void __iomem 
*base)
palm_bk3710_setpiomode(base, NULL, 0, 600, 0);
palm_bk3710_setpiomode(base, NULL, 1, 600, 0);
 }
+
+static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
+{
+   return ATA_CBL_PATA80;
+}
+
+static void __devinit palm_bk3710_init_hwif(ide_hwif_t *hwif)
+{
+   hwif->set_pio_mode = palm_bk3710_set_pio_mode;
+   hwif->set_dma_mode = palm_bk3710_set_dma_mode;
+
+   hwif->cable_detect = palm_bk3710_cable_detect;
+}
+
+static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
+   .init_hwif  = palm_bk3710_init_hwif,
+   .host_flags = IDE_HFLAG_NO_DMA, /* hack (no PCI) */
+   .pio_mask   = ATA_PIO4,
+   .udma_mask  = ATA_UDMA4,/* (input clk 99MHz) */
+   .mwdma_mask = ATA_MWDMA2,
+};
+
 static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 {
struct clk *clkp;
@@ -368,24 +390,15 @@ static int __devinit palm_bk3710_probe(struct 
platform_device *pdev)
ide_init_port_data(hwif, i);
 
ide_init_port_hw(hwif, &hw);
-   hwif->quirkproc = NULL;
 
-   hwif->set_pio_mode = &palm_bk3710_set_pio_mode;
-   hwif->set_dma_mode = &palm_bk3710_set_dma_mode;
hwif->mmio = 1;
default_hwif_mmiops(hwif);
-   hwif->cbl = ATA_CBL_PATA80;
-   hwif->ultra_mask = 0x1f;/* Ultra DMA Mode 4 Max
-   (input clk 99MHz) */
-   hwif->mwdma_mask = 0x7;
-   hwif->drives[0].autotune = 1;
-   hwif->drives[1].autotune = 1;
 
ide_setup_dma(hwif, mem->start);
 
idx[0] = i;
 
-   ide_device_add(idx, NULL);
+   ide_device_add(idx, &palm_bk3710_port_info);
 
if (!hwif->present)
goto out;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


palm_bk3710: port initialization/probing bugfix

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c92a7f1d8254fabd99df33af59094935fc2cfe32
Commit: c92a7f1d8254fabd99df33af59094935fc2cfe32
Parent: d4452be757b5b94b2d39c5c254743caee913915e
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:13 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:13 2008 +0100

palm_bk3710: port initialization/probing bugfix

Probe port _after_ it is fully initialized.

Cc: Anton Salnikov <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/palm_bk3710.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 0ce95c1..8e40bdb 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -370,13 +370,6 @@ static int __devinit palm_bk3710_probe(struct 
platform_device *pdev)
ide_init_port_hw(hwif, &hw);
hwif->quirkproc = NULL;
 
-   idx[0] = i;
-
-   ide_device_add(idx, NULL);
-
-   if (!hwif->present)
-   goto out;
-
hwif->set_pio_mode = &palm_bk3710_set_pio_mode;
hwif->set_dma_mode = &palm_bk3710_set_dma_mode;
hwif->mmio = 1;
@@ -390,6 +383,13 @@ static int __devinit palm_bk3710_probe(struct 
platform_device *pdev)
 
ide_setup_dma(hwif, mem->start);
 
+   idx[0] = i;
+
+   ide_device_add(idx, NULL);
+
+   if (!hwif->present)
+   goto out;
+
return 0;
 out:
printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


palm_bk3710: fix ide_unregister() usage

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d4452be757b5b94b2d39c5c254743caee913915e
Commit: d4452be757b5b94b2d39c5c254743caee913915e
Parent: 7824bc6b474caca6d74489498d9c2c2dfcc86d10
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:12 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:12 2008 +0100

palm_bk3710: fix ide_unregister() usage

Don't set 'restore' flag for ide_unregister() when initializing new
interface.

[ identical change as done to bast-ide/ide-cs/delkin_cb host drivers
  by commit 909f4369bca30f9a186316a3bf2b4a9c1e702a25 ]

Cc: Anton Salnikov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/palm_bk3710.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 0802966..0ce95c1 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -363,7 +363,7 @@ static int __devinit palm_bk3710_probe(struct 
platform_device *pdev)
i = hwif->index;
 
if (hwif->present)
-   ide_unregister(i, 0, 1);
+   ide_unregister(i, 0, 0);
else if (!hwif->hold)
ide_init_port_data(hwif, i);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


palm_bk3710: ide_register_hw() -> ide_device_add()

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7824bc6b474caca6d74489498d9c2c2dfcc86d10
Commit: 7824bc6b474caca6d74489498d9c2c2dfcc86d10
Parent: d30a426dc5fd8801dbd05485788a001de623d487
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:12 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:12 2008 +0100

palm_bk3710: ide_register_hw() -> ide_device_add()

* Convert palm_bk3710 host driver to use ide_device_add() instead of
  ide_register_hw() (while at it drop doing "ide_unregister()" loop which
  tries to unregister _all_ IDE interfaces if useable ide_hwifs[] slot
  cannot be find).

  [ identical change as done to bast-ide/ide-cs/delkin_cb host drivers
by commit 9e016a719209d95338e314b46c3012cc7feaaeec ]

* Rename 'ide_ctlr_info' to 'hw' and 'index' to 'i' while at it.

Cc: Anton Salnikov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/palm_bk3710.c |   45 +---
 1 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index c306997..0802966 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -313,13 +313,13 @@ static void __devinit palm_bk3710_chipinit(void __iomem 
*base)
 }
 static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 {
-   hw_regs_t ide_ctlr_info;
-   int index = 0;
-   int pribase;
struct clk *clkp;
struct resource *mem, *irq;
ide_hwif_t *hwif;
void __iomem *base;
+   int pribase, i;
+   hw_regs_t hw;
+   u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
clkp = clk_get(NULL, "IDECLK");
if (IS_ERR(clkp))
@@ -330,7 +330,7 @@ static int __devinit palm_bk3710_probe(struct 
platform_device *pdev)
ide_palm_clk = clk_get_rate(ideclkp)/10;
ide_palm_clk = (1/ide_palm_clk) + 1;
/* Register the IDE interface with Linux ATA Interface */
-   memset(&ide_ctlr_info, 0, sizeof(ide_ctlr_info));
+   memset(&hw, 0, sizeof(hw));
 
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (mem == NULL) {
@@ -349,17 +349,33 @@ static int __devinit palm_bk3710_probe(struct 
platform_device *pdev)
palm_bk3710_chipinit(base);
 
pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET;
-   for (index = 0; index < IDE_NR_PORTS - 2; index++)
-   ide_ctlr_info.io_ports[index] = pribase + index;
-   ide_ctlr_info.io_ports[IDE_CONTROL_OFFSET] = mem->start +
+   for (i = 0; i < IDE_NR_PORTS - 2; i++)
+   hw.io_ports[i] = pribase + i;
+   hw.io_ports[IDE_CONTROL_OFFSET] = mem->start +
IDE_PALM_ATA_PRI_CTL_OFFSET;
-   ide_ctlr_info.irq = irq->start;
-   ide_ctlr_info.chipset = ide_palm3710;
+   hw.irq = irq->start;
+   hw.chipset = ide_palm3710;
 
-   if (ide_register_hw(&ide_ctlr_info, NULL, &hwif) < 0) {
-   printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
-   return -ENODEV;
-   }
+   hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+   if (hwif == NULL)
+   goto out;
+
+   i = hwif->index;
+
+   if (hwif->present)
+   ide_unregister(i, 0, 1);
+   else if (!hwif->hold)
+   ide_init_port_data(hwif, i);
+
+   ide_init_port_hw(hwif, &hw);
+   hwif->quirkproc = NULL;
+
+   idx[0] = i;
+
+   ide_device_add(idx, NULL);
+
+   if (!hwif->present)
+   goto out;
 
hwif->set_pio_mode = &palm_bk3710_set_pio_mode;
hwif->set_dma_mode = &palm_bk3710_set_dma_mode;
@@ -375,6 +391,9 @@ static int __devinit palm_bk3710_probe(struct 
platform_device *pdev)
ide_setup_dma(hwif, mem->start);
 
return 0;
+out:
+   printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
+   return -ENODEV;
 }
 
 static struct platform_driver platform_bk_driver = {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: insert BUG_ON() into __ide_set_handler() (take 2)

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d30a426dc5fd8801dbd05485788a001de623d487
Commit: d30a426dc5fd8801dbd05485788a001de623d487
Parent: cb777922c3a15ccbea4c02bed401e030f195aaea
Author: Sergei Shtylyov <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:12 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:12 2008 +0100

ide: insert BUG_ON() into __ide_set_handler() (take 2)

Replace the check for hwgroup->handler and printk(KERN_CRIT, ...) at the 
start
of __ide_set_handler() with mere BUG_ON() while removing such from the 
caller,
ide_execute_command(). Fix up the code formatting, while at it...

Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-iops.c |   10 ++
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index c32e759..c419266 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -786,15 +786,11 @@ static void __ide_set_handler (ide_drive_t *drive, 
ide_handler_t *handler,
 {
ide_hwgroup_t *hwgroup = HWGROUP(drive);
 
-   if (hwgroup->handler != NULL) {
-   printk(KERN_CRIT "%s: ide_set_handler: handler not null; "
-   "old=%p, new=%p\n",
-   drive->name, hwgroup->handler, handler);
-   }
+   BUG_ON(hwgroup->handler);
hwgroup->handler= handler;
hwgroup->expiry = expiry;
hwgroup->timer.expires  = jiffies + timeout;
-   hwgroup->req_gen_timer = hwgroup->req_gen;
+   hwgroup->req_gen_timer  = hwgroup->req_gen;
add_timer(&hwgroup->timer);
 }
 
@@ -827,11 +823,9 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, 
ide_handler_t *handler,
 unsigned timeout, ide_expiry_t *expiry)
 {
unsigned long flags;
-   ide_hwgroup_t *hwgroup = HWGROUP(drive);
ide_hwif_t *hwif = HWIF(drive);
 
spin_lock_irqsave(&ide_lock, flags);
-   BUG_ON(hwgroup->handler);
__ide_set_handler(drive, handler, timeout, expiry);
hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG);
/*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cs5520: remove stale comment

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cb777922c3a15ccbea4c02bed401e030f195aaea
Commit: cb777922c3a15ccbea4c02bed401e030f195aaea
Parent: 3b0e044d5a881c937293a045158149514b86783c
Author: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:12 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:12 2008 +0100

cs5520: remove stale comment

Remove stale comment from the cs5520 IDE driver.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/cs5520.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index 0be1a82..1c163e4 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -147,11 +147,6 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, 
const struct pci_devic
 
/* We must not grab the entire device, it has 'ISA' space in its
 * BARS too and we will freak out other bits of the kernel
-*
-* pci_enable_device_bars() is going away. I replaced it with
-* IO only enable for now but I'll need confirmation this is
-* allright for that device. If not, it will need some kind of
-* quirk. --BenH.
 */
if (pci_enable_device_io(dev)) {
printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Use proper abstractions in quirk_intel_irqbalance

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9585ca02f8f9e844b64e7ff4d167ccc1390a99ab
Commit: 9585ca02f8f9e844b64e7ff4d167ccc1390a99ab
Parent: 19af35546de68c872dcb687613e0902a602cb20e
Author: Matthew Wilcox <[EMAIL PROTECTED]>
AuthorDate: Sun Feb 10 23:18:15 2008 -0500
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 08:15:03 2008 -0800

Use proper abstractions in quirk_intel_irqbalance

Since we may not have a pci_dev for the device we need to access, we can't
use pci_read_config_word.  But raw_pci_read is an internal implementation
detail; it's better to use the architected pci_bus_read_config_word
interface.  Using PCI_DEVFN instead of a mysterious constant helps
reassure everyone that we really do intend to access device 8.

[ Thanks to Grant Grundler for pointing out to me that this is exactly
  what the write immediately above this is doing -- enabling device 8 to
  respond to config space cycles.
- Matthew

  Grant also says:

"Can you also add a comment which points at the Intel
 documentation?

 The 'Intel E7320 Memory Controller Hub (MCH) Datasheet' at

  http://download.intel.com/design/chipsets/datashts/30300702.pdf

 Page 69 documents register F4h (DEVPRES1).

 And I just doubled checked that the 0xf4 register value is
 restored later in the quirk (obvious when you look at the code
 but not from the patch"

  so here it is.
 - Linus ]

Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]>
Acked-by: Grant Grundler <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 arch/x86/kernel/quirks.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 1941482..c47208f 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -11,7 +11,7 @@
 static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
 {
u8 config, rev;
-   u32 word;
+   u16 word;
 
/* BIOS may enable hardware IRQ balancing for
 * E7520/E7320/E7525(revision ID 0x9 and below)
@@ -26,8 +26,11 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev 
*dev)
pci_read_config_byte(dev, 0xf4, &config);
pci_write_config_byte(dev, 0xf4, config|0x2);
 
-   /* read xTPR register */
-   raw_pci_read(0, 0, 0x40, 0x4c, 2, &word);
+   /*
+* read xTPR register.  We may not have a pci_dev for device 8
+* because it might be hidden until the above write.
+*/
+   pci_bus_read_config_word(dev->bus, PCI_DEVFN(8, 0), 0x4c, &word);
 
if (!(word & (1 << 13))) {
dev_info(&dev->dev, "Intel E7520/7320/7525 detected; "
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide: another possible ide panic fix for blk-end-request

2008-02-11 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b0e044d5a881c937293a045158149514b86783c
Commit: 3b0e044d5a881c937293a045158149514b86783c
Parent: 0eccf60bfa9190d1588b2bf07d23d7b9b3a19d9e
Author: Kiyoshi Ueda <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 00:32:11 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 00:32:11 2008 +0100

ide: another possible ide panic fix for blk-end-request

I have reviewed all blk-end-request patches again to confirm whether
there are any similar problems with the last week's ide-cd panic:
http://lkml.org/lkml/2008/1/29/140

And I found a possible similar bug in ide-io change:
ide_end_drive_cmd() could be called for blk_pc_request() which could
have bios.  To complete such requests correctly, we need to pass
the actual size of the request.
Otherwise, __blk_end_request() returns 1 because the request still has
bios, and the system will BUG() unnecessarily.

The following patch fixes the bug and should be applied on top of
Linus' git.

Signed-off-by: Kiyoshi Ueda <[EMAIL PROTECTED]>
Signed-off-by: Jun'ichi Nomura <[EMAIL PROTECTED]>
Cc: Borislav Petkov <[EMAIL PROTECTED]>
Cc: Jens Axboe <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 3addbe4..e41383f 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -388,7 +388,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
spin_lock_irqsave(&ide_lock, flags);
HWGROUP(drive)->rq = NULL;
rq->errors = err;
-   if (__blk_end_request(rq, (rq->errors ? -EIO : 0), 0))
+   if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0),
+  blk_rq_bytes(rq
BUG();
spin_unlock_irqrestore(&ide_lock, flags);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html