[GIT PATCH] repost I/OAT fixes

2007-03-08 Thread Christopher Leech
I/OAT fixes and missing documentation.

Please pull from,
git://lost.foo-projects.org/~cleech/linux-2.6#master

--

Andrew Morton (1):
  I/OAT: warning fix

Chris Leech (6):
  ioatdma: Push pending transactions to hardware more frequently
  ioatdma: Remove the wrappers around read(bwl)/write(bwl) in ioatdma
  ioatdma: Remove the use of writeq from the ioatdma driver
  I/OAT: Add documentation for the tcp_dma_copybreak sysctl
  I/OAT: Add entries to MAINTAINERS for the DMA memcpy subsystem and ioatdma
  I/OAT: Only offload copies for TCP when there will be a context switch

Dan Aloni (1):
  I/OAT: fix I/OAT for kexec

Jeff Garzik (1):
  drivers/dma: handle sysfs errors


 Documentation/networking/ip-sysctl.txt |6 +
 MAINTAINERS|   12 +++
 drivers/dma/dmaengine.c|   22 +-
 drivers/dma/ioatdma.c  |   81 --
 drivers/dma/ioatdma_io.h   |  118 -
 net/ipv4/tcp.c |   26 +--
 6 files changed, 100 insertions(+), 165 deletions(-)

commit 3ac82a51550c649c67f42f218e5d1ccc4e865685
Author: Dan Aloni <[EMAIL PROTECTED]>
Date:   Thu Mar 8 09:57:36 2007 -0800

I/OAT: fix I/OAT for kexec

Under kexec, I/OAT initialization breaks over busy resources because the
previous kernel did not release them.

I'm not sure this fix can be considered a complete one but it works for me.
 I guess something similar to the *_remove method should occur there..

Signed-off-by: Dan Aloni <[EMAIL PROTECTED]>
Signed-off-by: Chris Leech <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>

diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c
index cbf93ca..1d259e5 100644
--- a/drivers/dma/ioatdma.c
+++ b/drivers/dma/ioatdma.c
@@ -41,6 +41,7 @@
 
 /* internal functions */
 static int __devinit ioat_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent);
+static void ioat_shutdown(struct pci_dev *pdev);
 static void __devexit ioat_remove(struct pci_dev *pdev);
 
 static int enumerate_dma_channels(struct ioat_device *device)
@@ -557,6 +558,7 @@ static struct pci_driver ioat_pci_drv = {
.name   = "ioatdma",
.id_table = ioat_pci_tbl,
.probe  = ioat_probe,
+   .shutdown = ioat_shutdown,
.remove = __devexit_p(ioat_remove),
 };
 
@@ -781,9 +783,20 @@ err_request_regions:
 err_set_dma_mask:
pci_disable_device(pdev);
 err_enable_device:
+
+   printk(KERN_ERR "Intel(R) I/OAT DMA Engine initialization failed\n");
+
return err;
 }
 
