IPoIB: Convert to NAPI

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8d1cc86a6278687efbab7b8c294ab01efe4d4231
Commit: 8d1cc86a6278687efbab7b8c294ab01efe4d4231
Parent: ed23a72778f3dbd465e55b06fe31629e7e1dd2f3
Author: Roland Dreier [EMAIL PROTECTED]
AuthorDate: Sun May 6 21:05:32 2007 -0700
Committer:  Roland Dreier [EMAIL PROTECTED]
CommitDate: Sun May 6 21:18:11 2007 -0700

IPoIB: Convert to NAPI

Convert the IP-over-InfiniBand network device driver over to using
NAPI to handle completions for the main CQ.  This covers all receives
as well as datagram mode sends; send completions for connected mode
connections are still handled from interrupt context.

Signed-off-by: Roland Dreier [EMAIL PROTECTED]
---
 drivers/infiniband/ulp/ipoib/ipoib.h  |1 +
 drivers/infiniband/ulp/ipoib/ipoib_cm.c   |2 +-
 drivers/infiniband/ulp/ipoib/ipoib_ib.c   |   89 ++--
 drivers/infiniband/ulp/ipoib/ipoib_main.c |2 +
 4 files changed, 74 insertions(+), 20 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h 
b/drivers/infiniband/ulp/ipoib/ipoib.h
index fd55826..15867af 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -311,6 +311,7 @@ extern struct workqueue_struct *ipoib_workqueue;
 
 /* functions */
 
+int ipoib_poll(struct net_device *dev, int *budget);
 void ipoib_ib_completion(struct ib_cq *cq, void *dev_ptr);
 
 struct ipoib_ah *ipoib_create_ah(struct net_device *dev,
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c 
b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index b8089a0..785bc85 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -416,7 +416,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct 
ib_wc *wc)
skb-dev = dev;
/* XXX get correct PACKET_ type here */
skb-pkt_type = PACKET_HOST;
-   netif_rx_ni(skb);
+   netif_receive_skb(skb);
 
 repost:
if (unlikely(ipoib_cm_post_receive(dev, wr_id)))
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c 
b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 1bdb910..68d72c6 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -226,7 +226,7 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, 
struct ib_wc *wc)
skb-dev = dev;
/* XXX get correct PACKET_ type here */
skb-pkt_type = PACKET_HOST;
-   netif_rx_ni(skb);
+   netif_receive_skb(skb);
} else {
ipoib_dbg_data(priv, dropping loopback packet\n);
dev_kfree_skb_any(skb);
@@ -280,28 +280,63 @@ static void ipoib_ib_handle_tx_wc(struct net_device *dev, 
struct ib_wc *wc)
   wc-status, wr_id, wc-vendor_err);
 }
 
-static void ipoib_ib_handle_wc(struct net_device *dev, struct ib_wc *wc)
+int ipoib_poll(struct net_device *dev, int *budget)
 {
-   if (wc-wr_id  IPOIB_CM_OP_SRQ)
-   ipoib_cm_handle_rx_wc(dev, wc);
-   else if (wc-wr_id  IPOIB_OP_RECV)
-   ipoib_ib_handle_rx_wc(dev, wc);
-   else
-   ipoib_ib_handle_tx_wc(dev, wc);
+   struct ipoib_dev_priv *priv = netdev_priv(dev);
+   int max = min(*budget, dev-quota);
+   int done;
+   int t;
+   int empty;
+   int n, i;
+
+   done  = 0;
+   empty = 0;
+
+   while (max) {
+   t = min(IPOIB_NUM_WC, max);
+   n = ib_poll_cq(priv-cq, t, priv-ibwc);
+
+   for (i = 0; i  n; ++i) {
+   struct ib_wc *wc = priv-ibwc + i;
+
+   if (wc-wr_id  IPOIB_CM_OP_SRQ) {
+   ++done;
+   --max;
+   ipoib_cm_handle_rx_wc(dev, wc);
+   } else if (wc-wr_id  IPOIB_OP_RECV) {
+   ++done;
+   --max;
+   ipoib_ib_handle_rx_wc(dev, wc);
+   } else
+   ipoib_ib_handle_tx_wc(dev, wc);
+   }
+
+   if (n != t) {
+   empty = 1;
+   break;
+   }
+   }
+
+   dev-quota -= done;
+   *budget-= done;
+
+   if (empty) {
+   netif_rx_complete(dev);
+   if (unlikely(ib_req_notify_cq(priv-cq,
+ IB_CQ_NEXT_COMP |
+ IB_CQ_REPORT_MISSED_EVENTS)) 
+   netif_rx_reschedule(dev, 0))
+   return 1;
+
+   return 0;
+   }
+
+   return 1;
 }
 
 void ipoib_ib_completion(struct ib_cq *cq, void *dev_ptr)
 {
-   struct net_device *dev = (struct net_device *) dev_ptr;
-   struct ipoib_dev_priv *priv = netdev_priv(dev);
-   int n, i;
-

[SCSI] SUNESP: sun_esp.c needs linux/delay.h

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6025dfe5b2598056cd763a2b10ca7e7faffb2e16
Commit: 6025dfe5b2598056cd763a2b10ca7e7faffb2e16
Parent: 15700770ef7c5d12e2f1659d2ddbeb3f658d9f37
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Sun Apr 29 16:12:29 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sun May 6 22:43:41 2007 -0700

[SCSI] SUNESP: sun_esp.c needs linux/delay.h

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/scsi/sun_esp.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index 8c766bc..bbeb245 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -5,6 +5,7 @@
 
 #include linux/kernel.h
 #include linux/types.h
+#include linux/delay.h
 #include linux/module.h
 #include linux/init.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


[SPARC]: Fix comment typo in smp4m_blackbox_current().

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4cad69174f385c183b2bcb369fb4304d8624ab96
Commit: 4cad69174f385c183b2bcb369fb4304d8624ab96
Parent: 6025dfe5b2598056cd763a2b10ca7e7faffb2e16
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Mon Apr 30 17:59:50 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sun May 6 22:43:46 2007 -0700

[SPARC]: Fix comment typo in smp4m_blackbox_current().

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 arch/sparc/kernel/sun4m_smp.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index e2d9c01..4e07bdb 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -405,7 +405,7 @@ void __init smp4m_blackbox_current(unsigned *addr)

addr[0] = 0x8158 | rd;  /* rd %tbr, reg */
addr[2] = 0x8130200a | rd | rs1;/* srl reg, 0xa, reg */
-   addr[4] = 0x8008200c | rd | rs1;/* and reg, 3, reg */
+   addr[4] = 0x8008200c | rd | rs1;/* and reg, 0xc, reg */
 }
 
 void __init sun4m_init_smp(void)
-
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


[SPARC64]: SUN4U PCI-E controller support.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=861fe90656b8e20d750d73c57088dc52d316ce7b
Commit: 861fe90656b8e20d750d73c57088dc52d316ce7b
Parent: 4cad69174f385c183b2bcb369fb4304d8624ab96
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Wed May 2 17:31:36 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sun May 6 22:44:06 2007 -0700

[SPARC64]: SUN4U PCI-E controller support.

Some minor refactoring in the generic code was necessary for
this:

1) This controller requires 8-byte access to the interrupt map
   and clear register.  They are 64-bits on all the other
   SBUS and PCI controllers anyways, so this was easy to cure.

2) The IMAP register has a different layout and some bits that we
   need to preserve, so use a read/modify/write when making
   changes to the IMAP register in generic code.

3) Flushing the entire IOMMU TLB is best done with a single write
   to a register on this PCI controller, add a iommu-iommu_flushinv
   for this.

Still lacks MSI support, that will come later.

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 arch/sparc64/kernel/Makefile|2 +-
 arch/sparc64/kernel/irq.c   |   16 +-
 arch/sparc64/kernel/pci.c   |9 +
 arch/sparc64/kernel/pci_fire.c  |  418 +++
 arch/sparc64/kernel/pci_iommu.c |   22 ++-
 arch/sparc64/kernel/prom.c  |   89 -
 include/asm-sparc64/iommu.h |1 +
 7 files changed, 535 insertions(+), 22 deletions(-)

diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index eff0c01..6bf6fb6 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -17,7 +17,7 @@ obj-y := process.o setup.o cpu.o idprom.o \
 obj-$(CONFIG_STACKTRACE) += stacktrace.o
 obj-$(CONFIG_PCI)   += ebus.o isa.o pci_common.o pci_iommu.o \
pci_psycho.o pci_sabre.o pci_schizo.o \
-   pci_sun4v.o pci_sun4v_asm.o
+   pci_sun4v.o pci_sun4v_asm.o pci_fire.o
 obj-$(CONFIG_SMP)   += smp.o trampoline.o
 obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o
 obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 6241e3d..3edc18e 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -279,7 +279,7 @@ static void sun4u_irq_enable(unsigned int virt_irq)
struct irq_handler_data *data = get_irq_chip_data(virt_irq);
 
if (likely(data)) {
-   unsigned long cpuid, imap;
+   unsigned long cpuid, imap, val;
unsigned int tid;
 
cpuid = irq_choose_cpu(virt_irq);
@@ -287,7 +287,11 @@ static void sun4u_irq_enable(unsigned int virt_irq)
 
tid = sun4u_compute_tid(imap, cpuid);
 
-   upa_writel(tid | IMAP_VALID, imap);
+   val = upa_readq(imap);
+   val = ~(IMAP_TID_UPA | IMAP_TID_JBUS |
+IMAP_AID_SAFARI | IMAP_NID_SAFARI);
+   val |= tid | IMAP_VALID;
+   upa_writeq(val, imap);
}
 }
 
@@ -297,10 +301,10 @@ static void sun4u_irq_disable(unsigned int virt_irq)
 
if (likely(data)) {
unsigned long imap = data-imap;
-   u32 tmp = upa_readl(imap);
+   u32 tmp = upa_readq(imap);
 
tmp = ~IMAP_VALID;
-   upa_writel(tmp, imap);
+   upa_writeq(tmp, imap);
}
 }
 
@@ -309,7 +313,7 @@ static void sun4u_irq_end(unsigned int virt_irq)
struct irq_handler_data *data = get_irq_chip_data(virt_irq);
 
if (likely(data))
-   upa_writel(ICLR_IDLE, data-iclr);
+   upa_writeq(ICLR_IDLE, data-iclr);
 }
 
 static void sun4v_irq_enable(unsigned int virt_irq)
@@ -465,7 +469,7 @@ unsigned int build_irq(int inofixup, unsigned long iclr, 
unsigned long imap)
 
BUG_ON(tlb_type == hypervisor);
 
-   ino = (upa_readl(imap)  (IMAP_IGN | IMAP_INO)) + inofixup;
+   ino = (upa_readq(imap)  (IMAP_IGN | IMAP_INO)) + inofixup;
bucket = ivector_table[ino];
if (!bucket-virt_irq) {
bucket-virt_irq = virt_irq_alloc(__irq(bucket));
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 9a54954..a72a3c3 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -190,6 +190,7 @@ extern void schizo_init(struct device_node *, const char *);
 extern void schizo_plus_init(struct device_node *, const char *);
 extern void tomatillo_init(struct device_node *, const char *);
 extern void sun4v_pci_init(struct device_node *, const char *);
+extern void fire_pci_init(struct device_node *, const char *);
 
 static struct {
char *model_name;
@@ -207,6 +208,7 @@ static struct {
{ SUNW,tomatillo, tomatillo_init },
  

[SPARC64]: Update defconfig.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7db00552d937e4c0825895734ba5fe257dfe8ced
Commit: 7db00552d937e4c0825895734ba5fe257dfe8ced
Parent: 71227521459872c321e7a581e82723bbc1aa33e1
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Sun May 6 22:47:14 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sun May 6 22:47:14 2007 -0700

[SPARC64]: Update defconfig.

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 arch/sparc64/defconfig |   71 +++-
 1 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 120c9c3..37c2d36 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -1,15 +1,16 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21-rc4
-# Sat Mar 17 14:18:44 2007
+# Linux kernel version: 2.6.21
+# Sun May  6 22:46:54 2007
 #
 CONFIG_SPARC=y
 CONFIG_SPARC64=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_64BIT=y
 CONFIG_MMU=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_LOCKDEP_SUPPORT=y
-CONFIG_TIME_INTERPOLATION=y
 CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
@@ -108,6 +109,9 @@ CONFIG_GENERIC_HARDIRQS=y
 #
 # General machine setup
 #
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
 # CONFIG_SMP is not set
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_TABLE=m
@@ -140,8 +144,7 @@ CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_SPARSEMEM_MANUAL=y
 CONFIG_SPARSEMEM=y
 CONFIG_HAVE_MEMORY_PRESENT=y
-# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_SPARSEMEM_STATIC=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=0
@@ -151,6 +154,7 @@ CONFIG_SUN_AUXIO=y
 CONFIG_SUN_IO=y
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+CONFIG_ARCH_SUPPORTS_MSI=y
 CONFIG_PCI_MSI=y
 # CONFIG_PCI_DEBUG is not set
 CONFIG_SUN_OPENPROMFS=m
@@ -178,7 +182,6 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 CONFIG_PACKET_MMAP=y
 CONFIG_UNIX=y
@@ -219,6 +222,7 @@ CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
 CONFIG_IPV6_ROUTE_INFO=y
+CONFIG_IPV6_OPTIMISTIC_DAD=y
 CONFIG_INET6_AH=m
 CONFIG_INET6_ESP=m
 CONFIG_INET6_IPCOMP=m
@@ -292,6 +296,14 @@ CONFIG_NET_TCPPROBE=m
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
 
 #
@@ -312,10 +324,6 @@ CONFIG_FW_LOADER=y
 # Connector - unified userspace - kernelspace linker
 #
 CONFIG_CONNECTOR=m
-
-#
-# Memory Technology Devices (MTD)
-#
 # CONFIG_MTD is not set
 
 #
@@ -383,7 +391,6 @@ CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-CONFIG_IDEDMA_PCI_AUTO=y
 CONFIG_IDEDMA_ONLYDISK=y
 # CONFIG_BLK_DEV_AEC62XX is not set
 CONFIG_BLK_DEV_ALI15X3=y
@@ -413,7 +420,6 @@ CONFIG_BLK_DEV_ALI15X3=y
 # CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
-CONFIG_IDEDMA_AUTO=y
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -443,6 +449,7 @@ CONFIG_SCSI_MULTI_LUN=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 # CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ -485,6 +492,7 @@ CONFIG_ISCSI_TCP=m
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_ESP_CORE is not set
 # CONFIG_SCSI_SUNESP is not set
 # CONFIG_SCSI_SRP is not set
 
@@ -628,9 +636,10 @@ CONFIG_BNX2=m
 # CONFIG_TR is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Wireless LAN
 #
-# CONFIG_NET_RADIO is not set
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
 
 #
 # Wan interfaces
@@ -695,6 +704,12 @@ CONFIG_KEYBOARD_LKKBD=m
 # CONFIG_KEYBOARD_STOWAWAY is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_SERIAL=y
 # CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
@@ -702,6 +717,7 @@ CONFIG_MOUSE_SERIAL=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_SPARCSPKR=y
 # CONFIG_INPUT_UINPUT is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Hardware I/O ports
@@ -763,11 +779,8 @@ CONFIG_RTC=y
 # TPM devices
 #
 # CONFIG_TCG_TPM is not set
-
-#
-# I2C support
-#
 CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
 # CONFIG_I2C_CHARDEV is not set
 
 #
@@ -791,17 +804,17 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_NFORCE2 is not set
 # CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_PASEMI is not set
 # CONFIG_I2C_PROSAVAGE is not set
 # CONFIG_I2C_SAVAGE4 is not set
+# 

[MM]: sparse_init() should be __init.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a5b518f222449e707e553573f937faf6e57f03d
Commit: 6a5b518f222449e707e553573f937faf6e57f03d
Parent: 7db00552d937e4c0825895734ba5fe257dfe8ced
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Sun May 6 23:54:25 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sun May 6 23:54:25 2007 -0700

[MM]: sparse_init() should be __init.

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 mm/sparse.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index ac26eb0..893e562 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -272,7 +272,7 @@ static void __kfree_section_memmap(struct page *memmap, 
unsigned long nr_pages)
  * Allocate the accumulated non-linear sections, allocate a mem_map
  * for each and record the physical to section mapping.
  */
-void sparse_init(void)
+void __init sparse_init(void)
 {
unsigned long pnum;
struct page *map;
-
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


[SPARC64]: Fix section mismatch warnings in arch/sparc64/kernel/console.c

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=23abc9ec6a4fbcb3da5475f9f4c25415c466de08
Commit: 23abc9ec6a4fbcb3da5475f9f4c25415c466de08
Parent: 6a5b518f222449e707e553573f937faf6e57f03d
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:00:37 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:00:37 2007 -0700

[SPARC64]: Fix section mismatch warnings in arch/sparc64/kernel/console.c

probe_other_fhcs() and central_probe() should be __init

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 arch/sparc64/kernel/central.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/sparc64/kernel/central.c b/arch/sparc64/kernel/central.c
index c65b2f9..8230099 100644
--- a/arch/sparc64/kernel/central.c
+++ b/arch/sparc64/kernel/central.c
@@ -98,7 +98,7 @@ void apply_central_ranges(struct linux_central *central,
central-num_central_ranges);
 }
 
-void * __init central_alloc_bootmem(unsigned long size)
+static void * __init central_alloc_bootmem(unsigned long size)
 {
void *ret;
 
@@ -116,7 +116,7 @@ static unsigned long prom_reg_to_paddr(struct 
linux_prom_registers *r)
return ret | (unsigned long) r-phys_addr;
 }
 
-static void probe_other_fhcs(void)
+static void __init probe_other_fhcs(void)
 {
struct device_node *dp;
const struct linux_prom64_registers *fpregs;
@@ -298,7 +298,7 @@ static void init_all_fhc_hw(void)
 
 }
 
-void central_probe(void)
+void __init central_probe(void)
 {
struct linux_prom_registers fpregs[6];
const struct linux_prom_registers *pr;
-
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


[SPARC64]: Fix section mismatch warnings in arch/sparc64/kernel/pci.c

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a6009dda97776d50166e7f1e378cf553a1c20309
Commit: a6009dda97776d50166e7f1e378cf553a1c20309
Parent: 23abc9ec6a4fbcb3da5475f9f4c25415c466de08
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:01:38 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:01:38 2007 -0700

[SPARC64]: Fix section mismatch warnings in arch/sparc64/kernel/pci.c

apb_calc_first_last(), apb_fake_ranges(), pci_of_scan_bus(),
of_scan_pci_bridge(), pci_of_scan_bus(), and pci_scan_one_pbm()
should all be __devinit.

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 arch/sparc64/kernel/pci.c |   28 ++--
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index a72a3c3..af2c7ff 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -477,7 +477,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
return dev;
 }
 
-static void __init apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p)
+static void __devinit apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p)
 {
u32 idx, first, last;
 
@@ -506,9 +506,9 @@ static void __init pci_resource_adjust(struct resource *res,
 /* Cook up fake bus resources for SUNW,simba PCI bridges which lack
  * a proper 'ranges' property.
  */
-static void __init apb_fake_ranges(struct pci_dev *dev,
-  struct pci_bus *bus,
-  struct pci_pbm_info *pbm)
+static void __devinit apb_fake_ranges(struct pci_dev *dev,
+ struct pci_bus *bus,
+ struct pci_pbm_info *pbm)
 {
struct resource *res;
u32 first, last;
@@ -531,15 +531,15 @@ static void __init apb_fake_ranges(struct pci_dev *dev,
pci_resource_adjust(res, pbm-mem_space);
 }
 
-static void __init pci_of_scan_bus(struct pci_pbm_info *pbm,
-  struct device_node *node,
-  struct pci_bus *bus);
+static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
+ struct device_node *node,
+ struct pci_bus *bus);
 
 #define GET_64BIT(prop, i) u64) (prop)[(i)])  32) | (prop)[(i)+1])
 
-void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
- struct device_node *node,
- struct pci_dev *dev)
+static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
+struct device_node *node,
+struct pci_dev *dev)
 {
struct pci_bus *bus;
const u32 *busrange, *ranges;
@@ -638,9 +638,9 @@ simba_cont:
pci_of_scan_bus(pbm, node, bus);
 }
 
-static void __init pci_of_scan_bus(struct pci_pbm_info *pbm,
-  struct device_node *node,
-  struct pci_bus *bus)
+static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
+ struct device_node *node,
+ struct pci_bus *bus)
 {
struct device_node *child;
const u32 *reg;
@@ -742,7 +742,7 @@ int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev,
return PCIBIOS_SUCCESSFUL;
 }
 