+static void ioat_shutdown(struct pci_dev *pdev)
+{
+   struct ioat_device *device;
+   device = pci_get_drvdata(pdev);
+
+   dma_async_device_unregister(>common);
+}
+
 static void __devexit ioat_remove(struct pci_dev *pdev)
 {
struct ioat_device *device;

commit 1fa77931067fac6fb2fa01008854da9c77cdcd87
Author: Andrew Morton <[EMAIL PROTECTED]>
Date:   Thu Mar 8 09:57:36 2007 -0800

I/OAT: warning fix
net/ipv4/tcp.c: In function 'tcp_recvmsg':
net/ipv4/tcp.c:: warning: unused variable 'available'

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Chris Leech <[EMAIL PROTECTED]>

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 5ccd5e1..69c525d 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1110,7 +1110,6 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, 
struct msghdr *msg,
long timeo;
struct task_struct *user_recv = NULL;
int copied_early = 0;
-   int available = 0;
struct sk_buff *skb;
 
lock_sock(sk);
@@ -1139,15 +1138,22 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, 
struct msghdr *msg,
tp->ucopy.dma_chan = NULL;
preempt_disable();
skb = skb_peek_tail(>sk_receive_queue);
-   if (skb)
-   available = TCP_SKB_CB(skb)->seq + skb->len - (*seq);
-   if ((available < target) &&
-   (len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) &&
-   !sysctl_tcp_low_latency && __get_cpu_var(softnet_data).net_dma) {
-   preempt_enable_no_resched();
-   tp->ucopy.pinned_list = dma_pin_iovec_pages(msg->msg_iov, len);
-   } else
-   preempt_enable_no_resched();
+   {
+   int available = 0;
+
+   if (skb)
+   available = TCP_SKB_CB(skb)->seq + skb->len - (*seq);
+   if ((available < target) &&
+   (len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) &&
+   !sysctl_tcp_low_latency &&
+   __get_cpu_var(softnet_data).net_dma) {
+   preempt_enable_no_resched();
+   tp->ucopy.pinned_list =
+   dma_pin_iovec_pages(msg->msg_iov, len);
+   } else {
+   preempt_enable_no_resched();
+   

[GIT PATCH] repost I/OAT fixes

2007-03-08 Thread Christopher Leech
I/OAT fixes and missing documentation.

Please pull from,
git://lost.foo-projects.org/~cleech/linux-2.6#master

--

Andrew Morton (1):
  I/OAT: warning fix

Chris Leech (6):
  ioatdma: Push pending transactions to hardware more frequently
  ioatdma: Remove the wrappers around read(bwl)/write(bwl) in ioatdma
  ioatdma: Remove the use of writeq from the ioatdma driver
  I/OAT: Add documentation for the tcp_dma_copybreak sysctl
  I/OAT: Add entries to MAINTAINERS for the DMA memcpy subsystem and ioatdma
  I/OAT: Only offload copies for TCP when there will be a context switch

Dan Aloni (1):
  I/OAT: fix I/OAT for kexec

Jeff Garzik (1):
  drivers/dma: handle sysfs errors


 Documentation/networking/ip-sysctl.txt |6 +
 MAINTAINERS|   12 +++
 drivers/dma/dmaengine.c|   22 +-
 drivers/dma/ioatdma.c  |   81 --
 drivers/dma/ioatdma_io.h   |  118 -
 net/ipv4/tcp.c |   26 +--
 6 files changed, 100 insertions(+), 165 deletions(-)

commit 3ac82a51550c649c67f42f218e5d1ccc4e865685
Author: Dan Aloni [EMAIL PROTECTED]
Date:   Thu Mar 8 09:57:36 2007 -0800

I/OAT: fix I/OAT for kexec

Under kexec, I/OAT initialization breaks over busy resources because the
previous kernel did not release them.

I'm not sure this fix can be considered a complete one but it works for me.
 I guess something similar to the *_remove method should occur there..

Signed-off-by: Dan Aloni [EMAIL PROTECTED]
Signed-off-by: Chris Leech [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]

diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c
index cbf93ca..1d259e5 100644
--- a/drivers/dma/ioatdma.c
+++ b/drivers/dma/ioatdma.c
@@ -41,6 +41,7 @@
 
 /* internal functions */
 static int __devinit ioat_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent);
+static void ioat_shutdown(struct pci_dev *pdev);
 static void __devexit ioat_remove(struct pci_dev *pdev);
 
 static int enumerate_dma_channels(struct ioat_device *device)
@@ -557,6 +558,7 @@ static struct pci_driver ioat_pci_drv = {
.name   = ioatdma,
.id_table = ioat_pci_tbl,
.probe  = ioat_probe,
+   .shutdown = ioat_shutdown,
.remove = __devexit_p(ioat_remove),
 };
 
@@ -781,9 +783,20 @@ err_request_regions:
 err_set_dma_mask:
pci_disable_device(pdev);
 err_enable_device:
+
+   printk(KERN_ERR Intel(R) I/OAT DMA Engine initialization failed\n);
+
return err;
 }
 
+static void ioat_shutdown(struct pci_dev *pdev)
+{
+   struct ioat_device *device;
+   device = pci_get_drvdata(pdev);
+
+   dma_async_device_unregister(device-common);
+}
+
 static void __devexit ioat_remove(struct pci_dev *pdev)
 {
struct ioat_device *device;

commit 1fa77931067fac6fb2fa01008854da9c77cdcd87
Author: Andrew Morton [EMAIL PROTECTED]
Date:   Thu Mar 8 09:57:36 2007 -0800

I/OAT: warning fix
net/ipv4/tcp.c: In function 'tcp_recvmsg':
net/ipv4/tcp.c:: warning: unused variable 'available'

Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Chris Leech [EMAIL PROTECTED]

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 5ccd5e1..69c525d 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1110,7 +1110,6 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, 
struct msghdr *msg,
long timeo;
struct task_struct *user_recv = NULL;
int copied_early = 0;
-   int available = 0;
struct sk_buff *skb;
 
lock_sock(sk);
@@ -1139,15 +1138,22 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, 
struct msghdr *msg,
tp-ucopy.dma_chan = NULL;
preempt_disable();
skb = skb_peek_tail(sk-sk_receive_queue);
-   if (skb)
-   available = TCP_SKB_CB(skb)-seq + skb-len - (*seq);
-   if ((available  target) 
-   (len  sysctl_tcp_dma_copybreak)  !(flags  MSG_PEEK) 
-   !sysctl_tcp_low_latency  __get_cpu_var(softnet_data).net_dma) {
-   preempt_enable_no_resched();
-   tp-ucopy.pinned_list = dma_pin_iovec_pages(msg-msg_iov, len);
-   } else
-   preempt_enable_no_resched();
+   {
+   int available = 0;
+
+   if (skb)
+   available = TCP_SKB_CB(skb)-seq + skb-len - (*seq);
+   if ((available  target) 
+   (len  sysctl_tcp_dma_copybreak)  !(flags  MSG_PEEK) 
+   !sysctl_tcp_low_latency 
+   __get_cpu_var(softnet_data).net_dma) {
+   preempt_enable_no_resched();
+   tp-ucopy.pinned_list =
+   dma_pin_iovec_pages(msg-msg_iov, len);
+   } else {
+   preempt_enable_no_resched();
+   }
+   }
 #endif
 
do {


Re: [2.6 patch] drivers/dma/: no "static inline" in C files

2007-02-26 Thread Christopher Leech
Thanks Adrian,

Dan, this applies to your code.  Mind adding it to your tree?

- Chris


On Sun, 2007-02-25 at 15:16 -0800, Adrian Bunk wrote:

This patch changes "static inline"s in C files to "static":
gcc should know best whether or not to inline a static function.

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

---

 drivers/dma/async_tx.c |   12 ++--
 drivers/dma/iop-adma.c |   14 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

--- linux-2.6.20-mm2/drivers/dma/iop-adma.c.old 2007-02-25 19:16:37.0 
+0100
+++ linux-2.6.20-mm2/drivers/dma/iop-adma.c 2007-02-25 19:16:58.0 
+0100
@@ -48,7 +48,7 @@
  * @slot: Slot to free
  * Caller must hold _chan->lock while calling this function
  */
-static inline void iop_adma_free_slots(struct iop_adma_desc_slot *slot)
+static void iop_adma_free_slots(struct iop_adma_desc_slot *slot)
 {
int stride = slot->stride;

@@ -60,7 +60,7 @@
}
 }

-static inline dma_cookie_t
+static dma_cookie_t
 iop_adma_run_tx_complete_actions(struct iop_adma_desc_slot *desc,
struct iop_adma_chan *iop_chan, dma_cookie_t cookie)
 {
@@ -108,7 +108,7 @@
return cookie;
 }

-static inline int
+static int
 iop_adma_clean_slot(struct iop_adma_desc_slot *desc,
struct iop_adma_chan *iop_chan)
 {
@@ -260,7 +260,7 @@
}
 }

-static inline void
+static void
 iop_adma_slot_cleanup(struct iop_adma_chan *iop_chan)
 {
spin_lock_bh(_chan->lock);
@@ -453,7 +453,7 @@
return (i > 0) ? i : -ENOMEM;
 }

-static inline dma_cookie_t
+static dma_cookie_t
 iop_desc_assign_cookie(struct iop_adma_chan *iop_chan,
struct iop_adma_desc_slot *desc)
 {
@@ -465,7 +465,7 @@
return cookie;
 }

-static inline void iop_adma_check_threshold(struct iop_adma_chan *iop_chan)
+static void iop_adma_check_threshold(struct iop_adma_chan *iop_chan)
 {
PRINTK("iop adma%d: pending: %d\n", iop_chan->device->id,
iop_chan->pending);
@@ -719,7 +719,7 @@
}
 }

-static inline void iop_adma_schedule_cleanup(unsigned long id)
+static void iop_adma_schedule_cleanup(unsigned long id)
 {
tasklet_schedule(iop_adma_tasklet[id]);
 }
--- linux-2.6.20-mm2/drivers/dma/async_tx.c.old 2007-02-25 19:17:06.0 
+0100
+++ linux-2.6.20-mm2/drivers/dma/async_tx.c 2007-02-25 19:17:48.0 
+0100
@@ -66,7 +66,7 @@
kfree(ref);
 }

-static inline void
+static void
 init_dma_chan_ref(struct dma_chan_ref *ref, struct dma_chan *chan)
 {
INIT_LIST_HEAD(>async_node);
@@ -316,7 +316,7 @@
do { } while (0);
 }

-static inline struct dma_chan *
+static struct dma_chan *
 async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
enum dma_transaction_type tx_type)
 {
@@ -324,7 +324,7 @@
 }
 #endif

-static inline void
+static void
 async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx,
enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx,
dma_async_tx_callback callback, void *callback_param)
@@ -370,7 +370,7 @@
  * @callback: function to call when the transaction completes
  * @callback_param: parameter to pass to the callback routine
  */
-static inline void
+static void
 sync_epilog(unsigned long flags, struct dma_async_tx_descriptor *depend_tx,
dma_async_tx_callback callback, void *callback_param)
 {
@@ -381,7 +381,7 @@
async_tx_ack(depend_tx);
 }