-struct pci_bus * __init pci_scan_one_pbm(struct pci_pbm_info *pbm)
+struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm)
 {
struct pci_controller_info *p = pbm-parent;
struct device_node *node = pbm-prom_node;
-
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


[SPARC64]: Fix section mismatch warnings in arch/sparc64/kernel/prom.c

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c35a376d6089ab0ece2913959c8363aad76eb820
Commit: c35a376d6089ab0ece2913959c8363aad76eb820
Parent: a6009dda97776d50166e7f1e378cf553a1c20309
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:02:24 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:02:24 2007 -0700

[SPARC64]: Fix section mismatch warnings in arch/sparc64/kernel/prom.c

The IRQ translation init routines should all be __init.

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 arch/sparc64/kernel/prom.c |   25 +
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 6625ac8..c54d4d8 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -396,7 +396,7 @@ static unsigned int psycho_irq_build(struct device_node *dp,
return build_irq(inofixup, iclr, imap);
 }
 
-static void psycho_irq_trans_init(struct device_node *dp)
+static void __init psycho_irq_trans_init(struct device_node *dp)
 {
const struct linux_prom64_registers *regs;
 
@@ -636,7 +636,7 @@ static unsigned int sabre_irq_build(struct device_node *dp,
return virt_irq;
 }
 
-static void sabre_irq_trans_init(struct device_node *dp)
+static void __init sabre_irq_trans_init(struct device_node *dp)
 {
const struct linux_prom64_registers *regs;
struct sabre_irq_data *irq_data;
@@ -793,7 +793,8 @@ static unsigned int schizo_irq_build(struct device_node *dp,
return virt_irq;
 }
 
-static void __schizo_irq_trans_init(struct device_node *dp, int is_tomatillo)
+static void __init __schizo_irq_trans_init(struct device_node *dp,
+  int is_tomatillo)
 {
const struct linux_prom64_registers *regs;
struct schizo_irq_data *irq_data;
@@ -815,12 +816,12 @@ static void __schizo_irq_trans_init(struct device_node 
*dp, int is_tomatillo)
irq_data-chip_version = of_getintprop_default(dp, version#, 0);
 }
 
-static void schizo_irq_trans_init(struct device_node *dp)
+static void __init schizo_irq_trans_init(struct device_node *dp)
 {
__schizo_irq_trans_init(dp, 0);
 }
 
-static void tomatillo_irq_trans_init(struct device_node *dp)
+static void __init tomatillo_irq_trans_init(struct device_node *dp)
 {
__schizo_irq_trans_init(dp, 1);
 }
@@ -834,7 +835,7 @@ static unsigned int pci_sun4v_irq_build(struct device_node 
*dp,
return sun4v_build_irq(devhandle, devino);
 }
 
-static void pci_sun4v_irq_trans_init(struct device_node *dp)
+static void __init pci_sun4v_irq_trans_init(struct device_node *dp)
 {
const struct linux_prom64_registers *regs;
 
@@ -908,7 +909,7 @@ static unsigned int fire_irq_build(struct device_node *dp,
return build_irq(ino, iclr, imap);
 }
 
-static void fire_irq_trans_init(struct device_node *dp)
+static void __init fire_irq_trans_init(struct device_node *dp)
 {
const struct linux_prom64_registers *regs;
struct fire_irq_data *irq_data;
@@ -1071,7 +1072,7 @@ static unsigned int sbus_of_build_irq(struct device_node 
*dp,
return build_irq(sbus_level, iclr, imap);
 }
 
-static void sbus_irq_trans_init(struct device_node *dp)
+static void __init sbus_irq_trans_init(struct device_node *dp)
 {
const struct linux_prom64_registers *regs;
 
@@ -1118,7 +1119,7 @@ static unsigned int central_build_irq(struct device_node 
*dp,
return build_irq(0, iclr, imap);
 }
 
-static void central_irq_trans_init(struct device_node *dp)
+static void __init central_irq_trans_init(struct device_node *dp)
 {
dp-irq_trans = prom_early_alloc(sizeof(struct of_irq_controller));
dp-irq_trans-irq_build = central_build_irq;
@@ -1132,7 +1133,7 @@ struct irq_trans {
 };
 
 #ifdef CONFIG_PCI
-static struct irq_trans pci_irq_trans_table[] = {
+static struct irq_trans __initdata pci_irq_trans_table[] = {
{ SUNW,sabre, sabre_irq_trans_init },
{ pci108e,a000, sabre_irq_trans_init },
{ pci108e,a001, sabre_irq_trans_init },
@@ -1158,7 +1159,7 @@ static unsigned int sun4v_vdev_irq_build(struct 
device_node *dp,
return sun4v_build_irq(devhandle, devino);
 }
 
-static void sun4v_vdev_irq_trans_init(struct device_node *dp)
+static void __init sun4v_vdev_irq_trans_init(struct device_node *dp)
 {
const struct linux_prom64_registers *regs;
 
@@ -1170,7 +1171,7 @@ static void sun4v_vdev_irq_trans_init(struct device_node 
*dp)
((regs-phys_addr  32UL)  0x0fff);
 }
 
-static void irq_trans_init(struct device_node *dp)
+static void __init irq_trans_init(struct device_node *dp)
 {
 #ifdef CONFIG_PCI
const char *model;
-
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  

[SPARC64]: pgtable_cache_init() should be __init.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7f11aeed02767541020984f72f823757c58e48e
Commit: e7f11aeed02767541020984f72f823757c58e48e
Parent: c35a376d6089ab0ece2913959c8363aad76eb820
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:02:46 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:02:46 2007 -0700

[SPARC64]: pgtable_cache_init() should be __init.

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 arch/sparc64/mm/init.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index cafadcb..8c7af7e 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -173,7 +173,7 @@ static void zero_ctor(void *addr, struct kmem_cache *cache, 
unsigned long flags)
 
 extern void tsb_cache_init(void);
 
-void pgtable_cache_init(void)
+void __init pgtable_cache_init(void)
 {
pgtable_cache = kmem_cache_create(pgtable_cache,
  PAGE_SIZE, PAGE_SIZE,
-
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


[SERIAL] sunsu: Fix section mismatch warnings.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=90a660a4546d6ba5ca5f3a23d5cc599db2b41e08
Commit: 90a660a4546d6ba5ca5f3a23d5cc599db2b41e08
Parent: e7f11aeed02767541020984f72f823757c58e48e
Author: David S. Miller [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:14:13 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:14:13 2007 -0700

[SERIAL] sunsu: Fix section mismatch warnings.

Mark sunsu_console_setup() as __init and rename 'sunsu_cons'
to 'sunsu_console' so that it matches modpost.c's whitelist.

Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/serial/sunsu.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index bfd4417..2a63cdb 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1312,7 +1312,7 @@ static void sunsu_console_write(struct console *co, const 
char *s,
  * - initialize the serial port
  * Return non-zero if we didn't find a serial port.
  */
-static int sunsu_console_setup(struct console *co, char *options)
+static int __init sunsu_console_setup(struct console *co, char *options)
 {
struct uart_port *port;
int baud = 9600;
@@ -1343,7 +1343,7 @@ static int sunsu_console_setup(struct console *co, char 
*options)
return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
-static struct console sunsu_cons = {
+static struct console sunsu_console = {
.name   =   ttyS,
.write  =   sunsu_console_write,
.device =   uart_console_device,
@@ -1373,9 +1373,9 @@ static inline struct console *SUNSU_CONSOLE(int num_uart)
if (i == num_uart)
return NULL;
 
-   sunsu_cons.index = i;
+   sunsu_console.index = i;
 
-   return sunsu_cons;
+   return sunsu_console;
 }
 #else
 #define SUNSU_CONSOLE(num_uart)(NULL)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Add ASPM workaround.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8ed5d97e5e0be0fb1aebad16f4c464613a0e472d
Commit: 8ed5d97e5e0be0fb1aebad16f4c464613a0e472d
Parent: 15700770ef7c5d12e2f1659d2ddbeb3f658d9f37
Author: Matt Carlson [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:25:49 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:25:49 2007 -0700

[TG3]: Add ASPM workaround.

This patch adds workaround to fix performance problems caused by slow
PCIE L1-L0 transitions on ICH8 platforms.

Changed all magic numbers to constants as suggested by Jeff Garzik.

Signed-off-by: Matt Carlson [EMAIL PROTECTED]
Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/tg3.c |   24 
 drivers/net/tg3.h |   10 ++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 59d6e74..630c8a6 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -3019,6 +3019,16 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
}
}
 
+   if (tp-tg3_flags  TG3_FLAG_ASPM_WORKAROUND) {
+   u32 val = tr32(PCIE_PWR_MGMT_THRESH);
+   if (!netif_carrier_ok(tp-dev))
+   val = (val  ~PCIE_PWR_MGMT_L1_THRESH_MSK) |
+ tp-pwrmgmt_thresh;
+   else
+   val |= PCIE_PWR_MGMT_L1_THRESH_MSK;
+   tw32(PCIE_PWR_MGMT_THRESH, val);
+   }
+
return err;
 }
 
@@ -10004,6 +10014,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 
*tp)
tp-tg3_flags = ~TG3_FLAG_EEPROM_WRITE_PROT;
tp-tg3_flags2 |= TG3_FLG2_IS_NIC;
}
+   if (tr32(VCPU_CFGSHDW)  VCPU_CFGSHDW_ASPM_DBNC)
+   tp-tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
return;
}
 
@@ -10131,6 +10143,14 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 
*tp)
/* bootcode if bit 18 is set */
if (cfg2  (1  18))
tp-tg3_flags2 |= TG3_FLG2_SERDES_PREEMPHASIS;
+
+   if (tp-tg3_flags2  TG3_FLG2_PCI_EXPRESS) {
+   u32 cfg3;
+
+   tg3_read_mem(tp, NIC_SRAM_DATA_CFG_3, cfg3);
+   if (cfg3  NIC_SRAM_ASPM_DEBOUNCE)
+   tp-tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
+   }
}
 }
 
@@ -10998,6 +11018,10 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 */
tp-tg3_flags = ~TG3_FLAG_WOL_ENABLE;
 
+   if (tp-tg3_flags  TG3_FLAG_ASPM_WORKAROUND)
+   tp-pwrmgmt_thresh = tr32(PCIE_PWR_MGMT_THRESH) 
+PCIE_PWR_MGMT_L1_THRESH_MSK;
+
return err;
 }
 
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index dcdfc08..4d334cf 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1150,6 +1150,9 @@
 #define  VCPU_STATUS_INIT_DONE  0x0400
 #define  VCPU_STATUS_DRV_RESET  0x0800
 
+#define VCPU_CFGSHDW   0x5104
+#define  VCPU_CFGSHDW_ASPM_DBNC 0x1000
+
 /* Mailboxes */
 #define GRCMBOX_BASE   0x5600
 #define GRCMBOX_INTERRUPT_00x5800 /* 64-bit */
@@ -1507,6 +1510,8 @@
 #define PCIE_TRANS_CFG_1SHOT_MSI0x2000
 #define PCIE_TRANS_CFG_LOM  0x0020
 
+#define PCIE_PWR_MGMT_THRESH   0x7d28
+#define PCIE_PWR_MGMT_L1_THRESH_MSK 0xff00
 
 #define TG3_EEPROM_MAGIC   0x669955aa
 #define TG3_EEPROM_MAGIC_FW0xa500
@@ -1593,6 +1598,9 @@
 #define  SHASTA_EXT_LED_MAC 0x0001
 #define  SHASTA_EXT_LED_COMBO   0x00018000
 
+#define NIC_SRAM_DATA_CFG_30x0d3c
+#define  NIC_SRAM_ASPM_DEBOUNCE 0x0002
+
 #define NIC_SRAM_RX_MINI_BUFFER_DESC   0x1000
 
 #define NIC_SRAM_DMA_DESC_POOL_BASE0x2000
@@ -2200,6 +2208,7 @@ struct tg3 {
 #define TG3_FLAG_USE_LINKCHG_REG   0x0008
 #define TG3_FLAG_USE_MI_INTERRUPT  0x0010
 #define TG3_FLAG_ENABLE_ASF0x0020
+#define TG3_FLAG_ASPM_WORKAROUND   0x0040
 #define TG3_FLAG_POLL_SERDES   0x0080
 #define TG3_FLAG_MBOX_WRITE_REORDER0x0100
 #define TG3_FLAG_PCIX_TARGET_HWBUG 0x0200
@@ -2288,6 +2297,7 @@ struct tg3 {
u32 grc_local_ctrl;
u32 dma_rwctrl;
u32 coalesce_mode;
+   u32 pwrmgmt_thresh;
 
/* PCI block */
u16 pci_chip_rev_id;
-
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 

[TG3]: Eliminate spurious interrupts.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c04cb34725fdcf5fdb4135d8fdfaf6f318f10e99
Commit: c04cb34725fdcf5fdb4135d8fdfaf6f318f10e99
Parent: 8ed5d97e5e0be0fb1aebad16f4c464613a0e472d
Author: Michael Chan [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:26:15 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:26:15 2007 -0700

[TG3]: Eliminate spurious interrupts.

Spurious interrupts are often encountered especially on systems
using the 8259 PIC mode.  This is because the I/O write to deassert
the interrupt is posted and won't get to the chip immediately.  As
a result, the IRQ may remain asserted after the IRQ handler exits,
causing spurious interrupts.

Flush the interrupt mailbox in non-MSI handlers to de-assert the
IRQ immediately.  This seems to be the most straight forward approach
after discussion with Jeff Garzik and David Miller.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/tg3.c |   12 ++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 630c8a6..6f849bd 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -3590,8 +3590,12 @@ static irqreturn_t tg3_interrupt(int irq, void *dev_id)
 * Writing non-zero to intr-mbox-0 additional tells the
 * NIC to stop sending us irqs, engaging in-intr-handler
 * event coalescing.
+*
+* Flush the mailbox to de-assert the IRQ immediately to prevent
+* spurious interrupts.  The flush impacts performance but
+* excessive spurious interrupts can be worse in some cases.
 */
-   tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x0001);
+   tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x0001);
if (tg3_irq_sync(tp))
goto out;
sblk-status = ~SD_STATUS_UPDATED;
@@ -3635,8 +3639,12 @@ static irqreturn_t tg3_interrupt_tagged(int irq, void 
*dev_id)
 * writing non-zero to intr-mbox-0 additional tells the
 * NIC to stop sending us irqs, engaging in-intr-handler
 * event coalescing.
+*
+* Flush the mailbox to de-assert the IRQ immediately to prevent
+* spurious interrupts.  The flush impacts performance but
+* excessive spurious interrupts can be worse in some cases.
 */
-   tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x0001);
+   tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x0001);
if (tg3_irq_sync(tp))
goto out;
if (netif_rx_schedule_prep(dev)) {
-
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


[TG3]: Update version and reldate.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=823036ed3291e30f32a905c94db821cd75524b59
Commit: 823036ed3291e30f32a905c94db821cd75524b59
Parent: c04cb34725fdcf5fdb4135d8fdfaf6f318f10e99
Author: Michael Chan [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:26:30 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:26:30 2007 -0700

[TG3]: Update version and reldate.

Update version to 3.76.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/tg3.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6f849bd..e5e901e 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
 
 #define DRV_MODULE_NAMEtg3
 #define PFX DRV_MODULE_NAME: 
-#define DRV_MODULE_VERSION 3.75
-#define DRV_MODULE_RELDATE March 23, 2007
+#define DRV_MODULE_VERSION 3.76
+#define DRV_MODULE_RELDATE May 5, 2007
 
 #define TG3_DEF_MAC_MODE   0
 #define TG3_DEF_RX_MODE0
-
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


[Bluetooth] Fix L2CAP and HCI setsockopt() information leaks

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0878b6667f28772aa7d6b735abff53efc7bf6d91
Commit: 0878b6667f28772aa7d6b735abff53efc7bf6d91
Parent: dc87c3985e9b442c60994308a96f887579addc39
Author: Marcel Holtmann [EMAIL PROTECTED]
AuthorDate: Sat May 5 00:35:59 2007 +0200
Committer:  Marcel Holtmann [EMAIL PROTECTED]
CommitDate: Sat May 5 00:35:59 2007 +0200

[Bluetooth] Fix L2CAP and HCI setsockopt() information leaks

The L2CAP and HCI setsockopt() implementations have a small information
leak that makes it possible to leak kernel stack memory to userspace.

If the optlen parameter is 0, no data will be copied by copy_from_user(),
but the uninitialized stack buffer will be read and stored later. A call
to getsockopt() can now retrieve the leaked information.

To fix this problem the stack buffer given to copy_from_user() must be
initialized with the current settings.

Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]
---
 net/bluetooth/hci_sock.c |9 +
 net/bluetooth/l2cap.c|6 ++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 832b5f4..bfc9a35 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -499,6 +499,15 @@ static int hci_sock_setsockopt(struct socket *sock, int 
level, int optname, char
break;
 
case HCI_FILTER:
+   {
+   struct hci_filter *f = hci_pi(sk)-filter;
+
+   uf.type_mask = f-type_mask;
+   uf.opcode= f-opcode;
+   uf.event_mask[0] = *((u32 *) f-event_mask + 0);
+   uf.event_mask[1] = *((u32 *) f-event_mask + 1);
+   }
+
len = min_t(unsigned int, len, sizeof(uf));
if (copy_from_user(uf, optval, len)) {
err = -EFAULT;
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index a586787..a59b1fb 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -954,11 +954,17 @@ static int l2cap_sock_setsockopt(struct socket *sock, int 
level, int optname, ch
 
switch (optname) {
case L2CAP_OPTIONS:
+   opts.imtu = l2cap_pi(sk)-imtu;
+   opts.omtu = l2cap_pi(sk)-omtu;
+   opts.flush_to = l2cap_pi(sk)-flush_to;
+   opts.mode = 0x00;
+
len = min_t(unsigned int, sizeof(opts), optlen);
if (copy_from_user((char *) opts, optval, len)) {
err = -EFAULT;
break;
}
+
l2cap_pi(sk)-imtu  = opts.imtu;
l2cap_pi(sk)-omtu  = opts.omtu;
break;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bluetooth] Attach host adapters to the Bluetooth bus

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=53c1d4b0b22243c093ded25aaa01c8ff8ab6e6b3
Commit: 53c1d4b0b22243c093ded25aaa01c8ff8ab6e6b3
Parent: 0878b6667f28772aa7d6b735abff53efc7bf6d91
Author: Marcel Holtmann [EMAIL PROTECTED]
AuthorDate: Sat May 5 00:36:03 2007 +0200
Committer:  Marcel Holtmann [EMAIL PROTECTED]
CommitDate: Sat May 5 00:36:03 2007 +0200

[Bluetooth] Attach host adapters to the Bluetooth bus

The Bluetooth host adapters are attached to the Bluetooth class and the
low-level connections are children of these class devices. Having class
devices as parent of bus devices breaks a lot of reasonable assumptions
about sysfs. The host adapters should be attached to the Bluetooth bus
to simplify the dependency resolving. For compatibility an additional
symlink from the Bluetooth class will be used.

Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]
---
 net/bluetooth/hci_sysfs.c |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 801d687..359e344 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -305,7 +305,7 @@ int hci_register_sysfs(struct hci_dev *hdev)
 
BT_DBG(%p name %s type %d, hdev, hdev-name, hdev-type);
 
-   dev-class = bt_class;
+   dev-bus = bt_bus;
dev-parent = hdev-parent;
 
strlcpy(dev-bus_id, hdev-name, BUS_ID_SIZE);
@@ -322,6 +322,10 @@ int hci_register_sysfs(struct hci_dev *hdev)
if (device_create_file(dev, bt_attrs[i])  0)
BT_ERR(Failed to create device attribute);
 
+   if (sysfs_create_link(bt_class-subsys.kset.kobj,
+   dev-kobj, kobject_name(dev-kobj))  0)
+   BT_ERR(Failed to create class symlink);
+
return 0;
 }
 
@@ -329,6 +333,9 @@ void hci_unregister_sysfs(struct hci_dev *hdev)
 {
BT_DBG(%p name %s type %d, hdev, hdev-name, hdev-type);
 
+   sysfs_remove_link(bt_class-subsys.kset.kobj,
+   kobject_name(hdev-dev.kobj));
+
device_del(hdev-dev);
 }
 
-
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


[Bluetooth] Use in-kernel sockets API

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=48db9ca4f2ac9f39eb90ccb12ad3ca7b645a552c
Commit: 48db9ca4f2ac9f39eb90ccb12ad3ca7b645a552c
Parent: 53c1d4b0b22243c093ded25aaa01c8ff8ab6e6b3
Author: Marcel Holtmann [EMAIL PROTECTED]
AuthorDate: Sat May 5 00:36:06 2007 +0200
Committer:  Marcel Holtmann [EMAIL PROTECTED]
CommitDate: Sat May 5 00:36:06 2007 +0200

[Bluetooth] Use in-kernel sockets API

The kernel provides a new convenient way to access the sockets API for
in-kernel users. It is a good idea to actually use it.

Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]
---
 net/bluetooth/rfcomm/core.c |   19 ++-
 1 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index fe7df90..71a72fc 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -622,7 +622,7 @@ static struct rfcomm_session 
*rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst
bacpy(addr.l2_bdaddr, src);
addr.l2_family = AF_BLUETOOTH;
addr.l2_psm= 0;
-   *err = sock-ops-bind(sock, (struct sockaddr *) addr, sizeof(addr));
+   *err = kernel_bind(sock, (struct sockaddr *) addr, sizeof(addr));
if (*err  0)
goto failed;
 
@@ -643,7 +643,7 @@ static struct rfcomm_session 
*rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst
bacpy(addr.l2_bdaddr, dst);
addr.l2_family = AF_BLUETOOTH;
addr.l2_psm= htobs(RFCOMM_PSM);
-   *err = sock-ops-connect(sock, (struct sockaddr *) addr, 
sizeof(addr), O_NONBLOCK);
+   *err = kernel_connect(sock, (struct sockaddr *) addr, sizeof(addr), 
O_NONBLOCK);
if (*err == 0 || *err == -EINPROGRESS)
return s;
 
@@ -1757,19 +1757,12 @@ static inline void rfcomm_accept_connection(struct 
rfcomm_session *s)
 
BT_DBG(session %p, s);
 
-   if (sock_create_lite(PF_BLUETOOTH, sock-type, BTPROTO_L2CAP, nsock))
+   err = kernel_accept(sock, nsock, O_NONBLOCK);
+   if (err  0)
return;
 
-   nsock-ops  = sock-ops;
-
__module_get(nsock-ops-owner);
 
-   err = sock-ops-accept(sock, nsock, O_NONBLOCK);
-   if (err  0) {
-   sock_release(nsock);
-   return;
-   }
-
/* Set our callbacks */
nsock-sk-sk_data_ready   = rfcomm_l2data_ready;
nsock-sk-sk_state_change = rfcomm_l2state_change;
@@ -1885,7 +1878,7 @@ static int rfcomm_add_listener(bdaddr_t *ba)
bacpy(addr.l2_bdaddr, ba);
addr.l2_family = AF_BLUETOOTH;
addr.l2_psm= htobs(RFCOMM_PSM);
-   err = sock-ops-bind(sock, (struct sockaddr *) addr, sizeof(addr));
+   err = kernel_bind(sock, (struct sockaddr *) addr, sizeof(addr));
if (err  0) {
BT_ERR(Bind failed %d, err);
goto failed;
@@ -1898,7 +1891,7 @@ static int rfcomm_add_listener(bdaddr_t *ba)
release_sock(sk);
 
/* Start listening on the socket */
-   err = sock-ops-listen(sock, 10);
+   err = kernel_listen(sock, 10);
if (err) {
BT_ERR(Listen failed %d, err);
goto failed;
-
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


[Bluetooth] Check that device is in rfcomm_dev_list before deleting

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=77f2a45fa1ba33147fd6cc8ae546188504a822cd
Commit: 77f2a45fa1ba33147fd6cc8ae546188504a822cd
Parent: 48db9ca4f2ac9f39eb90ccb12ad3ca7b645a552c
Author: Marcel Holtmann [EMAIL PROTECTED]
AuthorDate: Sat May 5 00:36:10 2007 +0200
Committer:  Marcel Holtmann [EMAIL PROTECTED]
CommitDate: Sat May 5 00:36:10 2007 +0200

[Bluetooth] Check that device is in rfcomm_dev_list before deleting

If RFCOMM_RELEASE_ONHUP flag is on and rfcomm_release_dev is called
before connection is closed, rfcomm_dev is deleted twice from the
rfcomm_dev_list and refcount is messed up. This patch adds a check
before deleting device that the device actually is listed.

Signed-off-by: Ville Tervo [EMAIL PROTECTED]
Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]
---
 net/bluetooth/rfcomm/tty.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 9a7a44f..b2b1cce 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -517,9 +517,10 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc 
*dlc, int err)
if (dlc-state == BT_CLOSED) {
if (!dev-tty) {
if (test_bit(RFCOMM_RELEASE_ONHUP, dev-flags)) {
-   rfcomm_dev_hold(dev);
-   rfcomm_dev_del(dev);
+   if (rfcomm_dev_get(dev-id) == NULL)
+   return;
 
+   rfcomm_dev_del(dev);
/* We have to drop DLC lock here, otherwise
   rfcomm_dev_put() will dead lock if it's
   the last reference. */
@@ -974,8 +975,12 @@ static void rfcomm_tty_hangup(struct tty_struct *tty)
 
rfcomm_tty_flush_buffer(tty);
 
-   if (test_bit(RFCOMM_RELEASE_ONHUP, dev-flags))
+   if (test_bit(RFCOMM_RELEASE_ONHUP, dev-flags)) {
+   if (rfcomm_dev_get(dev-id) == NULL)
+   return;
rfcomm_dev_del(dev);
+   rfcomm_dev_put(dev);
+   }
 }
 
 static int rfcomm_tty_read_proc(char *buf, char **start, off_t offset, int 
len, int *eof, void *unused)
-
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


[Bluetooth] Disconnect L2CAP connection after last RFCOMM DLC

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9cf5b0ea3a7f1432c61029f7aaf4b8b338628884
Commit: 9cf5b0ea3a7f1432c61029f7aaf4b8b338628884
Parent: 77f2a45fa1ba33147fd6cc8ae546188504a822cd
Author: Marcel Holtmann [EMAIL PROTECTED]
AuthorDate: Sat May 5 00:36:13 2007 +0200
Committer:  Marcel Holtmann [EMAIL PROTECTED]
CommitDate: Sat May 5 00:36:13 2007 +0200

[Bluetooth] Disconnect L2CAP connection after last RFCOMM DLC

The RFCOMM specification says that the device closing the last DLC on
a particular session is responsible for closing the multiplexer by
closing the corresponding L2CAP channel.

Signed-off-by: Ville Tervo [EMAIL PROTECTED]
Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]
---
 net/bluetooth/rfcomm/core.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 71a72fc..52e04df 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -1058,6 +1058,12 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 
dlci)
case BT_DISCONN:
d-state = BT_CLOSED;
__rfcomm_dlc_close(d, 0);
+
+   if (list_empty(s-dlcs)) {
+   s-state = BT_DISCONN;
+   rfcomm_send_disc(s, 0);
+   }
+
break;
}
} else {
@@ -1067,6 +1073,10 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 
dlci)
s-state = BT_CONNECTED;
rfcomm_process_connect(s);
break;
+
+   case BT_DISCONN:
+   rfcomm_session_put(s);
+   break;
}
}
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


[Bluetooth] Add support for Targus ACB10US USB dongle

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c51bd3d3d883d900efbeab3697ae182d60bdd217
Commit: c51bd3d3d883d900efbeab3697ae182d60bdd217
Parent: 9cf5b0ea3a7f1432c61029f7aaf4b8b338628884
Author: Marcel Holtmann [EMAIL PROTECTED]
AuthorDate: Sat May 5 00:36:17 2007 +0200
Committer:  Marcel Holtmann [EMAIL PROTECTED]
CommitDate: Sat May 5 00:36:17 2007 +0200

[Bluetooth] Add support for Targus ACB10US USB dongle

This patch adds the vendor and product id of the Targus ACB10US
dongle and sets a flag to send HCI_Reset as the first command.

Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]
---
 drivers/bluetooth/hci_usb.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 406af57..3133afa 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -118,6 +118,9 @@ static struct usb_device_id blacklist_ids[] = {
{ USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x2110), .driver_info = HCI_WRONG_SCO_MTU },
 
+   /* Targus ACB10US */
+   { USB_DEVICE(0x0a5c, 0x2100), .driver_info = HCI_RESET },
+
/* ANYCOM Bluetooth USB-200 and USB-250 */
{ USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET },
 
-
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


[Bluetooth] Correct SCO buffer for another Broadcom based dongle

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7bb078cba9ef55d810275b533747fa96a12e1823
Commit: 7bb078cba9ef55d810275b533747fa96a12e1823
Parent: c51bd3d3d883d900efbeab3697ae182d60bdd217
Author: Marcel Holtmann [EMAIL PROTECTED]
AuthorDate: Sat May 5 00:36:22 2007 +0200
Committer:  Marcel Holtmann [EMAIL PROTECTED]
CommitDate: Sat May 5 00:36:22 2007 +0200

[Bluetooth] Correct SCO buffer for another Broadcom based dongle

The SCO buffer size values for Bluetooth chips from Broadcom are wrong
and the USB Bluetooth driver has to set a quirk to correct these SCO
buffer size values.

Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]
---
 drivers/bluetooth/hci_usb.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 3133afa..b0238b4 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -114,6 +114,9 @@ static struct usb_device_id blacklist_ids[] = {
{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | 
HCI_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
 
+   /* Broadcom BCM2045 */
+   { USB_DEVICE(0x0a5c, 0x2101), .driver_info = HCI_WRONG_SCO_MTU },
+
/* IBM/Lenovo ThinkPad with Broadcom chip */
{ USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x2110), .driver_info = HCI_WRONG_SCO_MTU },
-
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


[NET] net/core: Fix error handling

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2396a22e0989df6038996506bfbf7a57f116c299
Commit: 2396a22e0989df6038996506bfbf7a57f116c299
Parent: d5bb306b42e39ffecaf85d1f9d04a3b5d9a97c86
Author: Josef 'Jeff' Sipek [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:33:18 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:33:18 2007 -0700

[NET] net/core: Fix error handling

Upon failure to register ptype procfs entry, softnet_stat was not
removed, and an incorrect attempt was made to remove the ptype entry.

Signed-off-by: Josef 'Jeff' Sipek [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/core/dev.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index f27d4ab..4317c1b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2377,9 +2377,9 @@ static int __init dev_proc_init(void)
 out:
return rc;
 out_softnet:
-   proc_net_remove(softnet_stat);
-out_dev2:
proc_net_remove(ptype);
+out_dev2:
+   proc_net_remove(softnet_stat);
 out_dev:
proc_net_remove(dev);
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


[NET]: rfkill: add support for input key to control wireless radio

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cf4328cd949c2086091c62c5685f1580fe9b55e4
Commit: cf4328cd949c2086091c62c5685f1580fe9b55e4
Parent: 2396a22e0989df6038996506bfbf7a57f116c299
Author: Ivo van Doorn [EMAIL PROTECTED]
AuthorDate: Mon May 7 00:34:20 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon May 7 00:34:20 2007 -0700

[NET]: rfkill: add support for input key to control wireless radio

The RF kill patch that provides infrastructure for implementing
switches controlling radio states on various network and other cards.

[EMAIL PROTECTED]: address review comments]
[EMAIL PROTECTED]: cleanups, build fixes]

Signed-off-by: Ivo van Doorn [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Dmitry Torokhov [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/linux/rfkill.h|   89 ++
 net/Kconfig   |2 +
 net/Makefile  |1 +
 net/rfkill/Kconfig|   24 +++
 net/rfkill/Makefile   |6 +
 net/rfkill/rfkill-input.c |  174 +++
 net/rfkill/rfkill.c   |  407 +
 7 files changed, 703 insertions(+), 0 deletions(-)

diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
new file mode 100644
index 000..7c1ffba
--- /dev/null
+++ b/include/linux/rfkill.h
@@ -0,0 +1,89 @@
+#ifndef __RFKILL_H
+#define __RFKILL_H
+
+/*
+ * Copyright (C) 2006 Ivo van Doorn
+ * Copyright (C) 2007 Dmitry Torokhov
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include linux/types.h
+#include linux/kernel.h
+#include linux/list.h
+#include linux/mutex.h
+#include linux/device.h
+
+/**
+ * enum rfkill_type - type of rfkill switch.
+ * RFKILL_TYPE_WLAN: switch is no a Wireless network devices.
+ * RFKILL_TYPE_BlUETOOTH: switch is on a bluetooth device.
+ * RFKILL_TYPE_IRDA: switch is on an infrared devices.
+ */
+enum rfkill_type {
+   RFKILL_TYPE_WLAN = 0,
+   RFKILL_TYPE_BLUETOOTH = 1,
+   RFKILL_TYPE_IRDA = 2,
+   RFKILL_TYPE_MAX = 3,
+};
+
+enum rfkill_state {
+   RFKILL_STATE_OFF= 0,
+   RFKILL_STATE_ON = 1,
+};
+
+/**
+ * struct rfkill - rfkill control structure.
+ * @name: Name of the switch.
+ * @type: Radio type which the button controls, the value stored
+ * here should be a value from enum rfkill_type.
+ * @state: State of the switch (on/off).
+ * @user_claim: Set when the switch is controlled exlusively by userspace.
+ * @mutex: Guards switch state transitions
+ * @data: Pointer to the RF button drivers private data which will be
+ * passed along when toggling radio state.
+ * @toggle_radio(): Mandatory handler to control state of the radio.
+ * @dev: Device structure integrating the switch into device tree.
+ * @node: Used to place switch into list of all switches known to the
+ * the system.
+ *
+ * This structure represents a RF switch located on a network device.
+ */
+struct rfkill {
+   char *name;
+   enum rfkill_type type;
+
+   enum rfkill_state state;
+   bool user_claim;
+
+   struct mutex mutex;
+
+   void *data;
+   int (*toggle_radio)(void *data, enum rfkill_state state);
+
+   struct device dev;
+   struct list_head node;
+};
+#define to_rfkill(d)   container_of(d, struct rfkill, dev)
+
+struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type);
+void rfkill_free(struct rfkill *rfkill);
+int rfkill_register(struct rfkill *rfkill);
+void rfkill_unregister(struct rfkill *rfkill);
+
+void rfkill_switch_all(enum rfkill_type type, enum rfkill_state state);
+
+#endif /* RFKILL_H */
diff --git a/net/Kconfig b/net/Kconfig
index 5b22278..caeacd1 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -225,6 +225,8 @@ source net/ieee80211/Kconfig
 
 endmenu
 
+source net/rfkill/Kconfig
+
 endif   # if NET
 endmenu # Networking
 
diff --git a/net/Makefile b/net/Makefile
index 9fdb60c..34e5b2d 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_IEEE80211)   += ieee80211/
 obj-$(CONFIG_TIPC) += tipc/
 obj-$(CONFIG_NETLABEL) += netlabel/
 obj-$(CONFIG_IUCV) += iucv/

drm: remove unused exports

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=41ed5de9714f3690642d50c44973308476a7d334
Commit: 41ed5de9714f3690642d50c44973308476a7d334
Parent: be521466feb3bb1cd89de82a2b1d080e9ebd3cb6
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Fri Feb 9 10:25:22 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:07:16 2007 +1100

drm: remove unused exports

This patch removes two unused exports.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_mm.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/char/drm/drm_mm.c b/drivers/char/drm/drm_mm.c
index 9b46b85..2ec1d9f 100644
--- a/drivers/char/drm/drm_mm.c
+++ b/drivers/char/drm/drm_mm.c
@@ -274,7 +274,6 @@ int drm_mm_init(drm_mm_t * mm, unsigned long start, 
unsigned long size)
return drm_mm_create_tail_node(mm, start, size);
 }
 
-EXPORT_SYMBOL(drm_mm_init);
 
 void drm_mm_takedown(drm_mm_t * mm)
 {
@@ -295,4 +294,3 @@ void drm_mm_takedown(drm_mm_t * mm)
drm_free(entry, sizeof(*entry), DRM_MEM_MM);
 }
 
-EXPORT_SYMBOL(drm_mm_takedown);
-
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


drm: update README.drm (bugzilla #7933)

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f54d1e40b2732cd882646de3c860d24a6920cbc2
Commit: f54d1e40b2732cd882646de3c860d24a6920cbc2
Parent: 41ed5de9714f3690642d50c44973308476a7d334
Author: Randy Dunlap [EMAIL PROTECTED]
AuthorDate: Fri Feb 9 10:28:21 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:07:16 2007 +1100

drm: update README.drm (bugzilla #7933)

Update URLs in drivers/char/drm/README.drm, to take care of kernel bugzilla

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/README.drm |   16 +++-
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/char/drm/README.drm b/drivers/char/drm/README.drm
index 6441e01..af74cd7 100644
--- a/drivers/char/drm/README.drm
+++ b/drivers/char/drm/README.drm
@@ -1,6 +1,6 @@
 
 * For the very latest on DRI development, please see:  *
-* http://dri.sourceforge.net/  *
+* http://dri.freedesktop.org/  *
 
 
 The Direct Rendering Manager (drm) is a device-independent kernel-level
@@ -26,21 +26,19 @@ ways:
 
 
 Documentation on the DRI is available from:
-http://precisioninsight.com/piinsights.html
+http://dri.freedesktop.org/wiki/Documentation
+http://sourceforge.net/project/showfiles.php?group_id=387
+http://dri.sourceforge.net/doc/
 
 For specific information about kernel-level support, see:
 
 The Direct Rendering Manager, Kernel Support for the Direct Rendering
 Infrastructure
-http://precisioninsight.com/dr/drm.html
+http://dri.sourceforge.net/doc/drm_low_level.html
 
 Hardware Locking for the Direct Rendering Infrastructure
-http://precisioninsight.com/dr/locking.html
+http://dri.sourceforge.net/doc/hardware_locking_low_level.html
 
 A Security Analysis of the Direct Rendering Infrastructure
-http://precisioninsight.com/dr/security.html
+http://dri.sourceforge.net/doc/security_low_level.html
 
-
-* For the very latest on DRI development, please see:  *
-* http://dri.sourceforge.net/  *
-
-
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


drm: Use ARRAY_SIZE macro when appropriate

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8311d570bcb3faea68941ebd5e240eb2e96d65a0
Commit: 8311d570bcb3faea68941ebd5e240eb2e96d65a0
Parent: f54d1e40b2732cd882646de3c860d24a6920cbc2
Author: Ahmed S. Darwish [EMAIL PROTECTED]
AuthorDate: Fri Feb 9 10:30:10 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:07:16 2007 +1100

drm: Use ARRAY_SIZE macro when appropriate

Use ARRAY_SIZE macro already defined in kernel.h

Signed-off-by: Ahmed S. Darwish [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_proc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/drm/drm_proc.c b/drivers/char/drm/drm_proc.c
index 7fd0da7..b204498 100644
--- a/drivers/char/drm/drm_proc.c
+++ b/drivers/char/drm/drm_proc.c
@@ -72,7 +72,7 @@ static struct drm_proc_list {
 #endif
 };
 
-#define DRM_PROC_ENTRIES (sizeof(drm_proc_list)/sizeof(drm_proc_list[0]))
+#define DRM_PROC_ENTRIES ARRAY_SIZE(drm_proc_list)
 
 /**
  * Initialize the DRI proc filesystem for a device.
-
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


drm: move protection stuff into separate function

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5cc7f9abec8391e43b0a052c8880509668e24b35
Commit: 5cc7f9abec8391e43b0a052c8880509668e24b35
Parent: 8311d570bcb3faea68941ebd5e240eb2e96d65a0
Author: Dave Airlie [EMAIL PROTECTED]
AuthorDate: Sat Feb 10 11:53:13 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:07:17 2007 +1100

drm: move protection stuff into separate function

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_vm.c |   44 ++--
 1 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
index 54a6328..7ed77e1 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -41,6 +41,30 @@
 static void drm_vm_open(struct vm_area_struct *vma);
 static void drm_vm_close(struct vm_area_struct *vma);
 
+pgprot_t drm_io_prot(uint32_t map_type, struct vm_area_struct *vma)
+{
+   pgprot_t tmp = vm_get_page_prot(vma-vm_flags);
+
+#if defined(__i386__) || defined(__x86_64__)
+   if (boot_cpu_data.x86  3  map_type != _DRM_AGP) {
+   pgprot_val(tmp) |= _PAGE_PCD;
+   pgprot_val(tmp) = ~_PAGE_PWT;
+   }
+#elif defined(__powerpc__)
+   pgprot_val(tmp) |= _PAGE_NO_CACHE;
+   if (map_type == _DRM_REGISTERS)
+   pgprot_val(tmp) |= _PAGE_GUARDED;
+#endif
+#if defined(__ia64__)
+   if (efi_range_is_wc(vma-vm_start, vma-vm_end -
+   vma-vm_start))
+   tmp = pgprot_writecombine(tmp);
+   else
+   tmp = pgprot_noncached(tmp);
+#endif
+   return tmp;
+}
+
 /**
  * \c nopage method for AGP virtual memory.
  *
@@ -600,25 +624,9 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
/* fall through to _DRM_FRAME_BUFFER... */
case _DRM_FRAME_BUFFER:
case _DRM_REGISTERS:
-#if defined(__i386__) || defined(__x86_64__)
-   if (boot_cpu_data.x86  3  map-type != _DRM_AGP) {
-   pgprot_val(vma-vm_page_prot) |= _PAGE_PCD;
-   pgprot_val(vma-vm_page_prot) = ~_PAGE_PWT;
-   }
-#elif defined(__powerpc__)
-   pgprot_val(vma-vm_page_prot) |= _PAGE_NO_CACHE;
-   if (map-type == _DRM_REGISTERS)
-   pgprot_val(vma-vm_page_prot) |= _PAGE_GUARDED;
-#endif
-   vma-vm_flags |= VM_IO; /* not in core dump */
-#if defined(__ia64__)
-   if (efi_range_is_wc(vma-vm_start, vma-vm_end - vma-vm_start))
-   vma-vm_page_prot =
-   pgprot_writecombine(vma-vm_page_prot);
-   else
-   vma-vm_page_prot = pgprot_noncached(vma-vm_page_prot);
-#endif
offset = dev-driver-get_reg_ofs(dev);
+   vma-vm_flags |= VM_IO; /* not in core dump */
+   vma-vm_page_prot = drm_io_prot(map-type, vma);
 #ifdef __sparc__
vma-vm_page_prot = pgprot_noncached(vma-vm_page_prot);
if (io_remap_pfn_range(vma, vma-vm_start,
-
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


drm: bring bufs code from git tree.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54ba2f76e281286cf4b2860ed8354602eab4c1ef
Commit: 54ba2f76e281286cf4b2860ed8354602eab4c1ef
Parent: 5cc7f9abec8391e43b0a052c8880509668e24b35
Author: Dave Airlie [EMAIL PROTECTED]
AuthorDate: Sat Feb 10 12:07:47 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:07:17 2007 +1100

drm: bring bufs code from git tree.

This checks the AGP mappings are in a valid place and also fixes the size
check in the vm..

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_bufs.c |   75 +-
 drivers/char/drm/drm_vm.c   |2 +-
 2 files changed, 67 insertions(+), 10 deletions(-)

diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c
index a6828cc..c113458 100644
--- a/drivers/char/drm/drm_bufs.c
+++ b/drivers/char/drm/drm_bufs.c
@@ -57,7 +57,8 @@ static drm_map_list_t *drm_find_matching_map(drm_device_t 
*dev,
list_for_each(list, dev-maplist-head) {
drm_map_list_t *entry = list_entry(list, drm_map_list_t, head);
if (entry-map  map-type == entry-map-type 
-   entry-map-offset == map-offset) {
+   ((entry-map-offset == map-offset) ||
+(map-type == _DRM_SHM  
map-flags==_DRM_CONTAINS_LOCK))) {
return entry;
}
}
@@ -180,8 +181,20 @@ static int drm_addmap_core(drm_device_t * dev, unsigned 
int offset,
if (map-type == _DRM_REGISTERS)
map-handle = ioremap(map-offset, map-size);
break;
-
case _DRM_SHM:
+   list = drm_find_matching_map(dev, map);
+   if (list != NULL) {
+   if(list-map-size != map-size) {
+   DRM_DEBUG(Matching maps of type %d with 
+ mismatched sizes, (%ld vs %ld)\n,
+ map-type, map-size, 
list-map-size);
+   list-map-size = map-size;
+   }
+
+   drm_free(map, sizeof(*map), DRM_MEM_MAPS);
+   *maplist = list;
+   return 0;
+   }
map-handle = vmalloc_user(map-size);
DRM_DEBUG(%lu %d %p\n,
  map-size, drm_order(map-size), map-handle);
@@ -200,15 +213,45 @@ static int drm_addmap_core(drm_device_t * dev, unsigned 
int offset,
dev-sigdata.lock = dev-lock.hw_lock = map-handle;
/* Pointer to lock */
}
break;
-   case _DRM_AGP:
-   if (drm_core_has_AGP(dev)) {
+   case _DRM_AGP: {
+   drm_agp_mem_t *entry;
+   int valid = 0;
+
+   if (!drm_core_has_AGP(dev)) {
+   drm_free(map, sizeof(*map), DRM_MEM_MAPS);
+   return -EINVAL;
+   }
 #ifdef __alpha__
-   map-offset += dev-hose-mem_space-start;
+   map-offset += dev-hose-mem_space-start;
 #endif
-   map-offset += dev-agp-base;
-   map-mtrr = dev-agp-agp_mtrr; /* for getmap */
+   /* Note: dev-agp-base may actually be 0 when the DRM
+* is not in control of AGP space. But if user space is
+* it should already have added the AGP base itself.
+*/
+   map-offset += dev-agp-base;
+   map-mtrr = dev-agp-agp_mtrr; /* for getmap */
+
+   /* This assumes the DRM is in total control of AGP space.
+* It's not always the case as AGP can be in the control
+* of user space (i.e. i810 driver). So this loop will get
+* skipped and we double check that dev-agp-memory is
+* actually set as well as being invalid before EPERM'ing
+*/
+   for (entry = dev-agp-memory; entry; entry = entry-next) {
+   if ((map-offset = entry-bound) 
+   (map-offset + map-size = entry-bound + 
entry-pages * PAGE_SIZE)) {
+   valid = 1;
+   break;
+   }
}
+   if (dev-agp-memory  !valid) {
+   drm_free(map, sizeof(*map), DRM_MEM_MAPS);
+   return -EPERM;
+   }
+   DRM_DEBUG(AGP offset = 0x%08lx, size = 0x%08lx\n, 
map-offset, map-size);
+
break;
+   }
case _DRM_SCATTER_GATHER:
if (!dev-sg) {
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
@@ -267,7 +310,7 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int 
offset,
 
*maplist = list;
return 0;
-}
+

drm: fix crash with fops lock and fixup sarea/page size locking

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=11d9c2fd0ae74647ea2b52f9bdfa7a920b48d1f1
Commit: 11d9c2fd0ae74647ea2b52f9bdfa7a920b48d1f1
Parent: 54ba2f76e281286cf4b2860ed8354602eab4c1ef
Author: Dave Airlie [EMAIL PROTECTED]
AuthorDate: Sun Feb 18 17:13:39 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:07:17 2007 +1100

drm: fix crash with fops lock and fixup sarea/page size locking

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_fops.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c
index 898f47d..afe5f07 100644
--- a/drivers/char/drm/drm_fops.c
+++ b/drivers/char/drm/drm_fops.c
@@ -46,6 +46,7 @@ static int drm_setup(drm_device_t * dev)
drm_local_map_t *map;
int i;
int ret;
+   u32 sareapage;
 
if (dev-driver-firstopen) {
ret = dev-driver-firstopen(dev);
@@ -56,7 +57,8 @@ static int drm_setup(drm_device_t * dev)
dev-magicfree.next = NULL;
 
/* prebuild the SAREA */
-   i = drm_addmap(dev, 0, SAREA_MAX, _DRM_SHM, _DRM_CONTAINS_LOCK, map);
+   sareapage = max(SAREA_MAX, PAGE_SIZE);
+   i = drm_addmap(dev, 0, sareapage, _DRM_SHM, _DRM_CONTAINS_LOCK, map);
if (i != 0)
return i;
 
@@ -84,7 +86,7 @@ static int drm_setup(drm_device_t * dev)
INIT_LIST_HEAD(dev-ctxlist-head);
 
dev-vmalist = NULL;
-   dev-sigdata.lock = dev-lock.hw_lock = NULL;
+   dev-sigdata.lock = NULL;
init_waitqueue_head(dev-lock.lock_queue);
dev-queue_count = 0;
dev-queue_reserved = 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


drm: port over use_vmalloc code from git hashtab

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cd839d0048c3cb332cb0cd7d3de3431f8e1d3c7a
Commit: cd839d0048c3cb332cb0cd7d3de3431f8e1d3c7a
Parent: 11d9c2fd0ae74647ea2b52f9bdfa7a920b48d1f1
Author: Dave Airlie [EMAIL PROTECTED]
AuthorDate: Sun Feb 18 17:14:09 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:07:17 2007 +1100

drm: port over use_vmalloc code from git hashtab

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_hashtab.c |   16 ++--
 drivers/char/drm/drm_hashtab.h |1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/char/drm/drm_hashtab.c b/drivers/char/drm/drm_hashtab.c
index a0b2d68..df0c485 100644
--- a/drivers/char/drm/drm_hashtab.c
+++ b/drivers/char/drm/drm_hashtab.c
@@ -43,7 +43,15 @@ int drm_ht_create(drm_open_hash_t *ht, unsigned int order)
ht-size = 1  order;
ht-order = order;
ht-fill = 0;
-   ht-table = vmalloc(ht-size*sizeof(*ht-table));
+   ht-use_vmalloc = ((ht-size * sizeof(*ht-table))  PAGE_SIZE);
+   if (!ht-use_vmalloc) {
+   ht-table = drm_calloc(ht-size, sizeof(*ht-table),
+  DRM_MEM_HASHTAB);
+   }
+   if (!ht-table) {
+   ht-use_vmalloc = 1;
+   ht-table = vmalloc(ht-size*sizeof(*ht-table));
+   }
if (!ht-table) {
DRM_ERROR(Out of memory for hash table\n);
return -ENOMEM;
@@ -183,7 +191,11 @@ int drm_ht_remove_item(drm_open_hash_t *ht, 
drm_hash_item_t *item)
 void drm_ht_remove(drm_open_hash_t *ht)
 {
if (ht-table) {
-   vfree(ht-table);
+   if (ht-use_vmalloc)
+   vfree(ht-table);
+   else
+   drm_free(ht-table, ht-size * sizeof(*ht-table),
+DRM_MEM_HASHTAB);
ht-table = NULL;
}
 }
diff --git a/drivers/char/drm/drm_hashtab.h b/drivers/char/drm/drm_hashtab.h
index 40afec0..613091c 100644
--- a/drivers/char/drm/drm_hashtab.h
+++ b/drivers/char/drm/drm_hashtab.h
@@ -47,6 +47,7 @@ typedef struct drm_open_hash{
unsigned int order;
unsigned int fill;
struct hlist_head *table;
+   int use_vmalloc;
 } drm_open_hash_t;
 
 
-
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


drm/radeon: Fix u32 overflows when determining AGP base address in card space.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=80b2c386f3d8c3367533a8600b599f8686c9d386
Commit: 80b2c386f3d8c3367533a8600b599f8686c9d386
Parent: cd839d0048c3cb332cb0cd7d3de3431f8e1d3c7a
Author: Michel Dänzer [EMAIL PROTECTED]
AuthorDate: Sun Feb 18 18:03:21 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:07:17 2007 +1100

drm/radeon: Fix u32 overflows when determining AGP base address in card 
space.

The overflows could lead to the AGP aperture overlapping the framebuffer 
arein the card's address space when the latter is located at the very end 
of th32 bit address space, which would result in a freeze on X server 
startup,
probably because the card read commands from the framebuffer instead of 
fromAGP.

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392915 .

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/radeon_cp.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index 5ed9656..c1850ec 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -1560,8 +1560,8 @@ static int radeon_do_init_cp(drm_device_t * dev, 
drm_radeon_init_t * init)
if (dev_priv-flags  RADEON_IS_AGP) {
base = dev-agp-base;
/* Check if valid */
-   if ((base + dev_priv-gart_size)  
dev_priv-fb_location 
-   base  (dev_priv-fb_location + dev_priv-fb_size)) 
{
+   if ((base + dev_priv-gart_size - 1) = 
dev_priv-fb_location 
+   base  (dev_priv-fb_location + dev_priv-fb_size - 
1)) {
DRM_INFO(Can't use AGP base @0x%08lx, won't 
fit\n,
 dev-agp-base);
base = 0;
@@ -1571,8 +1571,8 @@ static int radeon_do_init_cp(drm_device_t * dev, 
drm_radeon_init_t * init)
/* If not or if AGP is at 0 (Macs), try to put it elsewhere */
if (base == 0) {
base = dev_priv-fb_location + dev_priv-fb_size;
-   if (((base + dev_priv-gart_size)  0xul)
-base)
+   if (base  dev_priv-fb_location ||
+   ((base + dev_priv-gart_size)  0xul)  
base)
base = dev_priv-fb_location
- dev_priv-gart_size;
}   
-
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


drm: add missing NULL assignment

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c1185ccdfb797df82fa84b581eea128041bd63b0
Commit: c1185ccdfb797df82fa84b581eea128041bd63b0
Parent: 80b2c386f3d8c3367533a8600b599f8686c9d386
Author: Dave Airlie [EMAIL PROTECTED]
AuthorDate: Sun Feb 18 18:23:11 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:07:17 2007 +1100

drm: add missing NULL assignment

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_hashtab.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/drm/drm_hashtab.c b/drivers/char/drm/drm_hashtab.c
index df0c485..31acb62 100644
--- a/drivers/char/drm/drm_hashtab.c
+++ b/drivers/char/drm/drm_hashtab.c
@@ -43,6 +43,7 @@ int drm_ht_create(drm_open_hash_t *ht, unsigned int order)
ht-size = 1  order;
ht-order = order;
ht-fill = 0;
+   ht-table = NULL;
ht-use_vmalloc = ((ht-size * sizeof(*ht-table))  PAGE_SIZE);
if (!ht-use_vmalloc) {
ht-table = drm_calloc(ht-size, sizeof(*ht-table),
-
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


drm: remove via_mm.h

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5379397182a7b5fa1c68ceaefe311ce4c1d04b2a
Commit: 5379397182a7b5fa1c68ceaefe311ce4c1d04b2a
Parent: c1185ccdfb797df82fa84b581eea128041bd63b0
Author: Robert P. J. Day [EMAIL PROTECTED]
AuthorDate: Sun Mar 11 11:39:31 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:08:10 2007 +1100

drm: remove via_mm.h

Delete apparently unused header file drivers/char/drm/via_mm.h.

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/via_mm.h |   40 
 1 files changed, 0 insertions(+), 40 deletions(-)

diff --git a/drivers/char/drm/via_mm.h b/drivers/char/drm/via_mm.h
deleted file mode 100644
index d57efda..000
--- a/drivers/char/drm/via_mm.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
- * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the Software),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sub license,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-#ifndef _via_drm_mm_h_
-#define _via_drm_mm_h_
-
-typedef struct {
-   unsigned int context;
-   unsigned int size;
-   unsigned long offset;
-   unsigned long free;
-} drm_via_mm_t;
-
-typedef struct {
-   unsigned int size;
-   unsigned long handle;
-   void *virtual;
-} drm_via_dma_t;
-
-#endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drm: make drm_io_prot static.

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0bead7cdc94b4897f3d92db6170737a2da527134
Commit: 0bead7cdc94b4897f3d92db6170737a2da527134
Parent: 5379397182a7b5fa1c68ceaefe311ce4c1d04b2a
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Sun Mar 11 11:41:16 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:08:15 2007 +1100

drm: make drm_io_prot static.

This patch makes the needlessly global drm_io_prot() static.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_vm.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
index 9e3f259..239ac33 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -41,7 +41,7 @@
 static void drm_vm_open(struct vm_area_struct *vma);
 static void drm_vm_close(struct vm_area_struct *vma);
 
-pgprot_t drm_io_prot(uint32_t map_type, struct vm_area_struct *vma)
+static pgprot_t drm_io_prot(uint32_t map_type, struct vm_area_struct *vma)
 {
pgprot_t tmp = vm_get_page_prot(vma-vm_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


via: fix CX700 pci id

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74be8e3b3707956f8f232313de9fad896d5489ac
Commit: 74be8e3b3707956f8f232313de9fad896d5489ac
Parent: 0bead7cdc94b4897f3d92db6170737a2da527134
Author: Thomas Hellstrom thomas-at-tungstengraphics-dot-com
AuthorDate: Sun Mar 11 11:45:24 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:08:18 2007 +1100

via: fix CX700 pci id

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_pciids.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
index ad54b84..7288855 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
@@ -230,10 +230,10 @@
{0x1106, 0x7205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x1106, 0x3108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x1106, 0x3304, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
-   {0x1106, 0x3157, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x1106, 0x3344, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x1106, 0x3343, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x1106, 0x3230, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VIA_DX9_0}, \
+   {0x1106, 0x3157, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VIA_PRO_GROUP_A}, \
{0, 0, 0}
 
 #define i810_PCI_IDS \
-
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


drm: fix alpha domain handling

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6244270ef62203e057191bf85489e2ff91cc0e60
Commit: 6244270ef62203e057191bf85489e2ff91cc0e60
Parent: 74be8e3b3707956f8f232313de9fad896d5489ac
Author: Jay Estabrook [EMAIL PROTECTED]
AuthorDate: Sun Mar 11 11:46:27 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:08:21 2007 +1100

drm: fix alpha domain handling

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drmP.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 85d99e2..09705da 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -764,7 +764,7 @@ static __inline__ int drm_core_check_feature(struct 
drm_device *dev,
 }
 
 #ifdef __alpha__
-#define drm_get_pci_domain(dev) dev-hose-bus-number
+#define drm_get_pci_domain(dev) dev-hose-index
 #else
 #define drm_get_pci_domain(dev) 0
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drm: allow for more generic drm ioctls

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=99da6d861c659bb1a961b70f50fad268b9ed5a5f
Commit: 99da6d861c659bb1a961b70f50fad268b9ed5a5f
Parent: 6244270ef62203e057191bf85489e2ff91cc0e60
Author: Thomas Hellstrom thomas-at-tungstengraphics-dot-com
AuthorDate: Mon Mar 19 08:52:17 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Mon Mar 19 08:52:17 2007 +1100

drm: allow for more generic drm ioctls

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm.h |4 +++-
 drivers/char/drm/drm_drv.c |9 ++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h
index 8db9041..0891984 100644
--- a/drivers/char/drm/drm.h
+++ b/drivers/char/drm/drm.h
@@ -654,11 +654,13 @@ typedef struct drm_set_version {
 
 /**
  * Device specific ioctls should only be in their respective headers
- * The device specific ioctl range is from 0x40 to 0x79.
+ * The device specific ioctl range is from 0x40 to 0x99.
+ * Generic IOCTLS restart at 0xA0.
  *
  * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and
  * drmCommandReadWrite().
  */
 #define DRM_COMMAND_BASE0x40
+#define DRM_COMMAND_END0xA0
 
 #endif
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c
index f5b9b24..26bec30 100644
--- a/drivers/char/drm/drm_drv.c
+++ b/drivers/char/drm/drm_drv.c
@@ -496,11 +496,14 @@ int drm_ioctl(struct inode *inode, struct file *filp,
  (long)old_encode_dev(priv-head-device),
  priv-authenticated);
 
-   if (nr  DRIVER_IOCTL_COUNT)
-   ioctl = drm_ioctls[nr];
-   else if ((nr = DRM_COMMAND_BASE)
+   if ((nr = DRIVER_IOCTL_COUNT) 
+   ((nr  DRM_COMMAND_BASE) || (nr = DRM_COMMAND_END)))
+   goto err_i1;
+   if ((nr = DRM_COMMAND_BASE)  (nr  DRM_COMMAND_END)
  (nr  DRM_COMMAND_BASE + dev-driver-num_ioctls))
ioctl = dev-driver-ioctls[nr - DRM_COMMAND_BASE];
+   else if ((nr = DRM_COMMAND_END) || (nr  DRM_COMMAND_BASE))
+   ioctl = drm_ioctls[nr];
else
goto err_i1;
 
-
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


drm: fix warning in drm_fops.c

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4b560fde06aeb342f3ff0bce924627ab722d251a
Commit: 4b560fde06aeb342f3ff0bce924627ab722d251a
Parent: 99da6d861c659bb1a961b70f50fad268b9ed5a5f
Author: Andrew Morton [EMAIL PROTECTED]
AuthorDate: Mon Mar 19 09:08:21 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Mon Mar 19 09:08:21 2007 +1100

drm: fix warning in drm_fops.c

drivers/char/drm/drm_fops.c: In function 'drm_setup':
drivers/char/drm/drm_fops.c:60: warning: comparison of distinct pointer 
types lacks a cast

Unfortunately PAGE_SIZE has different types on different architectures.

Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_fops.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c
index afe5f07..314abd9 100644
--- a/drivers/char/drm/drm_fops.c
+++ b/drivers/char/drm/drm_fops.c
@@ -57,7 +57,7 @@ static int drm_setup(drm_device_t * dev)
dev-magicfree.next = NULL;
 
/* prebuild the SAREA */
-   sareapage = max(SAREA_MAX, PAGE_SIZE);
+   sareapage = max_t(unsigned, SAREA_MAX, PAGE_SIZE);
i = drm_addmap(dev, 0, sareapage, _DRM_SHM, _DRM_CONTAINS_LOCK, map);
if (i != 0)
return 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


drm: fix driver deadlock with AIGLX and reclaim_buffers_locked

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=040ac32048d5efabd557c1e0a6ab8aec2c710c56
Commit: 040ac32048d5efabd557c1e0a6ab8aec2c710c56
Parent: 4b560fde06aeb342f3ff0bce924627ab722d251a
Author: Thomas Hellstrom thomas-at-tungstengraphics-dot-com
AuthorDate: Fri Mar 23 13:28:33 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Fri Mar 23 13:28:33 2007 +1100

drm: fix driver deadlock with AIGLX and reclaim_buffers_locked

Bugzilla Bug #9457

Add refcounting of user waiters to the DRM hardware lock, so that we can use
DRM_LOCK_CONT flag more conservatively.

Also add a kernel waiter refcount that if nonzero transfers the lock for the
kernel context when it is released. This is useful when waiting for idle 
and can be used for very simple fence object driver implementations for the new 
memory manager

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drmP.h |   21 ++-
 drivers/char/drm/drm_fops.c |   90 ++---
 drivers/char/drm/drm_irq.c  |4 +-
 drivers/char/drm/drm_lock.c |  134 ++-
 drivers/char/drm/drm_stub.c |1 +
 drivers/char/drm/sis_drv.c  |2 +-
 drivers/char/drm/via_drv.c  |3 +-
 7 files changed, 174 insertions(+), 81 deletions(-)

diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 09705da..80041d5 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -414,6 +414,10 @@ typedef struct drm_lock_data {
struct file *filp;  /** File descr of lock holder 
(0=kernel) */
wait_queue_head_t lock_queue;   /** Queue of blocked processes */
unsigned long lock_time;/** Time of last lock in jiffies */
+   spinlock_t spinlock;
+   uint32_t kernel_waiters;
+   uint32_t user_waiters;
+   int idle_has_lock;
 } drm_lock_data_t;
 
 /**
@@ -590,6 +594,8 @@ struct drm_driver {
void (*reclaim_buffers) (struct drm_device * dev, struct file * filp);
void (*reclaim_buffers_locked) (struct drm_device *dev,
struct file *filp);
+   void (*reclaim_buffers_idlelocked) (struct drm_device *dev,
+   struct file * filp);
unsigned long (*get_map_ofs) (drm_map_t * map);
unsigned long (*get_reg_ofs) (struct drm_device * dev);
void (*set_version) (struct drm_device * dev, drm_set_version_t * sv);
@@ -915,9 +921,18 @@ extern int drm_lock(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
 extern int drm_unlock(struct inode *inode, struct file *filp,
  unsigned int cmd, unsigned long arg);
-extern int drm_lock_take(__volatile__ unsigned int *lock, unsigned int 
context);
-extern int drm_lock_free(drm_device_t * dev,
-__volatile__ unsigned int *lock, unsigned int context);
+extern int drm_lock_take(drm_lock_data_t *lock_data, unsigned int context);
+extern int drm_lock_free(drm_lock_data_t *lock_data, unsigned int context);
+extern void drm_idlelock_take(drm_lock_data_t *lock_data);
+extern void drm_idlelock_release(drm_lock_data_t *lock_data);
+
+/*
+ * These are exported to drivers so that they can implement fencing using
+ * DMA quiscent + idle. DMA quiescent usually requires the hardware lock.
+ */
+
+extern int drm_i_have_hw_lock(struct file *filp);
+extern int drm_kernel_take_hw_lock(struct file *filp);
 
/* Buffer management support (drm_bufs.h) */
 extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request);
diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c
index 314abd9..3b159ca 100644
--- a/drivers/char/drm/drm_fops.c
+++ b/drivers/char/drm/drm_fops.c
@@ -356,58 +356,56 @@ int drm_release(struct inode *inode, struct file *filp)
  current-pid, (long)old_encode_dev(priv-head-device),
  dev-open_count);
 
-   if (priv-lock_count  dev-lock.hw_lock 
-   _DRM_LOCK_IS_HELD(dev-lock.hw_lock-lock) 
-   dev-lock.filp == filp) {
-   DRM_DEBUG(File %p released, freeing lock for context %d\n,
- filp, _DRM_LOCKING_CONTEXT(dev-lock.hw_lock-lock));
-
-   if (dev-driver-reclaim_buffers_locked)
+   if (dev-driver-reclaim_buffers_locked  dev-lock.hw_lock) {
+   if (drm_i_have_hw_lock(filp)) {
dev-driver-reclaim_buffers_locked(dev, filp);
-
-   drm_lock_free(dev, dev-lock.hw_lock-lock,
- _DRM_LOCKING_CONTEXT(dev-lock.hw_lock-lock));
-
-   /* FIXME: may require heavy-handed reset of
-  hardware at this point, possibly
-  processed via a callback to the X
-  server. */
-   } else if (dev-driver-reclaim_buffers_locked  priv-lock_count
- 

drm: fix up mmap locking in preparation for ttm changes

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d7d8aac79dc38cbdef83b774e49bafdae9918137
Commit: d7d8aac79dc38cbdef83b774e49bafdae9918137
Parent: 040ac32048d5efabd557c1e0a6ab8aec2c710c56
Author: Thomas Hellstrom thomas-at-tungstengraphics-dot-com
AuthorDate: Sat Mar 24 17:52:49 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sat Mar 24 18:00:22 2007 +1100

drm: fix up mmap locking in preparation for ttm changes

This change is needed to protect againt disappearing maps which aren't 
common.
The map lists are protected using sturct_mutex but drm_mmap never locked it.

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_vm.c |   35 ++-
 1 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
index 239ac33..f7d4e29 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -413,7 +413,7 @@ static struct vm_operations_struct drm_vm_sg_ops = {
  * Create a new drm_vma_entry structure as the \p vma private data entry and
  * add it to drm_device::vmalist.
  */
-static void drm_vm_open(struct vm_area_struct *vma)
+static void drm_vm_open_locked(struct vm_area_struct *vma)
 {
drm_file_t *priv = vma-vm_file-private_data;
drm_device_t *dev = priv-head-dev;
@@ -425,15 +425,23 @@ static void drm_vm_open(struct vm_area_struct *vma)
 
vma_entry = drm_alloc(sizeof(*vma_entry), DRM_MEM_VMAS);
if (vma_entry) {
-   mutex_lock(dev-struct_mutex);
vma_entry-vma = vma;
vma_entry-next = dev-vmalist;
vma_entry-pid = current-pid;
dev-vmalist = vma_entry;
-   mutex_unlock(dev-struct_mutex);
}
 }
 
+static void drm_vm_open(struct vm_area_struct *vma)
+{
+   drm_file_t *priv = vma-vm_file-private_data;
+   drm_device_t *dev = priv-head-dev;
+
+   mutex_lock(dev-struct_mutex);
+   drm_vm_open_locked(vma);
+   mutex_unlock(dev-struct_mutex);
+}
+
 /**
  * \c close method for all virtual memory types.
  *
@@ -484,7 +492,6 @@ static int drm_mmap_dma(struct file *filp, struct 
vm_area_struct *vma)
drm_device_dma_t *dma;
unsigned long length = vma-vm_end - vma-vm_start;
 
-   lock_kernel();
dev = priv-head-dev;
dma = dev-dma;
DRM_DEBUG(start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n,
@@ -492,10 +499,8 @@ static int drm_mmap_dma(struct file *filp, struct 
vm_area_struct *vma)
 
/* Length must match exact page count */
if (!dma || (length  PAGE_SHIFT) != dma-page_count) {
-   unlock_kernel();
return -EINVAL;
}
-   unlock_kernel();
 
if (!capable(CAP_SYS_ADMIN) 
(dma-flags  _DRM_DMA_USE_PCI_RO)) {
@@ -518,7 +523,7 @@ static int drm_mmap_dma(struct file *filp, struct 
vm_area_struct *vma)
vma-vm_flags |= VM_RESERVED;   /* Don't swap */
 
vma-vm_file = filp;/* Needed for drm_vm_open() */
-   drm_vm_open(vma);
+   drm_vm_open_locked(vma);
return 0;
 }
 
@@ -553,7 +558,7 @@ EXPORT_SYMBOL(drm_core_get_reg_ofs);
  * according to the mapping type and remaps the pages. Finally sets the file
  * pointer and calls vm_open().
  */
-int drm_mmap(struct file *filp, struct vm_area_struct *vma)
+static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
 {
drm_file_t *priv = filp-private_data;
drm_device_t *dev = priv-head-dev;
@@ -667,8 +672,20 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
vma-vm_flags |= VM_RESERVED;   /* Don't swap */
 
vma-vm_file = filp;/* Needed for drm_vm_open() */
-   drm_vm_open(vma);
+   drm_vm_open_locked(vma);
return 0;
 }
 
+int drm_mmap(struct file *filp, struct vm_area_struct *vma)
+{
+   drm_file_t *priv = filp-private_data;
+   drm_device_t *dev = priv-head-dev;
+   int ret;
+
+   mutex_lock(dev-struct_mutex);
+   ret = drm_mmap_locked(filp, vma);
+   mutex_unlock(dev-struct_mutex);
+
+   return ret;
+}
 EXPORT_SYMBOL(drm_mmap);
-
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


drm: fix DRM_CONSISTENT mapping

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38315878a560eede1a2db52e511ad3a2cfbb4206
Commit: 38315878a560eede1a2db52e511ad3a2cfbb4206
Parent: d7d8aac79dc38cbdef83b774e49bafdae9918137
Author: Hugh Dickins [EMAIL PROTECTED]
AuthorDate: Sat Mar 24 17:55:16 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sat Mar 24 18:00:28 2007 +1100

drm: fix DRM_CONSISTENT mapping

This patch got lost in the DRM git tree for ages, bring it back to life.

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_vm.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
index f7d4e29..2d83b0b 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -175,8 +175,7 @@ static __inline__ struct page *drm_do_vm_shm_nopage(struct 
vm_area_struct *vma,
 
offset = address - vma-vm_start;
i = (unsigned long)map-handle + offset;
-   page = (map-type == _DRM_CONSISTENT) ?
-   virt_to_page((void *)i) : vmalloc_to_page((void *)i);
+   page = vmalloc_to_page((void *)i);
if (!page)
return NOPAGE_SIGBUS;
get_page(page);
@@ -651,10 +650,15 @@ static int drm_mmap_locked(struct file *filp, struct 
vm_area_struct *vma)
  vma-vm_start, vma-vm_end, map-offset + offset);
vma-vm_ops = drm_vm_ops;
break;
-   case _DRM_SHM:
case _DRM_CONSISTENT:
-   /* Consistent memory is really like shared memory. It's only
-* allocate in a different way */
+   /* Consistent memory is really like shared memory. But
+* it's allocated in a different way, so avoid nopage */
+   if (remap_pfn_range(vma, vma-vm_start,
+   page_to_pfn(virt_to_page(map-handle)),
+   vma-vm_end - vma-vm_start, vma-vm_page_prot))
+   return -EAGAIN;
+   /* fall through to _DRM_SHM */
+   case _DRM_SHM:
vma-vm_ops = drm_vm_shm_ops;
vma-vm_private_data = (void *)map;
/* Don't let this area swap.  Change when
-
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


drm: just use io_remap_pfn_range on all archs..

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9e9c1326a592c677c94d730fcf4446d0e275aef4
Commit: 9e9c1326a592c677c94d730fcf4446d0e275aef4
Parent: 38315878a560eede1a2db52e511ad3a2cfbb4206
Author: Dave Airlie [EMAIL PROTECTED]
AuthorDate: Sat Mar 24 17:57:54 2007 +1100
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Sat Mar 24 18:00:31 2007 +1100

drm: just use io_remap_pfn_range on all archs..

Move the sparc64 ifdef around to clean this up.

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_vm.c |7 +--
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
index 2d83b0b..35540cf 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -633,16 +633,11 @@ static int drm_mmap_locked(struct file *filp, struct 
vm_area_struct *vma)
vma-vm_page_prot = drm_io_prot(map-type, vma);
 #ifdef __sparc__
vma-vm_page_prot = pgprot_noncached(vma-vm_page_prot);
+#endif
if (io_remap_pfn_range(vma, vma-vm_start,
   (map-offset + offset)  PAGE_SHIFT,
   vma-vm_end - vma-vm_start,
   vma-vm_page_prot))
-#else
-   if (io_remap_pfn_range(vma, vma-vm_start,
-  (map-offset + offset)  PAGE_SHIFT,
-  vma-vm_end - vma-vm_start,
-  vma-vm_page_prot))
-#endif
return -EAGAIN;
DRM_DEBUG(   Type = %d; start = 0x%lx, end = 0x%lx,
   offset = 0x%lx\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


drm/i915: Add 965GM pci id update

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce7dd06372058f9e3e57ee4c0aeba694a43a80ad
Commit: ce7dd06372058f9e3e57ee4c0aeba694a43a80ad
Parent: 9e9c1326a592c677c94d730fcf4446d0e275aef4
Author: Wang Zhenyu [EMAIL PROTECTED]
AuthorDate: Thu Apr 26 07:42:56 2007 +1000
Committer:  Dave Airlie [EMAIL PROTECTED]
CommitDate: Thu Apr 26 07:42:56 2007 +1000

drm/i915: Add 965GM pci id update

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/drm_pciids.h |1 +
 drivers/char/drm/i915_dma.c   |3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
index 7288855..01cf482 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
@@ -296,5 +296,6 @@
{0x8086, 0x2982, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x8086, 0x2992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0x8086, 0x29a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
+   {0x8086, 0x2a02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
{0, 0, 0}
 
diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c
index 9354ce3..1ba15d9 100644
--- a/drivers/char/drm/i915_dma.c
+++ b/drivers/char/drm/i915_dma.c
@@ -34,7 +34,8 @@
 #define IS_I965G(dev) (dev-pci_device == 0x2972 || \
   dev-pci_device == 0x2982 || \
   dev-pci_device == 0x2992 || \
-  dev-pci_device == 0x29A2)
+  dev-pci_device == 0x29A2 || \
+  dev-pci_device == 0x2A02)
 
 /* Really want an OS-independent resettable timer.  Would like to have
  * this loop run for (eg) 3 sec, but have the timer reset every time
-
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


[GFS2] Add gfs2_tool lockdump support to gfs2 (bz 228540)

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c52b166c588c98cf3d2b2e7e6a0468a98e84d0d
Commit: 7c52b166c588c98cf3d2b2e7e6a0468a98e84d0d
Parent: dc87c3985e9b442c60994308a96f887579addc39
Author: Robert Peterson [EMAIL PROTECTED]
AuthorDate: Fri Mar 16 10:26:37 2007 +
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:29 2007 +0100

[GFS2] Add gfs2_tool lockdump support to gfs2 (bz 228540)

The attached patch resolves bz 228540.  This adds the capability
for gfs2 to dump gfs2 locks through the debugfs file system.
This used to exist in gfs1 as gfs_tool lockdump but it's missing from
gfs2 because all the ioctls were stripped out.  Please see the bugzilla
for more history about the fix.  This patch is also attached to the bugzilla
record.

The patch is against Steve Whitehouse's latest nmw git tree kernel
(2.6.21-rc1) and has been tested on system trin-10.

Signed-off-by: Robert Peterson [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/glock.c  |  314 --
 fs/gfs2/glock.h  |4 +
 fs/gfs2/incore.h |1 +
 fs/gfs2/main.c   |3 +
 fs/gfs2/ops_fstype.c |3 +
 5 files changed, 262 insertions(+), 63 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 12accb0..9f203ef 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -23,6 +23,8 @@
 #include linux/module.h
 #include linux/rwsem.h
 #include asm/uaccess.h
+#include linux/seq_file.h
+#include linux/debugfs.h
 
 #include gfs2.h
 #include incore.h
@@ -40,14 +42,22 @@ struct gfs2_gl_hash_bucket {
 struct hlist_head hb_list;
 };
 
+struct glock_iter {
+   int hash; /* hash bucket index */
+   struct gfs2_sbd *sdp; /* incore superblock */
+   struct gfs2_glock *gl;/* current glock struct  */
+   struct hlist_head *hb_list;   /* current hash bucket ptr   */
+   struct seq_file *seq; /* sequence file for debugfs */
+   char string[512]; /* scratch space */
+};
+
 typedef void (*glock_examiner) (struct gfs2_glock * gl);
 
 static int gfs2_dump_lockstate(struct gfs2_sbd *sdp);
-static int dump_glock(struct gfs2_glock *gl);
-static int dump_inode(struct gfs2_inode *ip);
 static void gfs2_glock_xmote_th(struct gfs2_holder *gh);
 static void gfs2_glock_drop_th(struct gfs2_glock *gl);
 static DECLARE_RWSEM(gfs2_umount_flush_sem);
+static struct dentry *gfs2_root;
 
 #define GFS2_GL_HASH_SHIFT  15
 #define GFS2_GL_HASH_SIZE   (1  GFS2_GL_HASH_SHIFT)
@@ -1109,6 +1119,20 @@ find_holder_by_owner(struct list_head *head, struct 
task_struct *owner)
return NULL;
 }
 
+static void print_dbg(struct glock_iter *gi, const char *fmt, ...)
+{
+   va_list args;
+
+   va_start(args, fmt);
+   if (gi) {
+   vsprintf(gi-string, fmt, args);
+   seq_printf(gi-seq, gi-string);
+   }
+   else
+   vprintk(fmt, args);
+   va_end(args);
+}
+
 /**
  * add_to_queue - Add a holder to the wait queue (but look for recursion)
  * @gh: the holder structure to add
@@ -1849,31 +1873,32 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp, int wait)
  * Returns: 0 on success, -ENOBUFS when we run out of space
  */
 
-static int dump_holder(char *str, struct gfs2_holder *gh)
+static int dump_holder(struct glock_iter *gi, char *str,
+  struct gfs2_holder *gh)
 {
unsigned int x;
-   int error = -ENOBUFS;
 
-   printk(KERN_INFO   %s\n, str);
-   printk(KERN_INFO owner = %ld\n,
+   print_dbg(gi,   %s\n, str);
+   print_dbg(gi, owner = %ld\n,
   (gh-gh_owner) ? (long)gh-gh_owner-pid : -1);
-   printk(KERN_INFO gh_state = %u\n, gh-gh_state);
-   printk(KERN_INFO gh_flags =);
+   print_dbg(gi, gh_state = %u\n, gh-gh_state);
+   print_dbg(gi, gh_flags =);
for (x = 0; x  32; x++)
if (gh-gh_flags  (1  x))
-   printk( %u, x);
-   printk( \n);
-   printk(KERN_INFO error = %d\n, gh-gh_error);
-   printk(KERN_INFO gh_iflags =);
+   print_dbg(gi,  %u, x);
+   print_dbg(gi,  \n);
+   print_dbg(gi, error = %d\n, gh-gh_error);
+   print_dbg(gi, gh_iflags =);
for (x = 0; x  32; x++)
if (test_bit(x, gh-gh_iflags))
-   printk( %u, x);
-   printk( \n);
-   print_symbol(KERN_INFO initialized at: %s\n, gh-gh_ip);
-
-   error = 0;
+   print_dbg(gi,  %u, x);
+   print_dbg(gi,  \n);
+   if (gi)
+   print_dbg(gi, initialized at: 0x%x\n, gh-gh_ip);
+   else
+   print_symbol(KERN_INFO initialized at: %s\n, gh-gh_ip);
 
-   return error;
+   return 0;
 }
 
 /**

[GFS2] fix bz 231369, gfs2 will oops if you specify an invalid mount option

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5c7342d894973636f03270673e1fb7b908a421a8
Commit: 5c7342d894973636f03270673e1fb7b908a421a8
Parent: 7c52b166c588c98cf3d2b2e7e6a0468a98e84d0d
Author: Josef Whiter [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 17:09:10 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:32 2007 +0100

[GFS2] fix bz 231369, gfs2 will oops if you specify an invalid mount option

If you specify an invalid mount option when trying to mount a gfs2 
filesystem,
gfs2 will oops.  The attached patch resolves this problem.

Signed-off-by: Josef Whiter [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/glock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 9f203ef..a3a24f2 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -2217,7 +2217,7 @@ int gfs2_create_debugfs_file(struct gfs2_sbd *sdp)
 
 void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp)
 {
-   if (sdp-debugfs_dentry)
+   if (sdp  sdp-debugfs_dentry)
debugfs_remove(sdp-debugfs_dentry);
 }
 
-
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


[DLM] Fix uninitialised variable in receiving

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89adc934f3f96600e7f31447426c7e99d62c5460
Commit: 89adc934f3f96600e7f31447426c7e99d62c5460
Parent: 5c7342d894973636f03270673e1fb7b908a421a8
Author: Patrick Caulfield [EMAIL PROTECTED]
AuthorDate: Tue Mar 13 17:08:45 2007 +
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:34 2007 +0100

[DLM] Fix uninitialised variable in receiving

The length of the second element of the kvec array was not initialised 
before
being added to the first one. This could cause invalid lengths to be passed 
to
kernel_recvmsg

Signed-Off-By: Patrick Caulfield [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/lowcomms-tcp.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/dlm/lowcomms-tcp.c b/fs/dlm/lowcomms-tcp.c
index 07e0a12..9bfe7fb 100644
--- a/fs/dlm/lowcomms-tcp.c
+++ b/fs/dlm/lowcomms-tcp.c
@@ -299,6 +299,7 @@ static int receive_from_sock(struct connection *con)
 */
iov[0].iov_len = con-cb.base - cbuf_data(con-cb);
iov[0].iov_base = page_address(con-rx_page) + cbuf_data(con-cb);
+   iov[1].iov_len = 0;
nvec = 1;
 
/*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GFS2] Fix bz 231380, unlock page before dequeing glocks in gfs2_commit_write

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1de913909263ba7f7054debeda1b79771a7233db
Commit: 1de913909263ba7f7054debeda1b79771a7233db
Parent: 89adc934f3f96600e7f31447426c7e99d62c5460
Author: Josef Whiter [EMAIL PROTECTED]
AuthorDate: Mon Mar 12 16:55:07 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:37 2007 +0100

[GFS2] Fix bz 231380, unlock page before dequeing glocks in 
gfs2_commit_write

If we are writing a file, and in the middle of writing the file
another node attempts to get a shared lock on that file (by doing a du for
example) the process doing the writing will hang waiting on lock_page.  The
reason for this is because when we have waiters on a exclusive glock, we 
will go
through and flush out all dirty pages associated with that inode and 
release the
lock.  The problem is that when we flush the dirty pages, we could hit a 
page
that we have locked durring the generic_file_buffered_write part of this
operation.  This patch unlocks the page before we go to dequeue the lock and
locks it immediatly afterwards, since generic_file_buffered_write needs the 
page
locked when the commit_write is completed.  This patch resolves the problem,
however if somebody sees a better way to do this please don't hesistate to 
yell.

Signed-off-by: Josef Whiter [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/ops_address.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index b3b7e84..90c2879 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -507,7 +507,9 @@ static int gfs2_commit_write(struct file *file, struct page 
*page,
gfs2_quota_unlock(ip);
gfs2_alloc_put(ip);
}
+   unlock_page(page);
gfs2_glock_dq_m(1, ip-i_gh);
+   lock_page(page);
gfs2_holder_uninit(ip-i_gh);
return 0;
 
@@ -520,7 +522,9 @@ fail_endtrans:
gfs2_quota_unlock(ip);
gfs2_alloc_put(ip);
}
+   unlock_page(page);
gfs2_glock_dq_m(1, ip-i_gh);
+   lock_page(page);
gfs2_holder_uninit(ip-i_gh);
 fail_nounlock:
ClearPageUptodate(page);
-
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


[GFS2] Fix bz 224480 and cleanup glock demotion code

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b8249f6178cb2b68b9d683587797270125cc06a
Commit: 3b8249f6178cb2b68b9d683587797270125cc06a
Parent: 1de913909263ba7f7054debeda1b79771a7233db
Author: Steven Whitehouse [EMAIL PROTECTED]
AuthorDate: Fri Mar 16 09:40:31 2007 +
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:39 2007 +0100

[GFS2] Fix bz 224480 and cleanup glock demotion code

This patch prevents the printing of a warning message in cases where
the fs is functioning normally by handing off responsibility for
unlinked, but still open inodes, to another node for eventual deallocation.
Also, there is now an improved system for ensuring that such requests
to other nodes do not get lost. The callback on the iopen lock is
only ever called when i_nlink == 0 and when a node is unable to deallocate
it due to it still being in use on another node. When a node receives
the callback therefore, it knows that i_nlink must be zero, so we mark
it as such (in gfs2_drop_inode) in order that it will then attempt
deallocation of the inode itself.

As an additional benefit, queuing a demote request no longer requires
a memory allocation. This simplifies the code for dealing with gfs2_holders
as it removes one special case.

There are two new fields in struct gfs2_glock. gl_demote_state is the
state which the remote node has requested and gl_demote_time is the
time when the request came in. Both fields are only valid when the
GLF_DEMOTE flag is set in gl_flags.

Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/glock.c |  233 ++-
 fs/gfs2/glock.h |2 +-
 fs/gfs2/incore.h|8 +-
 fs/gfs2/main.c  |1 -
 fs/gfs2/ops_super.c |   28 ++-
 5 files changed, 93 insertions(+), 179 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index a3a24f2..e707594 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -54,7 +54,7 @@ struct glock_iter {
 typedef void (*glock_examiner) (struct gfs2_glock * gl);
 
 static int gfs2_dump_lockstate(struct gfs2_sbd *sdp);
-static void gfs2_glock_xmote_th(struct gfs2_holder *gh);
+static void gfs2_glock_xmote_th(struct gfs2_glock *gl, struct gfs2_holder *gh);
 static void gfs2_glock_drop_th(struct gfs2_glock *gl);
 static DECLARE_RWSEM(gfs2_umount_flush_sem);
 static struct dentry *gfs2_root;
@@ -212,7 +212,6 @@ int gfs2_glock_put(struct gfs2_glock *gl)
gfs2_assert(sdp, list_empty(gl-gl_reclaim));
gfs2_assert(sdp, list_empty(gl-gl_holders));
gfs2_assert(sdp, list_empty(gl-gl_waiters1));
-   gfs2_assert(sdp, list_empty(gl-gl_waiters2));
gfs2_assert(sdp, list_empty(gl-gl_waiters3));
glock_free(gl);
rv = 1;
@@ -399,7 +398,7 @@ void gfs2_holder_reinit(unsigned int state, unsigned flags, 
struct gfs2_holder *
 {
gh-gh_state = state;
gh-gh_flags = flags;
-   gh-gh_iflags = 1  HIF_ALLOCED;
+   gh-gh_iflags = 0;
gh-gh_ip = (unsigned long)__builtin_return_address(0);
 }
 
@@ -416,54 +415,8 @@ void gfs2_holder_uninit(struct gfs2_holder *gh)
gh-gh_ip = 0;
 }
 
-/**
- * gfs2_holder_get - get a struct gfs2_holder structure
- * @gl: the glock
- * @state: the state we're requesting
- * @flags: the modifier flags
- * @gfp_flags:
- *
- * Figure out how big an impact this function has.  Either:
- * 1) Replace it with a cache of structures hanging off the struct gfs2_sbd
- * 2) Leave it like it is
- *
- * Returns: the holder structure, NULL on ENOMEM
- */
-
-static struct gfs2_holder *gfs2_holder_get(struct gfs2_glock *gl,
-  unsigned int state,
-  int flags, gfp_t gfp_flags)
-{
-   struct gfs2_holder *gh;
-
-   gh = kmalloc(sizeof(struct gfs2_holder), gfp_flags);
-   if (!gh)
-   return NULL;
-
-   gfs2_holder_init(gl, state, flags, gh);
-   set_bit(HIF_ALLOCED, gh-gh_iflags);
-   gh-gh_ip = (unsigned long)__builtin_return_address(0);
-   return gh;
-}
-
-/**
- * gfs2_holder_put - get rid of a struct gfs2_holder structure
- * @gh: the holder structure
- *
- */
-
-static void gfs2_holder_put(struct gfs2_holder *gh)
-{
-   gfs2_holder_uninit(gh);
-   kfree(gh);
-}
-
-static void gfs2_holder_dispose_or_wake(struct gfs2_holder *gh)
+static void gfs2_holder_wake(struct gfs2_holder *gh)
 {
-   if (test_bit(HIF_DEALLOC, gh-gh_iflags)) {
-   gfs2_holder_put(gh);
-   return;
-   }
clear_bit(HIF_WAIT, gh-gh_iflags);
smp_mb();
wake_up_bit(gh-gh_iflags, HIF_WAIT);
@@ -529,7 +482,7 @@ static int rq_promote(struct gfs2_holder *gh)
gfs2_reclaim_glock(sdp);
}
 
-   

[GFS2] Fix a bug on i386 due to evaluation order

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=420d2a1028b906f24e836e37089a6ad55ab1848f
Commit: 420d2a1028b906f24e836e37089a6ad55ab1848f
Parent: 3b8249f6178cb2b68b9d683587797270125cc06a
Author: Steven Whitehouse [EMAIL PROTECTED]
AuthorDate: Sun Mar 18 16:05:27 2007 +
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:42 2007 +0100

[GFS2] Fix a bug on i386 due to evaluation order

Since gcc didn't evaluate the last two terms of the expression in
glock.c:1881 as a constant expression, it resulted in an error on
i386 due to the lack of a 64bit divide instruction. This adds some
brackets to fix the problem.

This was reported by Andrew Morton.

Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
Cc: Andrew Morton [EMAIL PROTECTED]
---
 fs/gfs2/glock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index e707594..b8aa816 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1880,7 +1880,7 @@ static int dump_glock(struct glock_iter *gi, struct 
gfs2_glock *gl)
if (test_bit(GLF_DEMOTE, gl-gl_flags)) {
print_dbg(gi,   Demotion req to state %u (%llu uS ago)\n,
  gl-gl_demote_state,
- (u64)(jiffies - gl-gl_demote_time)*100/HZ);
+ (u64)(jiffies - gl-gl_demote_time)*(100/HZ));
}
if (gl-gl_ops == gfs2_inode_glops  gl-gl_object) {
if (!test_bit(GLF_LOCK, gl-gl_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


[DLM] Don't delete misc device if lockspace removal fails

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=254da030dfb1b13d42d07e4292a4790d88c6874f
Commit: 254da030dfb1b13d42d07e4292a4790d88c6874f
Parent: 420d2a1028b906f24e836e37089a6ad55ab1848f
Author: Patrick Caulfield [EMAIL PROTECTED]
AuthorDate: Wed Mar 21 09:23:53 2007 +
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:44 2007 +0100

[DLM] Don't delete misc device if lockspace removal fails

Currently if the lockspace removal fails the misc device associated with a
lockspace is left deleted. After that there is no way to access the orphaned
lockspace from userland.

This patch recreates the misc device if th dlm_release_lockspace fails. I
believe this is better than attempting to remove the lockspace first because
that leaves an unattached device lying around. The potential gap in which 
there
is no access to the lockspace between removing the misc device and 
recreating it
is acceptable ... after all the application is trying to remove it, and 
only new
users of the lockspace will be affected.

Signed-Off-By: Patrick Caulfield [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/user.c |   58 +++-
 1 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 3870150..27a75ce 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -286,11 +286,34 @@ static int device_user_unlock(struct dlm_user_proc *proc,
return error;
 }
 
+static int create_misc_device(struct dlm_ls *ls, char *name)
+{
+   int error, len;
+
+   error = -ENOMEM;
+   len = strlen(name) + strlen(name_prefix) + 2;
+   ls-ls_device.name = kzalloc(len, GFP_KERNEL);
+   if (!ls-ls_device.name)
+   goto fail;
+
+   snprintf((char *)ls-ls_device.name, len, %s_%s, name_prefix,
+name);
+   ls-ls_device.fops = device_fops;
+   ls-ls_device.minor = MISC_DYNAMIC_MINOR;
+
+   error = misc_register(ls-ls_device);
+   if (error) {
+   kfree(ls-ls_device.name);
+   }
+fail:
+   return error;
+}
+
 static int device_create_lockspace(struct dlm_lspace_params *params)
 {
dlm_lockspace_t *lockspace;
struct dlm_ls *ls;
-   int error, len;
+   int error;
 
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
@@ -304,29 +327,14 @@ static int device_create_lockspace(struct 
dlm_lspace_params *params)
if (!ls)
return -ENOENT;
 
-   error = -ENOMEM;
-   len = strlen(params-name) + strlen(name_prefix) + 2;
-   ls-ls_device.name = kzalloc(len, GFP_KERNEL);
-   if (!ls-ls_device.name)
-   goto fail;
-   snprintf((char *)ls-ls_device.name, len, %s_%s, name_prefix,
-params-name);
-   ls-ls_device.fops = device_fops;
-   ls-ls_device.minor = MISC_DYNAMIC_MINOR;
-
-   error = misc_register(ls-ls_device);
-   if (error) {
-   kfree(ls-ls_device.name);
-   goto fail;
-   }
-
-   error = ls-ls_device.minor;
+   error = create_misc_device(ls, params-name);
dlm_put_lockspace(ls);
-   return error;
 
- fail:
-   dlm_put_lockspace(ls);
-   dlm_release_lockspace(lockspace, 0);
+   if (error)
+   dlm_release_lockspace(lockspace, 0);
+   else
+   error = ls-ls_device.minor;
+
return error;
 }
 
@@ -343,6 +351,10 @@ static int device_remove_lockspace(struct 
dlm_lspace_params *params)
if (!ls)
return -ENOENT;
 
+   /* Deregister the misc device first, so we don't have
+* a device that's not attached to a lockspace. If
+* dlm_release_lockspace fails then we can recreate it
+*/
error = misc_deregister(ls-ls_device);
if (error) {
dlm_put_lockspace(ls);
@@ -361,6 +373,8 @@ static int device_remove_lockspace(struct dlm_lspace_params 
*params)
 
dlm_put_lockspace(ls);
error = dlm_release_lockspace(lockspace, force);
+   if (error)
+   create_misc_device(ls, ls-ls_name);
  out:
return error;
 }
-
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


[GFS2] flush the log if a transaction can't allocate space

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=172e045a7fcc3ee647fa70dbd585a3c247b49cb2
Commit: 172e045a7fcc3ee647fa70dbd585a3c247b49cb2
Parent: 6883562588bc6c70776ecc396ee7eda36c2c8da9
Author: Benjamin Marzinski [EMAIL PROTECTED]
AuthorDate: Fri Mar 23 14:51:56 2007 -0600
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:52 2007 +0100

[GFS2] flush the log if a transaction can't allocate space

This is a fix for bz #208514. When GFS2 frees up space, the freed blocks
aren't available for reuse until the resource group is successfully written
to the ondisk journal. So in rare cases, GFS2 operations will fail, saying
that the filesystem is out of space, when in reality, you are just waiting 
for
a log flush. For instance, on a 1Gig filesystem, if I continually write 10 
Mb
to a file, and then truncate it, after a hundred interations, the write will
fail with -ENOSPC, even though the filesystem is just 1% full.

The attached patch calls a log flush in these cases.  I tested this patch
fairly heavily to check if there were any locking issues that I missed, and
it seems to work just fine. Also, this patch only does the log flush if
get_local_rgrp makes a complete loop of resource groups without skipping
any do to locking issues. The code would be slightly simpler if it just 
always
did the log flush after the first failed pass, and you could only ever have
to go through the loop twice, instead of up to three times. However, I 
guessed
that failing to find a rg simply do to locking issues would be common enough
to skip the log flush in that case, but I'm not certain that this is the 
right
way to go. Either way, I don't suppose this code will be hit all that often.

Signed-off-by: Benjamin E. Marzinski [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/rgrp.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 8d9c08b..2ce48d4 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -27,6 +27,7 @@
 #include trans.h
 #include ops_file.h
 #include util.h
+#include log.h
 
 #define BFITNOENT ((u32)~0)
 
@@ -941,9 +942,13 @@ static int get_local_rgrp(struct gfs2_inode *ip)
rgd = gfs2_rgrpd_get_first(sdp);
 
if (rgd == begin) {
-   if (++loops = 2 || !skipped)
+   if (++loops = 3)
return -ENOSPC;
+   if (!skipped)
+   loops++;
flags = 0;
+   if (loops == 2)
+   gfs2_log_flush(sdp, NULL);
}
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GFS2] Red Hat bz 228540: owner references

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=04b933f27bc8e7f3f6423020cec58a4eab3bb7a7
Commit: 04b933f27bc8e7f3f6423020cec58a4eab3bb7a7
Parent: 172e045a7fcc3ee647fa70dbd585a3c247b49cb2
Author: Robert Peterson [EMAIL PROTECTED]
AuthorDate: Fri Mar 23 17:05:15 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:55 2007 +0100

[GFS2] Red Hat bz 228540: owner references

In Testing the previously posted and accepted patch for
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=228540
I uncovered some gfs2 badness.  It turns out that the current
gfs2 code saves off a process pointer when glocks is taken
in both the glock and glock holder structures.  Those
structures will persist in memory long after the process has
ended; pointers to poisoned memory.

This problem isn't caused by the 228540 fix; the new capability
introduced by the fix just uncovered the problem.

I wrote this patch that avoids saving process pointers
and instead saves off the process pid.  Rather than
referencing the bad pointers, it now does process lookups.
There is special code that makes the output nicer for
printing holder information for processes that have ended.

This patch also adds a stub for the new sprint_symbol
function that exists in Andrew Morton's -mm patch set, but
won't go into the base kernel until 2.6.22, since it adds
functionality but doesn't fix a bug.

Signed-off-by: Bob Peterson [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/glock.c  |   75 -
 fs/gfs2/glock.h  |2 +-
 fs/gfs2/incore.h |4 +-
 3 files changed, 59 insertions(+), 22 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index b8aa816..d2e3094 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -25,6 +25,8 @@
 #include asm/uaccess.h
 #include linux/seq_file.h
 #include linux/debugfs.h
+#include linux/module.h
+#include linux/kallsyms.h
 
 #include gfs2.h
 #include incore.h
@@ -54,6 +56,7 @@ struct glock_iter {
 typedef void (*glock_examiner) (struct gfs2_glock * gl);
 
 static int gfs2_dump_lockstate(struct gfs2_sbd *sdp);
+static int dump_glock(struct glock_iter *gi, struct gfs2_glock *gl);
 static void gfs2_glock_xmote_th(struct gfs2_glock *gl, struct gfs2_holder *gh);
 static void gfs2_glock_drop_th(struct gfs2_glock *gl);
 static DECLARE_RWSEM(gfs2_umount_flush_sem);
@@ -64,6 +67,7 @@ static struct dentry *gfs2_root;
 #define GFS2_GL_HASH_MASK   (GFS2_GL_HASH_SIZE - 1)
 
 static struct gfs2_gl_hash_bucket gl_hash_table[GFS2_GL_HASH_SIZE];
+static struct dentry *gfs2_root;
 
 /*
  * Despite what you might think, the numbers below are not arbitrary :-)
@@ -312,7 +316,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
atomic_set(gl-gl_ref, 1);
gl-gl_state = LM_ST_UNLOCKED;
gl-gl_hash = hash;
-   gl-gl_owner = NULL;
+   gl-gl_owner_pid = 0;
gl-gl_ip = 0;
gl-gl_ops = glops;
gl-gl_req_gh = NULL;
@@ -376,7 +380,7 @@ void gfs2_holder_init(struct gfs2_glock *gl, unsigned int 
state, unsigned flags,
INIT_LIST_HEAD(gh-gh_list);
gh-gh_gl = gl;
gh-gh_ip = (unsigned long)__builtin_return_address(0);
-   gh-gh_owner = current;
+   gh-gh_owner_pid = current-pid;
gh-gh_state = state;
gh-gh_flags = flags;
gh-gh_error = 0;
@@ -601,7 +605,7 @@ static void gfs2_glmutex_lock(struct gfs2_glock *gl)
if (test_and_set_bit(GLF_LOCK, gl-gl_flags)) {
list_add_tail(gh.gh_list, gl-gl_waiters1);
} else {
-   gl-gl_owner = current;
+   gl-gl_owner_pid = current-pid;
gl-gl_ip = (unsigned long)__builtin_return_address(0);
clear_bit(HIF_WAIT, gh.gh_iflags);
smp_mb();
@@ -628,7 +632,7 @@ static int gfs2_glmutex_trylock(struct gfs2_glock *gl)
if (test_and_set_bit(GLF_LOCK, gl-gl_flags)) {
acquired = 0;
} else {
-   gl-gl_owner = current;
+   gl-gl_owner_pid = current-pid;
gl-gl_ip = (unsigned long)__builtin_return_address(0);
}
spin_unlock(gl-gl_spin);
@@ -646,7 +650,7 @@ static void gfs2_glmutex_unlock(struct gfs2_glock *gl)
 {
spin_lock(gl-gl_spin);
clear_bit(GLF_LOCK, gl-gl_flags);
-   gl-gl_owner = NULL;
+   gl-gl_owner_pid = 0;
gl-gl_ip = 0;
run_queue(gl);
BUG_ON(!spin_is_locked(gl-gl_spin));
@@ -999,12 +1003,12 @@ static int glock_wait_internal(struct gfs2_holder *gh)
 }
 
 static inline struct gfs2_holder *
-find_holder_by_owner(struct list_head *head, struct task_struct *owner)
+find_holder_by_owner(struct list_head *head, pid_t pid)
 {
struct gfs2_holder *gh;
 
list_for_each_entry(gh, head, gh_list) {
-   

[DLM] fix coverity-spotted stupidity

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=032067270295cfca11975c0f7b467244aa170c14
Commit: 032067270295cfca11975c0f7b467244aa170c14
Parent: 04b933f27bc8e7f3f6423020cec58a4eab3bb7a7
Author: Patrick Caulfield [EMAIL PROTECTED]
AuthorDate: Mon Mar 26 09:56:00 2007 +0100
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:10:57 2007 +0100

[DLM] fix coverity-spotted stupidity

Replacement patch to remove redundant code rather than moving it around.

Signed-Off-By: Patrick Caulfield [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/lowcomms-tcp.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/fs/dlm/lowcomms-tcp.c b/fs/dlm/lowcomms-tcp.c
index 9bfe7fb..919e92a 100644
--- a/fs/dlm/lowcomms-tcp.c
+++ b/fs/dlm/lowcomms-tcp.c
@@ -319,8 +319,6 @@ static int receive_from_sock(struct connection *con)
 
if (ret = 0)
goto out_close;
-   if (ret == -EAGAIN)
-   goto out_resched;
 
if (ret == len)
call_again_soon = 1;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GFS2] use log_error before LM_OUT_ERROR

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9af8a788ade3435b53667873774b5366cf73f58
Commit: b9af8a788ade3435b53667873774b5366cf73f58
Parent: ef0c2bb05f40f9a0cd2deae63e199bfa62faa7fa
Author: David Teigland [EMAIL PROTECTED]
AuthorDate: Wed Mar 28 11:08:04 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:02 2007 +0100

[GFS2] use log_error before LM_OUT_ERROR

We always want to see the details of the error returned to gfs, but
log_debug is often turned off, so use log_error (printk).

Signed-off-by: David Teigland [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/locking/dlm/lock.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/locking/dlm/lock.c b/fs/gfs2/locking/dlm/lock.c
index f9c8bda..c305255 100644
--- a/fs/gfs2/locking/dlm/lock.c
+++ b/fs/gfs2/locking/dlm/lock.c
@@ -266,7 +266,7 @@ unsigned int gdlm_do_lock(struct gdlm_lock *lp)
}
 
if (error) {
-   log_debug(%s: gdlm_lock %x,%llx err=%d cur=%d req=%d lkf=%x 
+   log_error(%s: gdlm_lock %x,%llx err=%d cur=%d req=%d lkf=%x 
  flags=%lx, ls-fsname, lp-lockname.ln_type,
  (unsigned long long)lp-lockname.ln_number, error,
  lp-cur, lp-req, lp-lkf, lp-flags);
@@ -294,7 +294,7 @@ static unsigned int gdlm_do_unlock(struct gdlm_lock *lp)
error = dlm_unlock(ls-dlm_lockspace, lp-lksb.sb_lkid, lkf, NULL, lp);
 
if (error) {
-   log_debug(%s: gdlm_unlock %x,%llx err=%d cur=%d req=%d lkf=%x 
+   log_error(%s: gdlm_unlock %x,%llx err=%d cur=%d req=%d lkf=%x 
  flags=%lx, ls-fsname, lp-lockname.ln_type,
  (unsigned long long)lp-lockname.ln_number, error,
  lp-cur, lp-req, lp-lkf, lp-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


[GFS2] Set drop_count to 0 (off) by default

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f01963f2648cfd708ee8d521b3737cfa55ea8795
Commit: f01963f2648cfd708ee8d521b3737cfa55ea8795
Parent: b9af8a788ade3435b53667873774b5366cf73f58
Author: Steven Whitehouse [EMAIL PROTECTED]
AuthorDate: Mon Apr 2 10:03:24 2007 +0100
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:05 2007 +0100

[GFS2] Set drop_count to 0 (off) by default

This sets the drop_count to 0 by default which is a better default
for most people.

Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/locking/dlm/lock_dlm.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/gfs2/locking/dlm/lock_dlm.h b/fs/gfs2/locking/dlm/lock_dlm.h
index 6888bd4..d074c6e 100644
--- a/fs/gfs2/locking/dlm/lock_dlm.h
+++ b/fs/gfs2/locking/dlm/lock_dlm.h
@@ -36,7 +36,7 @@
 
 #define GDLM_STRNAME_BYTES 24
 #define GDLM_LVB_SIZE  32
-#define GDLM_DROP_COUNT20
+#define GDLM_DROP_COUNT0
 #define GDLM_DROP_PERIOD   60
 #define GDLM_NAME_LEN  128
 
-
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


[DLM] split create_message function

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7e4dac33594468153c38b5c94d8ebcafb0e0a68d
Commit: 7e4dac33594468153c38b5c94d8ebcafb0e0a68d
Parent: f01963f2648cfd708ee8d521b3737cfa55ea8795
Author: David Teigland [EMAIL PROTECTED]
AuthorDate: Mon Apr 2 09:06:41 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:07 2007 +0100

[DLM] split create_message function

This splits the current create_message() function into two parts so that
later patches can call the new lower-level _create_message() function when
they don't have an rsb struct.  No functional change in this patch.

Signed-off-by: David Teigland [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/lock.c |   54 --
 1 files changed, 32 insertions(+), 22 deletions(-)

diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index b865a46..7807958 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -2301,31 +2301,14 @@ int dlm_unlock(dlm_lockspace_t *lockspace,
  * receive_lookup_replysend_lookup_reply
  */
 
-static int create_message(struct dlm_rsb *r, struct dlm_lkb *lkb,
- int to_nodeid, int mstype,
- struct dlm_message **ms_ret,
- struct dlm_mhandle **mh_ret)
+static int _create_message(struct dlm_ls *ls, int mb_len,
+  int to_nodeid, int mstype,
+  struct dlm_message **ms_ret,
+  struct dlm_mhandle **mh_ret)
 {
struct dlm_message *ms;
struct dlm_mhandle *mh;
char *mb;
-   int mb_len = sizeof(struct dlm_message);
-
-   switch (mstype) {
-   case DLM_MSG_REQUEST:
-   case DLM_MSG_LOOKUP:
-   case DLM_MSG_REMOVE:
-   mb_len += r-res_length;
-   break;
-   case DLM_MSG_CONVERT:
-   case DLM_MSG_UNLOCK:
-   case DLM_MSG_REQUEST_REPLY:
-   case DLM_MSG_CONVERT_REPLY:
-   case DLM_MSG_GRANT:
-   if (lkb  lkb-lkb_lvbptr)
-   mb_len += r-res_ls-ls_lvblen;
-   break;
-   }
 
/* get_buffer gives us a message handle (mh) that we need to
   pass into lowcomms_commit and a message buffer (mb) that we
@@ -2340,7 +2323,7 @@ static int create_message(struct dlm_rsb *r, struct 
dlm_lkb *lkb,
ms = (struct dlm_message *) mb;
 
ms-m_header.h_version = (DLM_HEADER_MAJOR | DLM_HEADER_MINOR);
-   ms-m_header.h_lockspace = r-res_ls-ls_global_id;
+   ms-m_header.h_lockspace = ls-ls_global_id;
ms-m_header.h_nodeid = dlm_our_nodeid();
ms-m_header.h_length = mb_len;
ms-m_header.h_cmd = DLM_MSG;
@@ -2352,6 +2335,33 @@ static int create_message(struct dlm_rsb *r, struct 
dlm_lkb *lkb,
return 0;
 }
 
+static int create_message(struct dlm_rsb *r, struct dlm_lkb *lkb,
+ int to_nodeid, int mstype,
+ struct dlm_message **ms_ret,
+ struct dlm_mhandle **mh_ret)
+{
+   int mb_len = sizeof(struct dlm_message);
+
+   switch (mstype) {
+   case DLM_MSG_REQUEST:
+   case DLM_MSG_LOOKUP:
+   case DLM_MSG_REMOVE:
+   mb_len += r-res_length;
+   break;
+   case DLM_MSG_CONVERT:
+   case DLM_MSG_UNLOCK:
+   case DLM_MSG_REQUEST_REPLY:
+   case DLM_MSG_CONVERT_REPLY:
+   case DLM_MSG_GRANT:
+   if (lkb  lkb-lkb_lvbptr)
+   mb_len += r-res_ls-ls_lvblen;
+   break;
+   }
+
+   return _create_message(r-res_ls, mb_len, to_nodeid, mstype,
+  ms_ret, mh_ret);
+}
+
 /* further lowcomms enhancements or alternate implementations may make
the return value from this function useful at some point */
 
-
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


[DLM] interface for purge (2/2)

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=72c2be776bd6eec5186e316e6d9dd4aab78d314d
Commit: 72c2be776bd6eec5186e316e6d9dd4aab78d314d
Parent: 8499137d4ef1829281e04838113b6b09a0bf1269
Author: David Teigland [EMAIL PROTECTED]
AuthorDate: Fri Mar 30 15:06:16 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:12 2007 +0100

[DLM] interface for purge (2/2)

Add code to accept purge commands from userland.

Signed-off-by: David Teigland [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/lock.h  |2 ++
 fs/dlm/user.c  |   28 
 include/linux/dlm_device.h |9 -
 3 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/fs/dlm/lock.h b/fs/dlm/lock.h
index 0843a30..64fc4ec 100644
--- a/fs/dlm/lock.h
+++ b/fs/dlm/lock.h
@@ -41,6 +41,8 @@ int dlm_user_unlock(struct dlm_ls *ls, struct dlm_user_args 
*ua_tmp,
uint32_t flags, uint32_t lkid, char *lvb_in);
 int dlm_user_cancel(struct dlm_ls *ls,  struct dlm_user_args *ua_tmp,
uint32_t flags, uint32_t lkid);
+int dlm_user_purge(struct dlm_ls *ls, struct dlm_user_proc *proc,
+   int nodeid, int pid);
 void dlm_clear_proc_locks(struct dlm_ls *ls, struct dlm_user_proc *proc);
 
 static inline int is_master(struct dlm_rsb *r)
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index c978c67..3e746a6 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -56,6 +56,7 @@ struct dlm_write_request32 {
union  {
struct dlm_lock_params32 lock;
struct dlm_lspace_params lspace;
+   struct dlm_purge_params purge;
} i;
 };
 
@@ -92,6 +93,9 @@ static void compat_input(struct dlm_write_request *kb,
kb-i.lspace.flags = kb32-i.lspace.flags;
kb-i.lspace.minor = kb32-i.lspace.minor;
strcpy(kb-i.lspace.name, kb32-i.lspace.name);
+   } else if (kb-cmd == DLM_USER_PURGE) {
+   kb-i.purge.nodeid = kb32-i.purge.nodeid;
+   kb-i.purge.pid = kb32-i.purge.pid;
} else {
kb-i.lock.mode = kb32-i.lock.mode;
kb-i.lock.namelen = kb32-i.lock.namelen;
@@ -320,6 +324,22 @@ fail:
return error;
 }
 
+static int device_user_purge(struct dlm_user_proc *proc,
+struct dlm_purge_params *params)
+{
+   struct dlm_ls *ls;
+   int error;
+
+   ls = dlm_find_lockspace_local(proc-lockspace);
+   if (!ls)
+   return -ENOENT;
+
+   error = dlm_user_purge(ls, proc, params-nodeid, params-pid);
+
+   dlm_put_lockspace(ls);
+   return error;
+}
+
 static int device_create_lockspace(struct dlm_lspace_params *params)
 {
dlm_lockspace_t *lockspace;
@@ -522,6 +542,14 @@ static ssize_t device_write(struct file *file, const char 
__user *buf,
error = device_remove_lockspace(kbuf-i.lspace);
break;
 
+   case DLM_USER_PURGE:
+   if (!proc) {
+   log_print(no locking on control device);
+   goto out_sig;
+   }
+   error = device_user_purge(proc, kbuf-i.purge);
+   break;
+
default:
log_print(Unknown command passed to DLM device : %d\n,
  kbuf-cmd);
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h
index 2a2dd18..c2735ca 100644
--- a/include/linux/dlm_device.h
+++ b/include/linux/dlm_device.h
@@ -19,7 +19,7 @@
 
 /* Version of the device interface */
 #define DLM_DEVICE_VERSION_MAJOR 5
-#define DLM_DEVICE_VERSION_MINOR 0
+#define DLM_DEVICE_VERSION_MINOR 1
 #define DLM_DEVICE_VERSION_PATCH 0
 
 /* struct passed to the lock write */
@@ -44,6 +44,11 @@ struct dlm_lspace_params {
char name[0];
 };
 
+struct dlm_purge_params {
+   __u32 nodeid;
+   __u32 pid;
+};
+
 struct dlm_write_request {
__u32 version[3];
__u8 cmd;
@@ -53,6 +58,7 @@ struct dlm_write_request {
union  {
struct dlm_lock_params   lock;
struct dlm_lspace_params lspace;
+   struct dlm_purge_params  purge;
} i;
 };
 
@@ -76,6 +82,7 @@ struct dlm_lock_result {
 #define DLM_USER_QUERY3
 #define DLM_USER_CREATE_LOCKSPACE  4
 #define DLM_USER_REMOVE_LOCKSPACE  5
+#define DLM_USER_PURGE6
 
 /* Arbitrary length restriction */
 #define MAX_LS_NAME_LEN 64
-
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


[DLM] change lkid format

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce03f12b37c0bd81ad707d3642241cc55c944711
Commit: ce03f12b37c0bd81ad707d3642241cc55c944711
Parent: 72c2be776bd6eec5186e316e6d9dd4aab78d314d
Author: David Teigland [EMAIL PROTECTED]
AuthorDate: Mon Apr 2 12:12:55 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:15 2007 +0100

[DLM] change lkid format

A lock id is a uint32 and is used as an opaque reference to the lock.  For
userland apps, the lkid is passed up, through libdlm, as the return value
from a write() on the dlm device.  This created a problem when the high
bit was 1, making the lkid look like an error.  This is fixed by changing
how the lkid is composed.  The low 16 bits identified the hash bucket for
the lock and the high 16 bits were a per-bucket counter (which eventually
hit 0x8000 causing the problem).  These are simply swapped around; the
number of hash table buckets is far below 0x8000, making all lkid's
positive when viewed as signed.

Signed-off-by: David Teigland [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/lock.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 9d26b3a..eac54d2 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -580,7 +580,7 @@ static int create_lkb(struct dlm_ls *ls, struct dlm_lkb 
**lkb_ret)
/* counter can roll over so we must verify lkid is not in use */
 
while (lkid == 0) {
-   lkid = bucket | (ls-ls_lkbtbl[bucket].counter++  16);
+   lkid = (bucket  16) | ls-ls_lkbtbl[bucket].counter++;
 
list_for_each_entry(tmp, ls-ls_lkbtbl[bucket].list,
lkb_idtbl_list) {
@@ -601,8 +601,8 @@ static int create_lkb(struct dlm_ls *ls, struct dlm_lkb 
**lkb_ret)
 
 static struct dlm_lkb *__find_lkb(struct dlm_ls *ls, uint32_t lkid)
 {
-   uint16_t bucket = lkid  0x;
struct dlm_lkb *lkb;
+   uint16_t bucket = (lkid  16);
 
list_for_each_entry(lkb, ls-ls_lkbtbl[bucket].list, lkb_idtbl_list) {
if (lkb-lkb_id == lkid)
@@ -614,7 +614,7 @@ static struct dlm_lkb *__find_lkb(struct dlm_ls *ls, 
uint32_t lkid)
 static int find_lkb(struct dlm_ls *ls, uint32_t lkid, struct dlm_lkb **lkb_ret)
 {
struct dlm_lkb *lkb;
-   uint16_t bucket = lkid  0x;
+   uint16_t bucket = (lkid  16);
 
if (bucket = ls-ls_lkbtbl_size)
return -EBADSLT;
@@ -644,7 +644,7 @@ static void kill_lkb(struct kref *kref)
 
 static int __put_lkb(struct dlm_ls *ls, struct dlm_lkb *lkb)
 {
-   uint16_t bucket = lkb-lkb_id  0x;
+   uint16_t bucket = (lkb-lkb_id  16);
 
write_lock(ls-ls_lkbtbl[bucket].lock);
if (kref_put(lkb-lkb_ref, kill_lkb)) {
-
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


[GFS2] Fix bz 234168 (ignoring rgrp flags)

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a43a49066d36612f3bb46653cdb265a89c235eff
Commit: a43a49066d36612f3bb46653cdb265a89c235eff
Parent: ce03f12b37c0bd81ad707d3642241cc55c944711
Author: Steven Whitehouse [EMAIL PROTECTED]
AuthorDate: Mon Apr 2 10:48:17 2007 +0100
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:17 2007 +0100

[GFS2] Fix bz 234168 (ignoring rgrp flags)

Ths following patch makes GFS2 use the rgrp flags properly. Although
there are also separate flags for both data and metadata as well, I've
not implemented these as there seems little use for them. On the
otherhand, the noalloc flag is generally useful for future changes we
might which to make, so this ensures that we interpret it correctly.

In addition I fixed the comment above the function which was incorrect.

Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/rgrp.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 2ce48d4..1727f50 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -698,8 +698,6 @@ struct gfs2_alloc *gfs2_alloc_get(struct gfs2_inode *ip)
  * @al: the struct gfs2_alloc structure describing the reservation
  *
  * If there's room for the requested blocks to be allocated from the RG:
- *   Sets the $al_reserved_data field in @al.
- *   Sets the $al_reserved_meta field in @al.
  *   Sets the $al_rgd field in @al.
  *
  * Returns: 1 on success (it fits), 0 on failure (it doesn't fit)
@@ -710,6 +708,9 @@ static int try_rgrp_fit(struct gfs2_rgrpd *rgd, struct 
gfs2_alloc *al)
struct gfs2_sbd *sdp = rgd-rd_sbd;
int ret = 0;
 
+   if (rgd-rd_rg.rg_flags  GFS2_RGF_NOALLOC)
+   return 0;
+
spin_lock(sdp-sd_rindex_spin);
if (rgd-rd_free_clone = al-al_requested) {
al-al_rgd = rgd;
-
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


[DLM] Remove redundant assignment

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fc7c44f03d95f20b5446d06f5bb9605cddd53203
Commit: fc7c44f03d95f20b5446d06f5bb9605cddd53203
Parent: a43a49066d36612f3bb46653cdb265a89c235eff
Author: Patrick Caulfield [EMAIL PROTECTED]
AuthorDate: Tue Apr 10 09:40:19 2007 +0100
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:20 2007 +0100

[DLM] Remove redundant assignment

This patch removes a redundant (and incorrect) assignment from compat_output

Signed-Off-By: Patrick Caulfield [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/user.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 3e746a6..b0201ec 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -115,8 +115,6 @@ static void compat_input(struct dlm_write_request *kb,
 static void compat_output(struct dlm_lock_result *res,
  struct dlm_lock_result32 *res32)
 {
-   res32-length = res-length - (sizeof(struct dlm_lock_result) -
-  sizeof(struct dlm_lock_result32));
res32-user_astaddr = (__u32)(long)res-user_astaddr;
res32-user_astparam = (__u32)(long)res-user_astparam;
res32-user_lksb = (__u32)(long)res-user_lksb;
-
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


[DLM] fs/dlm/ast.c should #include ast.h

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8fa1de386f4d72f0710b389ccf96308fef87df78
Commit: 8fa1de386f4d72f0710b389ccf96308fef87df78
Parent: 6ed7257b46709e87d79ac2b6b819b7e0c9184998
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Apr 4 17:25:29 2007 +0200
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:25 2007 +0100

[DLM] fs/dlm/ast.c should #include ast.h

Every file should include the headers containing the prototypes for
it's global functions.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: David Teigland [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/ast.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
index f91d39c..6308122 100644
--- a/fs/dlm/ast.c
+++ b/fs/dlm/ast.c
@@ -14,6 +14,7 @@
 #include dlm_internal.h
 #include lock.h
 #include user.h
+#include ast.h
 
 #define WAKE_ASTS  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


[GFS2] bz 236008: Kernel gpf doing cat /debugfs/gfs2/xxx (lock dump)

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7a0079d9e3fe8826475a08785f3d348c4b509774
Commit: 7a0079d9e3fe8826475a08785f3d348c4b509774
Parent: 8fa1de386f4d72f0710b389ccf96308fef87df78
Author: Robert Peterson [EMAIL PROTECTED]
AuthorDate: Tue Apr 17 11:37:11 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:28 2007 +0100

[GFS2] bz 236008: Kernel gpf doing cat /debugfs/gfs2/xxx (lock dump)

This is for Bugzilla Bug 236008: Kernel gpf doing cat /debugfs/gfs2/xxx
(lock dump) seen at the gfs2 summit.  This also fixes the bug that caused
garbage to be printed by the initialized at field.  I apologize for the
kludge, but that code will all be ripped out anyway when the official
sprint_symbol function becomes available in the Linux kernel.  I also
changed some formatting so that spaces are replaced by proper tabs.

Signed-off-by: Robert Peterson [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/glock.c |   29 +
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index d2e3094..b075f93 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1765,15 +1765,20 @@ static void gfs2_print_symbol(struct glock_iter *gi, 
const char *fmt,
 {
 /* when sprint_symbol becomes available in the new kernel, replace this */
 /* function with:
-char buffer[KSYM_SYMBOL_LEN];
+   char buffer[KSYM_SYMBOL_LEN];
 
-sprint_symbol(buffer, address);
-print_dbg(gi, fmt, buffer);
+   sprint_symbol(buffer, address);
+   print_dbg(gi, fmt, buffer);
 */
-if (gi)
-print_dbg(gi, fmt, address);
-else
-print_symbol(fmt, address);
+   char buffer[256];
+
+   if (gi) {
+   memset(buffer, 0, sizeof(buffer));
+   sprintf(buffer, %p, address);
+   print_dbg(gi, fmt, buffer);
+   }
+   else
+   print_symbol(fmt, address);
 }
 
 /**
@@ -1993,14 +1998,19 @@ int __init gfs2_glock_init(void)
 
 static int gfs2_glock_iter_next(struct glock_iter *gi)
 {
+   read_lock(gl_lock_addr(gi-hash));
while (1) {
if (!gi-hb_list) {  /* If we don't have a hash bucket yet */
gi-hb_list = gl_hash_table[gi-hash].hb_list;
if (hlist_empty(gi-hb_list)) {
+   read_unlock(gl_lock_addr(gi-hash));
gi-hash++;
+   read_lock(gl_lock_addr(gi-hash));
gi-hb_list = NULL;
-   if (gi-hash = GFS2_GL_HASH_SIZE)
+   if (gi-hash = GFS2_GL_HASH_SIZE) {
+   read_unlock(gl_lock_addr(gi-hash));
return 1;
+   }
else
continue;
}
@@ -2011,7 +2021,9 @@ static int gfs2_glock_iter_next(struct glock_iter *gi)
}
} else {
if (gi-gl-gl_list.next == NULL) {
+   read_unlock(gl_lock_addr(gi-hash));
gi-hash++;
+   read_lock(gl_lock_addr(gi-hash));
gi-hb_list = NULL;
continue;
}
@@ -2021,6 +2033,7 @@ static int gfs2_glock_iter_next(struct glock_iter *gi)
if (gi-gl)
break;
}
+   read_unlock(gl_lock_addr(gi-hash));
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


[GFS2] Patch to detect corrupt number of dir entries in leaf and/or inode blocks

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bdd19a22f85a7039e01accd8717eaec4addd9dfd
Commit: bdd19a22f85a7039e01accd8717eaec4addd9dfd
Parent: 7a0079d9e3fe8826475a08785f3d348c4b509774
Author: Steven Whitehouse [EMAIL PROTECTED]
AuthorDate: Wed Apr 18 09:38:42 2007 +0100
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:30 2007 +0100

[GFS2] Patch to detect corrupt number of dir entries in leaf and/or inode 
blocks

This patch detects when the number of entries in a leaf block or inode
block (in the case of stuffed directories) is corrupt and informs the
user. It prevents us from running off the end of the array thats been
allocated for the sorting in this case,

Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/dir.c |   35 ++-
 1 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 82a1ac7..6c3ed76 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -1262,9 +1262,10 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 
*offset, void *opaque,
  u64 leaf_no)
 {
struct gfs2_inode *ip = GFS2_I(inode);
+   struct gfs2_sbd *sdp = GFS2_SB(inode);
struct buffer_head *bh;
struct gfs2_leaf *lf;
-   unsigned entries = 0;
+   unsigned entries = 0, entries2 = 0;
unsigned leaves = 0;
const struct gfs2_dirent **darr, *dent;
struct dirent_gather g;
@@ -1290,7 +1291,13 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 
*offset, void *opaque,
return 0;
 
error = -ENOMEM;
-   larr = vmalloc((leaves + entries) * sizeof(void *));
+   /*
+* The extra 99 entries are not normally used, but are a buffer
+* zone in case the number of entries in the leaf is corrupt.
+* 99 is the maximum number of entries that can fit in a single
+* leaf block.
+*/
+   larr = vmalloc((leaves + entries + 99) * sizeof(void *));
if (!larr)
goto out;
darr = (const struct gfs2_dirent **)(larr + leaves);
@@ -1305,10 +1312,18 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 
*offset, void *opaque,
lf = (struct gfs2_leaf *)bh-b_data;
lfn = be64_to_cpu(lf-lf_next);
if (lf-lf_entries) {
+   entries2 += be16_to_cpu(lf-lf_entries);
dent = gfs2_dirent_scan(inode, bh-b_data, bh-b_size,
gfs2_dirent_gather, NULL, g);
error = PTR_ERR(dent);
-   if (IS_ERR(dent)) {
+   if (IS_ERR(dent))
+   goto out_kfree;
+   if (entries2 != g.offset) {
+   fs_warn(sdp, Number of entries corrupt in dir 
leaf %llu, 
+   entries2 (%u) != g.offset (%u)\n,
+   (u64)bh-b_blocknr, entries2, g.offset);
+   
+   error = -EIO;
goto out_kfree;
}
error = 0;
@@ -1318,6 +1333,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 
*offset, void *opaque,
}
} while(lfn);
 
+   BUG_ON(entries2 != entries);
error = do_filldir_main(ip, offset, opaque, filldir, darr,
entries, copied);
 out_kfree:
@@ -1401,6 +1417,7 @@ int gfs2_dir_read(struct inode *inode, u64 *offset, void 
*opaque,
  filldir_t filldir)
 {
struct gfs2_inode *dip = GFS2_I(inode);
+   struct gfs2_sbd *sdp = GFS2_SB(inode);
struct dirent_gather g;
const struct gfs2_dirent **darr, *dent;
struct buffer_head *dibh;
@@ -1423,8 +1440,8 @@ int gfs2_dir_read(struct inode *inode, u64 *offset, void 
*opaque,
return error;
 
error = -ENOMEM;
-   darr = kmalloc(dip-i_di.di_entries * sizeof(struct gfs2_dirent *),
-  GFP_KERNEL);
+   /* 96 is max number of dirents which can be stuffed into an inode */
+   darr = kmalloc(96 * sizeof(struct gfs2_dirent *), GFP_KERNEL);
if (darr) {
g.pdent = darr;
g.offset = 0;
@@ -1434,6 +1451,14 @@ int gfs2_dir_read(struct inode *inode, u64 *offset, void 
*opaque,
error = PTR_ERR(dent);
goto out;
}
+   if (dip-i_di.di_entries != g.offset) {
+   fs_warn(sdp, Number of entries corrupt in dir %llu, 
+   ip-i_di.di_entries (%u) != g.offset (%u)\n,
+   dip-i_num.no_addr, dip-i_di.di_entries,
+   g.offset);
+  

[GFS2] lockdump improvements

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5f8820960cf4fb621483d4a37c24939ad831bfe7
Commit: 5f8820960cf4fb621483d4a37c24939ad831bfe7
Parent: bdd19a22f85a7039e01accd8717eaec4addd9dfd
Author: Robert Peterson [EMAIL PROTECTED]
AuthorDate: Wed Apr 18 11:41:11 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:33 2007 +0100

[GFS2] lockdump improvements

The patch below consists of the following changes (in code order):

1. I fixed a minor compiler warning regarding the printing of
   a kernel symbol address.
2. I implemented a suggestion from Dave Teigland that moves
   the debugfs information for gfs2 into a subdirectory so
   we can easily expand our use of debugfs in the future.
   The current code keeps the glock information in:
   /debug/gfs2/fs
   With the patch, the new code keeps the glock information in:
   /debug/gfs2/fs/glock
   That will allow us to create more debugfs files in the future.
3. This fixes a bug whereby a failed mount attempt causes the
   debugfs file to not be deleted.  Failed mount attempts should
   always clean up after themselves, including deleting the
   debugfs file and/or directory.

Signed-off-by: Bob Peterson [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/glock.c  |   26 ++
 fs/gfs2/incore.h |3 ++-
 fs/gfs2/ops_fstype.c |1 +
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index b075f93..7988715 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1774,7 +1774,7 @@ static void gfs2_print_symbol(struct glock_iter *gi, 
const char *fmt,
 
if (gi) {
memset(buffer, 0, sizeof(buffer));
-   sprintf(buffer, %p, address);
+   sprintf(buffer, 0x%08lx, address);
print_dbg(gi, fmt, buffer);
}
else
@@ -2146,11 +2146,14 @@ static const struct file_operations gfs2_debug_fops = {
 
 int gfs2_create_debugfs_file(struct gfs2_sbd *sdp)
 {
-   sdp-debugfs_dentry = debugfs_create_file(sdp-sd_table_name,
- S_IFREG | S_IRUGO,
- gfs2_root, sdp,
- gfs2_debug_fops);
-   if (!sdp-debugfs_dentry)
+   sdp-debugfs_dir = debugfs_create_dir(sdp-sd_table_name, gfs2_root);
+   if (!sdp-debugfs_dir)
+   return -ENOMEM;
+   sdp-debugfs_dentry_glocks = debugfs_create_file(glocks,
+S_IFREG | S_IRUGO,
+sdp-debugfs_dir, sdp,
+gfs2_debug_fops);
+   if (!sdp-debugfs_dentry_glocks)
return -ENOMEM;
 
return 0;
@@ -2158,8 +2161,14 @@ int gfs2_create_debugfs_file(struct gfs2_sbd *sdp)
 
 void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp)
 {
-   if (sdp  sdp-debugfs_dentry)
-   debugfs_remove(sdp-debugfs_dentry);
+   if (sdp  sdp-debugfs_dir) {
+   if (sdp-debugfs_dentry_glocks) {
+   debugfs_remove(sdp-debugfs_dentry_glocks);
+   sdp-debugfs_dentry_glocks = NULL;
+   }
+   debugfs_remove(sdp-debugfs_dir);
+   sdp-debugfs_dir = NULL;
+   }
 }
 
 int gfs2_register_debugfs(void)
@@ -2171,4 +2180,5 @@ int gfs2_register_debugfs(void)
 void gfs2_unregister_debugfs(void)
 {
debugfs_remove(gfs2_root);
+   gfs2_root = NULL;
 }
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index fdf0470..d995441 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -609,7 +609,8 @@ struct gfs2_sbd {
 
unsigned long sd_last_warning;
struct vfsmount *sd_gfs2mnt;
-   struct dentry *debugfs_dentry; /* for debugfs */
+   struct dentry *debugfs_dir;/* debugfs directory */
+   struct dentry *debugfs_dentry_glocks; /* for debugfs */
 };
 
 #endif /* __INCORE_DOT_H__ */
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index ecb8b18..2c5f8e7 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -756,6 +756,7 @@ fail_lm:
 fail_sys:
gfs2_sys_fs_del(sdp);
 fail:
+   gfs2_delete_debugfs_file(sdp);
kfree(sdp);
sb-s_fs_info = NULL;
return error;
-
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


[DLM] fix mode munging

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7d3c1feb80913ba4253c3517d48b9b3741c44fc9
Commit: 7d3c1feb80913ba4253c3517d48b9b3741c44fc9
Parent: 5f8820960cf4fb621483d4a37c24939ad831bfe7
Author: David Teigland [EMAIL PROTECTED]
AuthorDate: Thu Apr 19 10:30:41 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:36 2007 +0100

[DLM] fix mode munging

There are flags to enable two specialized features in the dlm:
1. CONVDEADLK causes the dlm to resolve conversion deadlocks internally by
   changing the granted mode of locks to NL.
2. ALTPR/ALTCW cause the dlm to change the requested mode of locks to PR
   or CW to grant them if the normal requested mode can't be granted.

GFS direct i/o exercises both of these features, especially when mixed
with buffered i/o.  The dlm has problems with them.

The first problem is on the master node. If it demotes a lock as a part of
converting it, the actual step of converting the lock isn't being done
after the demotion, the lock is just left sitting on the granted queue
with a granted mode of NL.  I think the mistaken assumption was that the
call to grant_pending_locks() would grant it, but that function naturally
doesn't look at locks on the granted queue.

The second problem is on the process node.  If the master either demotes
or gives an altmode, the munging of the gr/rq modes is never done in the
process copy of the lock, leaving the master/process copies out of sync.

Signed-off-by: David Teigland [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/lock.c |   82 +++-
 1 files changed, 80 insertions(+), 2 deletions(-)

diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index eac54d2..d8d6e72 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -224,6 +224,16 @@ static inline int is_demoted(struct dlm_lkb *lkb)
return (lkb-lkb_sbflags  DLM_SBF_DEMOTED);
 }
 
+static inline int is_altmode(struct dlm_lkb *lkb)
+{
+   return (lkb-lkb_sbflags  DLM_SBF_ALTMODE);
+}
+
+static inline int is_granted(struct dlm_lkb *lkb)
+{
+   return (lkb-lkb_status == DLM_LKSTS_GRANTED);
+}
+
 static inline int is_remote(struct dlm_rsb *r)
 {
DLM_ASSERT(r-res_nodeid = 0, dlm_print_rsb(r););
@@ -1191,6 +1201,50 @@ static void grant_lock_pending(struct dlm_rsb *r, struct 
dlm_lkb *lkb)
queue_cast(r, lkb, 0);
 }
 
+/* The special CONVDEADLK, ALTPR and ALTCW flags allow the master to
+   change the granted/requested modes.  We're munging things accordingly in
+   the process copy.
+   CONVDEADLK: our grmode may have been forced down to NL to resolve a
+   conversion deadlock
+   ALTPR/ALTCW: our rqmode may have been changed to PR or CW to become
+   compatible with other granted locks */
+
+static void munge_demoted(struct dlm_lkb *lkb, struct dlm_message *ms)
+{
+   if (ms-m_type != DLM_MSG_CONVERT_REPLY) {
+   log_print(munge_demoted %x invalid reply type %d,
+ lkb-lkb_id, ms-m_type);
+   return;
+   }
+
+   if (lkb-lkb_rqmode == DLM_LOCK_IV || lkb-lkb_grmode == DLM_LOCK_IV) {
+   log_print(munge_demoted %x invalid modes gr %d rq %d,
+ lkb-lkb_id, lkb-lkb_grmode, lkb-lkb_rqmode);
+   return;
+   }
+
+   lkb-lkb_grmode = DLM_LOCK_NL;
+}
+
+static void munge_altmode(struct dlm_lkb *lkb, struct dlm_message *ms)
+{
+   if (ms-m_type != DLM_MSG_REQUEST_REPLY 
+   ms-m_type != DLM_MSG_GRANT) {
+   log_print(munge_altmode %x invalid reply type %d,
+ lkb-lkb_id, ms-m_type);
+   return;
+   }
+
+   if (lkb-lkb_exflags  DLM_LKF_ALTPR)
+   lkb-lkb_rqmode = DLM_LOCK_PR;
+   else if (lkb-lkb_exflags  DLM_LKF_ALTCW)
+   lkb-lkb_rqmode = DLM_LOCK_CW;
+   else {
+   log_print(munge_altmode invalid exflags %x, lkb-lkb_exflags);
+   dlm_print_lkb(lkb);
+   }
+}
+
 static inline int first_in_list(struct dlm_lkb *lkb, struct list_head *head)
 {
struct dlm_lkb *first = list_entry(head-next, struct dlm_lkb,
@@ -1965,9 +2019,24 @@ static int do_convert(struct dlm_rsb *r, struct dlm_lkb 
*lkb)
goto out;
}
 
-   if (can_be_queued(lkb)) {
-   if (is_demoted(lkb))
+   /* is_demoted() means the can_be_granted() above set the grmode
+  to NL, and left us on the granted queue.  This auto-demotion
+  (due to CONVDEADLK) might mean other locks, and/or this lock, are
+  now grantable.  We have to try to grant other converting locks
+  before we try again to grant this one. */
+
+   if (is_demoted(lkb)) {
+   grant_pending_convert(r, DLM_LOCK_IV);
+   if (_can_be_granted(r, lkb, 1)) {

[DLM] Fix dlm_lowcoms_stop hang

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2439fe50724e8693e8b933b3f8125d870bfbdb25
Commit: 2439fe50724e8693e8b933b3f8125d870bfbdb25
Parent: 7d3c1feb80913ba4253c3517d48b9b3741c44fc9
Author: Josef Bacik [EMAIL PROTECTED]
AuthorDate: Thu Apr 19 17:59:05 2007 -0400
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:38 2007 +0100

[DLM] Fix dlm_lowcoms_stop hang

When you attempt to release a lockspace in DLM, it will hang trying to down 
a
semaphore that has already been downed.  The attached patch fixes the 
problem.

Signed-off-by: Josef Bacik [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
Cc: Patrick Caulfield [EMAIL PROTECTED]
---
 fs/dlm/lowcomms.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 76399b7..2b32f3c 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1407,7 +1407,7 @@ void dlm_lowcomms_stop(void)
clean_writequeues();
 
for (i = 0; i  max_nodeid; i++) {
-   con = nodeid2con(i, 0);
+   con = __nodeid2con(i, 0);
if (con) {
close_connection(con, true);
if (con-othercon)
-
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


[DLM] Lowcomms nodeid range initialisation fixes

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=30d3a2373f171e62e4032819f55fed2ec887d0b8
Commit: 30d3a2373f171e62e4032819f55fed2ec887d0b8
Parent: 2439fe50724e8693e8b933b3f8125d870bfbdb25
Author: Patrick Caulfield [EMAIL PROTECTED]
AuthorDate: Mon Apr 23 16:26:21 2007 +0100
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:41 2007 +0100

[DLM] Lowcomms nodeid range  initialisation fixes

Fix a few range  initialization bugs in lowcomms.
- max_nodeid is really the highest nodeid encountered, so all loops must 
include
it in their iterations.
- clean dlm_local_count  connection_idr so we can do a clean restart.
- Remove a spurious BUG_ON

Signed-Off-By: Patrick Caulfield [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/lowcomms.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 2b32f3c..5c33233 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -219,7 +219,7 @@ static struct connection *assoc2con(int assoc_id)
struct connection *con;
 
down(connections_lock);
-   for (i=0; imax_nodeid; i++) {
+   for (i=0; i=max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (con  con-sctp_assoc == assoc_id) {
up(connections_lock);
@@ -467,12 +467,10 @@ static void process_sctp_notification(struct connection 
*con, struct msghdr *msg
parg.associd = sn-sn_assoc_change.sac_assoc_id;
ret = kernel_getsockopt(con-sock, IPPROTO_SCTP, 
SCTP_SOCKOPT_PEELOFF,
(void *)parg, parglen);
-   if (ret  0) {
+   if (ret) {
log_print(Can't peel off a socket for 
connection %d to node %d: err=%d\n,
  parg.associd, nodeid, ret);
-   return;
}
-
file = fget(parg.sd);
new_con-sock = SOCKET_I(file-f_dentry-d_inode);
add_sock(new_con-sock, new_con);
@@ -585,7 +583,6 @@ static int receive_from_sock(struct connection *con)
 
/* Process SCTP notifications */
if (msg.msg_flags  MSG_NOTIFICATION) {
-   BUG_ON(con-nodeid != 0);
msg.msg_control = incmsg;
msg.msg_controllen = sizeof(incmsg);
 
@@ -984,6 +981,7 @@ static void init_local(void)
struct sockaddr_storage sas, *addr;
int i;
 
+   dlm_local_count = 0;
for (i = 0; i  DLM_MAX_ADDR_COUNT - 1; i++) {
if (dlm_our_addr(sas, i))
break;
@@ -1350,8 +1348,8 @@ static void clean_writequeues(void)
 {
int nodeid;
 
-   for (nodeid = 1; nodeid  max_nodeid; nodeid++) {
-   struct connection *con = nodeid2con(nodeid, 0);
+   for (nodeid = 1; nodeid = max_nodeid; nodeid++) {
+   struct connection *con = __nodeid2con(nodeid, 0);
 
if (con)
clean_one_writequeue(con);
@@ -1394,7 +1392,7 @@ void dlm_lowcomms_stop(void)
   socket activity.
*/
down(connections_lock);
-   for (i = 0; i  max_nodeid; i++) {
+   for (i = 0; i = max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (con)
con-flags |= 0xFF;
@@ -1406,7 +1404,7 @@ void dlm_lowcomms_stop(void)
down(connections_lock);
clean_writequeues();
 
-   for (i = 0; i  max_nodeid; i++) {
+   for (i = 0; i = max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (con) {
close_connection(con, true);
@@ -1415,8 +1413,10 @@ void dlm_lowcomms_stop(void)
kmem_cache_free(con_cache, con);
}
}
+   max_nodeid = 0;
up(connections_lock);
kmem_cache_destroy(con_cache);
+   idr_init(connections_idr);
 }
 
 int dlm_lowcomms_start(void)
-
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


[GFS2] use lib/parser for parsing mount options

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=476c006be009d4121e401a9e9f49a3362a7a272f
Commit: 476c006be009d4121e401a9e9f49a3362a7a272f
Parent: 30d3a2373f171e62e4032819f55fed2ec887d0b8
Author: Josef Bacik [EMAIL PROTECTED]
AuthorDate: Mon Apr 23 11:55:39 2007 -0400
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:43 2007 +0100

[GFS2] use lib/parser for parsing mount options

This patch converts the mount option parsing to use the kernels lib/parser 
stuff
like all of the other filesystems.  I tested this and it works well.  Thank 
you,

Signed-off-by: Josef Bacik [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/mount.c |  239 +--
 1 files changed, 143 insertions(+), 96 deletions(-)

diff --git a/fs/gfs2/mount.c b/fs/gfs2/mount.c
index 32caecd..4864659 100644
--- a/fs/gfs2/mount.c
+++ b/fs/gfs2/mount.c
@@ -13,6 +13,7 @@
 #include linux/buffer_head.h
 #include linux/gfs2_ondisk.h
 #include linux/lm_interface.h
+#include linux/parser.h
 
 #include gfs2.h
 #include incore.h
@@ -20,6 +21,52 @@
 #include sys.h
 #include util.h
 
+enum {
+   Opt_lockproto,
+   Opt_locktable,
+   Opt_hostdata,
+   Opt_spectator,
+   Opt_ignore_local_fs,
+   Opt_localflocks,
+   Opt_localcaching,
+   Opt_debug,
+   Opt_nodebug,
+   Opt_upgrade,
+   Opt_num_glockd,
+   Opt_acl,
+   Opt_noacl,
+   Opt_quota_off,
+   Opt_quota_account,
+   Opt_quota_on,
+   Opt_suiddir,
+   Opt_nosuiddir,
+   Opt_data_writeback,
+   Opt_data_ordered,
+};
+
+static match_table_t tokens = {
+   {Opt_lockproto, lockproto=%s},
+   {Opt_locktable, locktable=%s},
+   {Opt_hostdata, hostdata=%s},
+   {Opt_spectator, spectator},
+   {Opt_ignore_local_fs, ignore_local_fs},
+   {Opt_localflocks, localflocks},
+   {Opt_localcaching, localcaching},
+   {Opt_debug, debug},
+   {Opt_nodebug, nodebug},
+   {Opt_upgrade, upgrade},
+   {Opt_num_glockd, num_glockd=%d},
+   {Opt_acl, acl},
+   {Opt_noacl, noacl},
+   {Opt_quota_off, quota=off},
+   {Opt_quota_account, quota=account},
+   {Opt_quota_on, quota=on},
+   {Opt_suiddir, suiddir},
+   {Opt_nosuiddir, nosuiddir},
+   {Opt_data_writeback, data=writeback},
+   {Opt_data_ordered, data=ordered}
+};
+
 /**
  * gfs2_mount_args - Parse mount options
  * @sdp:
@@ -54,146 +101,150 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, char 
*data_arg, int remount)
   process them */
 
for (options = data; (o = strsep(options, ,)); ) {
+   int token, option;
+   substring_t tmp[MAX_OPT_ARGS];
+
if (!*o)
continue;
 
-   v = strchr(o, '=');
-   if (v)
-   *v++ = 0;
+   token = match_token(o, tokens, tmp);
+   switch (token) {
+   case Opt_lockproto:
+   v = match_strdup(tmp[0]);
+   if (!v) {
+   fs_info(sdp, no memory for lockproto\n);
+   error = -ENOMEM;
+   goto out_error;
+   }
 
-   if (!strcmp(o, lockproto)) {
-   if (!v)
-   goto need_value;
-   if (remount  strcmp(v, args-ar_lockproto))
+   if (remount  strcmp(v, args-ar_lockproto)) {
+   kfree(v);
goto cant_remount;
+   }
+   
strncpy(args-ar_lockproto, v, GFS2_LOCKNAME_LEN);
args-ar_lockproto[GFS2_LOCKNAME_LEN - 1] = 0;
-   }
+   kfree(v);
+   break;
+   case Opt_locktable:
+   v = match_strdup(tmp[0]);
+   if (!v) {
+   fs_info(sdp, no memory for locktable\n);
+   error = -ENOMEM;
+   goto out_error;
+   }
 
-   else if (!strcmp(o, locktable)) {
-   if (!v)
-   goto need_value;
-   if (remount  strcmp(v, args-ar_locktable))
+   if (remount  strcmp(v, args-ar_locktable)) {
+   kfree(v);
goto cant_remount;
+   }
+
strncpy(args-ar_locktable, v, GFS2_LOCKNAME_LEN);
-   args-ar_locktable[GFS2_LOCKNAME_LEN - 1] = 0;
-   }
+   args-ar_locktable[GFS2_LOCKNAME_LEN - 1]  = 0;
+   kfree(v);
+ 

[GFS2] Patch to fix mmap of stuffed files

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bf126aee6d54fe1e509846abf3b27aba84c6d7ce
Commit: bf126aee6d54fe1e509846abf3b27aba84c6d7ce
Parent: 476c006be009d4121e401a9e9f49a3362a7a272f
Author: Steven Whitehouse [EMAIL PROTECTED]
AuthorDate: Fri Apr 20 09:18:30 2007 +0100
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:46 2007 +0100

[GFS2] Patch to fix mmap of stuffed files

If a stuffed file is mmaped and a page fault is generated at some offset
above the initial page, we need to create a zero page to hang the buffer
heads off before we can unstuff the file. This is a fix for bz #236087

Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/ops_address.c |   17 ++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 90c2879..30c1562 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -197,7 +197,19 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct 
page *page)
void *kaddr;
int error;
 
-   BUG_ON(page-index);
+   /*
+* Due to the order of unstuffing files and -nopage(), we can be
+* asked for a zero page in the case of a stuffed file being extended,
+* so we need to supply one here. It doesn't happen often.
+*/
+   if (unlikely(page-index)) {
+   kaddr = kmap_atomic(page, KM_USER0);
+   memset(kaddr, 0, PAGE_CACHE_SIZE);
+   kunmap_atomic(kaddr, KM_USER0);
+   flush_dcache_page(page);
+   SetPageUptodate(page);
+   return 0;
+   }
 
error = gfs2_meta_inode_buffer(ip, dibh);
if (error)
@@ -208,9 +220,8 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct 
page *page)
   ip-i_di.di_size);
memset(kaddr + ip-i_di.di_size, 0, PAGE_CACHE_SIZE - ip-i_di.di_size);
kunmap_atomic(kaddr, KM_USER0);
-
+   flush_dcache_page(page);
brelse(dibh);
-
SetPageUptodate(page);
 
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


[GFS2] printk warning fixes

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f391a4ead61e4510ff385815ddaf3c0777fbad1b
Commit: f391a4ead61e4510ff385815ddaf3c0777fbad1b
Parent: bf126aee6d54fe1e509846abf3b27aba84c6d7ce
Author: [EMAIL PROTECTED] [EMAIL PROTECTED]
AuthorDate: Wed Apr 25 21:08:02 2007 -0700
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:48 2007 +0100

[GFS2] printk warning fixes

alpha:

fs/gfs2/dir.c: In function 'gfs2_dir_read_leaf':
fs/gfs2/dir.c:1322: warning: format '%llu' expects type 'long long unsigned 
int', but argument 3 has type 'sector_t'
fs/gfs2/dir.c: In function 'gfs2_dir_read':
fs/gfs2/dir.c:1455: warning: format '%llu' expects type 'long long unsigned 
int', but argument 3 has type '__u64'

Cc: Steven Whitehouse [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/dir.c |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 6c3ed76..a96fa07 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -1319,9 +1319,11 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 
*offset, void *opaque,
if (IS_ERR(dent))
goto out_kfree;
if (entries2 != g.offset) {
-   fs_warn(sdp, Number of entries corrupt in dir 
leaf %llu, 
-   entries2 (%u) != g.offset (%u)\n,
-   (u64)bh-b_blocknr, entries2, g.offset);
+   fs_warn(sdp, Number of entries corrupt in dir 
+   leaf %llu, entries2 (%u) != 
+   g.offset (%u)\n,
+   (unsigned long long)bh-b_blocknr,
+   entries2, g.offset);

error = -EIO;
goto out_kfree;
@@ -1454,7 +1456,8 @@ int gfs2_dir_read(struct inode *inode, u64 *offset, void 
*opaque,
if (dip-i_di.di_entries != g.offset) {
fs_warn(sdp, Number of entries corrupt in dir %llu, 
ip-i_di.di_entries (%u) != g.offset (%u)\n,
-   dip-i_num.no_addr, dip-i_di.di_entries,
+   (unsigned long long)dip-i_num.no_addr,
+   dip-i_di.di_entries,
g.offset);
error = -EIO;
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


[DLM] lowcomms style

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=617e82e10ccf96a13eb2efd5eac4abef44a87d02
Commit: 617e82e10ccf96a13eb2efd5eac4abef44a87d02
Parent: f391a4ead61e4510ff385815ddaf3c0777fbad1b
Author: David Teigland [EMAIL PROTECTED]
AuthorDate: Thu Apr 26 13:46:49 2007 -0500
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:11:51 2007 +0100

[DLM] lowcomms style

Replace some printk with log_print, and fix some simple cases of lines
over 80.  Also, return -ENOTCONN if lowcomms_start fails due to no local
IP address being available.

Signed-off-by: David Teigland [EMAIL PROTECTED]
Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/dlm/lowcomms.c |   67 +---
 1 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 5c33233..27970a5 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -395,7 +395,8 @@ static void sctp_init_failed(void)
 }
 
 /* Something happened to an association */
-static void process_sctp_notification(struct connection *con, struct msghdr 
*msg, char *buf)
+static void process_sctp_notification(struct connection *con,
+ struct msghdr *msg, char *buf)
 {
union sctp_notification *sn = (union sctp_notification *)buf;
 
@@ -422,7 +423,7 @@ static void process_sctp_notification(struct connection 
*con, struct msghdr *msg
 */
if ((int)sn-sn_assoc_change.sac_assoc_id = 0) {
log_print(COMM_UP for invalid assoc ID %d,
- 
(int)sn-sn_assoc_change.sac_assoc_id);
+(int)sn-sn_assoc_change.sac_assoc_id);
sctp_init_failed();
return;
}
@@ -465,10 +466,12 @@ static void process_sctp_notification(struct connection 
*con, struct msghdr *msg
 
/* Peel off a new sock */
parg.associd = sn-sn_assoc_change.sac_assoc_id;
-   ret = kernel_getsockopt(con-sock, IPPROTO_SCTP, 
SCTP_SOCKOPT_PEELOFF,
+   ret = kernel_getsockopt(con-sock, IPPROTO_SCTP,
+   SCTP_SOCKOPT_PEELOFF,
(void *)parg, parglen);
if (ret) {
-   log_print(Can't peel off a socket for 
connection %d to node %d: err=%d\n,
+   log_print(Can't peel off a socket for 
+ connection %d to node %d: err=%d\n,
  parg.associd, nodeid, ret);
}
file = fget(parg.sd);
@@ -478,7 +481,7 @@ static void process_sctp_notification(struct connection 
*con, struct msghdr *msg
put_unused_fd(parg.sd);
 
log_print(got new/restarted association %d nodeid %d,
- (int)sn-sn_assoc_change.sac_assoc_id, 
nodeid);
+(int)sn-sn_assoc_change.sac_assoc_id, nodeid);
 
/* Send any pending writes */
clear_bit(CF_CONNECT_PENDING, new_con-flags);
@@ -587,7 +590,7 @@ static int receive_from_sock(struct connection *con)
msg.msg_controllen = sizeof(incmsg);
 
process_sctp_notification(con, msg,
- page_address(con-rx_page) + 
con-cb.base);
+   page_address(con-rx_page) + con-cb.base);
mutex_unlock(con-sock_mutex);
return 0;
}
@@ -601,10 +604,10 @@ static int receive_from_sock(struct connection *con)
  con-cb.base, con-cb.len,
  PAGE_CACHE_SIZE);
if (ret == -EBADMSG) {
-   printk(KERN_INFO dlm: lowcomms: addr=%p, base=%u, len=%u, 
-  iov_len=%u, iov_base[0]=%p, read=%d\n,
-  page_address(con-rx_page), con-cb.base, con-cb.len,
-  len, iov[0].iov_base, r);
+   log_print(lowcomms: addr=%p, base=%u, len=%u, 
+ iov_len=%u, iov_base[0]=%p, read=%d,
+ page_address(con-rx_page), con-cb.base, con-cb.len,
+ len, iov[0].iov_base, r);
}
if (ret  0)
goto out_close;
@@ -680,7 +683,7 @@ static int tcp_accept_from_sock(struct connection *con)
/* Get the new node's NODEID */
make_sockaddr(peeraddr, 0, len);
if (dlm_addr_to_nodeid(peeraddr, nodeid)) {
-   printk(dlm: connect from non cluster node\n);
+   log_print(connect 

[GFS2] Uncomment sprintf_symbol calling code

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=37fde8ca6c60ea61f5e9d7cb877c25ac60e74167
Commit: 37fde8ca6c60ea61f5e9d7cb877c25ac60e74167
Parent: 617e82e10ccf96a13eb2efd5eac4abef44a87d02
Author: Steven Whitehouse [EMAIL PROTECTED]
AuthorDate: Tue May 1 09:51:39 2007 +0100
Committer:  Steven Whitehouse [EMAIL PROTECTED]
CommitDate: Tue May 1 09:51:39 2007 +0100

[GFS2] Uncomment sprintf_symbol calling code

Now that the patch from -mm has gone upstream, we can uncomment the code
in GFS2 which uses sprintf_symbol.

Signed-off-by: Steven Whitehouse [EMAIL PROTECTED]
Cc: Robert Peterson [EMAIL PROTECTED]
---
 fs/gfs2/glock.c |   12 
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 7988715..1815429 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1763,22 +1763,10 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp, int wait)
 static void gfs2_print_symbol(struct glock_iter *gi, const char *fmt,
   unsigned long address)
 {
-/* when sprint_symbol becomes available in the new kernel, replace this */
-/* function with:
char buffer[KSYM_SYMBOL_LEN];
 
sprint_symbol(buffer, address);
print_dbg(gi, fmt, buffer);
-*/
-   char buffer[256];
-
-   if (gi) {
-   memset(buffer, 0, sizeof(buffer));
-   sprintf(buffer, 0x%08lx, address);
-   print_dbg(gi, fmt, buffer);
-   }
-   else
-   print_symbol(fmt, address);
 }
 
 /**
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fix up SLUB compile

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f9008ef38d5a6305d94bbdd8f20d68fc75c63b6
Commit: 0f9008ef38d5a6305d94bbdd8f20d68fc75c63b6
Parent: 5cefcab3db2b13093480f2a42bf081574dd72d3d
Author: Linus Torvalds [EMAIL PROTECTED]
AuthorDate: Mon May 7 12:31:58 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 12:31:58 2007 -0700

Fix up SLUB compile

The newly merged SLUB allocator patches had been generated before the
removal of struct subsystem, and ended up applying fine, but wouldn't
build based on the current tree as a result.

Fix up that merge error - not that SLUB is likely really ready for
showtime yet, but at least I can fix the trivial stuff.

Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/slub.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index a632348..5db3da5 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3418,7 +3418,7 @@ static int sysfs_slab_add(struct kmem_cache *s)
 * This is typically the case for debug situations. In that
 * case we can catch duplicate names easily.
 */
-   sysfs_remove_link(slab_subsys.kset.kobj, s-name);
+   sysfs_remove_link(slab_subsys.kobj, s-name);
name = s-name;
} else {
/*
@@ -3473,8 +3473,8 @@ static int sysfs_slab_alias(struct kmem_cache *s, const 
char *name)
/*
 * If we have a leftover link then remove it.
 */
-   sysfs_remove_link(slab_subsys.kset.kobj, name);
-   return sysfs_create_link(slab_subsys.kset.kobj,
+   sysfs_remove_link(slab_subsys.kobj, name);
+   return sysfs_create_link(slab_subsys.kobj,
s-kobj, 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


locks: trivial removal of unnecessary parentheses

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=226a998dbf3c6f9b85f67d08a52c5a2143ed9d88
Commit: 226a998dbf3c6f9b85f67d08a52c5a2143ed9d88
Parent: 94a05509a9e11806acd797153d03019706e466f1
Author: J. Bruce Fields [EMAIL PROTECTED]
AuthorDate: Wed Feb 14 14:25:00 2007 -0500
Committer:  J. Bruce Fields [EMAIL PROTECTED]
CommitDate: Mon Apr 16 13:40:37 2007 -0400

locks: trivial removal of unnecessary parentheses

Remove some unnecessary parentheses.

Signed-off-by: J. Bruce Fields [EMAIL PROTECTED]
---
 fs/locks.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/locks.c b/fs/locks.c
index 52a8100..1a00b8b 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1738,7 +1738,7 @@ again:
else {
for (;;) {
error = posix_lock_file(filp, file_lock);
-   if ((error != -EAGAIN) || (cmd == F_SETLK))
+   if (error != -EAGAIN || cmd == F_SETLK)
break;
error = wait_event_interruptible(file_lock-fl_wait,
!file_lock-fl_next);
@@ -1881,7 +1881,7 @@ again:
else {
for (;;) {
error = posix_lock_file(filp, file_lock);
-   if ((error != -EAGAIN) || (cmd == F_SETLK64))
+   if (error != -EAGAIN || cmd == F_SETLK64)
break;
error = wait_event_interruptible(file_lock-fl_wait,
!file_lock-fl_next);
-
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


locks: create posix-to-flock helper functions

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c2fa1b8a6c059dd08a802545fed3badc8df2adc1
Commit: c2fa1b8a6c059dd08a802545fed3badc8df2adc1
Parent: 226a998dbf3c6f9b85f67d08a52c5a2143ed9d88
Author: J. Bruce Fields [EMAIL PROTECTED]
AuthorDate: Tue Feb 20 16:10:11 2007 -0500
Committer:  J. Bruce Fields [EMAIL PROTECTED]
CommitDate: Mon Apr 16 13:40:37 2007 -0400

locks: create posix-to-flock helper functions

Factor out a bit of messy code by creating posix-to-flock counterparts
to the existing flock-to-posix helper functions.

Cc: Christoph Hellwig [EMAIL PROTECTED]
Signed-off-by: J. Bruce Fields [EMAIL PROTECTED]
---
 fs/locks.c |   61 +++
 1 files changed, 36 insertions(+), 25 deletions(-)

diff --git a/fs/locks.c b/fs/locks.c
index 1a00b8b..957775b 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1611,6 +1611,38 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int 
cmd)
return error;
 }
 
+static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl)
+{
+   flock-l_pid = fl-fl_pid;
+#if BITS_PER_LONG == 32
+   /*
+* Make sure we can represent the posix lock via
+* legacy 32bit flock.
+*/
+   if (fl-fl_start  OFFT_OFFSET_MAX)
+   return -EOVERFLOW;
+   if (fl-fl_end != OFFSET_MAX  fl-fl_end  OFFT_OFFSET_MAX)
+   return -EOVERFLOW;
+#endif
+   flock-l_start = fl-fl_start;
+   flock-l_len = fl-fl_end == OFFSET_MAX ? 0 :
+   fl-fl_end - fl-fl_start + 1;
+   flock-l_whence = 0;
+   return 0;
+}
+
+#if BITS_PER_LONG == 32
+static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl)
+{
+   flock-l_pid = fl-fl_pid;
+   flock-l_start = fl-fl_start;
+   flock-l_len = fl-fl_end == OFFSET_MAX ? 0 :
+   fl-fl_end - fl-fl_start + 1;
+   flock-l_whence = 0;
+   flock-l_type = fl-fl_type;
+}
+#endif
+
 /* Report the first existing lock that would conflict with l.
  * This implements the F_GETLK command of fcntl().
  */
@@ -1645,24 +1677,9 @@ int fcntl_getlk(struct file *filp, struct flock __user 
*l)
  
flock.l_type = F_UNLCK;
if (fl != NULL) {
-   flock.l_pid = fl-fl_pid;
-#if BITS_PER_LONG == 32
-   /*
-* Make sure we can represent the posix lock via
-* legacy 32bit flock.
-*/
-   error = -EOVERFLOW;
-   if (fl-fl_start  OFFT_OFFSET_MAX)
-   goto out;
-   if ((fl-fl_end != OFFSET_MAX)
-(fl-fl_end  OFFT_OFFSET_MAX))
+   error = posix_lock_to_flock(flock, fl);
+   if (error)
goto out;
-#endif
-   flock.l_start = fl-fl_start;
-   flock.l_len = fl-fl_end == OFFSET_MAX ? 0 :
-   fl-fl_end - fl-fl_start + 1;
-   flock.l_whence = 0;
-   flock.l_type = fl-fl_type;
}
error = -EFAULT;
if (!copy_to_user(l, flock, sizeof(flock)))
@@ -1798,14 +1815,8 @@ int fcntl_getlk64(struct file *filp, struct flock64 
__user *l)
}
  
flock.l_type = F_UNLCK;
-   if (fl != NULL) {
-   flock.l_pid = fl-fl_pid;
-   flock.l_start = fl-fl_start;
-   flock.l_len = fl-fl_end == OFFSET_MAX ? 0 :
-   fl-fl_end - fl-fl_start + 1;
-   flock.l_whence = 0;
-   flock.l_type = fl-fl_type;
-   }
+   if (fl != NULL)
+   posix_lock_to_flock64(flock, fl);
error = -EFAULT;
if (!copy_to_user(l, flock, sizeof(flock)))
error = 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


lockd: pass cookie in nlmsvc_testlock

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85f3f1b3f7a6197b51a2ab98d927517df730214c
Commit: 85f3f1b3f7a6197b51a2ab98d927517df730214c
Parent: 0e4ac9d93515b27fd7635332d73eae3192ed5d4e
Author: Marc Eshel [EMAIL PROTECTED]
AuthorDate: Tue Nov 28 16:27:06 2006 -0500
Committer:  J. Bruce Fields [EMAIL PROTECTED]
CommitDate: Sun May 6 20:38:50 2007 -0400

lockd: pass cookie in nlmsvc_testlock

Change NLM internal interface to pass more information for test lock; we
need this to make sure the cookie information is pushed down to the place
where we do request deferral, which is handled for testlock by the
following patch.

Signed-off-by: Marc Eshel [EMAIL PROTECTED]
Signed-off-by: J. Bruce Fields [EMAIL PROTECTED]
---
 fs/lockd/svc4proc.c |2 +-
 fs/lockd/svclock.c  |5 +++--
 fs/lockd/svcproc.c  |2 +-
 include/linux/lockd/lockd.h |4 ++--
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 47a66aa..a1bccad 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -99,7 +99,7 @@ nlm4svc_proc_test(struct svc_rqst *rqstp, struct nlm_args 
*argp,
return resp-status == nlm_drop_reply ? rpc_drop_reply 
:rpc_success;
 
/* Now check for conflicting locks */
-   resp-status = nlmsvc_testlock(file, argp-lock, resp-lock);
+   resp-status = nlmsvc_testlock(rqstp, file, argp-lock, resp-lock, 
resp-cookie);
 
dprintk(lockd: TEST4  status %d\n, ntohl(resp-status));
nlm_release_host(host);
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 6e74857..7ab2e60 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -442,8 +442,9 @@ out:
  * Test for presence of a conflicting lock.
  */
 __be32
-nlmsvc_testlock(struct nlm_file *file, struct nlm_lock *lock,
-  struct nlm_lock *conflock)
+nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
+   struct nlm_lock *lock, struct nlm_lock *conflock,
+   struct nlm_cookie *cookie)
 {
dprintk(lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n,

file-f_file-f_path.dentry-d_inode-i_sb-s_id,
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 31cb484..d13b827 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -127,7 +127,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp, struct nlm_args 
*argp,
return resp-status == nlm_drop_reply ? rpc_drop_reply 
:rpc_success;
 
/* Now check for conflicting locks */
-   resp-status = cast_status(nlmsvc_testlock(file, argp-lock, 
resp-lock));
+   resp-status = cast_status(nlmsvc_testlock(rqstp, file, argp-lock, 
resp-lock, resp-cookie));
 
dprintk(lockd: TEST  status %d vers %d\n,
ntohl(resp-status), rqstp-rq_vers);
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index d4c4de7..424c3de 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -195,8 +195,8 @@ typedef int   (*nlm_host_match_fn_t)(struct nlm_host *cur, 
struct nlm_host *ref)
 __be32   nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
struct nlm_lock *, int, struct 
nlm_cookie *);
 __be32   nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
-__be32   nlmsvc_testlock(struct nlm_file *, struct nlm_lock *,
-   struct nlm_lock *);
+__be32   nlmsvc_testlock(struct svc_rqst *, struct nlm_file *,
+   struct nlm_lock *, struct nlm_lock *, struct nlm_cookie 
*);
 __be32   nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
 unsigned longnlmsvc_retry_blocked(void);
 void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
-
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


lockd: handle test_lock deferrals

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5ea0d75037b93baa453b4d326c6319968fe91cea
Commit: 5ea0d75037b93baa453b4d326c6319968fe91cea
Parent: 85f3f1b3f7a6197b51a2ab98d927517df730214c
Author: Marc Eshel [EMAIL PROTECTED]
AuthorDate: Tue Nov 28 16:27:06 2006 -0500
Committer:  J. Bruce Fields [EMAIL PROTECTED]
CommitDate: Sun May 6 20:38:50 2007 -0400

lockd: handle test_lock deferrals

Rewrite nlmsvc_testlock() to use the new asynchronous interface: instead of
immediately doing a posix_test_lock(), we first look for a matching block.
If the subsequent test_lock returns anything other than -EINPROGRESS, we
then remove the block we've found and return the results.

If it returns -EINPROGRESS, then we defer the lock request.

In the case where the block we find in the first step has B_QUEUED set,
we bypass the vfs_test_lock entirely, instead using the block to decide how
to respond:
with nlm_lck_denied if B_TIMED_OUT is set.
with nlm_granted if B_GOT_CALLBACK is set.
by dropping if neither B_TIMED_OUT nor B_GOT_CALLBACK is set

Signed-off-by: Marc Eshel [EMAIL PROTECTED]
Signed-off-by: J. Bruce Fields [EMAIL PROTECTED]
---
 fs/lockd/svc4proc.c |2 +
 fs/lockd/svclock.c  |   84 +--
 fs/lockd/svcproc.c  |3 ++
 3 files changed, 73 insertions(+), 16 deletions(-)

diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index a1bccad..205d8be 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -100,6 +100,8 @@ nlm4svc_proc_test(struct svc_rqst *rqstp, struct nlm_args 
*argp,
 
/* Now check for conflicting locks */
resp-status = nlmsvc_testlock(rqstp, file, argp-lock, resp-lock, 
resp-cookie);
+   if (resp-status == nlm_drop_reply)
+   return rpc_drop_reply;
 
dprintk(lockd: TEST4  status %d\n, ntohl(resp-status));
nlm_release_host(host);
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 7ab2e60..b7a8174 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -173,7 +173,7 @@ found:
  */
 static inline struct nlm_block *
 nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_file *file,
-   struct nlm_lock *lock, struct nlm_cookie 
*cookie)
+   struct nlm_lock *lock, struct nlm_cookie *cookie)
 {
struct nlm_block*block;
struct nlm_host *host;
@@ -210,6 +210,7 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_file 
*file,
block-b_daemon = rqstp-rq_server;
block-b_host   = host;
block-b_file   = file;
+   block-b_fl = NULL;
file-f_count++;
 
/* Add to file's list of blocks */
@@ -446,6 +447,10 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file 
*file,
struct nlm_lock *lock, struct nlm_lock *conflock,
struct nlm_cookie *cookie)
 {
+   struct nlm_block*block = NULL;
+   int error;
+   __be32  ret;
+
dprintk(lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n,

file-f_file-f_path.dentry-d_inode-i_sb-s_id,
file-f_file-f_path.dentry-d_inode-i_ino,
@@ -453,22 +458,70 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file 
*file,
(long long)lock-fl.fl_start,
(long long)lock-fl.fl_end);
 
-   if (posix_test_lock(file-f_file, lock-fl)) {
-   dprintk(lockd: conflicting lock(ty=%d, %Ld-%Ld)\n,
-   lock-fl.fl_type,
-   (long long)lock-fl.fl_start,
-   (long long)lock-fl.fl_end);
-   conflock-caller = somehost;  /* FIXME */
-   conflock-len = strlen(conflock-caller);
-   conflock-oh.len = 0;   /* don't return OH info */
-   conflock-svid = lock-fl.fl_pid;
-   conflock-fl.fl_type = lock-fl.fl_type;
-   conflock-fl.fl_start = lock-fl.fl_start;
-   conflock-fl.fl_end = lock-fl.fl_end;
-   return nlm_lck_denied;
+   /* Get existing block (in case client is busy-waiting) */
+   block = nlmsvc_lookup_block(file, lock);
+
+   if (block == NULL) {
+   struct file_lock *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
+
+   if (conf == NULL)
+   return nlm_granted;
+   block = nlmsvc_create_block(rqstp, file, lock, cookie);
+   if (block == NULL) {
+   kfree(conf);
+   return nlm_granted;
+   }
+   block-b_fl = conf;
+   }
+   if (block-b_flags  B_QUEUED) {
+   dprintk(lockd: nlmsvc_testlock deferred block %p flags %d fl 
%p\n,
+   block, 

lockd: always preallocate block in nlmsvc_lock()

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f812048020282fdfa9b72a6cf539c33b6df1fd07
Commit: f812048020282fdfa9b72a6cf539c33b6df1fd07
Parent: 5ea0d75037b93baa453b4d326c6319968fe91cea
Author: Marc Eshel [EMAIL PROTECTED]
AuthorDate: Tue Dec 5 23:48:10 2006 -0500
Committer:  J. Bruce Fields [EMAIL PROTECTED]
CommitDate: Sun May 6 20:38:50 2007 -0400

lockd: always preallocate block in nlmsvc_lock()

Normally we could skip ever having to allocate a block in the case where
the client asks for a non-blocking lock, or asks for a blocking lock that
succeeds immediately.

However we're going to want to always look up a block first in order to
check whether we're revisiting a deferred lock call, and to be prepared to
handle the case where the filesystem returns -EINPROGRESS--in that case we
want to make sure the lock we've given the filesystem is the one embedded
in the block that we'll use to track the deferred request.

Signed-off-by: Marc Eshel [EMAIL PROTECTED]
Signed-off-by: J. Bruce Fields [EMAIL PROTECTED]
---
 fs/lockd/svclock.c |   34 +++---
 1 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index b7a8174..0d7398e 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -365,7 +365,7 @@ __be32
 nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
struct nlm_lock *lock, int wait, struct nlm_cookie 
*cookie)
 {
-   struct nlm_block*block, *newblock = NULL;
+   struct nlm_block*block = NULL;
int error;
__be32  ret;
 
@@ -378,17 +378,20 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
wait);
 
 
-   lock-fl.fl_flags = ~FL_SLEEP;
-again:
/* Lock file against concurrent access */
mutex_lock(file-f_mutex);
-   /* Get existing block (in case client is busy-waiting) */
+   /* Get existing block (in case client is busy-waiting)
+* or create new block
+*/
block = nlmsvc_lookup_block(file, lock);
if (block == NULL) {
-   if (newblock != NULL)
-   lock = newblock-b_call-a_args.lock;
-   } else
+   block = nlmsvc_create_block(rqstp, file, lock, cookie);
+   ret = nlm_lck_denied_nolocks;
+   if (block == NULL)
+   goto out;
lock = block-b_call-a_args.lock;
+   } else
+   lock-fl.fl_flags = ~FL_SLEEP;
 
error = posix_lock_file(file-f_file, lock-fl, NULL);
lock-fl.fl_flags = ~FL_SLEEP;
@@ -414,26 +417,11 @@ again:
goto out;
 
ret = nlm_lck_blocked;
-   if (block != NULL)
-   goto out;
-
-   /* If we don't have a block, create and initialize it. Then
-* retry because we may have slept in kmalloc. */
-   /* We have to release f_mutex as nlmsvc_create_block may try to
-* to claim it while doing host garbage collection */
-   if (newblock == NULL) {
-   mutex_unlock(file-f_mutex);
-   dprintk(lockd: blocking on this lock (allocating).\n);
-   if (!(newblock = nlmsvc_create_block(rqstp, file, lock, 
cookie)))
-   return nlm_lck_denied_nolocks;
-   goto again;
-   }
 
/* Append to list of blocked */
-   nlmsvc_insert_block(newblock, NLM_NEVER);
+   nlmsvc_insert_block(block, NLM_NEVER);
 out:
mutex_unlock(file-f_mutex);
-   nlmsvc_release_block(newblock);
nlmsvc_release_block(block);
dprintk(lockd: nlmsvc_lock returned %u\n, ret);
return ret;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


lockd: add code to handle deferred lock requests

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1a8322b2b02071b0c7ac37a28357b93e6362f13e
Commit: 1a8322b2b02071b0c7ac37a28357b93e6362f13e
Parent: f812048020282fdfa9b72a6cf539c33b6df1fd07
Author: Marc Eshel [EMAIL PROTECTED]
AuthorDate: Tue Nov 28 16:27:06 2006 -0500
Committer:  J. Bruce Fields [EMAIL PROTECTED]
CommitDate: Sun May 6 20:38:50 2007 -0400

lockd: add code to handle deferred lock requests

Rewrite nlmsvc_lock() to use the asynchronous interface.

As with testlock, we answer nlm requests in nlmsvc_lock by first looking up
the block and then using the results we find in the block if B_QUEUED is
set, and calling vfs_lock_file() otherwise.

If this a new lock request and we get -EINPROGRESS return on a non-blocking
request then we defer the request.

Also modify nlmsvc_unlock() to call the filesystem method if appropriate.

Signed-off-by: Marc Eshel [EMAIL PROTECTED]
Signed-off-by: J. Bruce Fields [EMAIL PROTECTED]
---
 fs/lockd/svc4proc.c |2 ++
 fs/lockd/svclock.c  |   41 +++--
 fs/lockd/svcproc.c  |2 ++
 fs/lockd/svcsubs.c  |2 +-
 4 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 205d8be..bf27b6c 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -145,6 +145,8 @@ nlm4svc_proc_lock(struct svc_rqst *rqstp, struct nlm_args 
*argp,
/* Now try to lock the file */
resp-status = nlmsvc_lock(rqstp, file, argp-lock,
argp-block, argp-cookie);
+   if (resp-status == nlm_drop_reply)
+   return rpc_drop_reply;
 
dprintk(lockd: LOCK  status %d\n, ntohl(resp-status));
nlm_release_host(host);
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 0d7398e..b3efa45 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -393,17 +393,43 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
} else
lock-fl.fl_flags = ~FL_SLEEP;
 
-   error = posix_lock_file(file-f_file, lock-fl, NULL);
-   lock-fl.fl_flags = ~FL_SLEEP;
+   if (block-b_flags  B_QUEUED) {
+   dprintk(lockd: nlmsvc_lock deferred block %p flags %d\n,
+   block, block-b_flags);
+   if (block-b_granted) {
+   nlmsvc_unlink_block(block);
+   ret = nlm_granted;
+   goto out;
+   }
+   if (block-b_flags  B_TIMED_OUT) {
+   nlmsvc_unlink_block(block);
+   ret = nlm_lck_denied;
+   goto out;
+   }
+   ret = nlm_drop_reply;
+   goto out;
+   }
 
-   dprintk(lockd: posix_lock_file returned %d\n, error);
+   if (!wait)
+   lock-fl.fl_flags = ~FL_SLEEP;
+   error = vfs_lock_file(file-f_file, F_SETLK, lock-fl, NULL);
+   lock-fl.fl_flags = ~FL_SLEEP;
 
+   dprintk(lockd: vfs_lock_file returned %d\n, error);
switch(error) {
case 0:
ret = nlm_granted;
goto out;
case -EAGAIN:
+   ret = nlm_lck_denied;
break;
+   case -EINPROGRESS:
+   if (wait)
+   break;
+   /* Filesystem lock operation is in progress
+  Add it to the queue waiting for callback */
+   ret = nlmsvc_defer_lock_rqst(rqstp, block);
+   goto out;
case -EDEADLK:
ret = nlm_deadlock;
goto out;
@@ -535,7 +561,7 @@ nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock)
nlmsvc_cancel_blocked(file, lock);
 
lock-fl.fl_type = F_UNLCK;
-   error = posix_lock_file(file-f_file, lock-fl, NULL);
+   error = vfs_lock_file(file-f_file, F_SETLK, lock-fl, NULL);
 
return (error  0)? nlm_lck_denied_nolocks : nlm_granted;
 }
@@ -564,6 +590,8 @@ nlmsvc_cancel_blocked(struct nlm_file *file, struct 
nlm_lock *lock)
block = nlmsvc_lookup_block(file, lock);
mutex_unlock(file-f_mutex);
if (block != NULL) {
+   vfs_cancel_lock(block-b_file-f_file,
+   block-b_call-a_args.lock.fl);
status = nlmsvc_unlink_block(block);
nlmsvc_release_block(block);
}
@@ -697,14 +725,15 @@ nlmsvc_grant_blocked(struct nlm_block *block)
 
/* Try the lock operation again */
lock-fl.fl_flags |= FL_SLEEP;
-   error = posix_lock_file(file-f_file, lock-fl, NULL);
+   error = vfs_lock_file(file-f_file, F_SETLK, lock-fl, NULL);
lock-fl.fl_flags = ~FL_SLEEP;
 
switch (error) {

gfs2: nfs lock support for gfs2

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=586759f03e2e9031ac5589912a51a909ed53c30a
Commit: 586759f03e2e9031ac5589912a51a909ed53c30a
Parent: 1a8322b2b02071b0c7ac37a28357b93e6362f13e
Author: Marc Eshel [EMAIL PROTECTED]
AuthorDate: Tue Nov 14 16:37:25 2006 -0500
Committer:  J. Bruce Fields [EMAIL PROTECTED]
CommitDate: Sun May 6 20:38:50 2007 -0400

gfs2: nfs lock support for gfs2

Add NFS lock support to GFS2.

Signed-off-by: Marc Eshel [EMAIL PROTECTED]
Signed-off-by: J. Bruce Fields [EMAIL PROTECTED]
Acked-by: Steven Whitehouse [EMAIL PROTECTED]
---
 fs/gfs2/locking/dlm/plock.c |  109 +++
 fs/gfs2/ops_file.c  |5 ++
 2 files changed, 104 insertions(+), 10 deletions(-)

diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c
index 1dd4215..f82495e 100644
--- a/fs/gfs2/locking/dlm/plock.c
+++ b/fs/gfs2/locking/dlm/plock.c
@@ -25,6 +25,15 @@ struct plock_op {
struct gdlm_plock_info info;
 };
 
+struct plock_xop {
+   struct plock_op xop;
+   void *callback;
+   void *fl;
+   void *file;
+   struct file_lock flc;
+};
+
+
 static inline void set_version(struct gdlm_plock_info *info)
 {
info-version[0] = GDLM_PLOCK_VERSION_MAJOR;
@@ -64,12 +73,14 @@ int gdlm_plock(void *lockspace, struct lm_lockname *name,
 {
struct gdlm_ls *ls = lockspace;
struct plock_op *op;
+   struct plock_xop *xop;
int rv;
 
-   op = kzalloc(sizeof(*op), GFP_KERNEL);
-   if (!op)
+   xop = kzalloc(sizeof(*xop), GFP_KERNEL);
+   if (!xop)
return -ENOMEM;
 
+   op = xop-xop;
op-info.optype = GDLM_PLOCK_OP_LOCK;
op-info.pid= fl-fl_pid;
op-info.ex = (fl-fl_type == F_WRLCK);
@@ -79,9 +90,21 @@ int gdlm_plock(void *lockspace, struct lm_lockname *name,
op-info.start  = fl-fl_start;
op-info.end= fl-fl_end;
op-info.owner  = (__u64)(long) fl-fl_owner;
+   if (fl-fl_lmops  fl-fl_lmops-fl_grant) {
+   xop-callback   = fl-fl_lmops-fl_grant;
+   locks_init_lock(xop-flc);
+   locks_copy_lock(xop-flc, fl);
+   xop-fl = fl;
+   xop-file   = file;
+   } else
+   xop-callback   = NULL;
 
send_op(op);
-   wait_event(recv_wq, (op-done != 0));
+
+   if (xop-callback == NULL)
+   wait_event(recv_wq, (op-done != 0));
+   else
+   return -EINPROGRESS;
 
spin_lock(ops_lock);
if (!list_empty(op-list)) {
@@ -99,7 +122,63 @@ int gdlm_plock(void *lockspace, struct lm_lockname *name,
  (unsigned long long)name-ln_number);
}
 
-   kfree(op);
+   kfree(xop);
+   return rv;
+}
+
+/* Returns failure iff a succesful lock operation should be canceled */
+static int gdlm_plock_callback(struct plock_op *op)
+{
+   struct file *file;
+   struct file_lock *fl;
+   struct file_lock *flc;
+   int (*notify)(void *, void *, int) = NULL;
+   struct plock_xop *xop = (struct plock_xop *)op;
+   int rv = 0;
+
+   spin_lock(ops_lock);
+   if (!list_empty(op-list)) {
+   printk(KERN_INFO plock op on list\n);
+   list_del(op-list);
+   }
+   spin_unlock(ops_lock);
+
+   /* check if the following 2 are still valid or make a copy */
+   file = xop-file;
+   flc = xop-flc;
+   fl = xop-fl;
+   notify = xop-callback;
+
+   if (op-info.rv) {
+   notify(flc, NULL, op-info.rv);
+   goto out;
+   }
+
+   /* got fs lock; bookkeep locally as well: */
+   flc-fl_flags = ~FL_SLEEP;
+   if (posix_lock_file(file, flc, NULL)) {
+   /*
+* This can only happen in the case of kmalloc() failure.
+* The filesystem's own lock is the authoritative lock,
+* so a failure to get the lock locally is not a disaster.
+* As long as GFS cannot reliably cancel locks (especially
+* in a low-memory situation), we're better off ignoring
+* this failure than trying to recover.
+*/
+   log_error(gdlm_plock: vfs lock error file %p fl %p,
+   file, fl);
+   }
+
+   rv = notify(flc, NULL, 0);
+   if (rv) {
+   /* XXX: We need to cancel the fs lock here: */
+   printk(gfs2 lock granted after lock request failed;
+dangling lock!\n);
+   goto out;
+   }
+
+out:
+   kfree(xop);
return rv;
 }
 
@@ -138,6 +217,9 @@ int gdlm_punlock(void *lockspace, struct lm_lockname *name,
 
rv = op-info.rv;
 
+   if (rv == -ENOENT)
+   rv = 0;
+
kfree(op);
  

[IA64] Itanium MC Error Injection Tool: Kernel configuration

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e9ef08bdc189e98610bc4b9a6e6f19bc3793b2c8
Commit: e9ef08bdc189e98610bc4b9a6e6f19bc3793b2c8
Parent: 5263bf65d6342e12ab716db8e529501670979321
Author: Fenghua Yu [EMAIL PROTECTED]
AuthorDate: Fri Dec 8 16:06:01 2006 -0800
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Mon Jan 29 15:25:49 2007 -0800

[IA64] Itanium MC Error Injection Tool: Kernel configuration

This patch has kenrel configuration changes for the MC Error Injection
Tool.

Signed-off-by: Fenghua Yu [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 arch/ia64/Kconfig   |   10 ++
 arch/ia64/defconfig |1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index fcacfe2..f1e7cc1 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -429,6 +429,16 @@ config IA64_PALINFO
  To use this option, you have to ensure that the /proc file system
  support (CONFIG_PROC_FS) is enabled, too.
 
+config IA64_MC_ERR_INJECT
+   tristate MC error injection support
+   help
+ Selets whether support for MC error injection. By enabling the
+ support, kernel provide sysfs interface for user application to
+ call MC error injection PAL procedure to inject various errors.
+ This is a useful tool for MCA testing.
+
+ If you're unsure, do not select this option.
+
 config SGI_SN
def_bool y if (IA64_SGI_SN2 || IA64_GENERIC)
 
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index 9001b3f..327e1f5 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -144,6 +144,7 @@ CONFIG_COMPAT=y
 CONFIG_IA64_MCA_RECOVERY=y
 CONFIG_PERFMON=y
 CONFIG_IA64_PALINFO=y
+# CONFIG_MC_ERR_INJECT is not set
 CONFIG_SGI_SN=y
 
 #
-
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


[IA64] Itanium MC Error Injection Tool: Doc and sample application

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bf6285278418f1dc6f07296bbb286da0bfe26d5d
Commit: bf6285278418f1dc6f07296bbb286da0bfe26d5d
Parent: e9ef08bdc189e98610bc4b9a6e6f19bc3793b2c8
Author: Fenghua Yu [EMAIL PROTECTED]
AuthorDate: Fri Dec 8 16:14:22 2006 -0800
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Mon Jan 29 15:26:19 2007 -0800

[IA64] Itanium MC Error Injection Tool: Doc and sample application

This patch contains a documention and sample application. Since the sample
application has ~1000 lines of code, it might not be suitable in a kernel
documention in kenrel tree. If you think this is not good place to hold
the sample application, please let me know and I'm open to other choices
e.g. sourceforge etc.

Signed-off-by: Fenghua Yu [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 Documentation/ia64/err_inject.txt | 1068 +
 1 files changed, 1068 insertions(+), 0 deletions(-)

diff --git a/Documentation/ia64/err_inject.txt 
b/Documentation/ia64/err_inject.txt
new file mode 100644
index 000..26487c1
--- /dev/null
+++ b/Documentation/ia64/err_inject.txt
@@ -0,0 +1,1068 @@
+
+IPF Machine Check (MC) error inject tool
+
+
+IPF Machine Check (MC) error inject tool is used to inject MC
+errors from Linux. The tool is a test bed for IPF MC work flow including
+hardware correctable error handling, OS recoverable error handling, MC
+event logging, etc.
+
+The tool includes two parts: a kernel driver and a user application
+sample. The driver provides interface to PAL to inject error
+and query error injection capabilities. The driver code is in
+arch/ia64/kernel/err_inject.c. The application sample (shown below)
+provides a combination of various errors and calls the driver's interface
+(sysfs interface) to inject errors or query error injection capabilities.
+
+The tool can be used to test Intel IPF machine MC handling capabilities.
+It's especially useful for people who can not access hardware MC injection
+tool to inject error. It's also very useful to integrate with other
+software test suits to do stressful testing on IPF.
+
+Below is a sample application as part of the whole tool. The sample
+can be used as a working test tool. Or it can be expanded to include
+more features. It also can be a integrated into a libary or other user
+application to have more thorough test.
+
+The sample application takes err.conf as error configuation input. Gcc
+compiles the code. After you install err_inject driver, you can run
+this sample application to inject errors.
+
+Errata: Itanium 2 Processors Specification Update lists some errata against
+the pal_mc_error_inject PAL procedure. The following err.conf has been tested
+on latest Montecito PAL.
+
+err.conf:
+
+#This is configuration file for err_inject_tool.
+#The format of the each line is:
+#cpu, loop, interval, err_type_info, err_struct_info, err_data_buffer
+#where
+#  cpu: logical cpu number the error will be inject in.
+#  loop: times the error will be injected.
+#  interval: In second. every so often one error is injected.
+#  err_type_info, err_struct_info: PAL parameters.
+#
+#Note: All values are hex w/o or w/ 0x prefix.
+
+
+#On cpu2, inject only total 0x10 errors, interval 5 seconds
+#corrected, data cache, hier-2, physical addr(assigned by tool code).
+#working on Montecito latest PAL.
+2, 10, 5, 4101, 95
+
+#On cpu4, inject and consume total 0x10 errors, interval 5 seconds
+#corrected, data cache, hier-2, physical addr(assigned by tool code).
+#working on Montecito latest PAL.
+4, 10, 5, 4109, 95
+
+#On cpu15, inject and consume total 0x10 errors, interval 5 seconds
+#recoverable, DTR0, hier-2.
+#working on Montecito latest PAL.
+0xf, 0x10, 5, 4249, 15
+
+The sample application source code:
+
+err_injection_tool.c:
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Copyright (C) 2006 Intel Co
+ * Fenghua Yu [EMAIL PROTECTED]
+ *
+ */
+#include sys/types.h
+#include sys/stat.h
+#include fcntl.h
+#include stdio.h
+#include sched.h
+#include unistd.h
+#include stdlib.h
+#include stdarg.h
+#include string.h
+#include errno.h
+#include 

[IA64] Itanium MC Error Injection Tool: Driver sysfs interface

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=62fa562af36d32431ac8d7432b2c3ffbb7cf82df
Commit: 62fa562af36d32431ac8d7432b2c3ffbb7cf82df
Parent: bf6285278418f1dc6f07296bbb286da0bfe26d5d
Author: Fenghua Yu [EMAIL PROTECTED]
AuthorDate: Fri Dec 8 16:15:16 2006 -0800
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Mon Jan 29 15:26:40 2007 -0800

[IA64] Itanium MC Error Injection Tool: Driver sysfs interface

This kernel driver patch provides sysfs interface for user application to
call pal_mc_error_inject() procedure.

Signed-off-by: Fenghua Yu [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 arch/ia64/kernel/err_inject.c |  293 +
 1 files changed, 293 insertions(+), 0 deletions(-)

diff --git a/arch/ia64/kernel/err_inject.c b/arch/ia64/kernel/err_inject.c
new file mode 100644
index 000..d3e9f33
--- /dev/null
+++ b/arch/ia64/kernel/err_inject.c
@@ -0,0 +1,293 @@
+/*
+ * err_inject.c -
+ * 1.) Inject errors to a processor.
+ * 2.) Query error injection capabilities.
+ * This driver along with user space code can be acting as an error
+ * injection tool.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Written by: Fenghua Yu [EMAIL PROTECTED], Intel Corporation
+ * Copyright (C) 2006, Intel Corp.  All rights reserved.
+ *
+ */
+#include linux/sysdev.h
+#include linux/init.h
+#include linux/mm.h
+#include linux/cpu.h
+#include linux/module.h
+
+#define ERR_INJ_DEBUG
+
+#define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte;
+
+#define define_one_ro(name)\
+static SYSDEV_ATTR(name, 0444, show_##name, NULL)
+
+#define define_one_rw(name)\
+static SYSDEV_ATTR(name, 0644, show_##name, store_##name)
+
+static u64 call_start[NR_CPUS];
+static u64 phys_addr[NR_CPUS];
+static u64 err_type_info[NR_CPUS];
+static u64 err_struct_info[NR_CPUS];
+static struct {
+   u64 data1;
+   u64 data2;
+   u64 data3;
+} __attribute__((__aligned__(16))) err_data_buffer[NR_CPUS];
+static s64 status[NR_CPUS];
+static u64 capabilities[NR_CPUS];
+static u64 resources[NR_CPUS];
+
+#define show(name) \
+static ssize_t 
\
+show_##name(struct sys_device *dev, char *buf) \
+{  \
+   u32 cpu=dev-id;\
+   return sprintf(buf, %lx\n, name[cpu]);\
+}
+
+#define store(name)\
+static ssize_t 
\
+store_##name(struct sys_device *dev, const char *buf, size_t size) \
+{  \
+   unsigned int cpu=dev-id;   \
+   name[cpu] = simple_strtoull(buf, NULL, 16); \
+   return size;\
+}
+
+show(call_start)
+
+/* It's user's responsibility to call the PAL procedure on a specific
+ * processor. The cpu number in driver is only used for storing data.
+ */
+static ssize_t
+store_call_start(struct sys_device *dev, const char *buf, size_t size)
+{
+   unsigned int cpu=dev-id;
+   unsigned long call_start = simple_strtoull(buf, NULL, 16);
+
+#ifdef ERR_INJ_DEBUG
+   printk(KERN_DEBUG pal_mc_err_inject for cpu%d:\n, cpu);
+   printk(KERN_DEBUG err_type_info=%lx,\n, err_type_info[cpu]);
+   printk(KERN_DEBUG err_struct_info=%lx,\n, err_struct_info[cpu]);
+   printk(KERN_DEBUG err_data_buffer=%lx, %lx, %lx.\n,
+ err_data_buffer[cpu].data1,
+ err_data_buffer[cpu].data2,
+ err_data_buffer[cpu].data3);
+#endif
+   switch (call_start) {
+   case 0: /* Do nothing. */
+   break;
+   case 1: /* Call pal_mc_error_inject in physical mode. */
+   status[cpu]=ia64_pal_mc_error_inject_phys(err_type_info[cpu],

[IA64] Itanium MC Error Injection Tool: Makefile changes

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=539d517ad10bbaac2c04e0ee22916a360c5bcc0d
Commit: 539d517ad10bbaac2c04e0ee22916a360c5bcc0d
Parent: 62fa562af36d32431ac8d7432b2c3ffbb7cf82df
Author: Fenghua Yu [EMAIL PROTECTED]
AuthorDate: Fri Dec 8 16:16:24 2006 -0800
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Mon Jan 29 15:27:07 2007 -0800

[IA64] Itanium MC Error Injection Tool: Makefile changes

This patch has Makefile changes.

Signed-off-by: Fenghua Yu [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 arch/ia64/kernel/Makefile |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index 098ee60..33e5a59 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o
 obj-$(CONFIG_AUDIT)+= audit.o
 obj-$(CONFIG_PCI_MSI)  += msi_ia64.o
 mca_recovery-y += mca_drv.o mca_drv_asm.o
+obj-$(CONFIG_IA64_MC_ERR_INJECT)+= err_inject.o
 
 obj-$(CONFIG_IA64_ESI) += esi.o
 ifneq ($(CONFIG_IA64_ESI),)
-
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


[IA64] Itanium MC Error Injection Tool: pal_mc_error_inject() interface

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1138b7e2d40711b024768034beb64885994271e4
Commit: 1138b7e2d40711b024768034beb64885994271e4
Parent: 539d517ad10bbaac2c04e0ee22916a360c5bcc0d
Author: Fenghua Yu [EMAIL PROTECTED]
AuthorDate: Fri Dec 8 16:17:31 2006 -0800
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Mon Jan 29 15:29:56 2007 -0800

[IA64] Itanium MC Error Injection Tool: pal_mc_error_inject() interface

This patch implements pal_mc_error_inject() interface in kernel. Both 
physical
mode and virtual mode are supported.

Signed-off-by: Fenghua Yu [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 include/asm-ia64/pal.h |   33 +
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index bc76815..56e9210 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -89,6 +89,8 @@
 #define PAL_GET_PSTATE_TYPE_AVGNORESET 2
 #define PAL_GET_PSTATE_TYPE_INSTANT3
 
+#define PAL_MC_ERROR_INJECT276 /* Injects processor error or returns 
injection capabilities */
+
 #ifndef __ASSEMBLY__
 
 #include linux/types.h
@@ -1234,6 +1236,37 @@ ia64_pal_mc_error_info (u64 info_index, u64 type_index, 
u64 *size, u64 *error_in
return iprv.status;
 }
 
+/* Injects the requested processor error or returns info on
+ * supported injection capabilities for current processor implementation
+ */
+static inline s64
+ia64_pal_mc_error_inject_phys (u64 err_type_info, u64 err_struct_info,
+   u64 err_data_buffer, u64 *capabilities, u64 *resources)
+{
+   struct ia64_pal_retval iprv;
+   PAL_CALL_PHYS_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
+ err_struct_info, err_data_buffer);
+   if (capabilities)
+   *capabilities= iprv.v0;
+   if (resources)
+   *resources= iprv.v1;
+   return iprv.status;
+}
+
+static inline s64
+ia64_pal_mc_error_inject_virt (u64 err_type_info, u64 err_struct_info,
+   u64 err_data_buffer, u64 *capabilities, u64 *resources)
+{
+   struct ia64_pal_retval iprv;
+   PAL_CALL_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info,
+ err_struct_info, err_data_buffer);
+   if (capabilities)
+   *capabilities= iprv.v0;
+   if (resources)
+   *resources= iprv.v1;
+   return iprv.status;
+}
+
 /* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK 
willnot
  * attempt to correct any expected machine checks.
  */
-
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


[IA64] Fix example error injection program

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e1b43bd556a611584a65f529e5077c1b54ace4f7
Commit: e1b43bd556a611584a65f529e5077c1b54ace4f7
Parent: 1138b7e2d40711b024768034beb64885994271e4
Author: Tony Luck [EMAIL PROTECTED]
AuthorDate: Mon Feb 5 15:47:43 2007 -0800
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Mon Feb 5 15:47:43 2007 -0800

[IA64] Fix example error injection program

Progam accessed using /sys/devices/system/node/node0/cpu%d/err_inject/
This path only exists for CONFIG_NUMA=y systems.  Better to use
/sys/devices/system/cpu/cpu%d/err_inject/ which is available on all
systems.

Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 Documentation/ia64/err_inject.txt |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/ia64/err_inject.txt 
b/Documentation/ia64/err_inject.txt
index 26487c1..6449a70 100644
--- a/Documentation/ia64/err_inject.txt
+++ b/Documentation/ia64/err_inject.txt
@@ -111,7 +111,7 @@ err_injection_tool.c:
 #defineERR_DATA_BUFFER_SIZE3   // Three 8-byte.
 #define PARA_FIELD_NUM 5
 #define MASK_SIZE  (NR_CPUS/64)
-#define PATH_FORMAT /sys/devices/system/node/node0/cpu%d/err_inject/
+#define PATH_FORMAT /sys/devices/system/cpu/cpu%d/err_inject/
 
 int sched_setaffinity(pid_t pid, unsigned int len, unsigned long *mask);
 
-
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


[IA64] remove per-cpu ia64_phys_stacked_size_p8

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a0776ec8e97bf109e7d973d09fc3e1814eb32bfb
Commit: a0776ec8e97bf109e7d973d09fc3e1814eb32bfb
Parent: 62d0cfcb27cf755cebdc93ca95dabc83608007cd
Author: Chen, Kenneth W [EMAIL PROTECTED]
AuthorDate: Fri Oct 13 10:05:45 2006 -0700
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Tue Feb 6 15:04:18 2007 -0800

[IA64] remove per-cpu ia64_phys_stacked_size_p8

It's not efficient to use a per-cpu variable just to store
how many physical stack register a cpu has.  Ever since the
incarnation of ia64 up till upcoming Montecito processor, that
variable has glued to 96. Having a variable in memory means
that the kernel is burning an extra cacheline access on every
syscall and kernel exit path.  Such static value is better
served with the instruction patching utility exists today.
Convert ia64_phys_stacked_size_p8 into dynamic insn patching.

This also has a pleasant side effect of eliminating access to
per-cpu area while psr.ic=0 in the kernel exit path. (fixable
for per-cpu DTC work, but why bother?)

There are some concerns with the default value that the instruc-
tion encoded in the kernel image.  It shouldn't be concerned.
The reasons are:

(1) cpu_init() is called at CPU initialization.  In there, we
find out physical stack register size from PAL and patch
two instructions in kernel exit code.  The code in question
can not be executed before the patching is done.

(2) current implementation stores zero in ia64_phys_stacked_size_p8,
and that's what the current kernel exit path loads the value with.
With the new code, it is equivalent that we store reg size 96
in ia64_phys_stacked_size_p8, thus creating a better safety net.
Given (1) above can never fail, having (2) is just a bonus.

All in all, this patch allow one less memory reference in the kernel
exit path, thus reducing syscall and interrupt return latency; and
avoid polluting potential useful data in the CPU cache.

Signed-off-by: Ken Chen [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 arch/ia64/kernel/entry.S   |7 ++-
 arch/ia64/kernel/patch.c   |   20 
 arch/ia64/kernel/setup.c   |7 +--
 arch/ia64/kernel/vmlinux.lds.S |7 +++
 include/asm-ia64/asmmacro.h|   10 ++
 include/asm-ia64/patch.h   |1 +
 include/asm-ia64/processor.h   |1 +
 include/asm-ia64/sections.h|1 +
 8 files changed, 47 insertions(+), 7 deletions(-)

diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 15234ed..ac4b304 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -767,7 +767,7 @@ ENTRY(ia64_leave_syscall)
ld8.fill r15=[r3]   // M0|1 restore r15
mov b6=r18  // I0   restore b6
 
-   addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0 // A
+   LOAD_PHYS_STACK_REG_SIZE(r17)
mov f9=f0   // Fclear f9
 (pKStk) br.cond.dpnt.many skip_rbs_switch  // B
 
@@ -775,7 +775,6 @@ ENTRY(ia64_leave_syscall)
shr.u r18=r19,16// I0|1 get byte size of existing 
dirty partition
cover   // Badd current frame into dirty 
partition  set cr.ifs
;;
-(pUStk) ld4 r17=[r17]  // M0|1 r17 = 
cpu_data-phys_stacked_size_p8
mov r19=ar.bsp  // M2   get new backing store pointer
mov f10=f0  // Fclear f10
 
@@ -953,9 +952,7 @@ GLOBAL_ENTRY(ia64_leave_kernel)
shr.u r18=r19,16// get byte size of existing dirty partition
;;
mov r16=ar.bsp  // get existing backing store pointer
-   addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0
-   ;;
-   ld4 r17=[r17]   // r17 = cpu_data-phys_stacked_size_p8
+   LOAD_PHYS_STACK_REG_SIZE(r17)
 (pKStk)br.cond.dpnt skip_rbs_switch
 
/*
diff --git a/arch/ia64/kernel/patch.c b/arch/ia64/kernel/patch.c
index bc11bb0..e796e29 100644
--- a/arch/ia64/kernel/patch.c
+++ b/arch/ia64/kernel/patch.c
@@ -195,3 +195,23 @@ ia64_patch_gate (void)
ia64_patch_vtop(START(vtop), END(vtop));
ia64_patch_mckinley_e9(START(mckinley_e9), END(mckinley_e9));
 }
+
+void ia64_patch_phys_stack_reg(unsigned long val)
+{
+   s32 * offp = (s32 *) __start___phys_stack_reg_patchlist;
+   s32 * end = (s32 *) __end___phys_stack_reg_patchlist;
+   u64 ip, mask, imm;
+
+   /* see instruction format A4: adds r1 = imm13, r3 */
+   mask = (0x3fUL  27) | (0x7f  13);
+   imm = (((val  7)  0x3f)  27) | (val  0x7f)  13;
+
+   while (offp  end) {
+   ip = (u64) offp + *offp;
+   ia64_patch(ip, mask, imm);
+

[IA64] relax per-cpu TLB requirement to DTC

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=00b65985fb2fc542b855b03fcda0d0f2bab4f442
Commit: 00b65985fb2fc542b855b03fcda0d0f2bab4f442
Parent: a0776ec8e97bf109e7d973d09fc3e1814eb32bfb
Author: Chen, Kenneth W [EMAIL PROTECTED]
AuthorDate: Fri Oct 13 10:08:13 2006 -0700
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Tue Feb 6 15:04:48 2007 -0800

[IA64] relax per-cpu TLB requirement to DTC

Instead of pinning per-cpu TLB into a DTR, use DTC.  This will free up
one TLB entry for application, or even kernel if access pattern to
per-cpu data area has high temporal locality.

Since per-cpu is mapped at the top of region 7 address, we just need to
add special case in alt_dtlb_miss.  The physical address of per-cpu data
is already conveniently stored in IA64_KR(PER_CPU_DATA).  Latency for
alt_dtlb_miss is not affected as we can hide all the latency.  It was
measured that alt_dtlb_miss handler has 23 cycles latency before and
after the patch.

The performance effect is massive for applications that put lots of tlb
pressure on CPU.  Workload environment like database online transaction
processing or application uses tera-byte of memory would benefit the most.
Measurement with industry standard database benchmark shown an upward
of 1.6% gain.  While smaller workloads like cpu, java also showing small
improvement.

Signed-off-by: Ken Chen [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 arch/ia64/kernel/ivt.S |   19 ++-
 arch/ia64/kernel/mca_asm.S |   24 
 arch/ia64/mm/init.c|   11 +--
 include/asm-ia64/kregs.h   |3 +--
 4 files changed, 16 insertions(+), 41 deletions(-)

diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index 6b7fcbd..34f44d8 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -374,6 +374,7 @@ ENTRY(alt_dtlb_miss)
movl r19=(((1  IA64_MAX_PHYS_BITS) - 1)  ~0xfff)
mov r21=cr.ipsr
mov r31=pr
+   mov r24=PERCPU_ADDR
;;
 #ifdef CONFIG_DISABLE_VHPT
shr.u r22=r16,61// get the region number into 
r21
@@ -386,22 +387,30 @@ ENTRY(alt_dtlb_miss)
 (p8)   mov r29=b0  // save b0
 (p8)   br.cond.dptk dtlb_fault
 #endif
+   cmp.ge p10,p11=r16,r24  // access to per_cpu_data?
+   tbit.z p12,p0=r16,61// access to region 6?
+   mov r25=PERCPU_PAGE_SHIFT  2
+   mov r26=PERCPU_PAGE_SIZE
+   nop.m 0
+   nop.b 0
+   ;;
+(p10)  mov r19=IA64_KR(PER_CPU_DATA)
+(p11)  and r19=r19,r16 // clear non-ppn fields
extr.u r23=r21,IA64_PSR_CPL0_BIT,2  // extract psr.cpl
and r22=IA64_ISR_CODE_MASK,r20  // get the isr.code field
tbit.nz p6,p7=r20,IA64_ISR_SP_BIT   // is speculation bit on?
-   shr.u r18=r16,57// move address bit 61 to bit 4
-   and r19=r19,r16 // clear ed, reserved bits, and 
PTE control bits
tbit.nz p9,p0=r20,IA64_ISR_NA_BIT   // is non-access bit on?
;;
-   andcm r18=0x10,r18  // bit 4=~address-bit(61)
+(p10)  sub r19=r19,r26
+(p10)  mov cr.itir=r25
cmp.ne p8,p0=r0,r23
 (p9)   cmp.eq.or.andcm p6,p7=IA64_ISR_CODE_LFETCH,r22  // check isr.code field
+(p12)  dep r17=-1,r17,4,1  // set ma=UC for region 6 addr
 (p8)   br.cond.spnt page_fault
 
dep r21=-1,r21,IA64_PSR_ED_BIT,1
-   or r19=r19,r17  // insert PTE control bits into r19
;;
-   or r19=r19,r18  // set bit 4 (uncached) if the access was to 
region 6
+   or r19=r19,r17  // insert PTE control bits into r19
 (p6)   mov cr.ipsr=r21
;;
 (p7)   itc.d r19   // insert the TLB entry
diff --git a/arch/ia64/kernel/mca_asm.S b/arch/ia64/kernel/mca_asm.S
index c6b607c..8c9c26a 100644
--- a/arch/ia64/kernel/mca_asm.S
+++ b/arch/ia64/kernel/mca_asm.S
@@ -101,14 +101,6 @@ ia64_do_tlb_purge:
;;
srlz.d
;;
-   // 2. Purge DTR for PERCPU data.
-   movl r16=PERCPU_ADDR
-   mov r18=PERCPU_PAGE_SHIFT2
-   ;;
-   ptr.d r16,r18
-   ;;
-   srlz.d
-   ;;
// 3. Purge ITR for PAL code.
GET_THIS_PADDR(r2, ia64_mca_pal_base)
;;
@@ -196,22 +188,6 @@ ia64_reload_tr:
srlz.i
srlz.d
;;
-   // 2. Reload DTR register for PERCPU data.
-   GET_THIS_PADDR(r2, ia64_mca_per_cpu_pte)
-   ;;
-   movl r16=PERCPU_ADDR// vaddr
-   movl r18=PERCPU_PAGE_SHIFT2
-   ;;
-   mov cr.itir=r18
-   mov cr.ifa=r16
-   ;;
-   ld8 r18=[r2]// load per-CPU PTE
-   mov r16=IA64_TR_PERCPU_DATA;
-   ;;
-   itr.d dtr[r16]=r18
-   ;;
-   srlz.d
-   ;;
// 3. Reload ITR for 

[IA64] rename ioremap variables to match i386

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c4add2e537e6f60048dce8dc518254e7e605301d
Commit: c4add2e537e6f60048dce8dc518254e7e605301d
Parent: ce20269d1e97030afa476e12b99d2437e748d225
Author: Bjorn Helgaas [EMAIL PROTECTED]
AuthorDate: Fri Mar 30 10:33:11 2007 -0600
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Fri Mar 30 09:37:17 2007 -0700

[IA64] rename ioremap variables to match i386

No functional change, just use the same names as i386.

Signed-off-by: Bjorn Helgaas [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 arch/ia64/mm/ioremap.c |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/ia64/mm/ioremap.c b/arch/ia64/mm/ioremap.c
index 4280c07..1bc0c17 100644
--- a/arch/ia64/mm/ioremap.c
+++ b/arch/ia64/mm/ioremap.c
@@ -14,13 +14,13 @@
 #include asm/meminit.h
 
 static inline void __iomem *
-__ioremap (unsigned long offset, unsigned long size)
+__ioremap (unsigned long phys_addr, unsigned long size)
 {
-   return (void __iomem *) (__IA64_UNCACHED_OFFSET | offset);
+   return (void __iomem *) (__IA64_UNCACHED_OFFSET | phys_addr);
 }
 
 void __iomem *
-ioremap (unsigned long offset, unsigned long size)
+ioremap (unsigned long phys_addr, unsigned long size)
 {
u64 attr;
unsigned long gran_base, gran_size;
@@ -30,31 +30,31 @@ ioremap (unsigned long offset, unsigned long size)
 * as the rest of the kernel.  For more details, see
 * Documentation/ia64/aliasing.txt.
 */
-   attr = kern_mem_attribute(offset, size);
+   attr = kern_mem_attribute(phys_addr, size);
if (attr  EFI_MEMORY_WB)
-   return (void __iomem *) phys_to_virt(offset);
+   return (void __iomem *) phys_to_virt(phys_addr);
else if (attr  EFI_MEMORY_UC)
-   return __ioremap(offset, size);
+   return __ioremap(phys_addr, size);
 
/*
 * Some chipsets don't support UC access to memory.  If
 * WB is supported for the whole granule, we prefer that.
 */
-   gran_base = GRANULEROUNDDOWN(offset);
-   gran_size = GRANULEROUNDUP(offset + size) - gran_base;
+   gran_base = GRANULEROUNDDOWN(phys_addr);
+   gran_size = GRANULEROUNDUP(phys_addr + size) - gran_base;
if (efi_mem_attribute(gran_base, gran_size)  EFI_MEMORY_WB)
-   return (void __iomem *) phys_to_virt(offset);
+   return (void __iomem *) phys_to_virt(phys_addr);
 
-   return __ioremap(offset, size);
+   return __ioremap(phys_addr, size);
 }
 EXPORT_SYMBOL(ioremap);
 
 void __iomem *
-ioremap_nocache (unsigned long offset, unsigned long size)
+ioremap_nocache (unsigned long phys_addr, unsigned long size)
 {
-   if (kern_mem_attribute(offset, size)  EFI_MEMORY_WB)
+   if (kern_mem_attribute(phys_addr, size)  EFI_MEMORY_WB)
return NULL;
 
-   return __ioremap(offset, size);
+   return __ioremap(phys_addr, size);
 }
 EXPORT_SYMBOL(ioremap_nocache);
-
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


[IA64] make ioremap avoid unsupported attributes

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b50ffb0c0281bc5a08ccd56ae9bb84296c28f38
Commit: 9b50ffb0c0281bc5a08ccd56ae9bb84296c28f38
Parent: c4add2e537e6f60048dce8dc518254e7e605301d
Author: Bjorn Helgaas [EMAIL PROTECTED]
AuthorDate: Fri Mar 30 10:34:05 2007 -0600
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Fri Mar 30 09:37:41 2007 -0700

[IA64] make ioremap avoid unsupported attributes

Example memory map (from HP sx1000 with VGA enabled):
0x0 - 0x9 supports only WB (cacheable) access
0xA - 0xB supports only UC (uncacheable) access
0xC - 0xF supports only WB (cacheable) access

pci_read_rom() indirectly uses ioremap(0xC) to read the shadow VGA 
option
ROM.  ioremap() used to default to a 16MB or 64MB UC kernel identity 
mapping,
which would cause an MCA when reading 0xC since only WB is supported 
there.

X uses reads the option ROM to initialize devices.  A smaller test case is:
  # echo 1  /sys/bus/pci/devices/:aa:03.0/rom
  # cp /sys/bus/pci/devices/:aa:03.0/rom x

To avoid this, we can use the same ioremap_page_range() strategy that most
architectures use for all ioremaps.  These page table mappings come out of 
the
vmalloc area.  On ia64, these are in region 5 (0xA... addresses) and 
typically
use 16KB or 64KB mappings instead of 16MB or 64MB mappings.  The smaller
mappings give more flexibility to use the correct attributes.

Signed-off-by: Bjorn Helgaas [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 arch/ia64/mm/ioremap.c |   60 
 include/asm-ia64/io.h  |6 +
 2 files changed, 56 insertions(+), 10 deletions(-)

diff --git a/arch/ia64/mm/ioremap.c b/arch/ia64/mm/ioremap.c
index 1bc0c17..2a14062 100644
--- a/arch/ia64/mm/ioremap.c
+++ b/arch/ia64/mm/ioremap.c
@@ -1,5 +1,5 @@
 /*
- * (c) Copyright 2006 Hewlett-Packard Development Company, L.P.
+ * (c) Copyright 2006, 2007 Hewlett-Packard Development Company, L.P.
  * Bjorn Helgaas [EMAIL PROTECTED]
  *
  * This program is free software; you can redistribute it and/or modify
@@ -10,11 +10,13 @@
 #include linux/compiler.h
 #include linux/module.h
 #include linux/efi.h
+#include linux/io.h
+#include linux/vmalloc.h
 #include asm/io.h
 #include asm/meminit.h
 
 static inline void __iomem *
-__ioremap (unsigned long phys_addr, unsigned long size)
+__ioremap (unsigned long phys_addr)
 {
return (void __iomem *) (__IA64_UNCACHED_OFFSET | phys_addr);
 }
@@ -22,8 +24,13 @@ __ioremap (unsigned long phys_addr, unsigned long size)
 void __iomem *
 ioremap (unsigned long phys_addr, unsigned long size)
 {
+   void __iomem *addr;
+   struct vm_struct *area;
+   unsigned long offset;
+   pgprot_t prot;
u64 attr;
unsigned long gran_base, gran_size;
+   unsigned long page_base;
 
/*
 * For things in kern_memmap, we must use the same attribute
@@ -34,7 +41,7 @@ ioremap (unsigned long phys_addr, unsigned long size)
if (attr  EFI_MEMORY_WB)
return (void __iomem *) phys_to_virt(phys_addr);
else if (attr  EFI_MEMORY_UC)
-   return __ioremap(phys_addr, size);
+   return __ioremap(phys_addr);
 
/*
 * Some chipsets don't support UC access to memory.  If
@@ -45,7 +52,42 @@ ioremap (unsigned long phys_addr, unsigned long size)
if (efi_mem_attribute(gran_base, gran_size)  EFI_MEMORY_WB)
return (void __iomem *) phys_to_virt(phys_addr);
 
-   return __ioremap(phys_addr, size);
+   /*
+* WB is not supported for the whole granule, so we can't use
+* the region 7 identity mapping.  If we can safely cover the
+* area with kernel page table mappings, we can use those
+* instead.
+*/
+   page_base = phys_addr  PAGE_MASK;
+   size = PAGE_ALIGN(phys_addr + size) - page_base;
+   if (efi_mem_attribute(page_base, size)  EFI_MEMORY_WB) {
+   prot = PAGE_KERNEL;
+
+   /*
+* Mappings have to be page-aligned
+*/
+   offset = phys_addr  ~PAGE_MASK;
+   phys_addr = PAGE_MASK;
+
+   /*
+* Ok, go for it..
+*/
+   area = get_vm_area(size, VM_IOREMAP);
+   if (!area)
+   return NULL;
+
+   area-phys_addr = phys_addr;
+   addr = (void __iomem *) area-addr;
+   if (ioremap_page_range((unsigned long) addr,
+   (unsigned long) addr + size, phys_addr, prot)) {
+   vunmap((void __force *) addr);
+   return NULL;
+   }
+
+   return (void __iomem *) (offset + (char __iomem *)addr);
+   }
+
+   return 

[IA64] allow WB /sys/.../legacy_mem mmaps

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2cb22e23a5fcbcac2de49493aa57c7694028a06a
Commit: 2cb22e23a5fcbcac2de49493aa57c7694028a06a
Parent: 9b50ffb0c0281bc5a08ccd56ae9bb84296c28f38
Author: Bjorn Helgaas [EMAIL PROTECTED]
AuthorDate: Fri Mar 30 10:34:44 2007 -0600
Committer:  Tony Luck [EMAIL PROTECTED]
CommitDate: Fri Mar 30 09:38:03 2007 -0700

[IA64] allow WB /sys/.../legacy_mem mmaps

Allow cacheable mmaps of legacy_mem if WB access is supported for the 
region.
The legacy_mem file often contains a shadow option ROM, and some versions 
of
X depend on this.

Tim Yamin [EMAIL PROTECTED] reported that this change fixes X on a Dell
PowerEdge 3250.

Signed-off-by: Bjorn Helgaas [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]
---
 arch/ia64/pci/pci.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 0e83f3b..9f63589 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -659,8 +659,6 @@ pci_mmap_legacy_page_range(struct pci_bus *bus, struct 
vm_area_struct *vma)
return -EINVAL;
prot = phys_mem_access_prot(NULL, vma-vm_pgoff, size,
vma-vm_page_prot);
-   if (pgprot_val(prot) != pgprot_val(pgprot_noncached(vma-vm_page_prot)))
-   return -EINVAL;
 
addr = pci_get_legacy_mem(bus);
if (IS_ERR(addr))
-
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


Revert [PATCH] x86: __pa and __pa_symbol address space separation

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e3ebadd95cb621e2c7436f3d3646447ac9d5c16d
Commit: e3ebadd95cb621e2c7436f3d3646447ac9d5c16d
Parent: 15700770ef7c5d12e2f1659d2ddbeb3f658d9f37
Author: Linus Torvalds [EMAIL PROTECTED]
AuthorDate: Mon May 7 08:44:24 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 08:44:24 2007 -0700

Revert [PATCH] x86: __pa and __pa_symbol address space separation

This was broken.  It adds complexity, for no good reason.  Rather than
separate __pa() and __pa_symbol(), we should deprecate __pa_symbol(),
and preferably __pa() too - and just use virt_to_phys() instead, which
is more readable and has nicer semantics.

However, right now, just undo the separation, and make __pa_symbol() be
the exact same as __pa().  That fixes the bugs this patch introduced,
and we can do the fairly obvious cleanups later.

Do the new __phys_addr() function (which is now the actual workhorse for
the unified __pa()/__pa_symbol()) as a real external function, that way
all the potential issues with compile/link-time optimizations of
constant symbol addresses go away, and we can also, if we choose to, add
more sanity-checking of the argument.

Cc: Eric W. Biederman [EMAIL PROTECTED]
Cc: Vivek Goyal [EMAIL PROTECTED]
Cc: Andi Kleen [EMAIL PROTECTED]
Cc: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/alternative.c |4 ++--
 arch/i386/mm/init.c|   15 +++
 arch/x86_64/kernel/machine_kexec.c |   16 
 arch/x86_64/kernel/setup.c |9 -
 arch/x86_64/kernel/smp.c   |2 +-
 arch/x86_64/mm/init.c  |   31 ++-
 arch/x86_64/mm/ioremap.c   |9 +
 arch/x86_64/mm/pageattr.c  |   16 
 include/asm-x86_64/page.h  |   18 +++---
 include/asm-x86_64/pgtable.h   |4 ++--
 10 files changed, 66 insertions(+), 58 deletions(-)

diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c
index e5cec66..d8cda14 100644
--- a/arch/i386/kernel/alternative.c
+++ b/arch/i386/kernel/alternative.c
@@ -390,8 +390,8 @@ void __init alternative_instructions(void)
_text, _etext);
}
free_init_pages(SMP alternatives,
-   __pa_symbol(__smp_locks),
-   __pa_symbol(__smp_locks_end));
+   (unsigned long)__smp_locks,
+   (unsigned long)__smp_locks_end);
} else {
alternatives_smp_module_add(NULL, core kernel,
__smp_locks, __smp_locks_end,
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index dbe16f6..1a7197e 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -843,11 +843,10 @@ void free_init_pages(char *what, unsigned long begin, 
unsigned long end)
unsigned long addr;
 
for (addr = begin; addr  end; addr += PAGE_SIZE) {
-   struct page *page = pfn_to_page(addr  PAGE_SHIFT);
-   ClearPageReserved(page);
-   init_page_count(page);
-   memset(page_address(page), POISON_FREE_INITMEM, PAGE_SIZE);
-   __free_page(page);
+   ClearPageReserved(virt_to_page(addr));
+   init_page_count(virt_to_page(addr));
+   memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
+   free_page(addr);
totalram_pages++;
}
printk(KERN_INFO Freeing %s: %luk freed\n, what, (end - begin)  10);
@@ -856,14 +855,14 @@ void free_init_pages(char *what, unsigned long begin, 
unsigned long end)
 void free_initmem(void)
 {
free_init_pages(unused kernel memory,
-   __pa_symbol(__init_begin),
-   __pa_symbol(__init_end));
+   (unsigned long)(__init_begin),
+   (unsigned long)(__init_end));
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
-   free_init_pages(initrd memory, __pa(start), __pa(end));
+   free_init_pages(initrd memory, start, end);
 }
 #endif
 
diff --git a/arch/x86_64/kernel/machine_kexec.c 
b/arch/x86_64/kernel/machine_kexec.c
index a8bb33c..c3a5547 100644
--- a/arch/x86_64/kernel/machine_kexec.c
+++ b/arch/x86_64/kernel/machine_kexec.c
@@ -189,21 +189,21 @@ NORET_TYPE void machine_kexec(struct kimage *image)
control_page = page_address(image-control_code_page) + PAGE_SIZE;
memcpy(control_page, relocate_kernel, PAGE_SIZE);
 
-   page_list[PA_CONTROL_PAGE] = __pa(control_page);
+   page_list[PA_CONTROL_PAGE] = virt_to_phys(control_page);

slab: introduce krealloc

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fd76bab2fa6d8f3ef6b326a4c6ae442fa21d30a4
Commit: fd76bab2fa6d8f3ef6b326a4c6ae442fa21d30a4
Parent: e3ebadd95cb621e2c7436f3d3646447ac9d5c16d
Author: Pekka Enberg [EMAIL PROTECTED]
AuthorDate: Sun May 6 14:48:40 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 12:12:50 2007 -0700

slab: introduce krealloc

This introduce krealloc() that reallocates memory while keeping the contents
unchanged.  The allocator avoids reallocation if the new size fits the
currently used cache.  I also added a simple non-optimized version for
mm/slob.c for compatibility.

[EMAIL PROTECTED]: fix warnings]
Acked-by: Josef Sipek [EMAIL PROTECTED]
Acked-by: Matt Mackall [EMAIL PROTECTED]
Acked-by: Christoph Lameter [EMAIL PROTECTED]
Signed-off-by: Pekka Enberg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/slab.h |3 ++-
 mm/slab.c|   49 -
 mm/slob.c|   35 ++-
 3 files changed, 84 insertions(+), 3 deletions(-)

diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1ef822e..2f8f60f 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -72,8 +72,9 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache 
*cachep,
  */
 void *__kmalloc(size_t, gfp_t);
 void *__kzalloc(size_t, gfp_t);
+void * __must_check krealloc(const void *, size_t, gfp_t);
 void kfree(const void *);
-unsigned int ksize(const void *);
+size_t ksize(const void *);
 
 /**
  * kcalloc - allocate memory for an array. The memory is set to zero.
diff --git a/mm/slab.c b/mm/slab.c
index 168bfe9..8b71a9c 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3740,6 +3740,53 @@ EXPORT_SYMBOL(__kmalloc);
 #endif
 
 /**
+ * krealloc - reallocate memory. The contents will remain unchanged.
+ *
+ * @p: object to reallocate memory for.
+ * @new_size: how many bytes of memory are required.
+ * @flags: the type of memory to allocate.
+ *
+ * The contents of the object pointed to are preserved up to the
+ * lesser of the new and old sizes.  If @p is %NULL, krealloc()
+ * behaves exactly like kmalloc().  If @size is 0 and @p is not a
+ * %NULL pointer, the object pointed to is freed.
+ */
+void *krealloc(const void *p, size_t new_size, gfp_t flags)
+{
+   struct kmem_cache *cache, *new_cache;
+   void *ret;
+
+   if (unlikely(!p))
+   return kmalloc_track_caller(new_size, flags);
+
+   if (unlikely(!new_size)) {
+   kfree(p);
+   return NULL;
+   }
+
+   cache = virt_to_cache(p);
+   new_cache = __find_general_cachep(new_size, flags);
+
+   /*
+* If new size fits in the current cache, bail out.
+*/
+   if (likely(cache == new_cache))
+   return (void *)p;
+
+   /*
+* We are on the slow-path here so do not use __cache_alloc
+* because it bloats kernel text.
+*/
+   ret = kmalloc_track_caller(new_size, flags);
+   if (ret) {
+   memcpy(ret, p, min(new_size, ksize(p)));
+   kfree(p);
+   }
+   return ret;
+}
+EXPORT_SYMBOL(krealloc);
+
+/**
  * kmem_cache_free - Deallocate an object
  * @cachep: The cache the allocation was from.
  * @objp: The previously allocated object.
@@ -4481,7 +4528,7 @@ const struct seq_operations slabstats_op = {
  * allocated with either kmalloc() or kmem_cache_alloc(). The object
  * must not be freed during the duration of the call.
  */
-unsigned int ksize(const void *objp)
+size_t ksize(const void *objp)
 {
if (unlikely(objp == NULL))
return 0;
diff --git a/mm/slob.c b/mm/slob.c
index 5adc29c..03cce3d 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -190,6 +190,39 @@ void *__kmalloc(size_t size, gfp_t gfp)
 }
 EXPORT_SYMBOL(__kmalloc);
 
+/**
+ * krealloc - reallocate memory. The contents will remain unchanged.
+ *
+ * @p: object to reallocate memory for.
+ * @new_size: how many bytes of memory are required.
+ * @flags: the type of memory to allocate.
+ *
+ * The contents of the object pointed to are preserved up to the
+ * lesser of the new and old sizes.  If @p is %NULL, krealloc()
+ * behaves exactly like kmalloc().  If @size is 0 and @p is not a
+ * %NULL pointer, the object pointed to is freed.
+ */
+void *krealloc(const void *p, size_t new_size, gfp_t flags)
+{
+   void *ret;
+
+   if (unlikely(!p))
+   return kmalloc_track_caller(new_size, flags);
+
+   if (unlikely(!new_size)) {
+   kfree(p);
+   return NULL;
+   }
+
+   ret = kmalloc_track_caller(new_size, flags);
+   if (ret) {
+   memcpy(ret, p, min(new_size, ksize(p)));
+   kfree(p);
+   }
+   return ret;
+}
+EXPORT_SYMBOL(krealloc);
+
 

at91_cf, minor fix

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=02c83595b86480ee4d61665beb13f76685d40239
Commit: 02c83595b86480ee4d61665beb13f76685d40239
Parent: fd76bab2fa6d8f3ef6b326a4c6ae442fa21d30a4
Author: David Brownell [EMAIL PROTECTED]
AuthorDate: Sun May 6 14:48:42 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 12:12:50 2007 -0700

at91_cf, minor fix

This is a minor correctness fix: since the at91_cf driver probe() routine
is in the init section, it should use platform_driver_probe() instead of
leaving that pointer around in the driver struct after init section
removal.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Cc: Dominik Brodowski [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/pcmcia/at91_cf.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 99baabc..948efc7 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -360,7 +360,6 @@ static struct platform_driver at91_cf_driver = {
.name   = (char *) driver_name,
.owner  = THIS_MODULE,
},
-   .probe  = at91_cf_probe,
.remove = __exit_p(at91_cf_remove),
.suspend= at91_cf_suspend,
.resume = at91_cf_resume,
@@ -370,7 +369,7 @@ static struct platform_driver at91_cf_driver = {
 
 static int __init at91_cf_init(void)
 {
-   return platform_driver_register(at91_cf_driver);
+   return platform_driver_probe(at91_cf_driver, at91_cf_probe);
 }
 module_init(at91_cf_init);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


serial driver PMC MSP71xx

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=beab697ab4b2962e3d741b476abe443baad0933d
Commit: beab697ab4b2962e3d741b476abe443baad0933d
Parent: 6179b5562d5d17c7c09b54cb11dd925ca308d7a9
Author: Marc St-Jean [EMAIL PROTECTED]
AuthorDate: Sun May 6 14:48:45 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 12:12:50 2007 -0700

serial driver PMC MSP71xx

Serial driver patch for the PMC-Sierra MSP71xx devices.

There are three different fixes:

1 Fix for DesignWare APB THRE errata: In brief, this is a non-standard
  16550 in that the THRE interrupt will not re-assert itself simply by
  disabling and re-enabling the THRI bit in the IER, it is only re-enabled
  if a character is actually sent out.

  It appears that the 8250-uart-backup-timer.patch in the mm tree
  also fixes it so we have dropped our initial workaround.  This patch now
  needs to be applied on top of that mm patch.

2 Fix for Busy Detect on LCR write: The DesignWare APB UART has a feature
  which causes a new Busy Detect interrupt to be generated if it's busy
  when the LCR is written.  This fix saves the value of the LCR and
  rewrites it after clearing the interrupt.

3 Workaround for interrupt/data concurrency issue: The SoC needs to
  ensure that writes that can cause interrupts to be cleared reach the UART
  before returning from the ISR.  This fix reads a non-destructive register
  on the UART so the read transaction completion ensures the previously
  queued write transaction has also completed.

Signed-off-by: Marc St-Jean [EMAIL PROTECTED]
Cc: Russell King [EMAIL PROTECTED]
Cc: Ralf Baechle [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/mips/pmc-sierra/msp71xx/msp_serial.c |  165 +
 drivers/serial/8250.c |   31 ++
 drivers/serial/serial_core.c  |2 +
 include/linux/serial_core.h   |2 +
 include/linux/serial_reg.h|2 +
 5 files changed, 202 insertions(+), 0 deletions(-)

diff --git a/arch/mips/pmc-sierra/msp71xx/msp_serial.c 
b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
new file mode 100644
index 000..c41b53f
--- /dev/null
+++ b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
@@ -0,0 +1,165 @@
+/*
+ * The setup file for serial related hardware on PMC-Sierra MSP processors.
+ *
+ * Copyright 2005 PMC-Sierra, Inc.
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
+ *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *  NO  EVENT  SHALL   THE AUTHOR  BELIABLE FOR ANY   DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
+ *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  You should have received a copy of the  GNU General Public License along
+ *  with this program; if not, write  to the Free Software Foundation, Inc.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include linux/serial.h
+#include linux/serial_core.h
+#include linux/serial_reg.h
+
+#include asm/bootinfo.h
+#include asm/io.h
+#include asm/processor.h
+#include asm/serial.h
+
+#include msp_prom.h
+#include msp_int.h
+#include msp_regs.h
+
+#ifdef CONFIG_KGDB
+/*
+ * kgdb uses serial port 1 so the console can remain on port 0.
+ * To use port 0 change the definition to read as follows:
+ * #define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART0_BASE)
+ */
+#define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART1_BASE)
+
+int putDebugChar(char c)
+{
+   volatile uint32_t *uart = (volatile uint32_t *)DEBUG_PORT_BASE;
+   uint32_t val = (uint32_t)c;
+
+   local_irq_disable();
+   while( !(uart[5]  0x20) ); /* Wait for TXRDY */
+   uart[0] = val;
+   while( !(uart[5]  0x20) ); /* Wait for TXRDY */
+   local_irq_enable();
+
+   return 1;
+}
+
+char getDebugChar(void)
+{
+   volatile uint32_t *uart = (volatile uint32_t *)DEBUG_PORT_BASE;
+   uint32_t val;
+
+   while( !(uart[5]  0x01) ); /* Wait for RXRDY */
+   val = uart[0];
+
+   return (char)val;
+}
+
+void initDebugPort(unsigned int 

serial: define FIXED_PORT flag for serial_core

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=abb4a2390737867353ebafc012d45f2b03f3f944
Commit: abb4a2390737867353ebafc012d45f2b03f3f944
Parent: bd71c182d5a02337305fc381831c11029dd17d64
Author: David Gibson [EMAIL PROTECTED]
AuthorDate: Sun May 6 14:48:49 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 12:12:50 2007 -0700

serial: define FIXED_PORT flag for serial_core

At present, the serial core always allows setserial in userspace to change 
the
port address, irq and base clock of any serial port.  That makes sense for
legacy ISA ports, but not for (say) embedded ns16550 compatible serial ports
at peculiar addresses.  In these cases, the kernel code configuring the 
ports
must know exactly where they are, and their clocking arrangements (which can
be unusual on embedded boards).  It doesn't make sense for userspace to 
change
these settings.

Therefore, this patch defines a UPF_FIXED_PORT flag for the uart_port
structure.  If this flag is set when the serial port is configured, any
attempts to alter the port's type, io address, irq or base clock with
setserial are ignored.

In addition this patch uses the new flag for on-chip serial ports probed in
arch/powerpc/kernel/legacy_serial.c, and for other hard-wired serial ports
probed by drivers/serial/of_serial.c.

Signed-off-by: David Gibson [EMAIL PROTECTED]
Cc: Russell King [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/powerpc/kernel/legacy_serial.c |3 ++-
 drivers/serial/of_serial.c  |3 ++-
 drivers/serial/serial_core.c|   22 +-
 include/linux/serial_core.h |1 +
 4 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/kernel/legacy_serial.c 
b/arch/powerpc/kernel/legacy_serial.c
index 63dd2c3..ae4836e 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -115,7 +115,8 @@ static int __init add_legacy_soc_port(struct device_node 
*np,
 {
u64 addr;
const u32 *addrp;
-   upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
+   upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ
+   | UPF_FIXED_PORT;
struct device_node *tsi = of_get_parent(np);
 
/* We only support ports that have a clock frequency properly
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
index 09b0b73..336d0f4 100644
--- a/drivers/serial/of_serial.c
+++ b/drivers/serial/of_serial.c
@@ -48,7 +48,8 @@ static int __devinit of_platform_serial_setup(struct 
of_device *ofdev,
port-iotype = UPIO_MEM;
port-type = type;
port-uartclk = *clk;
-   port-flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP;
+   port-flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
+   | UPF_FIXED_PORT;
port-dev = ofdev-dev;
port-custom_divisor = *clk / (16 * (*spd));
 
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index a677133..f409be3 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -672,19 +672,21 @@ static int uart_set_info(struct uart_state *state,
 */
mutex_lock(state-mutex);
 
-   change_irq  = new_serial.irq != port-irq;
+   change_irq  = !(port-flags  UPF_FIXED_PORT)
+new_serial.irq != port-irq;
 
/*
 * Since changing the 'type' of the port changes its resource
 * allocations, we should treat type changes the same as
 * IO port changes.
 */
-   change_port = new_port != port-iobase ||
- (unsigned long)new_serial.iomem_base != port-mapbase ||
- new_serial.hub6 != port-hub6 ||
- new_serial.io_type != port-iotype ||
- new_serial.iomem_reg_shift != port-regshift ||
- new_serial.type != port-type;
+   change_port = !(port-flags  UPF_FIXED_PORT)
+(new_port != port-iobase ||
+   (unsigned long)new_serial.iomem_base != port-mapbase ||
+   new_serial.hub6 != port-hub6 ||
+   new_serial.io_type != port-iotype ||
+   new_serial.iomem_reg_shift != port-regshift ||
+   new_serial.type != port-type);
 
old_flags = port-flags;
new_flags = new_serial.flags;
@@ -796,8 +798,10 @@ static int uart_set_info(struct uart_state *state,
}
}
 
-   port-irq  = new_serial.irq;
-   port-uartclk  = new_serial.baud_base * 16;
+   if (change_irq)
+   port-irq  = new_serial.irq;
+   if (!(port-flags  UPF_FIXED_PORT))
+   port-uartclk  = new_serial.baud_base * 16;

MPSC serial driver tx locking

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1733310bb762cb926669f2c10f6f8719bb20ed91
Commit: 1733310bb762cb926669f2c10f6f8719bb20ed91
Parent: abb4a2390737867353ebafc012d45f2b03f3f944
Author: Dave Jiang [EMAIL PROTECTED]
AuthorDate: Sun May 6 14:48:50 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 12:12:50 2007 -0700

MPSC serial driver tx locking

The MPSC serial driver assumes that interrupt is always on to pick up the
DMA transmit ops that aren't submitted while the DMA engine is active.
However when irqs are off for a period of time such as operations under
kernel crash dump console messages do not show up due to additional DMA ops
are being dropped.  This makes console writes to process through all the tx
DMAs queued up before submitting a new request.

Also, the current locking mechanism does not protect the hardware registers
and ring buffer when a printk is done during the serial write operations.
The additional per port transmit lock provides a finer granular locking and
protects registers being clobbered while printks are nested within UART
writes.

Signed-off-by: Dave Jiang [EMAIL PROTECTED]
Signed-off-by: Mark A. Greer [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/serial/mpsc.c |   25 -
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index 3d2fcc5..d09f209 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -183,6 +183,7 @@ struct mpsc_port_info {
u8 *txb_p;  /* Phys addr of txb */
int txr_head;   /* Where new data goes */
int txr_tail;   /* Where sent data comes off */
+   spinlock_t tx_lock; /* transmit lock */
 
/* Mirrored values of regs we can't read (if 'mirror_regs' set) */
u32 MPSC_MPCR_m;
@@ -1212,6 +1213,9 @@ mpsc_tx_intr(struct mpsc_port_info *pi)
 {
struct mpsc_tx_desc *txre;
int rc = 0;
+   unsigned long iflags;
+
+   spin_lock_irqsave(pi-tx_lock, iflags);
 
if (!mpsc_sdma_tx_active(pi)) {
txre = (struct mpsc_tx_desc *)(pi-txr +
@@ -1248,6 +1252,7 @@ mpsc_tx_intr(struct mpsc_port_info *pi)
mpsc_sdma_start_tx(pi); /* start next desc if ready */
}
 
+   spin_unlock_irqrestore(pi-tx_lock, iflags);
return rc;
 }
 
@@ -1338,11 +1343,16 @@ static void
 mpsc_start_tx(struct uart_port *port)
 {
struct mpsc_port_info *pi = (struct mpsc_port_info *)port;
+   unsigned long iflags;
+
+   spin_lock_irqsave(pi-tx_lock, iflags);
 
mpsc_unfreeze(pi);
mpsc_copy_tx_data(pi);
mpsc_sdma_start_tx(pi);
 
+   spin_unlock_irqrestore(pi-tx_lock, iflags);
+
pr_debug(mpsc_start_tx[%d]\n, port-line);
return;
 }
@@ -1625,6 +1635,16 @@ mpsc_console_write(struct console *co, const char *s, 
uint count)
struct mpsc_port_info *pi = mpsc_ports[co-index];
u8 *bp, *dp, add_cr = 0;
int i;
+   unsigned long iflags;
+
+   spin_lock_irqsave(pi-tx_lock, iflags);
+
+   while (pi-txr_head != pi-txr_tail) {
+   while (mpsc_sdma_tx_active(pi))
+   udelay(100);
+   mpsc_sdma_intr_ack(pi);
+   mpsc_tx_intr(pi);
+   }
 
while (mpsc_sdma_tx_active(pi))
udelay(100);
@@ -1668,6 +1688,7 @@ mpsc_console_write(struct console *co, const char *s, 
uint count)
pi-txr_tail = (pi-txr_tail + 1)  (MPSC_TXR_ENTRIES - 1);
}
 
+   spin_unlock_irqrestore(pi-tx_lock, iflags);
return;
 }
 
@@ -2005,7 +2026,8 @@ mpsc_drv_probe(struct platform_device *dev)
if (!(rc = mpsc_drv_map_regs(pi, dev))) {
mpsc_drv_get_platform_data(pi, dev, dev-id);
 
-   if (!(rc = mpsc_make_ready(pi)))
+   if (!(rc = mpsc_make_ready(pi))) {
+   spin_lock_init(pi-tx_lock);
if (!(rc = uart_add_one_port(mpsc_reg,
pi-port)))
rc = 0;
@@ -2014,6 +2036,7 @@ mpsc_drv_probe(struct platform_device *dev)
(struct uart_port *)pi);
mpsc_drv_unmap_regs(pi);
}
+   }
else
mpsc_drv_unmap_regs(pi);
}
-
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


RM9000 serial driver

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bd71c182d5a02337305fc381831c11029dd17d64
Commit: bd71c182d5a02337305fc381831c11029dd17d64
Parent: beab697ab4b2962e3d741b476abe443baad0933d
Author: Thomas Koeller [EMAIL PROTECTED]
AuthorDate: Sun May 6 14:48:47 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 12:12:50 2007 -0700

RM9000 serial driver

Add support for the integrated serial ports of the MIPS RM9122 processor
and its relatives.

The patch also does some whitespace cleanup.

[EMAIL PROTECTED]: cleanups]
Signed-off-by: Thomas Koeller [EMAIL PROTECTED]
Cc: Ralf Baechle [EMAIL PROTECTED]
Cc: Russell King [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/mips/Kconfig   |3 +
 drivers/serial/8250.c   |   92 +--
 drivers/serial/Kconfig  |9 
 include/linux/serial_core.h |4 +-
 4 files changed, 95 insertions(+), 13 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 130d825..7441a2c 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1042,6 +1042,9 @@ config SOC_AU1X00
select SYS_SUPPORTS_APM_EMULATION
select SYS_SUPPORTS_KGDB
 
+config SERIAL_RM9000
+   bool
+
 config PNX8550
bool
select SOC_PNX8550
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 194362d..c9832d9 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -251,9 +251,16 @@ static const struct serial8250_config uart_config[] = {
.fcr= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
.flags  = UART_CAP_FIFO | UART_CAP_UUE,
},
+   [PORT_RM9000] = {
+   .name   = RM9000,
+   .fifo_size  = 16,
+   .tx_loadsz  = 16,
+   .fcr= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+   .flags  = UART_CAP_FIFO,
+   },
 };
 
-#ifdef CONFIG_SERIAL_8250_AU1X00
+#if defined (CONFIG_SERIAL_8250_AU1X00)
 
 /* Au1x00 UART hardware has a weird register layout */
 static const u8 au_io_in_map[] = {
@@ -289,6 +296,44 @@ static inline int map_8250_out_reg(struct uart_8250_port 
*up, int offset)
return au_io_out_map[offset];
 }
 
+#elif defined (CONFIG_SERIAL_8250_RM9K)
+
+static const u8
+   regmap_in[8] = {
+   [UART_RX]   = 0x00,
+   [UART_IER]  = 0x0c,
+   [UART_IIR]  = 0x14,
+   [UART_LCR]  = 0x1c,
+   [UART_MCR]  = 0x20,
+   [UART_LSR]  = 0x24,
+   [UART_MSR]  = 0x28,
+   [UART_SCR]  = 0x2c
+   },
+   regmap_out[8] = {
+   [UART_TX]   = 0x04,
+   [UART_IER]  = 0x0c,
+   [UART_FCR]  = 0x18,
+   [UART_LCR]  = 0x1c,
+   [UART_MCR]  = 0x20,
+   [UART_LSR]  = 0x24,
+   [UART_MSR]  = 0x28,
+   [UART_SCR]  = 0x2c
+   };
+
+static inline int map_8250_in_reg(struct uart_8250_port *up, int offset)
+{
+   if (up-port.iotype != UPIO_RM9000)
+   return offset;
+   return regmap_in[offset];
+}
+
+static inline int map_8250_out_reg(struct uart_8250_port *up, int offset)
+{
+   if (up-port.iotype != UPIO_RM9000)
+   return offset;
+   return regmap_out[offset];
+}
+
 #else
 
 /* sane hardware needs no mapping */
@@ -311,6 +356,7 @@ static unsigned int serial_in(struct uart_8250_port *up, 
int offset)
case UPIO_DWAPB:
return readb(up-port.membase + offset);
 
+   case UPIO_RM9000:
case UPIO_MEM32:
return readl(up-port.membase + offset);
 
@@ -348,6 +394,7 @@ serial_out(struct uart_8250_port *up, int offset, int value)
writeb(value, up-port.membase + offset);
break;
 
+   case UPIO_RM9000:
case UPIO_MEM32:
writel(value, up-port.membase + offset);
break;
@@ -419,7 +466,7 @@ static inline void _serial_dl_write(struct uart_8250_port 
*up, int value)
serial_outp(up, UART_DLM, value  8  0xff);
 }
 
-#ifdef CONFIG_SERIAL_8250_AU1X00
+#if defined (CONFIG_SERIAL_8250_AU1X00)
 /* Au1x00 haven't got a standard divisor latch */
 static int serial_dl_read(struct uart_8250_port *up)
 {
@@ -436,6 +483,24 @@ static void serial_dl_write(struct uart_8250_port *up, int 
value)
else
_serial_dl_write(up, value);
 }
+#elif defined (CONFIG_SERIAL_8250_RM9K)
+static int serial_dl_read(struct uart_8250_port *up)
+{
+   return  (up-port.iotype == UPIO_RM9000) ?
+   (((__raw_readl(up-port.membase + 0x10)  8) |
+   (__raw_readl(up-port.membase + 0x08)  0xff))  0x) :
+   

add new_id to PCMCIA drivers

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6179b5562d5d17c7c09b54cb11dd925ca308d7a9
Commit: 6179b5562d5d17c7c09b54cb11dd925ca308d7a9
Parent: 02c83595b86480ee4d61665beb13f76685d40239
Author: Bernhard Walle [EMAIL PROTECTED]
AuthorDate: Sun May 6 14:48:44 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 12:12:50 2007 -0700

add new_id to PCMCIA drivers

PCI drivers have the new_id file in sysfs which allows new IDs to be added
at runtime.  The advantage is to avoid re-compilation of a driver that
works for a new device, but it's ID table doesn't contain the new device.
This mechanism is only meant for testing, after the driver has been tested
successfully, the ID should be added in source code so that new revisions
of the kernel automatically detect the device.

The implementation follows the PCI implementation. The interface is 
documented
in Documentation/pcmcia/driver.txt. Computations should be done in 
userspace,
so the sysfs string contains the raw structure members for matching.

Signed-off-by: Bernhard Walle [EMAIL PROTECTED]
Cc: Dominik Brodowski [EMAIL PROTECTED]
Cc: Greg KH [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/pcmcia/driver.txt |   30 ++
 drivers/pcmcia/ds.c |  113 ++-
 include/pcmcia/ds.h |6 ++
 3 files changed, 148 insertions(+), 1 deletions(-)

diff --git a/Documentation/pcmcia/driver.txt b/Documentation/pcmcia/driver.txt
new file mode 100644
index 000..0ac1679
--- /dev/null
+++ b/Documentation/pcmcia/driver.txt
@@ -0,0 +1,30 @@
+PCMCIA Driver
+-
+
+
+sysfs
+-
+
+New PCMCIA IDs may be added to a device driver pcmcia_device_id table at
+runtime as shown below:
+
+echo match_flags manf_id card_id func_id function device_no \
+prod_id_hash[0] prod_id_hash[1] prod_id_hash[2] prod_id_hash[3]  \
+/sys/bus/pcmcia/drivers/{driver}/new_id
+
+All fields are passed in as hexadecimal values (no leading 0x).
+The meaning is described in the PCMCIA specification, the match_flags is
+a bitwise or-ed combination from PCMCIA_DEV_ID_MATCH_* constants
+defined in include/linux/mod_devicetable.h.
+
+Once added, the driver probe routine will be invoked for any unclaimed
+PCMCIA device listed in its (newly updated) pcmcia_device_id list.
+
+A common use-case is to add a new device according to the manufacturer ID
+and the card ID (form the manf_id and card_id file in the device tree).
+For this, just use:
+
+echo 0x3 manf_id card_id 0 0 0 0 0 0 0  \
+/sys/bus/pcmcia/drivers/{driver}/new_id
+
+after loading the driver.
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 18e111e..143c6ef 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -234,6 +234,89 @@ static void pcmcia_check_driver(struct pcmcia_driver 
*p_drv)
 /*==*/
 
 
+struct pcmcia_dynid {
+   struct list_headnode;
+   struct pcmcia_device_id id;
+};
+
+/**
+ * pcmcia_store_new_id - add a new PCMCIA device ID to this driver and 
re-probe devices
+ * @driver: target device driver
+ * @buf: buffer for scanning device ID data
+ * @count: input size
+ *
+ * Adds a new dynamic PCMCIA device ID to this driver,
+ * and causes the driver to probe for all devices again.
+ */
+static ssize_t
+pcmcia_store_new_id(struct device_driver *driver, const char *buf, size_t 
count)
+{
+   struct pcmcia_dynid *dynid;
+   struct pcmcia_driver *pdrv = to_pcmcia_drv(driver);
+   __u16 match_flags, manf_id, card_id;
+   __u8 func_id, function, device_no;
+   __u32 prod_id_hash[4] = {0, 0, 0, 0};
+   int fields=0;
+   int retval = 0;
+
+   fields = sscanf(buf, %hx %hx %hx %hhx %hhx %hhx %x %x %x %x,
+   match_flags, manf_id, card_id, func_id, function, 
device_no,
+   prod_id_hash[0], prod_id_hash[1], prod_id_hash[2], 
prod_id_hash[3]);
+   if (fields  6)
+   return -EINVAL;
+
+   dynid = kzalloc(sizeof(struct pcmcia_dynid), GFP_KERNEL);
+   if (!dynid)
+   return -ENOMEM;
+
+   INIT_LIST_HEAD(dynid-node);
+   dynid-id.match_flags = match_flags;
+   dynid-id.manf_id = manf_id;
+   dynid-id.card_id = card_id;
+   dynid-id.func_id = func_id;
+   dynid-id.function = function;
+   dynid-id.device_no = device_no;
+   memcpy(dynid-id.prod_id_hash, prod_id_hash, sizeof(__u32) * 4);
+
+   spin_lock(pdrv-dynids.lock);
+   list_add_tail(pdrv-dynids.list, dynid-node);
+   spin_unlock(pdrv-dynids.lock);
+
+   if (get_driver(pdrv-drv)) {
+   retval = driver_attach(pdrv-drv);
+   put_driver(pdrv-drv);
+   }
+
+   if (retval)
+   

Serial: serial_core, use pr_debug

2007-05-07 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eb3a1e1145ca8f12372c7c96aa0702d86a9002a9
Commit: eb3a1e1145ca8f12372c7c96aa0702d86a9002a9
Parent: 1733310bb762cb926669f2c10f6f8719bb20ed91
Author: Jiri Slaby [EMAIL PROTECTED]
AuthorDate: Sun May 6 14:48:52 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon May 7 12:12:51 2007 -0700

Serial: serial_core, use pr_debug

serial_core, use pr_debug

Signed-off-by: Jiri Slaby [EMAIL PROTECTED]
Cc: Russell King [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/serial/serial_core.c |   17 +
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index f409be3..326020f 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -37,13 +37,6 @@
 #include asm/irq.h
 #include asm/uaccess.h
 
-#undef DEBUG
-#ifdef DEBUG
-#define DPRINTK(x...)  printk(x)
-#else
-#define DPRINTK(x...)  do { } while (0)
-#endif
-
 /*
  * This is used to lock changes in serial line configuration.
  */
@@ -552,7 +545,7 @@ static void uart_flush_buffer(struct tty_struct *tty)
return;
}
 
-   DPRINTK(uart_flush_buffer(%d) called\n, tty-index);
+   pr_debug(uart_flush_buffer(%d) called\n, tty-index);
 
spin_lock_irqsave(port-lock, flags);
uart_circ_clear(state-info-xmit);
@@ -1224,7 +1217,7 @@ static void uart_close(struct tty_struct *tty, struct 
file *filp)
 
port = state-port;
 
-   DPRINTK(uart_close(%d) called\n, port-line);
+   pr_debug(uart_close(%d) called\n, port-line);
 
mutex_lock(state-mutex);
 
@@ -1343,7 +1336,7 @@ static void uart_wait_until_sent(struct tty_struct *tty, 
int timeout)
 
expire = jiffies + timeout;
 
-   DPRINTK(uart_wait_until_sent(%d), jiffies=%lu, expire=%lu...\n,
+   pr_debug(uart_wait_until_sent(%d), jiffies=%lu, expire=%lu...\n,
port-line, jiffies, expire);
 
/*
@@ -1372,7 +1365,7 @@ static void uart_hangup(struct tty_struct *tty)
struct uart_state *state = tty-driver_data;
 
BUG_ON(!kernel_locked());
-   DPRINTK(uart_hangup(%d)\n, state-port-line);
+   pr_debug(uart_hangup(%d)\n, state-port-line);
 
mutex_lock(state-mutex);
if (state-info  state-info-flags  UIF_NORMAL_ACTIVE) {
@@ -1570,7 +1563,7 @@ static int uart_open(struct tty_struct *tty, struct file 
*filp)
int retval, line = tty-index;
 
BUG_ON(!kernel_locked());
-   DPRINTK(uart_open(%d) called\n, line);
+   pr_debug(uart_open(%d) called\n, line);
 
/*
 * tty-driver-num won't change, so we won't fail here with
-
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


  1   2   3   >