-static inline void
+static void
 do_async_xor(struct dma_async_tx_descriptor *tx, struct dma_device *device,
struct dma_chan *chan, struct page *dest, struct page **src_list,
unsigned int offset, unsigned int src_cnt, size_t len,
@@ -413,7 +413,7 @@
callback_param);
 }

-static inline void
+static void
 do_sync_xor(struct page *dest, struct page **src_list, unsigned int offset,
unsigned int src_cnt, size_t len, enum async_tx_flags flags,
struct dma_async_tx_descriptor *depend_tx,


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


Re: [2.6 patch] drivers/dma/: no static inline in C files

2007-02-26 Thread Christopher Leech
Thanks Adrian,

Dan, this applies to your code.  Mind adding it to your tree?

- Chris


On Sun, 2007-02-25 at 15:16 -0800, Adrian Bunk wrote:

This patch changes static inlines in C files to static:
gcc should know best whether or not to inline a static function.

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

---

 drivers/dma/async_tx.c |   12 ++--
 drivers/dma/iop-adma.c |   14 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

--- linux-2.6.20-mm2/drivers/dma/iop-adma.c.old 2007-02-25 19:16:37.0 
+0100
+++ linux-2.6.20-mm2/drivers/dma/iop-adma.c 2007-02-25 19:16:58.0 
+0100
@@ -48,7 +48,7 @@
  * @slot: Slot to free
  * Caller must hold iop_chan-lock while calling this function
  */
-static inline void iop_adma_free_slots(struct iop_adma_desc_slot *slot)
+static void iop_adma_free_slots(struct iop_adma_desc_slot *slot)
 {
int stride = slot-stride;

@@ -60,7 +60,7 @@
}
 }

-static inline dma_cookie_t
+static dma_cookie_t
 iop_adma_run_tx_complete_actions(struct iop_adma_desc_slot *desc,
struct iop_adma_chan *iop_chan, dma_cookie_t cookie)
 {
@@ -108,7 +108,7 @@
return cookie;
 }

-static inline int
+static int
 iop_adma_clean_slot(struct iop_adma_desc_slot *desc,
struct iop_adma_chan *iop_chan)
 {
@@ -260,7 +260,7 @@
}
 }

-static inline void
+static void
 iop_adma_slot_cleanup(struct iop_adma_chan *iop_chan)
 {
spin_lock_bh(iop_chan-lock);
@@ -453,7 +453,7 @@
return (i  0) ? i : -ENOMEM;
 }

-static inline dma_cookie_t
+static dma_cookie_t
 iop_desc_assign_cookie(struct iop_adma_chan *iop_chan,
struct iop_adma_desc_slot *desc)
 {
@@ -465,7 +465,7 @@
return cookie;
 }

-static inline void iop_adma_check_threshold(struct iop_adma_chan *iop_chan)
+static void iop_adma_check_threshold(struct iop_adma_chan *iop_chan)
 {
PRINTK(iop adma%d: pending: %d\n, iop_chan-device-id,
iop_chan-pending);
@@ -719,7 +719,7 @@
}
 }

-static inline void iop_adma_schedule_cleanup(unsigned long id)
+static void iop_adma_schedule_cleanup(unsigned long id)
 {
tasklet_schedule(iop_adma_tasklet[id]);
 }
--- linux-2.6.20-mm2/drivers/dma/async_tx.c.old 2007-02-25 19:17:06.0 
+0100
+++ linux-2.6.20-mm2/drivers/dma/async_tx.c 2007-02-25 19:17:48.0 
+0100
@@ -66,7 +66,7 @@
kfree(ref);
 }

-static inline void
+static void
 init_dma_chan_ref(struct dma_chan_ref *ref, struct dma_chan *chan)
 {
INIT_LIST_HEAD(ref-async_node);
@@ -316,7 +316,7 @@
do { } while (0);
 }

-static inline struct dma_chan *
+static struct dma_chan *
 async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
enum dma_transaction_type tx_type)
 {
@@ -324,7 +324,7 @@
 }
 #endif

-static inline void
+static void
 async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx,
enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx,
dma_async_tx_callback callback, void *callback_param)
@@ -370,7 +370,7 @@
  * @callback: function to call when the transaction completes
  * @callback_param: parameter to pass to the callback routine
  */
-static inline void
+static void
 sync_epilog(unsigned long flags, struct dma_async_tx_descriptor *depend_tx,
dma_async_tx_callback callback, void *callback_param)
 {
@@ -381,7 +381,7 @@
async_tx_ack(depend_tx);
 }

-static inline void
+static void
 do_async_xor(struct dma_async_tx_descriptor *tx, struct dma_device *device,
struct dma_chan *chan, struct page *dest, struct page **src_list,
unsigned int offset, unsigned int src_cnt, size_t len,
@@ -413,7 +413,7 @@
callback_param);
 }

-static inline void
+static void
 do_sync_xor(struct page *dest, struct page **src_list, unsigned int offset,
unsigned int src_cnt, size_t len, enum async_tx_flags flags,
struct dma_async_tx_descriptor *depend_tx,


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