add upper-32-bits macro

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=218e180e7ea5334e1f94121940ba82cd1f0f4e58
Commit: 218e180e7ea5334e1f94121940ba82cd1f0f4e58
Parent: 894b8788d7f265eb7c6f75a9a77cedeb48f51586
Author: Andrew Morton [EMAIL PROTECTED]
AuthorDate: Thu May 10 03:15:18 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu May 10 09:26:52 2007 -0700

add upper-32-bits macro

We keep on getting right shift count = width of type warnings when doing
things like

sector_t s;

x = s  56;

because with CONFIG_LBD=n, s is only 32-bit.  Similar problems can occur 
with
dma_addr_t's.

So add a simple wrapper function which code can use to avoid this warning.
The above example would become

x = upper_32_bits(s)  24;

The first user is in fact AFS.

Cc: James Bottomley [EMAIL PROTECTED]
Cc: Cameron, Steve [EMAIL PROTECTED]
Cc: Miller, Mike (OS Dev) [EMAIL PROTECTED]
Cc: Hisashi Hifumi [EMAIL PROTECTED]
Cc: Alan Cox [EMAIL PROTECTED]
Cc: David Howells [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/kernel.h |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 144b615..8645181 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -41,6 +41,16 @@ extern const char linux_proc_banner[];
 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
 #define roundup(x, y) x) + ((y) - 1)) / (y)) * (y))
 
+/**
+ * upper_32_bits - return bits 32-63 of a number
+ * @n: the number we're accessing
+ *
+ * A basic shift-right of a 64- or 32-bit quantity.  Use this to suppress
+ * the right shift count = width of type warning when that quantity is
+ * 32-bits.
+ */
+#define upper_32_bits(n) ((u32)(((n)  16)  16))
+
 #defineKERN_EMERG  0   /* system is unusable   
*/
 #defineKERN_ALERT  1   /* action must be taken immediately 
*/
 #defineKERN_CRIT   2   /* critical conditions  
*/
-
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


early_pfn_to_nid needs to be __meminit

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6f076f5dd9d227cea2704061048894b00cc0d62b
Commit: 6f076f5dd9d227cea2704061048894b00cc0d62b
Parent: a6a62b69b9f1b0cec0a119c5f4cd2f17d091e8f5
Author: Stephen Rothwell [EMAIL PROTECTED]
AuthorDate: Thu May 10 03:15:27 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu May 10 09:26:52 2007 -0700

early_pfn_to_nid needs to be __meminit

Since it is referenced by memmap_init_zone (which is __meminit) via the
early_pfn_in_nid macro when CONFIG_NODES_SPAN_OTHER_NODES is set (which
basically means PowerPC 64).

This removes a section mismatch warning in those circumstances.

Signed-off-by: Stephen Rothwell [EMAIL PROTECTED]
Cc: Yasunori Goto [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/page_alloc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index f9b5d6d..ae96dd8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2284,7 +2284,7 @@ static int __meminit next_active_region_index_in_nid(int 
index, int nid)
  * was used and there are no special requirements, this is a convenient
  * alternative
  */
-int __init early_pfn_to_nid(unsigned long pfn)
+int __meminit early_pfn_to_nid(unsigned long pfn)
 {
int i;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


AFS: write support fixes

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9b1f8d5930a813879278d0cbfc8c658d6a038dc
Commit: b9b1f8d5930a813879278d0cbfc8c658d6a038dc
Parent: 218e180e7ea5334e1f94121940ba82cd1f0f4e58
Author: David Howells [EMAIL PROTECTED]
AuthorDate: Thu May 10 03:15:21 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu May 10 09:26:52 2007 -0700

AFS: write support fixes

AFS write support fixes:

 (1) Support large files using the 64-bit file access operations if 
available
 on the server.

 (2) Use kmap_atomic() rather than kmap() in afs_prepare_page().

 (3) Don't do stuff in afs_writepage() that's done by the caller.

[EMAIL PROTECTED]: fix right shift count = width of type]
Signed-off-by: David Howells [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/afs/afs_fs.h   |2 +
 fs/afs/fsclient.c |  217 +++--
 fs/afs/write.c|   14 +---
 3 files changed, 216 insertions(+), 17 deletions(-)

diff --git a/fs/afs/afs_fs.h b/fs/afs/afs_fs.h
index 2198006..d963ef4 100644
--- a/fs/afs/afs_fs.h
+++ b/fs/afs/afs_fs.h
@@ -31,6 +31,8 @@ enum AFS_FS_Operations {
FSGETVOLUMEINFO = 148,  /* AFS Get root volume information */
FSGETROOTVOLUME = 151,  /* AFS Get root volume name */
FSLOOKUP= 161,  /* AFS lookup file in directory */
+   FSFETCHDATA64   = 65537, /* AFS Fetch file data */
+   FSSTOREDATA64   = 65538, /* AFS Store file data */
 };
 
 enum AFS_FS_Errors {
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index 025b190..56cc0ef 100644
--- a/fs/afs/fsclient.c
+++ b/fs/afs/fsclient.c
@@ -293,9 +293,33 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call,
case 0:
call-offset = 0;
call-unmarshall++;
+   if (call-operation_ID != FSFETCHDATA64) {
+   call-unmarshall++;
+   goto no_msw;
+   }
 
-   /* extract the returned data length */
+   /* extract the upper part of the returned data length of an
+* FSFETCHDATA64 op (which should always be 0 using this
+* client) */
case 1:
+   _debug(extract data length (MSW));
+   ret = afs_extract_data(call, skb, last, call-tmp, 4);
+   switch (ret) {
+   case 0: break;
+   case -EAGAIN:   return 0;
+   default:return ret;
+   }
+
+   call-count = ntohl(call-tmp);
+   _debug(DATA length MSW: %u, call-count);
+   if (call-count  0)
+   return -EBADMSG;
+   call-offset = 0;
+   call-unmarshall++;
+
+   no_msw:
+   /* extract the returned data length */
+   case 2:
_debug(extract data length);
ret = afs_extract_data(call, skb, last, call-tmp, 4);
switch (ret) {
@@ -312,7 +336,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call,
call-unmarshall++;
 
/* extract the returned data */
-   case 2:
+   case 3:
_debug(extract data);
if (call-count  0) {
page = call-reply3;
@@ -331,7 +355,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call,
call-unmarshall++;
 
/* extract the metadata */
-   case 3:
+   case 4:
ret = afs_extract_data(call, skb, last, call-buffer,
   (21 + 3 + 6) * 4);
switch (ret) {
@@ -349,7 +373,7 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call,
call-offset = 0;
call-unmarshall++;
 
-   case 4:
+   case 5:
_debug(trailer);
if (skb-len != 0)
return -EBADMSG;
@@ -381,6 +405,56 @@ static const struct afs_call_type afs_RXFSFetchData = {
.destructor = afs_flat_call_destructor,
 };
 
+static const struct afs_call_type afs_RXFSFetchData64 = {
+   .name   = FS.FetchData64,
+   .deliver= afs_deliver_fs_fetch_data,
+   .abort_to_error = afs_abort_to_error,
+   .destructor = afs_flat_call_destructor,
+};
+
+/*
+ * fetch data from a very large file
+ */
+static int afs_fs_fetch_data64(struct afs_server *server,
+  struct key *key,
+  struct afs_vnode *vnode,
+  off_t offset, size_t length,
+  struct page *buffer,
+  const struct afs_wait_mode *wait_mode)
+{
+   struct afs_call *call;
+   __be32 *bp;
+
+   

ocfs2: kobject/kset foobar

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c4a7f5eb5f6a02dcc3a35e47c37c3d221ebc1cc2
Commit: c4a7f5eb5f6a02dcc3a35e47c37c3d221ebc1cc2
Parent: 6f076f5dd9d227cea2704061048894b00cc0d62b
Author: Randy Dunlap [EMAIL PROTECTED]
AuthorDate: Thu May 10 03:15:30 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu May 10 09:26:52 2007 -0700

ocfs2: kobject/kset foobar

Fix gcc warning and Oops that it causes:

fs/ocfs2/cluster/masklog.c:161: warning: assignment from incompatible 
pointer type
[ 2776.204120] OCFS2 Node Manager 1.3.3
[ 2776.211729] BUG: spinlock bad magic on CPU#0, modprobe/4424
[ 2776.214269]  lock: 810021c8fe18, .magic: , .owner: /6394416, 
.owner_cpu: 0
[ 2776.217864] [ 2776.217865] Call Trace:
[ 2776.219662]  [803426c8] spin_bug+0x9e/0xe9
[ 2776.221921]  [803427bf] _raw_spin_lock+0x23/0xf9
[ 2776.224417]  [8051acf4] _spin_lock+0x9/0xb
[ 2776.226676]  [8033c3b1] kobject_shadow_add+0x98/0x1ac
[ 2776.229367]  [8033c4d0] kobject_add+0xb/0xd
[ 2776.231665]  [8033c4df] kset_add+0xd/0xf
[ 2776.233845]  [8033c5a6] kset_register+0x23/0x28
[ 2776.236309]  [8808ccb7] 
:ocfs2_nodemanager:mlog_sys_init+0x68/0x6d
[ 2776.239518]  [8808ccee] 
:ocfs2_nodemanager:o2cb_sys_init+0x32/0x4a
[ 2776.242726]  [880b80a6] :ocfs2_nodemanager:init_o2nm+0xa6/0xd5
[ 2776.245772]  [8025266c] sys_init_module+0x1471/0x15d2
[ 2776.248465]  [8033f250] simple_strtoull+0x0/0xdc
[ 2776.250959]  [8020948e] system_call+0x7e/0x83

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
Acked-by: Mark Fasheh [EMAIL PROTECTED]
Cc: Greg KH [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/ocfs2/cluster/masklog.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
index 2e975c0..a93620c 100644
--- a/fs/ocfs2/cluster/masklog.c
+++ b/fs/ocfs2/cluster/masklog.c
@@ -144,7 +144,8 @@ static struct kobj_type mlog_ktype = {
 };
 
 static struct kset mlog_kset = {
-   .kobj   = {.name = logmask, .ktype = mlog_ktype},
+   .kobj  = {.name = logmask},
+   .ktype = mlog_ktype
 };
 
 int mlog_sys_init(struct kset *o2cb_subsys)
@@ -157,7 +158,7 @@ int mlog_sys_init(struct kset *o2cb_subsys)
}
mlog_attr_ptrs[i] = NULL;
 
-   kobj_set_kset_s(mlog_kset, o2cb_subsys);
+   kobj_set_kset_s(mlog_kset, *o2cb_subsys);
return kset_register(mlog_kset);
 }
 
-
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


arm: fix i2c-pxa build

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0cfe61e1a72b345073bb7900a7887da8541abc7a
Commit: 0cfe61e1a72b345073bb7900a7887da8541abc7a
Parent: c4a7f5eb5f6a02dcc3a35e47c37c3d221ebc1cc2
Author: Russell King [EMAIL PROTECTED]
AuthorDate: Thu May 10 03:15:32 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu May 10 09:26:52 2007 -0700

arm: fix i2c-pxa build

From commit 7d054817b780e664bed6701b2aa637718e1905b7:
 According to the PXA27x developer's manual, we shall do so.

We shall also at least compile test our changes.

Signed-off-by: Russell King [EMAIL PROTECTED]
Cc: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-pxa.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 873544a..8a0a99b 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -548,7 +548,7 @@ static inline void i2c_pxa_stop_message(struct pxa_i2c *i2c)
 */
icr = readl(_ICR(i2c));
icr = ~(ICR_STOP | ICR_ACKNAK);
-   writel(icr, _IRC(i2c));
+   writel(icr, _ICR(i2c));
 }
 
 /*
-
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] paravirt: Add startup infrastructure for paravirtualization

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a18c92aab13aac7917bc87ceefa23da68698be4
Commit: 5a18c92aab13aac7917bc87ceefa23da68698be4
Parent: 0cfe61e1a72b345073bb7900a7887da8541abc7a
Author: Eric W. Biederman [EMAIL PROTECTED]
AuthorDate: Thu May 10 03:15:36 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu May 10 09:26:53 2007 -0700

Revert [PATCH] paravirt: Add startup infrastructure for paravirtualization

This reverts commit c9ccf30d77f04064fe5436027ab9d2230c7cdd94.

Entering the kernel at startup_32 without passing our real mode data in
%esi, and without guaranteeing that physical and virtual addresses are
identity mapped makes head.S impossible to maintain.

The only user of this infrastructure is lguest which is not merged so
nothing we currently support will break by removing this over designed
nightmare, and only the pending lguest patches will be affected.  The
pending Xen patches have a different entry point that they use.

We are currently discussing what Xen and lguest need to do to boot the
kernel in a more normal fashion so using startup_32 in this weird manner is
clearly not their long term direction.

So let's remove this code in head.S before it causes brain damage to people
trying to maintain head.S

Cc: Chris Wright [EMAIL PROTECTED]
Cc: Andi Kleen [EMAIL PROTECTED]
Cc: Jeremy Fitzhardinge [EMAIL PROTECTED]
Cc: Zachary Amsden [EMAIL PROTECTED]
CC: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
Signed-off-by: Rusty Russell [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/i386/kernel/head.S|   38 --
 arch/i386/kernel/paravirt.c|1 -
 arch/i386/kernel/vmlinux.lds.S |6 --
 include/asm-i386/paravirt.h|5 -
 4 files changed, 0 insertions(+), 50 deletions(-)

diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index 9b10af6..f74dfc4 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -71,12 +71,6 @@ INIT_MAP_BEYOND_END = BOOTBITMAP_SIZE + (PAGE_TABLE_SIZE + 
ALLOCATOR_SLOP)*PAGE_
 .section .text.head,ax,@progbits
 ENTRY(startup_32)
 
-#ifdef CONFIG_PARAVIRT
-movl %cs, %eax
-testl $0x3, %eax
-jnz startup_paravirt
-#endif
-
 /*
  * Set segments to known values.
  */
@@ -501,38 +495,6 @@ ignore_int:
iret
 
 .section .text
-#ifdef CONFIG_PARAVIRT
-startup_paravirt:
-   cld
-   movl $(init_thread_union+THREAD_SIZE),%esp
-
-   /* We take pains to preserve all the regs. */
-   pushl   %edx
-   pushl   %ecx
-   pushl   %eax
-
-   pushl   $__start_paravirtprobe
-1:
-   movl0(%esp), %eax
-   cmpl$__stop_paravirtprobe, %eax
-   je  unhandled_paravirt
-   pushl   (%eax)
-   movl8(%esp), %eax
-   call*(%esp)
-   popl%eax
-
-   movl4(%esp), %eax
-   movl8(%esp), %ecx
-   movl12(%esp), %edx
-
-   addl$4, (%esp)
-   jmp 1b
-
-unhandled_paravirt:
-   /* Nothing wanted us: we're screwed. */
-   ud2
-#endif
-
 /*
  * Real beginning of normal text segment
  */
diff --git a/arch/i386/kernel/paravirt.c b/arch/i386/kernel/paravirt.c
index 5c10f37..faab09a 100644
--- a/arch/i386/kernel/paravirt.c
+++ b/arch/i386/kernel/paravirt.c
@@ -19,7 +19,6 @@
 #include linux/module.h
 #include linux/efi.h
 #include linux/bcd.h
-#include linux/start_kernel.h
 #include linux/highmem.h
 
 #include asm/bug.h
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/i386/kernel/vmlinux.lds.S
index 23e8614..80bec66 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/i386/kernel/vmlinux.lds.S
@@ -78,12 +78,6 @@ SECTIONS
CONSTRUCTORS
} :data
 
-  .paravirtprobe : AT(ADDR(.paravirtprobe) - LOAD_OFFSET) {
-   __start_paravirtprobe = .;
-   *(.paravirtprobe)
-   __stop_paravirtprobe = .;
-  }
-
   . = ALIGN(4096);
   .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
__nosave_begin = .;
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h
index bc5c12c..d7a0512 100644
--- a/include/asm-i386/paravirt.h
+++ b/include/asm-i386/paravirt.h
@@ -222,11 +222,6 @@ struct paravirt_ops
void (*iret)(void);
 };
 
-/* Mark a paravirt probe function. */
-#define paravirt_probe(fn) \
- static asmlinkage void (*__paravirtprobe_##fn)(void) __attribute_used__ \
-   __attribute__((__section__(.paravirtprobe))) = fn
-
 extern struct paravirt_ops paravirt_ops;
 
 #define PARAVIRT_PATCH(x)  \
-
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  

SLUB: SLUB_DEBUG must depend on SLUB

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d4751a2797bc0a37a8e85783d65ffaa9de689e60
Commit: d4751a2797bc0a37a8e85783d65ffaa9de689e60
Parent: 5a18c92aab13aac7917bc87ceefa23da68698be4
Author: Christoph Lameter [EMAIL PROTECTED]
AuthorDate: Thu May 10 03:15:40 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu May 10 09:26:53 2007 -0700

SLUB: SLUB_DEBUG must depend on SLUB

Otherwise people get asked about SLUB_DEBUG even if they have another
slab allocator enabled.

Signed-off-by: Christoph Lameter [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 init/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
index e63a017..322b1f8 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -505,6 +505,7 @@ config VM_EVENT_COUNTERS
 config SLUB_DEBUG
default y
bool Enable SLUB debugging support if EMBEDDED
+   depends on SLUB
help
  SLUB has extensive debug support features. Disabling these can
  result in significant savings in code size. This also disables
-
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


SLUB: remove nr_cpu_ids hack

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bcf889f96597137760c6edfdd0ee59fd37cb108c
Commit: bcf889f96597137760c6edfdd0ee59fd37cb108c
Parent: d4751a2797bc0a37a8e85783d65ffaa9de689e60
Author: Christoph Lameter [EMAIL PROTECTED]
AuthorDate: Thu May 10 03:15:44 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu May 10 09:26:53 2007 -0700

SLUB: remove nr_cpu_ids hack

This was in SLUB in order to head off trouble while the nr_cpu_ids
functionality was not merged.  Its merged now so no need to still have this.

Signed-off-by: Christoph Lameter [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/slub.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index b07a1ca..b39c8a6 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2445,9 +2445,8 @@ void __init kmem_cache_init(void)
register_cpu_notifier(slab_notifier);
 #endif
 
-   if (nr_cpu_ids) /* Remove when nr_cpu_ids is fixed upstream ! */
-   kmem_size = offsetof(struct kmem_cache, cpu_slab)
-+ nr_cpu_ids * sizeof(struct page *);
+   kmem_size = offsetof(struct kmem_cache, cpu_slab) +
+   nr_cpu_ids * sizeof(struct page *);
 
printk(KERN_INFO SLUB: Genslabs=%d, HWalign=%d, Order=%d-%d, 
MinObjects=%d,
 Processors=%d, Nodes=%d\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


i2c-at91 supports new-style i2c drivers

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6e99806ebb33c1b4906ce4f99eec65d4962f12b9
Commit: 6e99806ebb33c1b4906ce4f99eec65d4962f12b9
Parent: dd00a99e7a4b739bd41ef4093760efc7e447f963
Author: David Brownell [EMAIL PROTECTED]
AuthorDate: Thu May 10 03:15:52 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Thu May 10 09:26:53 2007 -0700

i2c-at91 supports new-style i2c drivers

Make i2c-at91 register as i2c adapter zero (none of these chips seem to
have more than one TWI controllers) to let it kick in any board-specific
device declarations; also make it hotplug/coldplug.

Signed-off-by: David Brownell [EMAIL PROTECTED]
Acked-by: Jean Delvare [EMAIL PROTECTED]
Cc: Andrew Victor [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/i2c/busses/i2c-at91.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index f35156c..1dcb714 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -226,13 +226,14 @@ static int __devinit at91_i2c_probe(struct 
platform_device *pdev)
adapter-algo = at91_algorithm;
adapter-class = I2C_CLASS_HWMON;
adapter-dev.parent = pdev-dev;
+   /* adapter-id == 0 ... only one TWI controller for now */
 
platform_set_drvdata(pdev, adapter);
 
clk_enable(twi_clk);/* enable peripheral clock */
at91_twi_hwinit();  /* initialize TWI controller */
 
-   rc = i2c_add_adapter(adapter);
+   rc = i2c_add_numbered_adapter(adapter);
if (rc) {
dev_err(pdev-dev, Adapter %s registration failed\n,
adapter-name);
@@ -295,6 +296,9 @@ static int at91_i2c_resume(struct platform_device *pdev)
 #define at91_i2c_resumeNULL
 #endif
 
+/* work with modprobe at91_i2c from hotplugging or coldplugging */
+MODULE_ALIAS(at91_i2c);
+
 static struct platform_driver at91_i2c_driver = {
.probe  = at91_i2c_probe,
.remove = __devexit_p(at91_i2c_remove),
-
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


[S390] fix subsystem removal fallout

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0b0bb3c6bd66bd28062a71c2ca3878d31e2081ee
Commit: 0b0bb3c6bd66bd28062a71c2ca3878d31e2081ee
Parent: de5603748af8bf7deac403e6ba92887f8d18e812
Author: Cornelia Huck [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:41 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:45:50 2007 +0200

[S390] fix subsystem removal fallout

This patch fixes compilation on s390 after the removal of
struct subsystem.

Signed-off-by: Cornelia Huck [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 arch/s390/hypfs/inode.c |2 +-
 arch/s390/kernel/ipl.c  |   26 +-
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index ba5d316..8e1ea1c 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -477,7 +477,7 @@ static int __init hypfs_init(void)
goto fail_diag;
}
}
-   kset_set_kset_s(s390_subsys, hypervisor_subsys);
+   kobj_set_kset_s(s390_subsys, hypervisor_subsys);
rc = subsystem_register(s390_subsys);
if (rc)
goto fail_sysfs;
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 0ea048d..367caf9 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -816,23 +816,23 @@ static int __init ipl_register_fcp_files(void)
 {
int rc;
 
-   rc = sysfs_create_group(ipl_subsys.kset.kobj,
+   rc = sysfs_create_group(ipl_subsys.kobj,
ipl_fcp_attr_group);
if (rc)
goto out;
-   rc = sysfs_create_bin_file(ipl_subsys.kset.kobj,
+   rc = sysfs_create_bin_file(ipl_subsys.kobj,
   ipl_parameter_attr);
if (rc)
goto out_ipl_parm;
-   rc = sysfs_create_bin_file(ipl_subsys.kset.kobj,
+   rc = sysfs_create_bin_file(ipl_subsys.kobj,
   ipl_scp_data_attr);
if (!rc)
goto out;
 
-   sysfs_remove_bin_file(ipl_subsys.kset.kobj, ipl_parameter_attr);
+   sysfs_remove_bin_file(ipl_subsys.kobj, ipl_parameter_attr);
 
 out_ipl_parm:
-   sysfs_remove_group(ipl_subsys.kset.kobj, ipl_fcp_attr_group);
+   sysfs_remove_group(ipl_subsys.kobj, ipl_fcp_attr_group);
 out:
return rc;
 }
@@ -846,7 +846,7 @@ static int __init ipl_init(void)
return rc;
switch (ipl_info.type) {
case IPL_TYPE_CCW:
-   rc = sysfs_create_group(ipl_subsys.kset.kobj,
+   rc = sysfs_create_group(ipl_subsys.kobj,
ipl_ccw_attr_group);
break;
case IPL_TYPE_FCP:
@@ -854,11 +854,11 @@ static int __init ipl_init(void)
rc = ipl_register_fcp_files();
break;
case IPL_TYPE_NSS:
-   rc = sysfs_create_group(ipl_subsys.kset.kobj,
+   rc = sysfs_create_group(ipl_subsys.kobj,
ipl_nss_attr_group);
break;
default:
-   rc = sysfs_create_group(ipl_subsys.kset.kobj,
+   rc = sysfs_create_group(ipl_subsys.kobj,
ipl_unknown_attr_group);
break;
}
@@ -885,7 +885,7 @@ static int __init reipl_nss_init(void)
 
if (!MACHINE_IS_VM)
return 0;
-   rc = sysfs_create_group(reipl_subsys.kset.kobj, reipl_nss_attr_group);
+   rc = sysfs_create_group(reipl_subsys.kobj, reipl_nss_attr_group);
if (rc)
return rc;
strncpy(reipl_nss_name, kernel_nss_name, NSS_NAME_SIZE + 1);
@@ -900,7 +900,7 @@ static int __init reipl_ccw_init(void)
reipl_block_ccw = (void *) get_zeroed_page(GFP_KERNEL);
if (!reipl_block_ccw)
return -ENOMEM;
-   rc = sysfs_create_group(reipl_subsys.kset.kobj, reipl_ccw_attr_group);
+   rc = sysfs_create_group(reipl_subsys.kobj, reipl_ccw_attr_group);
if (rc) {
free_page((unsigned long)reipl_block_ccw);
return rc;
@@ -938,7 +938,7 @@ static int __init reipl_fcp_init(void)
reipl_block_fcp = (void *) get_zeroed_page(GFP_KERNEL);
if (!reipl_block_fcp)
return -ENOMEM;
-   rc = sysfs_create_group(reipl_subsys.kset.kobj, reipl_fcp_attr_group);
+   rc = sysfs_create_group(reipl_subsys.kobj, reipl_fcp_attr_group);
if (rc) {
free_page((unsigned long)reipl_block_fcp);
return rc;
@@ -990,7 +990,7 @@ static int __init dump_ccw_init(void)
dump_block_ccw = (void *) get_zeroed_page(GFP_KERNEL);
if (!dump_block_ccw)
return -ENOMEM;
-   rc = sysfs_create_group(dump_subsys.kset.kobj, dump_ccw_attr_group);
+   rc = 

[S390] cio: Get rid of _ccw_device_get_device_number().

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a92fe48b92993bb3d20fd7021e22a1ab8a473df
Commit: 9a92fe48b92993bb3d20fd7021e22a1ab8a473df
Parent: 0b0bb3c6bd66bd28062a71c2ca3878d31e2081ee
Author: Cornelia Huck [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:42 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:45:51 2007 +0200

[S390] cio: Get rid of _ccw_device_get_device_number().

The function shouldn't have existed in the first place (not MSS-aware).
Introduce a new function ccw_device_get_id() that extracts the
ccw_dev_id structure of a ccw device and convert all users of
_ccw_device_get_device_number to ccw_device_get_id.

Signed-off-by: Cornelia Huck [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/block/dasd_diag.c  |   10 ++
 drivers/s390/block/dasd_ioctl.c |4 +++-
 drivers/s390/char/raw3270.c |5 +++--
 drivers/s390/cio/device_ops.c   |   11 +++
 include/asm-s390/ccwdev.h   |3 ++-
 5 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index e810e4a..eccac1c 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -50,6 +50,7 @@ struct dasd_diag_private {
struct dasd_diag_rw_io iob;
struct dasd_diag_init_io iib;
blocknum_t pt_block;
+   struct ccw_dev_id dev_id;
 };
 
 struct dasd_diag_req {
@@ -102,7 +103,7 @@ mdsk_init_io(struct dasd_device *device, unsigned int 
blocksize,
iib = private-iib;
memset(iib, 0, sizeof (struct dasd_diag_init_io));
 
-   iib-dev_nr = _ccw_device_get_device_number(device-cdev);
+   iib-dev_nr = private-dev_id.devno;
iib-block_size = blocksize;
iib-offset = offset;
iib-flaga = DASD_DIAG_FLAGA_DEFAULT;
@@ -127,7 +128,7 @@ mdsk_term_io(struct dasd_device * device)
private = (struct dasd_diag_private *) device-private;
iib = private-iib;
memset(iib, 0, sizeof (struct dasd_diag_init_io));
-   iib-dev_nr = _ccw_device_get_device_number(device-cdev);
+   iib-dev_nr = private-dev_id.devno;
rc = dia250(iib, TERM_BIO);
return rc;
 }
@@ -166,7 +167,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
private = (struct dasd_diag_private *) device-private;
dreq = (struct dasd_diag_req *) cqr-data;
 
-   private-iob.dev_nr = _ccw_device_get_device_number(device-cdev);
+   private-iob.dev_nr = private-dev_id.devno;
private-iob.key = 0;
private-iob.flags = DASD_DIAG_RWFLAG_ASYNC;
private-iob.block_count = dreq-block_count;
@@ -323,11 +324,12 @@ dasd_diag_check_device(struct dasd_device *device)
memory allocation failed for private data);
return -ENOMEM;
}
+   ccw_device_get_id(device-cdev, private-dev_id);
device-private = (void *) private;
}
/* Read Device Characteristics */
rdc_data = (void *) (private-rdc_data);
-   rdc_data-dev_nr = _ccw_device_get_device_number(device-cdev);
+   rdc_data-dev_nr = private-dev_id.devno;
rdc_data-rdc_len = sizeof (struct dasd_diag_characteristics);
 
rc = diag210((struct diag210 *) rdc_data);
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 758cfb5..672eb0a 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -255,6 +255,7 @@ dasd_ioctl_information(struct dasd_device *device,
unsigned long flags;
int rc;
struct ccw_device *cdev;
+   struct ccw_dev_id dev_id;
 
if (!device-discipline-fill_info)
return -EINVAL;
@@ -270,8 +271,9 @@ dasd_ioctl_information(struct dasd_device *device,
}
 
cdev = device-cdev;
+   ccw_device_get_id(cdev, dev_id);
 
-   dasd_info-devno = _ccw_device_get_device_number(device-cdev);
+   dasd_info-devno = dev_id.devno;
dasd_info-schid = _ccw_device_get_subchannel_number(device-cdev);
dasd_info-cu_type = cdev-id.cu_type;
dasd_info-cu_model = cdev-id.cu_model;
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 8facd14..f6ef90e 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -589,9 +589,10 @@ static int
 __raw3270_size_device_vm(struct raw3270 *rp)
 {
int rc, model;
+   struct ccw_dev_id dev_id;
 
-   raw3270_init_diag210.vrdcdvno = 
-   _ccw_device_get_device_number(rp-cdev);
+   ccw_device_get_id(rp-cdev, dev_id);
+   raw3270_init_diag210.vrdcdvno = dev_id.devno;
raw3270_init_diag210.vrdclen = sizeof(struct diag210);
rc = diag210(raw3270_init_diag210);
if (rc)
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index 

[S390] cio: Make some structures and a function static.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7e5d67c7928bfdbcdfd95a0b3d75122238e23e0
Commit: f7e5d67c7928bfdbcdfd95a0b3d75122238e23e0
Parent: 9a92fe48b92993bb3d20fd7021e22a1ab8a473df
Author: Cornelia Huck [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:43 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:45:51 2007 +0200

[S390] cio: Make some structures and a function static.

Signed-off-by: Cornelia Huck [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/cio/css.c|3 +--
 drivers/s390/cio/css.h|2 --
 drivers/s390/cio/device.c |4 ++--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 27c6d9e..dfca0ef 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -191,8 +191,7 @@ static int css_register_subchannel(struct subchannel *sch)
return ret;
 }
 
-int
-css_probe_device(struct subchannel_id schid)
+static int css_probe_device(struct subchannel_id schid)
 {
int ret;
struct subchannel *sch;
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
index 71fcfdc..ed79775 100644
--- a/drivers/s390/cio/css.h
+++ b/drivers/s390/cio/css.h
@@ -138,9 +138,7 @@ struct css_driver {
  * all css_drivers have the css_bus_type
  */
 extern struct bus_type css_bus_type;
-extern struct css_driver io_subchannel_driver;
 
-extern int css_probe_device(struct subchannel_id);
 extern int css_sch_device_register(struct subchannel *);
 extern void css_sch_device_unregister(struct subchannel *);
 extern struct subchannel * get_subchannel_by_schid(struct subchannel_id);
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index a23ff58..a8b373f 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -129,7 +129,7 @@ static void io_subchannel_verify(struct device *);
 static void io_subchannel_ioterm(struct device *);
 static void io_subchannel_shutdown(struct subchannel *);
 
-struct css_driver io_subchannel_driver = {
+static struct css_driver io_subchannel_driver = {
.subchannel_type = SUBCHANNEL_TYPE_IO,
.drv = {
.name = io_subchannel,
@@ -546,7 +546,7 @@ static struct attribute_group ccwdev_attr_group = {
.attrs = ccwdev_attrs,
 };
 
-struct attribute_group *ccwdev_attr_groups[] = {
+static struct attribute_group *ccwdev_attr_groups[] = {
ccwdev_attr_group,
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


[S390] monreader inlining cleanup.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b0c455a04d73d8ffa388a1006925620ad684ad8
Commit: 9b0c455a04d73d8ffa388a1006925620ad684ad8
Parent: f7e5d67c7928bfdbcdfd95a0b3d75122238e23e0
Author: Martin Schwidefsky [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:44 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:45:51 2007 +0200

[S390] monreader inlining cleanup.

Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/char/monreader.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 8df7b13..67009bf 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -97,7 +97,7 @@ static u8 user_data_sever[16] = {
  * Create the 8 bytes EBCDIC DCSS segment name from
  * an ASCII name, incl. padding
  */
-static inline void dcss_mkname(char *ascii_name, char *ebcdic_name)
+static void dcss_mkname(char *ascii_name, char *ebcdic_name)
 {
int i;
 
@@ -191,7 +191,7 @@ static inline u32 mon_rec_end(struct mon_msg *monmsg)
return *((u32 *) (mon_mca_start(monmsg) + monmsg-mca_offset + 8));
 }
 
-static inline int mon_check_mca(struct mon_msg *monmsg)
+static int mon_check_mca(struct mon_msg *monmsg)
 {
if ((mon_rec_end(monmsg) = mon_rec_start(monmsg)) ||
(mon_rec_start(monmsg)  mon_dcss_start) ||
@@ -209,8 +209,8 @@ static inline int mon_check_mca(struct mon_msg *monmsg)
return 0;
 }
 
-static inline int mon_send_reply(struct mon_msg *monmsg,
-struct mon_private *monpriv)
+static int mon_send_reply(struct mon_msg *monmsg,
+ struct mon_private *monpriv)
 {
int rc;
 
@@ -236,7 +236,7 @@ static inline int mon_send_reply(struct mon_msg *monmsg,
return 0;
 }
 
-static inline void mon_free_mem(struct mon_private *monpriv)
+static void mon_free_mem(struct mon_private *monpriv)
 {
int i;
 
@@ -246,7 +246,7 @@ static inline void mon_free_mem(struct mon_private *monpriv)
kfree(monpriv);
 }
 
-static inline struct mon_private *mon_alloc_mem(void)
+static struct mon_private *mon_alloc_mem(void)
 {
int i;
struct mon_private *monpriv;
@@ -307,7 +307,7 @@ static inline void mon_next_mca(struct mon_msg *monmsg)
monmsg-pos = 0;
 }
 
-static inline struct mon_msg *mon_next_message(struct mon_private *monpriv)
+static struct mon_msg *mon_next_message(struct mon_private *monpriv)
 {
struct mon_msg *monmsg;
 
-
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


[S390] dasd: Fix modular build.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aaff0f644a182015622d7686a66986319a1085d1
Commit: aaff0f644a182015622d7686a66986319a1085d1
Parent: 9b0c455a04d73d8ffa388a1006925620ad684ad8
Author: Cornelia Huck [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:45 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:45:52 2007 +0200

[S390] dasd: Fix modular build.

Add missing export of dasd_generic_read_dev_chars().

Signed-off-by: Cornelia Huck [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/block/dasd.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 9775210..403957a 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -2219,6 +2219,7 @@ int dasd_generic_read_dev_chars(struct dasd_device 
*device, char *magic,
dasd_sfree_request(cqr, cqr-device);
return ret;
 }
+EXPORT_SYMBOL_GPL(dasd_generic_read_dev_chars);
 
 static int __init
 dasd_init(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


[S390] Avoid sparse warnings.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=763968e217c6657afaff90fbbec93531b3d6ce70
Commit: 763968e217c6657afaff90fbbec93531b3d6ce70
Parent: aaff0f644a182015622d7686a66986319a1085d1
Author: Heiko Carstens [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:46 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:45:52 2007 +0200

[S390] Avoid sparse warnings.

Monthly sparse warning avoidance patch. Sigh.

Signed-off-by: Heiko Carstens [EMAIL PROTECTED]
---
 drivers/s390/block/dasd.c  |7 ---
 drivers/s390/block/dasd_eckd.c |6 +++---
 drivers/s390/char/sclp.h   |3 +++
 drivers/s390/char/sclp_sdias.c |8 
 drivers/s390/char/zcore.c  |9 +++--
 drivers/s390/net/qeth_mpc.c|4 ++--
 drivers/s390/scsi/zfcp_aux.c   |8 +++-
 drivers/s390/scsi/zfcp_dbf.c   |2 +-
 include/asm-s390/ipl.h |2 +-
 9 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 403957a..bfeca57 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -2174,9 +2174,10 @@ dasd_generic_notify(struct ccw_device *cdev, int event)
return ret;
 }
 
-struct dasd_ccw_req * dasd_generic_build_rdc(struct dasd_device *device,
-void *rdc_buffer,
-int rdc_buffer_size, char *magic)
+static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device,
+  void *rdc_buffer,
+  int rdc_buffer_size,
+  char *magic)
 {
struct dasd_ccw_req *cqr;
struct ccw1 *ccw;
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index c9583fb..418b4e6 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -450,9 +450,9 @@ dasd_eckd_generate_uid(struct dasd_device *device, struct 
dasd_uid *uid)
return 0;
 }
 
-struct dasd_ccw_req * dasd_eckd_build_rcd_lpm(struct dasd_device *device,
- void *rcd_buffer,
- struct ciw *ciw, __u8 lpm)
+static struct dasd_ccw_req *dasd_eckd_build_rcd_lpm(struct dasd_device *device,
+   void *rcd_buffer,
+   struct ciw *ciw, __u8 lpm)
 {
struct dasd_ccw_req *cqr;
struct ccw1 *ccw;
diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h
index 87ac4a3..dbb99d1 100644
--- a/drivers/s390/char/sclp.h
+++ b/drivers/s390/char/sclp.h
@@ -132,6 +132,9 @@ int sclp_deactivate(void);
 int sclp_reactivate(void);
 int sclp_service_call(sclp_cmdw_t command, void *sccb);
 
+int sclp_sdias_init(void);
+void sclp_sdias_exit(void);
+
 /* useful inlines */
 
 /* VM uses EBCDIC 037, LPAR+native(SE+HMC) use EBCDIC 500 */
diff --git a/drivers/s390/char/sclp_sdias.c b/drivers/s390/char/sclp_sdias.c
index 52283da..1c06497 100644
--- a/drivers/s390/char/sclp_sdias.c
+++ b/drivers/s390/char/sclp_sdias.c
@@ -66,9 +66,9 @@ static DEFINE_MUTEX(sdias_mutex);
 
 static void sdias_callback(struct sclp_req *request, void *data)
 {
-   struct sdias_sccb *sccb;
+   struct sdias_sccb *cbsccb;
 
-   sccb = (struct sdias_sccb *) request-sccb;
+   cbsccb = (struct sdias_sccb *) request-sccb;
sclp_req_done = 1;
wake_up(sdias_wq); /* Inform caller, that request is complete */
TRACE(callback done\n);
@@ -229,7 +229,7 @@ out:
return rc;
 }
 
-int __init sdias_init(void)
+int __init sclp_sdias_init(void)
 {
int rc;
 
@@ -248,7 +248,7 @@ int __init sdias_init(void)
return 0;
 }
 
-void __exit sdias_exit(void)
+void __exit sclp_sdias_exit(void)
 {
debug_unregister(sdias_dbf);
sclp_unregister(sclp_sdias_register);
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c
index 89d4393..66eb068 100644
--- a/drivers/s390/char/zcore.c
+++ b/drivers/s390/char/zcore.c
@@ -21,6 +21,7 @@
 #include asm/debug.h
 #include asm/processor.h
 #include asm/irqflags.h
+#include sclp.h
 
 #define TRACE(x...) debug_sprintf_event(zcore_dbf, 1, x)
 #define MSG(x...) printk( KERN_ALERT x )
@@ -564,8 +565,6 @@ static void __init zcore_header_init(int arch, struct 
zcore_header *hdr)
get_cpu_id(hdr-cpu_id);
 }
 
-extern int sdias_init(void);
-
 static int __init zcore_init(void)
 {
unsigned char arch;
@@ -582,7 +581,7 @@ static int __init zcore_init(void)
TRACE(wwpn:   %llx\n, (unsigned long long) ipl_info.data.fcp.wwpn);
TRACE(lun:%llx\n, (unsigned long long) ipl_info.data.fcp.lun);
 
-   rc = sdias_init();
+   rc = sclp_sdias_init();
if (rc)
goto fail;
 
@@ -634,12 +633,10 

[S390] qdio: re-add lost perf_stats.tl_runs change in qdio_handle_pci

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=853944cc40ef563f4046a0ada4c1e391419f6a25
Commit: 853944cc40ef563f4046a0ada4c1e391419f6a25
Parent: 763968e217c6657afaff90fbbec93531b3d6ce70
Author: Ursula Braun [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:47 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:45:52 2007 +0200

[S390] qdio: re-add lost perf_stats.tl_runs change in qdio_handle_pci

Statement has been inadvertently lost with commit
00c0c6466c66bdf05f2a3dcf59e6895179ea8b76.

Signed-off-by: Ursula Braun [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/s390/cio/qdio.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index f770018..e70aeb7 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -1983,6 +1983,7 @@ qdio_handle_pci(struct qdio_irq *irq_ptr)
if (q-is_input_qQDIO_FLAG_NO_INPUT_INTERRUPT_CONTEXT)
qdio_mark_q(q);
else {
+   qdio_perf_stat_dec(perf_stats.tl_runs);
__qdio_inbound_processing(q);
}
}
-
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


[S390] Avoid compile warning.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=490f03d6595fade75a9b26e6ea9c9ebb1e4fd05a
Commit: 490f03d6595fade75a9b26e6ea9c9ebb1e4fd05a
Parent: 853944cc40ef563f4046a0ada4c1e391419f6a25
Author: Heiko Carstens [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:48 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:45:53 2007 +0200

[S390] Avoid compile warning.

arch/s390/mm/fault.c: In function `signal_return':
arch/s390/mm/fault.c:256: warning: unused variable `compat'

Signed-off-by: Heiko Carstens [EMAIL PROTECTED]
---
 arch/s390/mm/fault.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 8b924b3..d855cdb 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -253,7 +253,10 @@ static int signal_return(struct mm_struct *mm, struct 
pt_regs *regs,
 unsigned long address, unsigned long error_code)
 {
u16 instruction;
-   int rc, compat;
+   int rc;
+#ifdef CONFIG_COMPAT
+   int compat;
+#endif
 
pagefault_disable();
rc = __get_user(instruction, (u16 __user *) regs-psw.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


[S390] Kconfig: refine depends statements.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eeca7a36a86db8bfc1945dd7f6f0c22a6b66b31d
Commit: eeca7a36a86db8bfc1945dd7f6f0c22a6b66b31d
Parent: 490f03d6595fade75a9b26e6ea9c9ebb1e4fd05a
Author: Martin Schwidefsky [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:56 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:46:07 2007 +0200

[S390] Kconfig: refine depends statements.

Refine some depends statements to limit their visibility to the
environments that are actually supported.

Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/auxdisplay/Kconfig |1 +
 drivers/char/Kconfig   |2 ++
 drivers/ieee1394/Kconfig   |1 +
 drivers/kvm/Kconfig|1 +
 drivers/message/fusion/Kconfig |1 +
 drivers/message/i2o/Kconfig|1 +
 6 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig
index 0300e7f..2e18a63 100644
--- a/drivers/auxdisplay/Kconfig
+++ b/drivers/auxdisplay/Kconfig
@@ -6,6 +6,7 @@
 #
 
 menu Auxiliary Display support
+   depends on PARPORT
 
 config KS0108
tristate KS0108 LCD Controller
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 2df42fd..7152500 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -81,6 +81,7 @@ config VT_HW_CONSOLE_BINDING
 
 config SERIAL_NONSTANDARD
bool Non-standard serial port support
+   depends on HAS_IOMEM
---help---
  Say Y here if you have any non-standard serial boards -- boards
  which aren't supported using the standard dumb serial driver.
@@ -858,6 +859,7 @@ config COBALT_LCD
 
 config DTLK
tristate Double Talk PC internal speech card support
+   depends on ISA
help
  This driver is for the DoubleTalk PC, a speech synthesizer
  manufactured by RC Systems (http://www.rcsys.com/).  It is also
diff --git a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig
index 61d7809..f21426a 100644
--- a/drivers/ieee1394/Kconfig
+++ b/drivers/ieee1394/Kconfig
@@ -1,4 +1,5 @@
 menu IEEE 1394 (FireWire) support
+   depends on PCI || BROKEN
 
 config IEEE1394
tristate IEEE 1394 (FireWire) support
diff --git a/drivers/kvm/Kconfig b/drivers/kvm/Kconfig
index 703cc88..e8e37d8 100644
--- a/drivers/kvm/Kconfig
+++ b/drivers/kvm/Kconfig
@@ -2,6 +2,7 @@
 # KVM configuration
 #
 menu Virtualization
+   depends on X86
 
 config KVM
tristate Kernel-based Virtual Machine (KVM) support
diff --git a/drivers/message/fusion/Kconfig b/drivers/message/fusion/Kconfig
index 71037f9..c88cc75 100644
--- a/drivers/message/fusion/Kconfig
+++ b/drivers/message/fusion/Kconfig
@@ -1,5 +1,6 @@
 
 menu Fusion MPT device support
+   depends on PCI
 
 config FUSION
bool
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig
index 6443392..f4ac21e 100644
--- a/drivers/message/i2o/Kconfig
+++ b/drivers/message/i2o/Kconfig
@@ -1,5 +1,6 @@
 
 menu I2O device support
+   depends on PCI
 
 config I2O
tristate I2O support
-
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


[S390] Kconfig: menus with depends on HAS_IOMEM.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e25df1205f37c7bff3ab14fdfc8a5249f3c69c82
Commit: e25df1205f37c7bff3ab14fdfc8a5249f3c69c82
Parent: eeca7a36a86db8bfc1945dd7f6f0c22a6b66b31d
Author: Martin Schwidefsky [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:57 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:46:07 2007 +0200

[S390] Kconfig: menus with depends on HAS_IOMEM.

Add depends on HAS_IOMEM to a number of menus to make them
disappear for s390 which does not have I/O memory.

Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/ata/Kconfig|1 +
 drivers/char/ipmi/Kconfig  |2 ++
 drivers/char/tpm/Kconfig   |1 +
 drivers/edac/Kconfig   |1 +
 drivers/hwmon/Kconfig  |1 +
 drivers/i2c/Kconfig|1 +
 drivers/ide/Kconfig|1 +
 drivers/infiniband/Kconfig |1 +
 drivers/leds/Kconfig   |1 +
 drivers/media/Kconfig  |1 +
 drivers/mfd/Kconfig|1 +
 drivers/mmc/Kconfig|1 +
 drivers/mtd/Kconfig|1 +
 drivers/parport/Kconfig|1 +
 drivers/pnp/Kconfig|1 +
 drivers/serial/Kconfig |1 +
 drivers/spi/Kconfig|1 +
 drivers/telephony/Kconfig  |1 +
 drivers/usb/Kconfig|1 +
 drivers/video/Kconfig  |1 +
 drivers/w1/Kconfig |1 +
 sound/Kconfig  |1 +
 22 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index c721966..f031b87 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu Serial ATA (prod) and Parallel ATA (experimental) drivers
+   depends on HAS_IOMEM
 
 config ATA
tristate ATA device support
diff --git a/drivers/char/ipmi/Kconfig b/drivers/char/ipmi/Kconfig
index a6dcb29..b894f67 100644
--- a/drivers/char/ipmi/Kconfig
+++ b/drivers/char/ipmi/Kconfig
@@ -3,6 +3,8 @@
 #
 
 menu IPMI
+   depends on HAS_IOMEM
+
 config IPMI_HANDLER
tristate 'IPMI top-level message handler'
help
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 11089be..dc4e1ff 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu TPM devices
+   depends on HAS_IOMEM
 
 config TCG_TPM
tristate TPM Hardware Support
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index 4f08984..807c402 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -7,6 +7,7 @@
 #
 
 menu 'EDAC - error detection and reporting (RAS) (EXPERIMENTAL)'
+   depends on HAS_IOMEM
 
 config EDAC
tristate EDAC core system error reporting (EXPERIMENTAL)
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 3ba3a52..4d1cb5b 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -4,6 +4,7 @@
 
 menuconfig HWMON
tristate Hardware Monitoring support
+   depends on HAS_IOMEM
default y
help
  Hardware monitoring devices let you monitor the hardware health
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index 434a61b..9686734 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -4,6 +4,7 @@
 
 menuconfig I2C
tristate I2C support
+   depends on HAS_IOMEM
---help---
  I2C (pronounce: I-square-C) is a slow serial bus protocol used in
  many micro controller applications and developed by Philips.  SMBus,
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 1d06b41..9040809 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -7,6 +7,7 @@
 if BLOCK
 
 menu ATA/ATAPI/MFM/RLL support
+   depends on HAS_IOMEM
 
 config IDE
tristate ATA/ATAPI/MFM/RLL support
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig
index 37deaae..994decc 100644
--- a/drivers/infiniband/Kconfig
+++ b/drivers/infiniband/Kconfig
@@ -1,4 +1,5 @@
 menu InfiniBand support
+   depends on HAS_IOMEM
 
 config INFINIBAND
depends on PCI || BROKEN
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 80acd08..87d2046 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -1,5 +1,6 @@
 
 menu LED devices
+   depends on HAS_IOMEM
 
 config NEW_LEDS
bool LED Support
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index 91d2579..3a80e0c 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu Multimedia devices
+   depends on HAS_IOMEM
 
 config VIDEO_DEV
tristate Video For Linux
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index ab6e985..a20a51e 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu Multifunction device drivers
+   depends on HAS_IOMEM
 
 config MFD_SM501
tristate Support for Silicon Motion SM501
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 45b7d53..c0b41e8 100644

[S390] Kconfig: unwanted menus for s390.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9556fb73edfc37410cab3b47ae5e94bcecd8edf2
Commit: 9556fb73edfc37410cab3b47ae5e94bcecd8edf2
Parent: e25df1205f37c7bff3ab14fdfc8a5249f3c69c82
Author: Martin Schwidefsky [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:45:58 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:46:07 2007 +0200

[S390] Kconfig: unwanted menus for s390.

Disable some more menus in the configuration files that are of no
interest to a s390 machine.

Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/dma/Kconfig |1 +
 drivers/input/Kconfig   |1 +
 drivers/isdn/Kconfig|1 +
 drivers/net/phy/Kconfig |1 +
 drivers/rtc/Kconfig |1 +
 net/ax25/Kconfig|2 +-
 net/bluetooth/Kconfig   |2 +-
 net/irda/Kconfig|2 +-
 8 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 30d021d..72be6c6 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu DMA Engine support
+   depends on !S390
 
 config DMA_ENGINE
bool Support for DMA engines
diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig
index 0e9b695..f814fb3 100644
--- a/drivers/input/Kconfig
+++ b/drivers/input/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu Input device support
+   depends on !S390
 
 config INPUT
tristate Generic input layer (needed for keyboard, mouse, ...) if 
EMBEDDED
diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig
index c90afee..d42fe89 100644
--- a/drivers/isdn/Kconfig
+++ b/drivers/isdn/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu ISDN subsystem
+   depends on !S390
 
 config ISDN
tristate ISDN support
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index f994f12..c0d3101 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu PHY device support
+   depends on !S390
 
 config PHYLIB
tristate PHY Device support and infrastructure
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 76422ed..1759baa 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu Real Time Clock
+   depends on !S390
 
 config RTC_LIB
tristate
diff --git a/net/ax25/Kconfig b/net/ax25/Kconfig
index 43dd86f..2a72aa9 100644
--- a/net/ax25/Kconfig
+++ b/net/ax25/Kconfig
@@ -3,7 +3,7 @@
 #
 
 menuconfig HAMRADIO
-   depends on NET
+   depends on NET  !S390
bool Amateur Radio support
help
  If you want to connect your Linux box to an amateur radio, answer Y
diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
index 6929490..7725da9 100644
--- a/net/bluetooth/Kconfig
+++ b/net/bluetooth/Kconfig
@@ -3,7 +3,7 @@
 #
 
 menuconfig BT
-   depends on NET
+   depends on NET  !S390
tristate Bluetooth subsystem support
help
  Bluetooth is low-cost, low-power, short-range wireless technology.
diff --git a/net/irda/Kconfig b/net/irda/Kconfig
index 9efb17b..c8671a7 100644
--- a/net/irda/Kconfig
+++ b/net/irda/Kconfig
@@ -3,7 +3,7 @@
 #
 
 menuconfig IRDA
-   depends on NET
+   depends on NET  !S390
tristate IrDA (infrared) subsystem support
select CRC_CCITT
---help---
-
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


[S390] Kconfig: use common Kconfig files for s390.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=61d48c2c31799ab9dbddbbcfccfd8042a5c6b75a
Commit: 61d48c2c31799ab9dbddbbcfccfd8042a5c6b75a
Parent: abf3ea1b549afc62dc7304fddab1cdaf23d0cc84
Author: Martin Schwidefsky [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:46:00 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:46:08 2007 +0200

[S390] Kconfig: use common Kconfig files for s390.

Disband drivers/s390/Kconfig, use the common Kconfig files. The s390
specific config options from drivers/s390/Kconfig are moved to the
respective common Kconfig files.

Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 arch/s390/Kconfig  |   49 +++--
 drivers/block/Kconfig  |4 +-
 drivers/char/Kconfig   |2 +
 drivers/crypto/Kconfig |   22 
 drivers/s390/Kconfig   |  239 
 drivers/s390/block/Kconfig |   11 +--
 drivers/s390/char/Kconfig  |  166 ++
 drivers/s390/net/Kconfig   |8 +-
 include/asm-s390/param.h   |2 +-
 9 files changed, 217 insertions(+), 286 deletions(-)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 1a84719..098c62c 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -4,27 +4,23 @@
 #
 
 config MMU
-   bool
-   default y
+   def_bool y
 
 config ZONE_DMA
def_bool y
depends on 64BIT
 
 config LOCKDEP_SUPPORT
-   bool
-   default y
+   def_bool y
 
 config STACKTRACE_SUPPORT
-   bool
-   default y
+   def_bool y
 
 config RWSEM_GENERIC_SPINLOCK
bool
 
 config RWSEM_XCHGADD_ALGORITHM
-   bool
-   default y
+   def_bool y
 
 config ARCH_HAS_ILOG2_U32
bool
@@ -35,8 +31,7 @@ config ARCH_HAS_ILOG2_U64
default n
 
 config GENERIC_HWEIGHT
-   bool
-   default y
+   def_bool y
 
 config GENERIC_TIME
def_bool y
@@ -55,8 +50,7 @@ config NO_DMA
 mainmenu Linux Kernel Configuration
 
 config S390
-   bool
-   default y
+   def_bool y
 
 source init/Kconfig
 
@@ -280,6 +274,10 @@ config WARN_STACK_SIZE
 config ARCH_POPULATES_NODE_MAP
def_bool y
 
+comment Kernel preemption
+
+source kernel/Kconfig.preempt
+
 source mm/Kconfig
 
 config HOLES_IN_ZONE
@@ -320,17 +318,6 @@ config QDIO_DEBUG
 
 comment Misc
 
-config PREEMPT
-   bool Preemptible Kernel
-   help
- This option reduces the latency of the kernel when reacting to
- real-time or interactive events by allowing a low priority process to
- be preempted even if it is in kernel mode executing a system call.
- This allows applications to run more reliably even when the system is
- under load.
-
- Say N if you are unsure.
-
 config IPL
bool Builtin IPL record support
help
@@ -488,6 +475,8 @@ config APPLDATA_NET_SUM
  This can also be compiled as a module, which will be called
  appldata_net_sum.o.
 
+source kernel/Kconfig.hz
+
 config NO_IDLE_HZ
bool No HZ timer ticks in idle
help
@@ -535,18 +524,12 @@ endmenu
 source net/Kconfig
 
 config PCMCIA
-   bool
-   default n
-
-source drivers/base/Kconfig
+   def_bool n
 
-source drivers/connector/Kconfig
-
-source drivers/scsi/Kconfig
-
-source drivers/s390/Kconfig
+config CCW
+   def_bool y
 
-source drivers/net/Kconfig
+source drivers/Kconfig
 
 source fs/Kconfig
 
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 17ee97f..b4c8319 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -444,8 +444,6 @@ config CDROM_PKTCDVD_WCACHE
  this option is dangerous unless the CD-RW media is known good, as we
  don't do deferred write error handling yet.
 
-source drivers/s390/block/Kconfig
-
 config ATA_OVER_ETH
tristate ATA over Ethernet support
depends on NET
@@ -453,6 +451,8 @@ config ATA_OVER_ETH
This driver provides Support for ATA over Ethernet block
devices like the Coraid EtherDrive (R) Storage Blade.
 
+source drivers/s390/block/Kconfig
+
 endmenu
 
 endif
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 7ff85ad..abcafac 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -1081,5 +1081,7 @@ config DEVPORT
depends on ISA || PCI
default y
 
+source drivers/s390/char/Kconfig
+
 endmenu
 
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index f4c6345..e678a33 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -56,4 +56,26 @@ config CRYPTO_DEV_GEODE
  To compile this driver as a module, choose M here: the module
  will be called geode-aes.
 
+config ZCRYPT
+   tristate Support for PCI-attached cryptographic adapters
+   depends on S390
+   select ZCRYPT_MONOLITHIC if ZCRYPT=y
+   default m
+   help
+ Select this option if you want to use a 

[S390] Kconfig: no wireless on s390.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f54bfc0e34dbd15e9df099a8e36a346c6c583f3c
Commit: f54bfc0e34dbd15e9df099a8e36a346c6c583f3c
Parent: 61d48c2c31799ab9dbddbbcfccfd8042a5c6b75a
Author: Martin Schwidefsky [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:46:01 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:46:08 2007 +0200

[S390] Kconfig: no wireless on s390.

Hide the config menues for wireless on s390.

Cc: John W. Linville [EMAIL PROTECTED]
Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 drivers/net/wireless/Kconfig |1 +
 net/Kconfig  |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index e273347..e3f5bb0 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -3,6 +3,7 @@
 #
 
 menu Wireless LAN
+   depends on !S390
 
 config WLAN_PRE80211
bool Wireless LAN (pre-802.11)
diff --git a/net/Kconfig b/net/Kconfig
index caeacd1..f3de729 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -218,6 +218,7 @@ config FIB_RULES
bool
 
 menu Wireless
+   depends on !S390
 
 source net/wireless/Kconfig
 source net/mac80211/Kconfig
-
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


[S390] update default configuration.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=906fc9e92f0e8b618d4025c3aa6289415ecd8152
Commit: 906fc9e92f0e8b618d4025c3aa6289415ecd8152
Parent: f54bfc0e34dbd15e9df099a8e36a346c6c583f3c
Author: Martin Schwidefsky [EMAIL PROTECTED]
AuthorDate: Thu May 10 15:46:02 2007 +0200
Committer:  Martin Schwidefsky [EMAIL PROTECTED]
CommitDate: Thu May 10 15:46:08 2007 +0200

[S390] update default configuration.

Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED]
---
 arch/s390/defconfig |  234 ---
 1 files changed, 128 insertions(+), 106 deletions(-)

diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 0e4da8a..485b60c 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21-rc1
-# Wed Feb 21 10:44:30 2007
+# Linux kernel version: 2.6.21
+# Thu May 10 15:18:19 2007
 #
 CONFIG_MMU=y
 CONFIG_ZONE_DMA=y
@@ -14,6 +14,7 @@ CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_BUG=y
 CONFIG_NO_IOMEM=y
+CONFIG_NO_DMA=y
 CONFIG_S390=y
 CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config
 
@@ -41,9 +42,11 @@ CONFIG_AUDIT=y
 # CONFIG_AUDITSYSCALL is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_CPUSETS is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -60,12 +63,14 @@ CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
-CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -128,6 +133,14 @@ CONFIG_CHECK_STACK=y
 CONFIG_STACK_GUARD=256
 # CONFIG_WARN_STACK is not set
 CONFIG_ARCH_POPULATES_NODE_MAP=y
+
+#
+# Kernel preemption
+#
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_PREEMPT_BKL=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -150,7 +163,6 @@ CONFIG_QDIO=y
 #
 # Misc
 #
-CONFIG_PREEMPT=y
 CONFIG_IPL=y
 # CONFIG_IPL_TAPE is not set
 CONFIG_IPL_VM=y
@@ -163,6 +175,11 @@ CONFIG_PFAULT=y
 CONFIG_VIRT_TIMER=y
 CONFIG_VIRT_CPU_ACCOUNTING=y
 # CONFIG_APPLDATA_BASE is not set
+CONFIG_HZ_100=y
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
 CONFIG_NO_IDLE_HZ=y
 CONFIG_NO_IDLE_HZ_INIT=y
 CONFIG_S390_HYPFS_FS=y
@@ -177,7 +194,6 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -216,6 +232,7 @@ CONFIG_DEFAULT_TCP_CONG=cubic
 CONFIG_IPV6=y
 # CONFIG_IPV6_PRIVACY is not set
 # CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
 # CONFIG_INET6_AH is not set
 # CONFIG_INET6_ESP is not set
 # CONFIG_INET6_IPCOMP is not set
@@ -240,7 +257,12 @@ CONFIG_IPV6_SIT=y
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-# CONFIG_IP_SCTP is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
 
 #
 # TIPC Configuration (EXPERIMENTAL)
@@ -263,9 +285,6 @@ CONFIG_IPV6_SIT=y
 #
 CONFIG_NET_SCHED=y
 CONFIG_NET_SCH_FIFO=y
-CONFIG_NET_SCH_CLK_JIFFIES=y
-# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
-# CONFIG_NET_SCH_CLK_CPU is not set
 
 #
 # Queueing/Scheduling
@@ -308,11 +327,14 @@ CONFIG_NET_ESTIMATOR=y
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_NET_TCPPROBE is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_IEEE80211 is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_RFKILL is not set
 # CONFIG_PCMCIA is not set
+CONFIG_CCW=y
+
+#
+# Device Drivers
+#
 
 #
 # Generic Driver Options
@@ -330,6 +352,37 @@ CONFIG_SYS_HYPERVISOR=y
 # CONFIG_CONNECTOR is not set
 
 #
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# S/390 block device drivers
+#
+CONFIG_BLK_DEV_XPRAM=m
+# CONFIG_DCSSBLK is not set
+CONFIG_DASD=y
+CONFIG_DASD_PROFILE=y
+CONFIG_DASD_ECKD=y
+CONFIG_DASD_FBA=y
+CONFIG_DASD_DIAG=y
+CONFIG_DASD_EER=y
+
+#
+# Misc devices
+#
+# CONFIG_BLINK is not set
+
+#
 # SCSI device support
 #
 # CONFIG_RAID_ATTRS is not set
@@ -356,6 +409,7 @@ CONFIG_SCSI_MULTI_LUN=y
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ 

firewire: Add driver for OHCI firewire host controllers.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ed5689122f4cdb5cb8c6770ad1a2c8561b32d9b3
Commit: ed5689122f4cdb5cb8c6770ad1a2c8561b32d9b3
Parent: 19a15b937b26638933307bb02f7b1801310d6eb2
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Dec 19 19:58:35 2006 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:34 2007 +0100

firewire: Add driver for OHCI firewire host controllers.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/Kconfig   |   11 +
 drivers/firewire/Makefile  |1 +
 drivers/firewire/fw-ohci.c | 1394 
 drivers/firewire/fw-ohci.h |  152 +
 4 files changed, 1558 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig
index bdd6303..b386334 100644
--- a/drivers/firewire/Kconfig
+++ b/drivers/firewire/Kconfig
@@ -20,4 +20,15 @@ config FW
  To compile this driver as a module, say M here: the
  module will be called fw-core.
 
+config FW_OHCI
+   tristate Support for OHCI firewire host controllers
+   depends on PCI  FW
+   help
+ Enable this driver if you have an firewire controller based
+ on the OHCI specification.  For all practical purposes, this
+ is the only chipset in use, so say Y here.
+
+ To compile this driver as a module, say M here: the
+ module will be called fw-ohci.
+
 endmenu
diff --git a/drivers/firewire/Makefile b/drivers/firewire/Makefile
index da77bc0..add3b98 100644
--- a/drivers/firewire/Makefile
+++ b/drivers/firewire/Makefile
@@ -6,3 +6,4 @@ fw-core-objs := fw-card.o fw-topology.o fw-transaction.o 
fw-iso.o \
fw-device.o fw-device-cdev.o
 
 obj-$(CONFIG_FW) += fw-core.o
+obj-$(CONFIG_FW_OHCI) += fw-ohci.o
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
new file mode 100644
index 000..5392a2b
--- /dev/null
+++ b/drivers/firewire/fw-ohci.c
@@ -0,0 +1,1394 @@
+/* -*- c-basic-offset: 8 -*-
+ *
+ * fw-ohci.c - Driver for OHCI 1394 boards
+ * Copyright (C) 2003-2006 Kristian Hoegsberg [EMAIL PROTECTED]
+ *
+ * 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/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/interrupt.h
+#include linux/pci.h
+#include linux/delay.h
+#include linux/poll.h
+#include asm/uaccess.h
+#include asm/semaphore.h
+
+#include fw-transaction.h
+#include fw-ohci.h
+
+#define descriptor_output_more 0
+#define descriptor_output_last (1  12)
+#define descriptor_input_more  (2  12)
+#define descriptor_input_last  (3  12)
+#define descriptor_status  (1  11)
+#define descriptor_key_immediate   (2  8)
+#define descriptor_ping(1  7)
+#define descriptor_yy  (1  6)
+#define descriptor_no_irq  (0  4)
+#define descriptor_irq_error   (1  4)
+#define descriptor_irq_always  (3  4)
+#define descriptor_branch_always   (3  2)
+
+struct descriptor {
+   __le16 req_count;
+   __le16 control;
+   __le32 data_address;
+   __le32 branch_address;
+   __le16 res_count;
+   __le16 transfer_status;
+} __attribute__((aligned(16)));
+
+struct ar_context {
+   struct fw_ohci *ohci;
+   struct descriptor descriptor;
+   __le32 buffer[512];
+   dma_addr_t descriptor_bus;
+   dma_addr_t buffer_bus;
+
+   u32 command_ptr;
+   u32 control_set;
+   u32 control_clear;
+
+   struct tasklet_struct tasklet;
+};
+
+struct at_context {
+   struct fw_ohci *ohci;
+   dma_addr_t descriptor_bus;
+   dma_addr_t buffer_bus;
+
+   struct list_head list;
+
+   struct {
+   struct descriptor more;
+   __le32 header[4];
+   struct descriptor last;
+   } d;
+
+   u32 command_ptr;
+   u32 control_set;
+   u32 control_clear;
+
+   struct tasklet_struct tasklet;
+};
+
+#define it_header_sy(v)  ((v)   0)
+#define it_header_tcode(v)   ((v)   4)
+#define it_header_channel(v) ((v)   8)
+#define it_header_tag(v) ((v)  14)

firewire: put old and new stack into same Kconfig submenu

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=22a38e72bc18b9e8b860182c512efaade5590c7d
Commit: 22a38e72bc18b9e8b860182c512efaade5590c7d
Parent: 687198bbd2679cb72cf381da070082d3d9f57edf
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Dec 31 17:20:20 2006 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:38 2007 +0100

firewire: put old and new stack into same Kconfig submenu

Screenshot from make menuconfig:
...
  ?? IEEE 1394 (FireWire) support 
???
  ?  Arrow keys navigate the menu.  Enter selects submenus ---.  
?
...
  ? ??? 
?
  ? ?M IEEE 1394 (FireWire) support (JUJU alternative stack, experim? 
?
  ? ?M   Support for OHCI firewire host controllers ? 
?
  ? ?M   Support for storage devices (SBP-2 protocol driver)? 
?
  ? ?M IEEE 1394 (FireWire) support ? 
?
  ? ?---   Subsystem Options  ? 
?
  ? ?[ ]   Excessive debugging output ? 
?
...
  ?Select Exit  Help  
?
  
???

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/Kconfig  |2 --
 drivers/firewire/Kconfig |5 +
 drivers/ieee1394/Kconfig |2 ++
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/Kconfig b/drivers/Kconfig
index 9c52a04..050323f 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -30,8 +30,6 @@ source drivers/md/Kconfig
 
 source drivers/message/fusion/Kconfig
 
-source drivers/firewire/Kconfig
-
 source drivers/ieee1394/Kconfig
 
 source drivers/message/i2o/Kconfig
diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig
index 8e14675..048d52e 100644
--- a/drivers/firewire/Kconfig
+++ b/drivers/firewire/Kconfig
@@ -1,8 +1,6 @@
 # -*- shell-script -*-
 
-menu IEEE 1394 (FireWire) support (JUJU alternative stack)
-
-comment This is an EXPERIMENTAL set of alternative FireWire drivers.
+comment An alternative FireWire stack is available with EXPERIMENTAL=y
depends on EXPERIMENTAL=n
 
 config FW
@@ -47,4 +45,3 @@ config FW_SBP2
  You should also enable support for disks, CD-ROMs, etc. in the SCSI
  configuration section.
 
-endmenu
diff --git a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig
index b8a4734..c668538 100644
--- a/drivers/ieee1394/Kconfig
+++ b/drivers/ieee1394/Kconfig
@@ -2,6 +2,8 @@
 
 menu IEEE 1394 (FireWire) support
 
+source drivers/firewire/Kconfig
+
 config IEEE1394
tristate IEEE 1394 (FireWire) support
depends on PCI || BROKEN
-
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


firewire: mark some structs const

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=21ebcd1224d05c8673053e1e93ab9ec7ef3e0b84
Commit: 21ebcd1224d05c8673053e1e93ab9ec7ef3e0b84
Parent: 227e7d8194bd147484f6ae135a082ce22112b5b3
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Jan 14 15:29:07 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:39 2007 +0100

firewire: mark some structs const

Instances of struct file_operations and struct fw_card_driver can be
qualified as const.  Ditto with struct fw_descriptor.data, struct
fw_device_id, and predefined instances of struct fw_address_region,
at least in the current implementation.

Data qualified as const is placed into the .rodata section which won't
be mixed with dirty data.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-card.c|2 +-
 drivers/firewire/fw-device-cdev.c |2 +-
 drivers/firewire/fw-device.c  |2 +-
 drivers/firewire/fw-device.h  |4 ++--
 drivers/firewire/fw-ohci.c|2 +-
 drivers/firewire/fw-sbp2.c|2 +-
 drivers/firewire/fw-transaction.c |   14 +++---
 drivers/firewire/fw-transaction.h |   18 +-
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 7977390..82a9243 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -257,7 +257,7 @@ flush_timer_callback(unsigned long data)
 }
 
 void
-fw_card_initialize(struct fw_card *card, struct fw_card_driver *driver,
+fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
   struct device *device)
 {
static int index;
diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index c10e332..117bc6d 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -602,7 +602,7 @@ static unsigned int fw_device_op_poll(struct file *file, 
poll_table * pt)
return 0;
 }
 
-struct file_operations fw_device_ops = {
+const struct file_operations fw_device_ops = {
.owner  = THIS_MODULE,
.open   = fw_device_op_open,
.read   = fw_device_op_read,
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index ec1cb7f..e541daa 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(fw_csr_iterator_next);
 
 static int is_fw_unit(struct device *dev);
 
-static int match_unit_directory(u32 * directory, struct fw_device_id *id)
+static int match_unit_directory(u32 * directory, const struct fw_device_id *id)
 {
struct fw_csr_iterator ci;
int key, value, match;
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
index 731abbe..f39cf6a 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
@@ -113,7 +113,7 @@ struct fw_driver {
struct device_driver driver;
/* Called when the parent device sits through a bus reset. */
void (*update) (struct fw_unit *unit);
-   struct fw_device_id *id_table;
+   const struct fw_device_id *id_table;
 };
 
 static inline struct fw_driver *
@@ -122,6 +122,6 @@ fw_driver(struct device_driver *drv)
 return container_of(drv, struct fw_driver, driver);
 }
 
-extern struct file_operations fw_device_ops;
+extern const struct file_operations fw_device_ops;
 
 #endif /* __fw_device_h */
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 5d42d18..d3750a2 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1146,7 +1146,7 @@ ohci_queue_iso(struct fw_iso_context *base,
return 0;
 }
 
-static struct fw_card_driver ohci_driver = {
+static const struct fw_card_driver ohci_driver = {
.name   = ohci_driver_name,
.enable = ohci_enable,
.update_phy_reg = ohci_update_phy_reg,
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index ce9c41f..28acae8 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -681,7 +681,7 @@ static void sbp2_update(struct fw_unit *unit)
 #define SBP2_UNIT_SPEC_ID_ENTRY0x609e
 #define SBP2_SW_VERSION_ENTRY  0x00010483
 
-static struct fw_device_id sbp2_id_table[] = {
+static const struct fw_device_id sbp2_id_table[] = {
{
.match_flags  = FW_MATCH_SPECIFIER_ID | FW_MATCH_VERSION,
.specifier_id = SBP2_UNIT_SPEC_ID_ENTRY,
diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index affd420..a72f502 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -331,15 +331,15 @@ lookup_enclosing_address_handler(struct list_head *list,
 static DEFINE_SPINLOCK(address_handler_lock);
 static 

firewire: cleanups

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=95688e97cdf7453cde22eaa73cc2ab6b113c1853
Commit: 95688e97cdf7453cde22eaa73cc2ab6b113c1853
Parent: 21ebcd1224d05c8673053e1e93ab9ec7ef3e0b84
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Mon Jan 22 19:17:37 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:40 2007 +0100

firewire: cleanups

This patch contains the following cleanups:
- extern inline - static inline
- fw-topology.c: make struct fw_node_create static

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c|8 
 drivers/firewire/fw-topology.c|2 +-
 drivers/firewire/fw-topology.h|6 +++---
 drivers/firewire/fw-transaction.c |2 +-
 drivers/firewire/fw-transaction.h |2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index d3750a2..6eff799 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -147,7 +147,7 @@ struct fw_ohci {
struct iso_context *ir_context_list;
 };
 
-extern inline struct fw_ohci *fw_ohci(struct fw_card *card)
+static inline struct fw_ohci *fw_ohci(struct fw_card *card)
 {
return container_of(card, struct fw_ohci, card);
 }
@@ -174,17 +174,17 @@ extern inline struct fw_ohci *fw_ohci(struct fw_card 
*card)
 
 static char ohci_driver_name[] = KBUILD_MODNAME;
 
-extern inline void reg_write(const struct fw_ohci *ohci, int offset, u32 data)
+static inline void reg_write(const struct fw_ohci *ohci, int offset, u32 data)
 {
writel(data, ohci-registers + offset);
 }
 
-extern inline u32 reg_read(const struct fw_ohci *ohci, int offset)
+static inline u32 reg_read(const struct fw_ohci *ohci, int offset)
 {
return readl(ohci-registers + offset);
 }
 
-extern inline void flush_writes(const struct fw_ohci *ohci)
+static inline void flush_writes(const struct fw_ohci *ohci)
 {
/* Do a dummy read to flush writes. */
reg_read(ohci, OHCI1394_Version);
diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
index e475025..e111687 100644
--- a/drivers/firewire/fw-topology.c
+++ b/drivers/firewire/fw-topology.c
@@ -92,7 +92,7 @@ static int get_port_type(u32 *sid, int port_index)
return (sid[index]  shift)  0x03;
 }
 
-struct fw_node *fw_node_create(u32 sid, int port_count, int color)
+static struct fw_node *fw_node_create(u32 sid, int port_count, int color)
 {
struct fw_node *node;
 
diff --git a/drivers/firewire/fw-topology.h b/drivers/firewire/fw-topology.h
index 32ea7cd..a78c951 100644
--- a/drivers/firewire/fw-topology.h
+++ b/drivers/firewire/fw-topology.h
@@ -57,13 +57,13 @@ struct fw_node {
 struct fw_port ports[0];
 };
 
-extern inline struct fw_node *
+static inline struct fw_node *
 fw_node(struct list_head *l)
 {
 return list_entry (l, struct fw_node, link);
 }
 
-extern inline struct fw_node *
+static inline struct fw_node *
 fw_node_get(struct fw_node *node)
 {
atomic_inc(node-ref_count);
@@ -71,7 +71,7 @@ fw_node_get(struct fw_node *node)
return node;
 }
 
-extern inline void
+static inline void
 fw_node_put(struct fw_node *node)
 {
if (atomic_dec_and_test(node-ref_count))
diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index a72f502..c2473a8 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -106,7 +106,7 @@ transmit_complete_callback(struct fw_packet *packet,
}
 }
 
-void
+static void
 fw_fill_packet(struct fw_packet *packet, int tcode, int tlabel,
   int node_id, int generation, int speed,
   unsigned long long offset, void *payload, size_t length)
diff --git a/drivers/firewire/fw-transaction.h 
b/drivers/firewire/fw-transaction.h
index 2f849c8..a664fc3 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -198,7 +198,7 @@ struct fw_transaction {
 void *callback_data;
 };
 
-extern inline struct fw_packet *
+static inline struct fw_packet *
 fw_packet(struct list_head *l)
 {
 return list_entry (l, struct fw_packet, link);
-
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


firewire: whitespace adjustments

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e20c282184fd5794661b663231ff5348abc
Commit: 5e20c282184fd5794661b663231ff5348abc
Parent: 95688e97cdf7453cde22eaa73cc2ab6b113c1853
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Jan 21 20:44:09 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:40 2007 +0100

firewire: whitespace adjustments

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
---
 drivers/firewire/fw-card.c|   41 -
 drivers/firewire/fw-device-cdev.h |   18 ++--
 drivers/firewire/fw-device.c  |4 -
 drivers/firewire/fw-device.h  |6 +-
 drivers/firewire/fw-iso.c |4 -
 drivers/firewire/fw-ohci.c|5 +-
 drivers/firewire/fw-ohci.h|   44 +-
 drivers/firewire/fw-topology.c|1 -
 drivers/firewire/fw-topology.h|8 +-
 drivers/firewire/fw-transaction.c |8 --
 drivers/firewire/fw-transaction.h |  174 ++--
 11 files changed, 144 insertions(+), 169 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 82a9243..c560fd5 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -76,12 +76,12 @@ generate_config_rom (struct fw_card *card, size_t 
*config_rom_length)
static u32 config_rom[256];
int i, j, length;
 
-/* Initialize contents of config rom buffer.  On the OHCI
- * controller, block reads to the config rom accesses the host
- * memory, but quadlet read access the hardware bus info block
- * registers.  That's just crack, but it means we should make
- * sure the contents of bus info block in host memory mathces
- * the version stored in the OHCI registers. */
+   /* Initialize contents of config rom buffer.  On the OHCI
+* controller, block reads to the config rom accesses the host
+* memory, but quadlet read access the hardware bus info block
+* registers.  That's just crack, but it means we should make
+* sure the contents of bus info block in host memory mathces
+* the version stored in the OHCI registers. */
 
memset(config_rom, 0, sizeof config_rom);
config_rom[0] = bib_crc_length(4) | bib_info_length(4) | bib_crc(0);
@@ -263,13 +263,13 @@ fw_card_initialize(struct fw_card *card, const struct 
fw_card_driver *driver,
static int index;
 
card-index = index++;
-card-driver = driver;
+   card-driver = driver;
card-device = device;
-card-current_tlabel = 0;
-card-tlabel_mask = 0;
+   card-current_tlabel = 0;
+   card-tlabel_mask = 0;
card-color = 0;
 
-INIT_LIST_HEAD(card-transaction_list);
+   INIT_LIST_HEAD(card-transaction_list);
spin_lock_init(card-lock);
setup_timer(card-flush_timer,
flush_timer_callback, (unsigned long)card);
@@ -307,7 +307,7 @@ fw_card_add(struct fw_card *card,
 
retval = device_add(card-card_device);
if (retval  0) {
-fw_error(Failed to register card device.);
+   fw_error(Failed to register card device.);
return retval;
}
 
@@ -358,13 +358,13 @@ dummy_set_config_rom(struct fw_card *card,
 static void
 dummy_send_request(struct fw_card *card, struct fw_packet *packet)
 {
-packet-callback(packet, card, -ENODEV);
+   packet-callback(packet, card, -ENODEV);
 }
 
 static void
 dummy_send_response(struct fw_card *card, struct fw_packet *packet)
 {
-packet-callback(packet, card, -ENODEV);
+   packet-callback(packet, card, -ENODEV);
 }
 
 static int
@@ -375,12 +375,12 @@ dummy_enable_phys_dma(struct fw_card *card,
 }
 
 static struct fw_card_driver dummy_driver = {
-.name= dummy,
+   .name= dummy,
.enable  = dummy_enable,
.update_phy_reg  = dummy_update_phy_reg,
.set_config_rom  = dummy_set_config_rom,
-.send_request= dummy_send_request,
-.send_response   = dummy_send_response,
+   .send_request= dummy_send_request,
+   .send_response   = dummy_send_response,
.enable_phys_dma = dummy_enable_phys_dma
 };
 
@@ -428,13 +428,6 @@ EXPORT_SYMBOL(fw_card_put);
 int
 fw_core_initiate_bus_reset(struct fw_card *card, int short_reset)
 {
-u32 address;
-
-if (short_reset)
-address = 5;
-else
-address = 1;
-
-return card-driver-update_phy_reg(card, address, 0, 0x40);
+   return card-driver-update_phy_reg(card, short_reset ? 5 : 1, 0, 0x40);
 }
 EXPORT_SYMBOL(fw_core_initiate_bus_reset);
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index e2ae933..b934272 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ 

firewire: comma after last enum item or initializer

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5af4e5eab30d481f76b89a2167c873dfad960acb
Commit: 5af4e5eab30d481f76b89a2167c873dfad960acb
Parent: 5e20c282184fd5794661b663231ff5348abc
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Jan 21 20:45:32 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:41 2007 +0100

firewire: comma after last enum item or initializer

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
---
 drivers/firewire/fw-card.c|2 +-
 drivers/firewire/fw-device-cdev.c |2 +-
 drivers/firewire/fw-device.c  |8 
 drivers/firewire/fw-device.h  |2 +-
 drivers/firewire/fw-ohci.c|2 +-
 drivers/firewire/fw-sbp2.c|2 +-
 drivers/firewire/fw-topology.h|2 +-
 drivers/firewire/fw-transaction.c |   12 ++--
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index c560fd5..c8b7d69 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -381,7 +381,7 @@ static struct fw_card_driver dummy_driver = {
.set_config_rom  = dummy_set_config_rom,
.send_request= dummy_send_request,
.send_response   = dummy_send_response,
-   .enable_phys_dma = dummy_enable_phys_dma
+   .enable_phys_dma = dummy_enable_phys_dma,
 };
 
 void
diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 117bc6d..5ffc58c 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -612,6 +612,6 @@ const struct file_operations fw_device_ops = {
.mmap   = fw_device_op_mmap,
 
 #ifdef CONFIG_COMPAT
-   .compat_ioctl   = fw_device_op_compat_ioctl
+   .compat_ioctl   = fw_device_op_compat_ioctl,
 #endif
 };
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index 559b934..f1b0e75 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -154,7 +154,7 @@ fw_unit_uevent(struct device *dev, char **envp, int 
num_envp,
 struct bus_type fw_bus_type = {
.name = fw,
.match = fw_unit_match,
-   .uevent = fw_unit_uevent
+   .uevent = fw_unit_uevent,
 };
 EXPORT_SYMBOL(fw_bus_type);
 
@@ -209,8 +209,8 @@ show_modalias_attribute(struct device *dev,
 }
 
 static struct device_attribute modalias_attribute = {
-   .attr = {.name = modalias,.mode = S_IRUGO},
-   .show = show_modalias_attribute
+   .attr = { .name = modalias, .mode = S_IRUGO, },
+   .show = show_modalias_attribute,
 };
 
 static ssize_t
@@ -225,7 +225,7 @@ show_config_rom_attribute(struct device *dev,
 }
 
 static struct device_attribute config_rom_attribute = {
-   .attr = {.name = config_rom,.mode = S_IRUGO},
+   .attr = {.name = config_rom, .mode = S_IRUGO,},
.show = show_config_rom_attribute,
 };
 
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
index b150adb..5399b48 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
@@ -28,7 +28,7 @@
 enum fw_device_state {
FW_DEVICE_INITIALIZING,
FW_DEVICE_RUNNING,
-   FW_DEVICE_SHUTDOWN
+   FW_DEVICE_SHUTDOWN,
 };
 
 struct fw_device {
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 1f34bdd..ea52e15 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1157,7 +1157,7 @@ static const struct fw_card_driver ohci_driver = {
.allocate_iso_context   = ohci_allocate_iso_context,
.free_iso_context   = ohci_free_iso_context,
.queue_iso  = ohci_queue_iso,
-   .send_iso   = ohci_send_iso
+   .send_iso   = ohci_send_iso,
 };
 
 static int software_reset(struct fw_ohci *ohci)
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 28acae8..13e47e9 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -685,7 +685,7 @@ static const struct fw_device_id sbp2_id_table[] = {
{
.match_flags  = FW_MATCH_SPECIFIER_ID | FW_MATCH_VERSION,
.specifier_id = SBP2_UNIT_SPEC_ID_ENTRY,
-   .version  = SBP2_SW_VERSION_ENTRY
+   .version  = SBP2_SW_VERSION_ENTRY,
},
{ }
 };
diff --git a/drivers/firewire/fw-topology.h b/drivers/firewire/fw-topology.h
index 4311d9f..ab03059 100644
--- a/drivers/firewire/fw-topology.h
+++ b/drivers/firewire/fw-topology.h
@@ -27,7 +27,7 @@ enum {
FW_NODE_UPDATED =   0x01,
FW_NODE_DESTROYED = 0x02,
FW_NODE_LINK_ON =   0x03,
-   FW_NODE_LINK_OFF =  0x04
+   FW_NODE_LINK_OFF =  0x04,
 };
 
 struct fw_port {
diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index 79563b2..4c1275f 100644
--- a/drivers/firewire/fw-transaction.c

firewire: fix failure path in ohci_enable_phys_dma

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6cad95fe97dc062d0367da125ac0b2e5f1694b23
Commit: 6cad95fe97dc062d0367da125ac0b2e5f1694b23
Parent: 5af4e5eab30d481f76b89a2167c873dfad960acb
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Jan 21 20:46:45 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:41 2007 +0100

firewire: fix failure path in ohci_enable_phys_dma

goto out happens with the lock taken.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index ea52e15..1b4b53d 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -850,10 +850,8 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, 
int generation)
  1  (node_id - 32));
}
flush_writes(ohci);
-
-   spin_unlock_irqrestore(ohci-lock, flags);
-
  out:
+   spin_unlock_irqrestore(ohci-lock, flags);
return retval;
 }
 
-
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


firewire: fw-sbp2: remove unused macro

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=02af8e70cbe42833805d6f2f10fc1d43ce90da0d
Commit: 02af8e70cbe42833805d6f2f10fc1d43ce90da0d
Parent: 5fa1580d2d922171c5ef8da487054d056298a970
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Jan 21 20:50:11 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:42 2007 +0100

firewire: fw-sbp2: remove unused macro

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 0b0dcc7..f5c4682 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -64,7 +64,6 @@ struct sbp2_device {
 
 #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
 #define SBP2_MAX_SECTORS   255 /* Max sectors supported */
-#define SBP2_MAX_CMDS  8   /* This should be safe */
 
 #define SBP2_ORB_NULL  0x8000
 
@@ -1010,8 +1009,8 @@ static struct scsi_host_template scsi_driver_template = {
.this_id= -1,
.sg_tablesize   = SG_ALL,
.use_clustering = ENABLE_CLUSTERING,
-   .cmd_per_lun= 1,/* SBP2_MAX_CMDS, */
-   .can_queue  = 1,/* SBP2_MAX_CMDS, */
+   .cmd_per_lun= 1,
+   .can_queue  = 1,
 };
 
 static int add_scsi_devices(struct fw_unit *unit)
-
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


firewire: fw-sbp2: remove bogus emulated host flag

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5fa1580d2d922171c5ef8da487054d056298a970
Commit: 5fa1580d2d922171c5ef8da487054d056298a970
Parent: 6cad95fe97dc062d0367da125ac0b2e5f1694b23
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Jan 21 20:49:38 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:42 2007 +0100

firewire: fw-sbp2: remove bogus emulated host flag

There is no emulation going on here too.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 13e47e9..0b0dcc7 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -1012,7 +1012,6 @@ static struct scsi_host_template scsi_driver_template = {
.use_clustering = ENABLE_CLUSTERING,
.cmd_per_lun= 1,/* SBP2_MAX_CMDS, */
.can_queue  = 1,/* SBP2_MAX_CMDS, */
-   .emulated   = 1,
 };
 
 static int add_scsi_devices(struct fw_unit *unit)
-
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


firewire: fw-ohci: remove unnecessary macro

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=366f5f4fa31cd3f3d5901f5edfe255a48906505d
Commit: 366f5f4fa31cd3f3d5901f5edfe255a48906505d
Parent: 02af8e70cbe42833805d6f2f10fc1d43ce90da0d
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Tue Jan 23 21:09:23 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:43 2007 +0100

firewire: fw-ohci: remove unnecessary macro

Cleans up after patch Add PCI class ID for firewire OHCI controllers.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 1b4b53d..ba10203 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -169,9 +169,6 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card)
 #define OHCI1394_PCI_HCI_Control   0x40
 #define SELF_ID_BUF_SIZE   0x800
 
-/* FIXME: Move this to linux/pci_ids.h */
-#define PCI_CLASS_SERIAL_FIREWIRE_OHCI 0x0c0010
-
 static char ohci_driver_name[] = KBUILD_MODNAME;
 
 static inline void reg_write(const struct fw_ohci *ohci, int offset, u32 data)
-
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


firewire: consistent usage of node_id

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=907293d78872ee492ce6a114258dd853ec5082ae
Commit: 907293d78872ee492ce6a114258dd853ec5082ae
Parent: 366f5f4fa31cd3f3d5901f5edfe255a48906505d
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Tue Jan 23 21:11:43 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:43 2007 +0100

firewire: consistent usage of node_id

Definitions as per IEEE 1212 and IEEE 1394:

 Node ID: Concatenation of bus ID and local ID. 16 bits long.
  Bus ID: Identifies a particular bus within a group of buses
  interconnected by bus bridges.
Local ID: Identifies a particular node on a bus.
  PHY ID: Local ID of IEEE 1394 nodes. 6 bits long.

Never ever use a variable called node_id for anything else than a node ID.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |2 +-
 drivers/firewire/fw-device.c  |4 ++--
 drivers/firewire/fw-ohci.c|   21 -
 drivers/firewire/fw-sbp2.c|8 
 drivers/firewire/fw-topology.c|2 +-
 drivers/firewire/fw-transaction.c |6 +++---
 6 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 5ffc58c..1b9e5f7 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -238,7 +238,7 @@ static ssize_t ioctl_send_request(struct client *client, 
void __user *arg)
 
fw_send_request(device-card, response-transaction,
request.tcode,
-   device-node-node_id | LOCAL_BUS,
+   device-node-node_id,
device-card-generation,
device-node-max_speed,
request.offset,
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index f1b0e75..4fb5587 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -257,7 +257,7 @@ static int read_rom(struct fw_device *device, int index, 
u32 * data)
 
offset = 0xf400ULL + index * 4;
fw_send_request(device-card, t, TCODE_READ_QUADLET_REQUEST,
-   device-node_id | LOCAL_BUS,
+   device-node_id,
device-generation, SCODE_100,
offset, NULL, 4, complete_transaction, callback_data);
 
@@ -447,7 +447,7 @@ static void fw_device_init(struct work_struct *work)
device-config_rom_retries++;
schedule_delayed_work(device-work, RETRY_DELAY);
} else {
-   fw_notify(giving up on config rom for node id %d\n,
+   fw_notify(giving up on config rom for node id %x\n,
  device-node_id);
fw_device_release(device-device);
}
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index ba10203..d6f0644 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -828,10 +828,10 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, 
int generation)
 {
struct fw_ohci *ohci = fw_ohci(card);
unsigned long flags;
-   int retval = 0;
+   int n, retval = 0;
 
-   /* FIXME: make sure this bitmask is cleared when we clear the
-* busReset interrupt bit. */
+   /* FIXME:  Make sure this bitmask is cleared when we clear the busReset
+* interrupt bit.  Clear physReqResourceAllBuses on bus reset. */
 
spin_lock_irqsave(ohci-lock, flags);
 
@@ -840,12 +840,15 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, 
int generation)
goto out;
}
 
-   if (node_id  32) {
-   reg_write(ohci, OHCI1394_PhyReqFilterLoSet, 1  node_id);
-   } else {
-   reg_write(ohci, OHCI1394_PhyReqFilterHiSet,
- 1  (node_id - 32));
-   }
+   /* NOTE, if the node ID contains a non-local bus ID, physical DMA is
+* enabled for _all_ nodes on remote buses. */
+
+   n = (node_id  0xffc0) == LOCAL_BUS ? node_id  0x3f : 63;
+   if (n  32)
+   reg_write(ohci, OHCI1394_PhyReqFilterLoSet, 1  n);
+   else
+   reg_write(ohci, OHCI1394_PhyReqFilterHiSet, 1  (n - 32));
+
flush_writes(ohci);
  out:
spin_unlock_irqrestore(ohci-lock, flags);
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index f5c4682..4e42b73 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -328,7 +328,7 @@ sbp2_send_orb(struct sbp2_orb *orb, struct fw_unit *unit,
spin_unlock_irqrestore(device-card-lock, flags);
 
fw_send_request(device-card, orb-t, TCODE_WRITE_BLOCK_REQUEST,
-   node_id | 

firewire: fw-sbp2: set command set related device flags

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cfb01381f4ffcd05aefe76c74911ba6bc996e8ba
Commit: cfb01381f4ffcd05aefe76c74911ba6bc996e8ba
Parent: 907293d78872ee492ce6a114258dd853ec5082ae
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Tue Jan 23 21:20:08 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:44 2007 +0100

firewire: fw-sbp2: set command set related device flags

Copied from sbp2:
  - enable spin-up by START STOP UNIT for all devices
  - enable INQUIRY (36) workaround on demand
  - prefer READ/ WRITE (10) over (6) for all devices
  - prefer MODE SENSE (10) for MMC devices

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 4e42b73..54cad3a 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -968,11 +968,27 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, 
scsi_done_fn_t done)
return 0;
 }
 
+static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
+{
+   struct fw_unit *unit = (struct fw_unit *)sdev-host-hostdata[0];
+   struct sbp2_device *sd = unit-device.driver_data;
+
+   sdev-allow_restart = 1;
+
+   if (sd-workarounds  SBP2_WORKAROUND_INQUIRY_36)
+   sdev-inquiry_len = 36;
+   return 0;
+}
+
 static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
 {
struct fw_unit *unit = (struct fw_unit *)sdev-host-hostdata[0];
struct sbp2_device *sd = unit-device.driver_data;
 
+   sdev-use_10_for_rw = 1;
+
+   if (sdev-type == TYPE_ROM)
+   sdev-use_10_for_ms = 1;
if (sdev-type == TYPE_DISK 
sd-workarounds  SBP2_WORKAROUND_MODE_SENSE_8)
sdev-skip_ms_page_8 = 1;
@@ -1004,6 +1020,7 @@ static struct scsi_host_template scsi_driver_template = {
.name   = SBP-2 IEEE-1394,
.proc_name  = (char *)sbp2_driver_name,
.queuecommand   = sbp2_scsi_queuecommand,
+   .slave_alloc= sbp2_scsi_slave_alloc,
.slave_configure= sbp2_scsi_slave_configure,
.eh_abort_handler   = sbp2_scsi_abort,
.this_id= -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


firewire: Implement gap count optimization.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=83db801ce8c644edee49f4364c7ebdfef1657762
Commit: 83db801ce8c644edee49f4364c7ebdfef1657762
Parent: cfb01381f4ffcd05aefe76c74911ba6bc996e8ba
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Jan 26 00:37:50 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:44 2007 +0100

firewire: Implement gap count optimization.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-card.c|   46 +++---
 drivers/firewire/fw-topology.c|   76 
 drivers/firewire/fw-topology.h|   15 +--
 drivers/firewire/fw-transaction.c |8 +++-
 drivers/firewire/fw-transaction.h |6 ++-
 5 files changed, 120 insertions(+), 31 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index c8b7d69..307c8b8 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -186,14 +186,17 @@ fw_core_remove_descriptor (struct fw_descriptor *desc)
 }
 EXPORT_SYMBOL(fw_core_remove_descriptor);
 
+static const char gap_count_table[] = {
+   63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40
+};
+
 static void
 fw_card_irm_work(struct work_struct *work)
 {
-   struct fw_card *card =
-   container_of(work, struct fw_card, work.work);
+   struct fw_card *card = container_of(work, struct fw_card, work.work);
struct fw_device *root;
unsigned long flags;
-   int new_irm_id, generation;
+   int root_id, new_irm_id, gap_count, generation, do_reset = 0;
 
/* FIXME: This simple bus management unconditionally picks a
 * cycle master if the current root can't do it.  We need to
@@ -206,35 +209,50 @@ fw_card_irm_work(struct work_struct *work)
 
generation = card-generation;
root = card-root_node-data;
+   root_id = card-root_node-node_id;
 
-   if (root == NULL)
+   if (root == NULL) {
/* Either link_on is false, or we failed to read the
 * config rom.  In either case, pick another root. */
new_irm_id = card-local_node-node_id;
-   else if (root-state != FW_DEVICE_RUNNING)
+   } else if (root-state != FW_DEVICE_RUNNING) {
/* If we haven't probed this device yet, bail out now
 * and let's try again once that's done. */
-   new_irm_id = -1;
-   else if (root-config_rom[2]  bib_cmc)
+   new_irm_id = root_id;
+   } else if (root-config_rom[2]  bib_cmc) {
/* FIXME: I suppose we should set the cmstr bit in the
 * STATE_CLEAR register of this node, as described in
 * 1394-1995, 8.4.2.6.  Also, send out a force root
 * packet for this node. */
-   new_irm_id = -1;
-   else
+   new_irm_id = root_id;
+   } else {
/* Current root has an active link layer and we
 * successfully read the config rom, but it's not
 * cycle master capable. */
new_irm_id = card-local_node-node_id;
+   }
+
+   /* Now figure out what gap count to set. */
+   if (card-topology_type == FW_TOPOLOGY_A 
+   card-root_node-max_hops  ARRAY_SIZE(gap_count_table))
+   gap_count = gap_count_table[card-root_node-max_hops];
+   else
+   gap_count = 63;
+
+   /* Finally, figure out if we should do a reset or not.  If we've
+* done less that 5 resets with the same physical topology and we
+* have either a new root or a new gap count setting, let's do it. */
 
-   if (card-irm_retries++  5)
-   new_irm_id = -1;
+   if (card-irm_retries++  5 
+   (card-gap_count != gap_count || new_irm_id != root_id))
+   do_reset = 1;
 
spin_unlock_irqrestore(card-lock, flags);
 
-   if (new_irm_id  0) {
-   fw_notify(Trying to become root (card %d)\n, card-index);
-   fw_send_force_root(card, new_irm_id, generation);
+   if (do_reset) {
+   fw_notify(phy config: card %d, new root=%x, gap_count=%d\n,
+ card-index, new_irm_id, gap_count);
+   fw_send_phy_config(card, new_irm_id, generation, gap_count);
fw_core_initiate_bus_reset(card, 1);
}
 }
diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
index 684d87d..d3131e7 100644
--- a/drivers/firewire/fw-topology.c
+++ b/drivers/firewire/fw-topology.c
@@ -113,6 +113,44 @@ static struct fw_node *fw_node_create(u32 sid, int 
port_count, int color)
return node;
 }
 
+/* Compute the maximum hop count for this node and it's children.  The
+ * maximum hop count is the maximum number of connections between any
+ * two nodes in 

firewire: fix compilation with gcc 3.4

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=748086eb53cc5f467604c9b46ab48dc3cb771c89
Commit: 748086eb53cc5f467604c9b46ab48dc3cb771c89
Parent: 83db801ce8c644edee49f4364c7ebdfef1657762
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sat Jan 27 16:59:15 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:45 2007 +0100

firewire: fix compilation with gcc 3.4

drivers/firewire/fw-topology.c: In function `report_found_node':
drivers/firewire/fw-topology.c:345: error: `typeof' applied to a bit-field
drivers/firewire/fw-topology.c:345: error: `typeof' applied to a bit-field

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-topology.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
index d3131e7..fc8f1e7 100644
--- a/drivers/firewire/fw-topology.c
+++ b/drivers/firewire/fw-topology.c
@@ -342,8 +342,9 @@ report_found_node(struct fw_card *card,
int b_path = (node-phy_speed == SCODE_BETA);
 
if (parent != NULL) {
-   node-max_speed = min((u8)parent-max_speed,
- (u8)node-phy_speed);
+   /* min() macro doesn't work here with gcc 3.4 */
+   node-max_speed = parent-max_speed  node-phy_speed ?
+   parent-max_speed : node-phy_speed;
node-b_path = parent-b_path  b_path;
} else {
node-max_speed = node-phy_speed;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


firewire: Use struct fw_packet for incoming packets too in controller interface.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2639a6fb268e1f2a7700fe3d31cbca9b39aa3ad9
Commit: 2639a6fb268e1f2a7700fe3d31cbca9b39aa3ad9
Parent: 748086eb53cc5f467604c9b46ab48dc3cb771c89
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Jan 26 00:37:57 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:45 2007 +0100

firewire: Use struct fw_packet for incoming packets too in controller 
interface.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c|   61 +++---
 drivers/firewire/fw-transaction.c |   99 +---
 drivers/firewire/fw-transaction.h |   13 ++---
 3 files changed, 92 insertions(+), 81 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index d6f0644..8dc872a 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -221,24 +221,48 @@ static void ar_context_tasklet(unsigned long data)
 {
struct ar_context *ctx = (struct ar_context *)data;
struct fw_ohci *ohci = ctx-ohci;
-   u32 status;
-   int length, speed, ack, timestamp, tcode;
+   struct fw_packet p;
+   u32 status, length, tcode;
 
/* FIXME: What to do about evt_* errors? */
length= le16_to_cpu(ctx-descriptor.req_count) -
le16_to_cpu(ctx-descriptor.res_count) - 4;
status= le32_to_cpu(ctx-buffer[length / 4]);
-   ack   = ((status  16)  0x1f) - 16;
-   speed = (status  21)  0x7;
-   timestamp = status  0x;
 
-   ctx-buffer[0] = le32_to_cpu(ctx-buffer[0]);
-   ctx-buffer[1] = le32_to_cpu(ctx-buffer[1]);
-   ctx-buffer[2] = le32_to_cpu(ctx-buffer[2]);
+   p.ack= ((status  16)  0x1f) - 16;
+   p.speed  = (status  21)  0x7;
+   p.timestamp  = status  0x;
+   p.generation = ohci-request_generation;
+
+   p.header[0] = le32_to_cpu(ctx-buffer[0]);
+   p.header[1] = le32_to_cpu(ctx-buffer[1]);
+   p.header[2] = le32_to_cpu(ctx-buffer[2]);
+
+   tcode = (p.header[0]  4)  0x0f;
+   switch (tcode) {
+   case TCODE_WRITE_QUADLET_REQUEST:
+   case TCODE_READ_QUADLET_RESPONSE:
+   p.header[3] = ctx-buffer[3];
+   p.header_length = 16;
+   break;
+
+   case TCODE_WRITE_BLOCK_REQUEST:
+   case TCODE_READ_BLOCK_REQUEST :
+   case TCODE_READ_BLOCK_RESPONSE:
+   case TCODE_LOCK_REQUEST:
+   case TCODE_LOCK_RESPONSE:
+   p.header[3] = le32_to_cpu(ctx-buffer[3]);
+   p.header_length = 16;
+   break;
+
+   case TCODE_WRITE_RESPONSE:
+   case TCODE_READ_QUADLET_REQUEST:
+   p.header_length = 12;
+   break;
+   }
 
-   tcode = (ctx-buffer[0]  4)  0x0f;
-   if (TCODE_IS_BLOCK_PACKET(tcode))
-   ctx-buffer[3] = le32_to_cpu(ctx-buffer[3]);
+   p.payload = (void *) ctx-buffer + p.header_length;
+   p.payload_length = length - p.header_length;
 
/* The OHCI bus reset handler synthesizes a phy packet with
 * the new generation number when a bus reset happens (see
@@ -248,15 +272,12 @@ static void ar_context_tasklet(unsigned long data)
 * we use the unique tlabel for finding the matching
 * request. */
 
-   if (ack + 16 == 0x09)
+   if (p.ack + 16 == 0x09)
ohci-request_generation = (ctx-buffer[2]  16)  0xff;
else if (ctx == ohci-ar_request_ctx)
-   fw_core_handle_request(ohci-card, speed, ack, timestamp,
-  ohci-request_generation,
-  length, ctx-buffer);
+   fw_core_handle_request(ohci-card, p);
else
-   fw_core_handle_response(ohci-card, speed, ack, timestamp,
-   length, ctx-buffer);
+   fw_core_handle_response(ohci-card, p);
 
ctx-descriptor.data_address = cpu_to_le32(ctx-buffer_bus);
ctx-descriptor.req_count= cpu_to_le16(sizeof ctx-buffer);
@@ -323,15 +344,15 @@ do_packet_callbacks(struct fw_ohci *ohci, struct 
list_head *list)
struct fw_packet *p, *next;
 
list_for_each_entry_safe(p, next, list, link)
-   p-callback(p, ohci-card, p-status);
+   p-callback(p, ohci-card, p-ack);
 }
 
 static void
 complete_transmission(struct fw_packet *packet,
- int status, struct list_head *list)
+ int ack, struct list_head *list)
 {
list_move_tail(packet-link, list);
-   packet-status = status;
+   packet-ack = ack;
 }
 
 /* This function prepares the first packet in the context queue for
diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index 57ecf95..4ca39f0 100644
--- 

firewire: Loop requests to the host controller back into the stack.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e636fe2576be552252a5b63e9287915e810b37d8
Commit: e636fe2576be552252a5b63e9287915e810b37d8
Parent: 2639a6fb268e1f2a7700fe3d31cbca9b39aa3ad9
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Jan 26 00:38:04 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:46 2007 +0100

firewire: Loop requests to the host controller back into the stack.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device.c |5 -
 drivers/firewire/fw-ohci.c   |   33 +
 2 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index 4fb5587..d71824b 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -532,11 +532,6 @@ void fw_node_event(struct fw_card *card, struct fw_node 
*node, int event)
 {
struct fw_device *device;
 
-   /* Ignore events for the local node (i.e. the node that
-* corresponds to the ieee1394 controller in this linux box). */
-   if (node == card-local_node)
-   return;
-
switch (event) {
case FW_NODE_CREATED:
case FW_NODE_LINK_ON:
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 8dc872a..5156329 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -121,6 +121,7 @@ struct fw_ohci {
dma_addr_t self_id_bus;
__le32 *self_id_cpu;
struct tasklet_struct bus_reset_tasklet;
+   int node_id;
int generation;
int request_generation;
 
@@ -538,29 +539,45 @@ at_context_init(struct at_context *ctx, struct fw_ohci 
*ohci, u32 control_set)
return 0;
 }
 
+#define header_get_destination(q)  (((q)  16)  0x)
+
 static void
 at_context_transmit(struct at_context *ctx, struct fw_packet *packet)
 {
LIST_HEAD(list);
unsigned long flags;
-   int was_empty;
+   int local;
 
spin_lock_irqsave(ctx-ohci-lock, flags);
 
-   was_empty = list_empty(ctx-list);
-   list_add_tail(packet-link, ctx-list);
-   if (was_empty)
-   at_context_setup_packet(ctx, list);
+   if (header_get_destination(packet-header[0]) == ctx-ohci-node_id 
+   ctx-ohci-generation == packet-generation) {
+   local = 1;
+   } else {
+   list_add_tail(packet-link, ctx-list);
+   if (ctx-list.next == packet-link)
+   at_context_setup_packet(ctx, list);
+   local = 0;
+   }
 
spin_unlock_irqrestore(ctx-ohci-lock, flags);
 
do_packet_callbacks(ctx-ohci, list);
+
+   if (local) {
+   packet-ack = ACK_PENDING;
+   packet-callback(packet, ctx-ohci-card, packet-ack);
+   if (ctx == ctx-ohci-at_request_ctx)
+   fw_core_handle_request(ctx-ohci-card, packet);
+   else
+   fw_core_handle_response(ctx-ohci-card, packet);
+   }
 }
 
 static void bus_reset_tasklet(unsigned long data)
 {
struct fw_ohci *ohci = (struct fw_ohci *)data;
-   int self_id_count, i, j, reg, node_id;
+   int self_id_count, i, j, reg;
int generation, new_generation;
unsigned long flags;
 
@@ -569,7 +586,7 @@ static void bus_reset_tasklet(unsigned long data)
fw_error(node ID not valid, new bus reset in progress\n);
return;
}
-   node_id = reg  0x;
+   ohci-node_id = reg  0x;
 
/* The count in the SelfIDCount register is the number of
 * bytes in the self ID receive buffer.  Since we also receive
@@ -638,7 +655,7 @@ static void bus_reset_tasklet(unsigned long data)
 
spin_unlock_irqrestore(ohci-lock, flags);
 
-   fw_core_handle_bus_reset(ohci-card, node_id, generation,
+   fw_core_handle_bus_reset(ohci-card, ohci-node_id, generation,
 self_id_count, ohci-self_id_buffer);
 }
 
-
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


firewire: Add lock transaction opcodes to fw-device-cdev.h.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=746083d86cf5f874741e3ddecf56ea3ed32959c8
Commit: 746083d86cf5f874741e3ddecf56ea3ed32959c8
Parent: 36bfe49d076404fcdf5766098de21724635a1816
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Jan 26 00:38:18 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:47 2007 +0100

firewire: Add lock transaction opcodes to fw-device-cdev.h.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index b934272..ddbae43 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -37,6 +37,14 @@
 #define TCODE_STREAM_DATA  10
 #define TCODE_LOCK_RESPONSE11
 
+#define TCODE_LOCK_MASK_SWAP   0x11
+#define TCODE_LOCK_COMPARE_SWAP0x12
+#define TCODE_LOCK_FETCH_ADD   0x13
+#define TCODE_LOCK_LITTLE_ADD  0x14
+#define TCODE_LOCK_BOUNDED_ADD 0x15
+#define TCODE_LOCK_WRAP_ADD0x16
+#define TCODE_LOCK_VENDOR_DEPENDENT0x17
+
 #define RCODE_COMPLETE 0x0
 #define RCODE_CONFLICT_ERROR   0x4
 #define RCODE_DATA_ERROR   0x5
-
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


firewire: Handle access to CSR resources on local node.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=93c4cceb963ebb133531e5e3f4f6e2da0d222656
Commit: 93c4cceb963ebb133531e5e3f4f6e2da0d222656
Parent: 746083d86cf5f874741e3ddecf56ea3ed32959c8
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Jan 26 00:38:26 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:47 2007 +0100

firewire: Handle access to CSR resources on local node.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c|  130 -
 drivers/firewire/fw-transaction.c |   14 +++--
 drivers/firewire/fw-transaction.h |   31 +
 3 files changed, 154 insertions(+), 21 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 5156329..ac6c018 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -540,38 +540,136 @@ at_context_init(struct at_context *ctx, struct fw_ohci 
*ohci, u32 control_set)
 }
 
 #define header_get_destination(q)  (((q)  16)  0x)
+#define header_get_tcode(q)(((q)  4)  0x0f)
+#define header_get_offset_high(q)  (((q)  0)  0x)
+#define header_get_data_length(q)  (((q)  16)  0x)
+#define header_get_extended_tcode(q)   (((q)  0)  0x)
+
+static void
+handle_local_rom(struct fw_ohci *ohci, struct fw_packet *packet, u32 csr)
+{
+   struct fw_packet response;
+   int tcode, length, i;
+
+   tcode = header_get_tcode(packet-header[0]);
+   if (TCODE_IS_BLOCK_PACKET(tcode))
+   length = header_get_data_length(packet-header[3]);
+   else
+   length = 4;
+
+   i = csr - CSR_CONFIG_ROM;
+   if (i + length  CONFIG_ROM_SIZE) {
+   fw_fill_response(response, packet-header,
+RCODE_ADDRESS_ERROR, NULL, 0);
+   } else if (!TCODE_IS_READ_REQUEST(tcode)) {
+   fw_fill_response(response, packet-header,
+RCODE_TYPE_ERROR, NULL, 0);
+   } else {
+   fw_fill_response(response, packet-header, RCODE_COMPLETE,
+(void *) ohci-config_rom + i, length);
+   }
+
+   fw_core_handle_response(ohci-card, response);
+}
+
+static void
+handle_local_lock(struct fw_ohci *ohci, struct fw_packet *packet, u32 csr)
+{
+   struct fw_packet response;
+   int tcode, length, ext_tcode, sel;
+   __be32 *payload, lock_old;
+   u32 lock_arg, lock_data;
+
+   tcode = header_get_tcode(packet-header[0]);
+   length = header_get_data_length(packet-header[3]);
+   payload = packet-payload;
+   ext_tcode = header_get_extended_tcode(packet-header[3]);
+
+   if (tcode == TCODE_LOCK_REQUEST 
+   ext_tcode == EXTCODE_COMPARE_SWAP  length == 8) {
+   lock_arg = be32_to_cpu(payload[0]);
+   lock_data = be32_to_cpu(payload[1]);
+   } else if (tcode == TCODE_READ_QUADLET_REQUEST) {
+   lock_arg = 0;
+   lock_data = 0;
+   } else {
+   fw_fill_response(response, packet-header,
+RCODE_TYPE_ERROR, NULL, 0);
+   goto out;
+   }
+
+   sel = (csr - CSR_BUS_MANAGER_ID) / 4;
+   reg_write(ohci, OHCI1394_CSRData, lock_data);
+   reg_write(ohci, OHCI1394_CSRCompareData, lock_arg);
+   reg_write(ohci, OHCI1394_CSRControl, sel);
+
+   if (reg_read(ohci, OHCI1394_CSRControl)  0x8000)
+   lock_old = cpu_to_be32(reg_read(ohci, OHCI1394_CSRData));
+   else
+   fw_notify(swap not done yet\n);
+
+   fw_fill_response(response, packet-header,
+RCODE_COMPLETE, lock_old, sizeof lock_old);
+ out:
+   fw_core_handle_response(ohci-card, response);
+}
+
+static void
+handle_local_request(struct at_context *ctx, struct fw_packet *packet)
+{
+   u64 offset;
+   u32 csr;
+
+   packet-ack = ACK_PENDING;
+   packet-callback(packet, ctx-ohci-card, packet-ack);
+
+   offset =
+   ((unsigned long long)
+header_get_offset_high(packet-header[1])  32) |
+   packet-header[2];
+   csr = offset - CSR_REGISTER_BASE;
+
+   /* Handle config rom reads. */
+   if (csr = CSR_CONFIG_ROM  csr  CSR_CONFIG_ROM_END)
+   handle_local_rom(ctx-ohci, packet, csr);
+   else switch (csr) {
+   case CSR_BUS_MANAGER_ID:
+   case CSR_BANDWIDTH_AVAILABLE:
+   case CSR_CHANNELS_AVAILABLE_HI:
+   case CSR_CHANNELS_AVAILABLE_LO:
+   handle_local_lock(ctx-ohci, packet, csr);
+   break;
+   default:
+   if (ctx == ctx-ohci-at_request_ctx)
+   fw_core_handle_request(ctx-ohci-card, packet);
+   else
+   fw_core_handle_response(ctx-ohci-card, packet);
+   

firewire: Clean up response handling.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=36bfe49d076404fcdf5766098de21724635a1816
Commit: 36bfe49d076404fcdf5766098de21724635a1816
Parent: e636fe2576be552252a5b63e9287915e810b37d8
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Jan 26 00:38:13 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:46 2007 +0100

firewire: Clean up response handling.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-transaction.c |   54 ++--
 1 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index 4ca39f0..a116ffa 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -107,9 +107,9 @@ transmit_complete_callback(struct fw_packet *packet,
 }
 
 static void
-fw_fill_packet(struct fw_packet *packet, int tcode, int tlabel,
-  int node_id, int generation, int speed,
-  unsigned long long offset, void *payload, size_t length)
+fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
+   int node_id, int generation, int speed,
+   unsigned long long offset, void *payload, size_t length)
 {
int ext_tcode;
 
@@ -240,8 +240,8 @@ fw_send_request(struct fw_card *card, struct fw_transaction 
*t,
t-callback = callback;
t-callback_data = callback_data;
 
-   fw_fill_packet(t-packet, tcode, t-tlabel,
-  node_id, generation, speed, offset, payload, length);
+   fw_fill_request(t-packet, tcode, t-tlabel,
+   node_id, generation, speed, offset, payload, length);
t-packet.callback = transmit_complete_callback;
 
card-driver-send_request(card, t-packet);
@@ -409,6 +409,7 @@ EXPORT_SYMBOL(fw_core_remove_address_handler);
 
 struct fw_request {
struct fw_packet response;
+   u32 request_header[4];
int ack;
u32 length;
u32 data[0];
@@ -425,22 +426,24 @@ free_response_callback(struct fw_packet *packet,
 }
 
 static void
-fw_fill_response(struct fw_packet *response,
-struct fw_packet *request, void *data)
+fw_fill_response(struct fw_packet *response, u32 *request_header,
+int rcode, void *payload, size_t length)
 {
int tcode, tlabel, extended_tcode, source, destination;
 
-   tcode  = header_get_tcode(request-header[0]);
-   tlabel = header_get_tlabel(request-header[0]);
-   source = header_get_destination(request-header[0]);
-   destination= header_get_source(request-header[1]);
-   extended_tcode = header_get_extended_tcode(request-header[3]);
+   tcode  = header_get_tcode(request_header[0]);
+   tlabel = header_get_tlabel(request_header[0]);
+   source = header_get_destination(request_header[0]);
+   destination= header_get_source(request_header[1]);
+   extended_tcode = header_get_extended_tcode(request_header[3]);
 
response-header[0] =
header_retry(RETRY_1) |
header_tlabel(tlabel) |
header_destination(destination);
-   response-header[1] = header_source(source);
+   response-header[1] =
+   header_source(source) |
+   header_rcode(rcode);
response-header[2] = 0;
 
switch (tcode) {
@@ -454,7 +457,7 @@ fw_fill_response(struct fw_packet *response,
case TCODE_READ_QUADLET_REQUEST:
response-header[0] |=
header_tcode(TCODE_READ_QUADLET_RESPONSE);
-   response-header[3] = 0;
+   response-header[3] = *(u32 *)payload;
response-header_length = 16;
response-payload_length = 0;
break;
@@ -463,11 +466,11 @@ fw_fill_response(struct fw_packet *response,
case TCODE_LOCK_REQUEST:
response-header[0] |= header_tcode(tcode + 2);
response-header[3] =
-   header_data_length(request-payload_length) |
+   header_data_length(length) |
header_extended_tcode(extended_tcode);
response-header_length = 16;
-   response-payload = data;
-   response-payload_length = request-payload_length;
+   response-payload = payload;
+   response-payload_length = length;
break;
 
default:
@@ -530,7 +533,7 @@ allocate_request(struct fw_packet *p)
if (data)
memcpy(request-data, p-payload, p-payload_length);
 
-   fw_fill_response(request-response, p, request-data);
+   memcpy(request-request_header, p-header, sizeof p-header);
 
return request;
 }
@@ -538,21 +541,18 @@ 

firewire: Sanitize send error codes.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5f49c3b837ff90c8aec2c6c66c4966080aced06
Commit: e5f49c3b837ff90c8aec2c6c66c4966080aced06
Parent: 93c4cceb963ebb133531e5e3f4f6e2da0d222656
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Jan 26 00:38:34 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:47 2007 +0100

firewire: Sanitize send error codes.

Drop the negative errnos and use RCODEs for all error codes
in the complete transaction callback.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c|   20 ++--
 drivers/firewire/fw-transaction.c |   12 ++--
 drivers/firewire/fw-transaction.h |2 ++
 3 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index ac6c018..58bc85d 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -376,7 +376,7 @@ at_context_setup_packet(struct at_context *ctx, struct 
list_head *list)
 packet-payload_length,
 DMA_TO_DEVICE);
if (packet-payload_bus == 0) {
-   complete_transmission(packet, -ENOMEM, list);
+   complete_transmission(packet, RCODE_SEND_ERROR, list);
return;
}
 
@@ -438,7 +438,7 @@ at_context_setup_packet(struct at_context *ctx, struct 
list_head *list)
/* We dont return error codes from this function; all
 * transmission errors are reported through the
 * callback. */
-   complete_transmission(packet, -ESTALE, list);
+   complete_transmission(packet, RCODE_GENERATION, list);
}
 }
 
@@ -484,26 +484,26 @@ static void at_context_tasklet(unsigned long data)
switch (evt) {
case OHCI1394_evt_timeout:
/* Async response transmit timed out. */
-   complete_transmission(packet, -ETIMEDOUT, list);
+   complete_transmission(packet, RCODE_CANCELLED, list);
break;
 
case OHCI1394_evt_flushed:
/* The packet was flushed should give same
 * error as when we try to use a stale
 * generation count. */
-   complete_transmission(packet, -ESTALE, list);
+   complete_transmission(packet,
+ RCODE_GENERATION, list);
break;
 
case OHCI1394_evt_missing_ack:
-   /* This would be a higher level software
-* error, it is using a valid (current)
-* generation count, but the node is not on
-* the bus. */
-   complete_transmission(packet, -ENODEV, list);
+   /* Using a valid (current) generation count,
+* but the node is not on the bus or not
+* sending acks. */
+   complete_transmission(packet, RCODE_NO_ACK, list);
break;
 
default:
-   complete_transmission(packet, -EIO, list);
+   complete_transmission(packet, RCODE_SEND_ERROR, list);
break;
}
} else
diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index 780ed2b..8387c8e 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -93,15 +93,15 @@ transmit_complete_callback(struct fw_packet *packet,
close_transaction(t, card, RCODE_BUSY, NULL, 0);
break;
case ACK_DATA_ERROR:
+   close_transaction(t, card, RCODE_DATA_ERROR, NULL, 0);
+   break;
case ACK_TYPE_ERROR:
-   close_transaction(t, card, RCODE_SEND_ERROR, NULL, 0);
+   close_transaction(t, card, RCODE_TYPE_ERROR, NULL, 0);
break;
default:
-   /* FIXME: In this case, status is a negative errno,
-* corresponding to an OHCI specific transmit error
-* code.  We should map that to an RCODE instead of
-* just the generic RCODE_SEND_ERROR. */
-   close_transaction(t, card, RCODE_SEND_ERROR, NULL, 0);
+   /* In this case the ack is really a juju specific
+* rcode, so just forward that to the callback. */
+   close_transaction(t, card, status, NULL, 0);
break;
}
 }
diff --git a/drivers/firewire/fw-transaction.h 

firewire: Fix bit shift typo.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9fc82689bf2920e9b3a8cc1766bcb6ad6454a7c4
Commit: 9fc82689bf2920e9b3a8cc1766bcb6ad6454a7c4
Parent: e5f49c3b837ff90c8aec2c6c66c4966080aced06
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Jan 26 00:38:38 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:48 2007 +0100

firewire: Fix bit shift typo.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-transaction.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index 8387c8e..4a48e2d 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -48,7 +48,7 @@
 
 #define header_get_tcode(q)(((q)  4)  0x0f)
 #define header_get_tlabel(q)   (((q)  10)  0x3f)
-#define header_get_rcode(q)(((q)  4)  0x0f)
+#define header_get_rcode(q)(((q)  12)  0x0f)
 #define header_get_destination(q)  (((q)  16)  0x)
 #define header_get_source(q)   (((q)  16)  0x)
 #define header_get_offset_high(q)  (((q)  0)  0x)
-
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


firewire: Implement compliant bus management.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=931c4834c8d1e1bf0dcc256b89449a01711f970d
Commit: 931c4834c8d1e1bf0dcc256b89449a01711f970d
Parent: 9fc82689bf2920e9b3a8cc1766bcb6ad6454a7c4
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Jan 26 00:38:45 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:48 2007 +0100

firewire: Implement compliant bus management.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-card.c|  127 +++--
 drivers/firewire/fw-device.c  |2 +
 drivers/firewire/fw-topology.c|7 +-
 drivers/firewire/fw-transaction.h |6 +-
 4 files changed, 117 insertions(+), 25 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 307c8b8..f94874c 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -92,7 +92,7 @@ generate_config_rom (struct fw_card *card, size_t 
*config_rom_length)
bib_generation(card-config_rom_generation++ % 14 + 2) |
bib_max_rom(2) |
bib_max_receive(card-max_receive) |
-   bib_isc | bib_cmc | bib_imc;
+   bib_bmc | bib_isc | bib_cmc | bib_imc;
config_rom[3] = card-guid  32;
config_rom[4] = card-guid;
 
@@ -190,48 +190,137 @@ static const char gap_count_table[] = {
63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40
 };
 
+struct bm_data {
+   struct fw_transaction t;
+   struct {
+   __be32 arg;
+   __be32 data;
+   } lock;
+   u32 old;
+   int rcode;
+   struct completion done;
+};
+
 static void
-fw_card_irm_work(struct work_struct *work)
+complete_bm_lock(struct fw_card *card, int rcode,
+void *payload, size_t length, void *data)
+{
+   struct bm_data *bmd = data;
+
+   if (rcode == RCODE_COMPLETE)
+   bmd-old = be32_to_cpu(*(__be32 *) payload);
+   bmd-rcode = rcode;
+   complete(bmd-done);
+}
+
+static void
+fw_card_bm_work(struct work_struct *work)
 {
struct fw_card *card = container_of(work, struct fw_card, work.work);
struct fw_device *root;
+   struct bm_data bmd;
unsigned long flags;
-   int root_id, new_irm_id, gap_count, generation, do_reset = 0;
-
-   /* FIXME: This simple bus management unconditionally picks a
-* cycle master if the current root can't do it.  We need to
-* not do this if there is a bus manager already.  Also, some
-* hubs set the contender bit, which is bogus, so we should
-* probably do a little sanity check on the IRM (like, read
-* the bandwidth register) if it's not us. */
+   int root_id, new_root_id, irm_id, gap_count, generation, grace;
+   int do_reset = 0;
 
spin_lock_irqsave(card-lock, flags);
 
generation = card-generation;
root = card-root_node-data;
root_id = card-root_node-node_id;
+   grace = time_after(jiffies, card-reset_jiffies + DIV_ROUND_UP(HZ, 10));
+
+   if (card-bm_generation + 1 == generation ||
+   (card-bm_generation != generation  grace)) {
+   /* This first step is to figure out who is IRM and
+* then try to become bus manager.  If the IRM is not
+* well defined (e.g. does not have an active link
+* layer or does not responds to our lock request, we
+* will have to do a little vigilante bus management.
+* In that case, we do a goto into the gap count logic
+* so that when we do the reset, we still optimize the
+* gap count.  That could well save a reset in the
+* next generation. */
+
+   irm_id = card-irm_node-node_id;
+   if (!card-irm_node-link_on) {
+   new_root_id = card-local_node-node_id;
+   fw_notify(IRM has link off, making local node (%02x) 
root.\n,
+ new_root_id);
+   goto pick_me;
+   }
+
+   bmd.lock.arg = cpu_to_be32(0x3f);
+   bmd.lock.data = cpu_to_be32(card-local_node-node_id);
+
+   spin_unlock_irqrestore(card-lock, flags);
+
+   init_completion(bmd.done);
+   fw_send_request(card, bmd.t, TCODE_LOCK_COMPARE_SWAP,
+   irm_id, generation,
+   SCODE_100, CSR_REGISTER_BASE + 
CSR_BUS_MANAGER_ID,
+   bmd.lock, sizeof bmd.lock,
+   complete_bm_lock, bmd);
+   wait_for_completion(bmd.done);
+
+   if (bmd.rcode == RCODE_GENERATION) {
+   /* Another bus reset happened. Just return,
+* the 

firewire: Rework async receive DMA.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=32b46093a076986fa3c6e1dd484791624edf4585
Commit: 32b46093a076986fa3c6e1dd484791624edf4585
Parent: 641f8791f031d6133e5c3e9ce036b3e942416e9d
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:30 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:50 2007 +0100

firewire: Rework async receive DMA.

The old DMA program for receiving async packets stops DMA while
processing received packets and only expects one packet per
interrupt.  Stopping DMA can silently drop packets and we need to
handle multiple received packets per interrupt.

This new version keeps DMA running at all times and just append new
pages as buffers fill up, and supports multiple packets per interrupt.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c|  212 +++--
 drivers/firewire/fw-transaction.c |3 +-
 2 files changed, 132 insertions(+), 83 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 29285f2..ec47ae9 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -55,17 +55,20 @@ struct descriptor {
__le16 transfer_status;
 } __attribute__((aligned(16)));
 
-struct ar_context {
-   struct fw_ohci *ohci;
+struct ar_buffer {
struct descriptor descriptor;
-   __le32 buffer[512];
-   dma_addr_t descriptor_bus;
-   dma_addr_t buffer_bus;
+   struct ar_buffer *next;
+   __le32 data[0];
+};
 
+struct ar_context {
+   struct fw_ohci *ohci;
+   struct ar_buffer *current_buffer;
+   struct ar_buffer *last_buffer;
+   void *pointer;
u32 command_ptr;
u32 control_set;
u32 control_clear;
-
struct tasklet_struct tasklet;
 };
 
@@ -169,8 +172,7 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card)
 #define OHCI_LOOP_COUNT500
 #define OHCI1394_PCI_HCI_Control   0x40
 #define SELF_ID_BUF_SIZE   0x800
-
-#define MAX_STOP_CONTEXT_LOOPS 1000
+#define OHCI_TCODE_PHY_PACKET  0x0e
 
 static char ohci_driver_name[] = KBUILD_MODNAME;
 
@@ -213,66 +215,97 @@ ohci_update_phy_reg(struct fw_card *card, int addr,
return 0;
 }
 
-static void ar_context_run(struct ar_context *ctx)
+static int ar_context_add_page(struct ar_context *ctx)
 {
-   reg_write(ctx-ohci, ctx-command_ptr, ctx-descriptor_bus | 1);
-   reg_write(ctx-ohci, ctx-control_set, CONTEXT_RUN);
+   struct device *dev = ctx-ohci-card.device;
+   struct ar_buffer *ab;
+   dma_addr_t ab_bus;
+   size_t offset;
+
+   ab = (struct ar_buffer *) __get_free_page(GFP_ATOMIC);
+   if (ab == NULL)
+   return -ENOMEM;
+
+   ab_bus = dma_map_single(dev, ab, PAGE_SIZE, DMA_BIDIRECTIONAL);
+   if (dma_mapping_error(ab_bus)) {
+   free_page((unsigned long) ab);
+   return -ENOMEM;
+   }
+
+   memset(ab-descriptor, 0, sizeof ab-descriptor);
+   ab-descriptor.control= cpu_to_le16(descriptor_input_more |
+   descriptor_status |
+   descriptor_branch_always);
+   offset = offsetof(struct ar_buffer, data);
+   ab-descriptor.req_count  = cpu_to_le16(PAGE_SIZE - offset);
+   ab-descriptor.data_address   = cpu_to_le32(ab_bus + offset);
+   ab-descriptor.res_count  = cpu_to_le16(PAGE_SIZE - offset);
+   ab-descriptor.branch_address = 0;
+
+   dma_sync_single_for_device(dev, ab_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
+
+   ctx-last_buffer-descriptor.branch_address = ab_bus | 1;
+   ctx-last_buffer-next = ab;
+   ctx-last_buffer = ab;
+
+   reg_write(ctx-ohci, ctx-control_set, CONTEXT_WAKE);
flush_writes(ctx-ohci);
+
+   return 0;
 }
 
-static void ar_context_tasklet(unsigned long data)
+static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
 {
-   struct ar_context *ctx = (struct ar_context *)data;
struct fw_ohci *ohci = ctx-ohci;
struct fw_packet p;
u32 status, length, tcode;
-   int i;
 
-   /* FIXME: We stop and restart the ar context here, what if we
-* stop while a receive is in progress? Maybe we could just
-* loop the context back to itself and use it in buffer fill
-* mode as intended... */
-   reg_write(ctx-ohci, ctx-control_clear, CONTEXT_RUN);
-
-   /* FIXME: What to do about evt_* errors? */
-   length= le16_to_cpu(ctx-descriptor.req_count) -
-   le16_to_cpu(ctx-descriptor.res_count) - 4;
-   status= le32_to_cpu(ctx-buffer[length / 4]);
-
-   p.ack= ((status  16)  0x1f) - 16;
-   p.speed  = (status  21)  0x7;

firewire: Reduce some redundant register definitions.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=72e318e07e1fa9840bfdd5788421fc6dc51a93de
Commit: 72e318e07e1fa9840bfdd5788421fc6dc51a93de
Parent: 32b46093a076986fa3c6e1dd484791624edf4585
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:31 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:51 2007 +0100

firewire: Reduce some redundant register definitions.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |   50 +++
 1 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index ec47ae9..02b2b69 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -55,6 +55,11 @@ struct descriptor {
__le16 transfer_status;
 } __attribute__((aligned(16)));
 
+#define control_set(regs)  (regs)
+#define control_clear(regs)((regs) + 4)
+#define command_ptr(regs)  ((regs) + 12)
+#define context_match(regs)((regs) + 16)
+
 struct ar_buffer {
struct descriptor descriptor;
struct ar_buffer *next;
@@ -66,9 +71,7 @@ struct ar_context {
struct ar_buffer *current_buffer;
struct ar_buffer *last_buffer;
void *pointer;
-   u32 command_ptr;
-   u32 control_set;
-   u32 control_clear;
+   u32 regs;
struct tasklet_struct tasklet;
 };
 
@@ -85,9 +88,7 @@ struct at_context {
struct descriptor last;
} d;
 
-   u32 command_ptr;
-   u32 control_set;
-   u32 control_clear;
+   u32 regs;
 
struct tasklet_struct tasklet;
 };
@@ -102,10 +103,7 @@ struct at_context {
 struct iso_context {
struct fw_iso_context base;
struct tasklet_struct tasklet;
-   u32 control_set;
-   u32 control_clear;
-   u32 command_ptr;
-   u32 context_match;
+   u32 regs;
 
struct descriptor *buffer;
dma_addr_t buffer_bus;
@@ -248,7 +246,7 @@ static int ar_context_add_page(struct ar_context *ctx)
ctx-last_buffer-next = ab;
ctx-last_buffer = ab;
 
-   reg_write(ctx-ohci, ctx-control_set, CONTEXT_WAKE);
+   reg_write(ctx-ohci, control_set(ctx-regs), CONTEXT_WAKE);
flush_writes(ctx-ohci);
 
return 0;
@@ -375,15 +373,13 @@ static void ar_context_tasklet(unsigned long data)
 }
 
 static int
-ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, u32 control_set)
+ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, u32 regs)
 {
struct ar_buffer ab;
 
-   ctx-control_set   = control_set;
-   ctx-control_clear = control_set + 4;
-   ctx-command_ptr   = control_set + 12;
-   ctx-ohci  = ohci;
-   ctx-last_buffer   = ab;
+   ctx-regs= regs;
+   ctx-ohci= ohci;
+   ctx-last_buffer = ab;
tasklet_init(ctx-tasklet, ar_context_tasklet, (unsigned long)ctx);
 
ar_context_add_page(ctx);
@@ -391,8 +387,8 @@ ar_context_init(struct ar_context *ctx, struct fw_ohci 
*ohci, u32 control_set)
ctx-current_buffer = ab.next;
ctx-pointer = ctx-current_buffer-data;
 
-   reg_write(ctx-ohci, ctx-command_ptr, ab.descriptor.branch_address);
-   reg_write(ctx-ohci, ctx-control_set, CONTEXT_RUN);
+   reg_write(ctx-ohci, command_ptr(ctx-regs), 
ab.descriptor.branch_address);
+   reg_write(ctx-ohci, control_set(ctx-regs), CONTEXT_RUN);
flush_writes(ctx-ohci);
 
return 0;
@@ -489,9 +485,9 @@ at_context_setup_packet(struct at_context *ctx, struct 
list_head *list)
 
/* FIXME: Document how the locking works. */
if (ohci-generation == packet-generation) {
-   reg_write(ctx-ohci, ctx-command_ptr,
+   reg_write(ctx-ohci, command_ptr(ctx-regs),
  ctx-descriptor_bus | z);
-   reg_write(ctx-ohci, ctx-control_set,
+   reg_write(ctx-ohci, control_set(ctx-regs),
  CONTEXT_RUN | CONTEXT_WAKE);
} else {
/* We dont return error codes from this function; all
@@ -505,9 +501,9 @@ static void at_context_stop(struct at_context *ctx)
 {
u32 reg;
 
-   reg_write(ctx-ohci, ctx-control_clear, CONTEXT_RUN);
+   reg_write(ctx-ohci, control_clear(ctx-regs), CONTEXT_RUN);
 
-   reg = reg_read(ctx-ohci, ctx-control_set);
+   reg = reg_read(ctx-ohci, control_set(ctx-regs));
if (reg  CONTEXT_ACTIVE)
fw_notify(Tried to stop context, but it is still active 
  (0x%08x).\n, reg);
@@ -578,7 +574,7 @@ static void at_context_tasklet(unsigned long data)
 }
 
 static int
-at_context_init(struct at_context *ctx, struct fw_ohci *ohci, u32 control_set)
+at_context_init(struct at_context *ctx, struct fw_ohci *ohci, u32 regs)
 {

firewire: Implement proper transaction cancelation.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=730c32f58ba81b3a4fe6d19c7d9e9829dd96d363
Commit: 730c32f58ba81b3a4fe6d19c7d9e9829dd96d363
Parent: 72e318e07e1fa9840bfdd5788421fc6dc51a93de
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:32 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:51 2007 +0100

firewire: Implement proper transaction cancelation.

Drivers such as fw-sbp2 had no way to properly cancel in-progress
transactions, which could leave a pending transaction or an unset
packet in the low-level queues after kfree'ing the containing
structure. fw_cancel_transaction() lets drivers cancel a submitted
transaction.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-card.c|7 +
 drivers/firewire/fw-ohci.c|   33 ++
 drivers/firewire/fw-sbp2.c|3 ++
 drivers/firewire/fw-transaction.c |   54 -
 drivers/firewire/fw-transaction.h |5 +++
 5 files changed, 95 insertions(+), 7 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 7f5dc43..f785b10 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -475,6 +475,12 @@ dummy_send_response(struct fw_card *card, struct fw_packet 
*packet)
 }
 
 static int
+dummy_cancel_packet(struct fw_card *card, struct fw_packet *packet)
+{
+   return -ENOENT;
+}
+
+static int
 dummy_enable_phys_dma(struct fw_card *card,
  int node_id, int generation)
 {
@@ -487,6 +493,7 @@ static struct fw_card_driver dummy_driver = {
.update_phy_reg  = dummy_update_phy_reg,
.set_config_rom  = dummy_set_config_rom,
.send_request= dummy_send_request,
+   .cancel_packet   = dummy_cancel_packet,
.send_response   = dummy_send_response,
.enable_phys_dma = dummy_enable_phys_dma,
 };
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 02b2b69..e6fa349 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -79,6 +79,7 @@ struct at_context {
struct fw_ohci *ohci;
dma_addr_t descriptor_bus;
dma_addr_t buffer_bus;
+   struct fw_packet *current_packet;
 
struct list_head list;
 
@@ -489,6 +490,7 @@ at_context_setup_packet(struct at_context *ctx, struct 
list_head *list)
  ctx-descriptor_bus | z);
reg_write(ctx-ohci, control_set(ctx-regs),
  CONTEXT_RUN | CONTEXT_WAKE);
+   ctx-current_packet = packet;
} else {
/* We dont return error codes from this function; all
 * transmission errors are reported through the
@@ -524,6 +526,12 @@ static void at_context_tasklet(unsigned long data)
 
at_context_stop(ctx);
 
+   /* If the head of the list isn't the packet that just got
+* transmitted, the packet got cancelled before we finished
+* transmitting it. */
+   if (ctx-current_packet != packet)
+   goto skip_to_next;
+
if (packet-payload_length  0) {
dma_unmap_single(ohci-card.device, packet-payload_bus,
 packet-payload_length, DMA_TO_DEVICE);
@@ -564,6 +572,7 @@ static void at_context_tasklet(unsigned long data)
} else
complete_transmission(packet, evt - 16, list);
 
+ skip_to_next:
/* If more packets are queued, set up the next one. */
if (!list_empty(ctx-list))
at_context_setup_packet(ctx, list);
@@ -1012,6 +1021,29 @@ static void ohci_send_response(struct fw_card *card, 
struct fw_packet *packet)
at_context_transmit(ohci-at_response_ctx, packet);
 }
 
+static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
+{
+   struct fw_ohci *ohci = fw_ohci(card);
+   LIST_HEAD(list);
+   unsigned long flags;
+
+   spin_lock_irqsave(ohci-lock, flags);
+
+   if (packet-ack == 0) {
+   fw_notify(cancelling packet %p (header[0]=%08x)\n,
+ packet, packet-header[0]);
+
+   complete_transmission(packet, RCODE_CANCELLED, list);
+   }
+
+   spin_unlock_irqrestore(ohci-lock, flags);
+
+   do_packet_callbacks(ohci, list);
+
+   /* Return success if we actually cancelled something. */
+   return list_empty(list) ? -ENOENT : 0;
+}
+
 static int
 ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
 {
@@ -1339,6 +1371,7 @@ static const struct fw_card_driver ohci_driver = {
.set_config_rom = ohci_set_config_rom,
.send_request   = ohci_send_request,
.send_response  = ohci_send_response,
+   .cancel_packet  = ohci_cancel_packet,
.enable_phys_dma   

firewire: fw-sbp2: Do ORB timeout right.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1d3d52c5367e0ca352aff6d6986533787bcf36d0
Commit: 1d3d52c5367e0ca352aff6d6986533787bcf36d0
Parent: 730c32f58ba81b3a4fe6d19c7d9e9829dd96d363
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:33 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:52 2007 +0100

firewire: fw-sbp2: Do ORB timeout right.

When a management ORB times out, either because the fw_transaction
times out or when we don't get the status write, we need to properly
cancel the entire operation.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   24 +---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index bb13339..c196333 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -24,6 +24,7 @@
 #include linux/device.h
 #include linux/scatterlist.h
 #include linux/dma-mapping.h
+#include linux/timer.h
 
 #include scsi/scsi.h
 #include scsi/scsi_cmnd.h
@@ -58,12 +59,16 @@ struct sbp2_device {
int address_high;
int generation;
 
+   /* Timer for flushing ORBs. */
+   struct timer_list orb_timer;
+
struct work_struct work;
struct Scsi_Host *scsi_host;
 };
 
 #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
 #define SBP2_MAX_SECTORS   255 /* Max sectors supported */
+#define SBP2_ORB_TIMEOUT   2000/* Timeout in ms */
 
 #define SBP2_ORB_NULL  0x8000
 
@@ -327,6 +332,9 @@ sbp2_send_orb(struct sbp2_orb *orb, struct fw_unit *unit,
list_add_tail(orb-link, sd-orb_list);
spin_unlock_irqrestore(device-card-lock, flags);
 
+   mod_timer(sd-orb_timer,
+ jiffies + DIV_ROUND_UP(SBP2_ORB_TIMEOUT * HZ, 1000));
+
fw_send_request(device-card, orb-t, TCODE_WRITE_BLOCK_REQUEST,
node_id, generation,
device-node-max_speed, offset,
@@ -356,6 +364,13 @@ static void sbp2_cancel_orbs(struct fw_unit *unit)
}
 }
 
+static void orb_timer_callback(unsigned long data)
+{
+   struct sbp2_device *sd = (struct sbp2_device *)data;
+
+   sbp2_cancel_orbs(sd-unit);
+}
+
 static void
 complete_management_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)
 {
@@ -374,7 +389,6 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, 
int generation,
struct fw_device *device = fw_device(unit-device.parent);
struct sbp2_device *sd = unit-device.driver_data;
struct sbp2_management_orb *orb;
-   unsigned long timeout;
int retval = -ENOMEM;
 
orb = kzalloc(sizeof *orb, GFP_ATOMIC);
@@ -426,7 +440,7 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, 
int generation,
sbp2_send_orb(orb-base, unit,
  node_id, generation, sd-management_agent_address);
 
-   timeout = wait_for_completion_timeout(orb-done, 10 * HZ);
+   wait_for_completion(orb-done);
 
/* FIXME: Handle bus reset race here. */
 
@@ -437,7 +451,7 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, 
int generation,
goto out;
}
 
-   if (timeout == 0) {
+   if (orb-base.rcode == RCODE_CANCELLED) {
fw_error(orb reply timed out, rcode=0x%02x\n,
 orb-base.rcode);
goto out;
@@ -516,6 +530,7 @@ static int sbp2_probe(struct device *dev)
unit-device.driver_data = sd;
sd-unit = unit;
INIT_LIST_HEAD(sd-orb_list);
+   setup_timer(sd-orb_timer, orb_timer_callback, (unsigned long)sd);
 
sd-address_handler.length = 0x100;
sd-address_handler.address_callback = sbp2_status_write;
@@ -583,6 +598,7 @@ static int sbp2_probe(struct device *dev)
if (sbp2_send_management_orb(unit, node_id, generation,
 SBP2_LOGIN_REQUEST, lun, response)  0) {
fw_core_remove_address_handler(sd-address_handler);
+   del_timer_sync(sd-orb_timer);
kfree(sd);
return -EBUSY;
}
@@ -618,6 +634,7 @@ static int sbp2_probe(struct device *dev)
 SBP2_LOGOUT_REQUEST, sd-login_id,
 NULL);
fw_core_remove_address_handler(sd-address_handler);
+   del_timer_sync(sd-orb_timer);
kfree(sd);
return retval;
}
@@ -634,6 +651,7 @@ static int sbp2_remove(struct device *dev)
 SBP2_LOGOUT_REQUEST, sd-login_id, NULL);
 
remove_scsi_devices(unit);
+   del_timer_sync(sd-orb_timer);
 
fw_core_remove_address_handler(sd-address_handler);
kfree(sd);
-
To 

firewire: Introduce a retry mechanism for reconnects and logins.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f37c426c68d34aa221ce29262c1eba39034ac97
Commit: 7f37c426c68d34aa221ce29262c1eba39034ac97
Parent: 1d3d52c5367e0ca352aff6d6986533787bcf36d0
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:34 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:52 2007 +0100

firewire: Introduce a retry mechanism for reconnects and logins.

Sometimes we reconnect too soon, sometimes too late.  Adding a retry
mechanism make the reconnect step much more robust.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |  180 ++-
 1 files changed, 109 insertions(+), 71 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index c196333..432c35a 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -62,7 +62,8 @@ struct sbp2_device {
/* Timer for flushing ORBs. */
struct timer_list orb_timer;
 
-   struct work_struct work;
+   int retries;
+   struct delayed_work work;
struct Scsi_Host *scsi_host;
 };
 
@@ -511,6 +512,75 @@ static int sbp2_agent_reset(struct fw_unit *unit)
 
 static int add_scsi_devices(struct fw_unit *unit);
 static void remove_scsi_devices(struct fw_unit *unit);
+static void sbp2_reconnect(struct work_struct *work);
+
+static void sbp2_login(struct work_struct *work)
+{
+   struct sbp2_device *sd =
+   container_of(work, struct sbp2_device, work.work);
+   struct fw_unit *unit = sd-unit;
+   struct fw_device *device = fw_device(unit-device.parent);
+   struct sbp2_login_response response;
+   int generation, node_id, local_node_id, lun, retval;
+
+   /* FIXME: Make this work for multi-lun devices. */
+   lun = 0;
+
+   generation= device-card-generation;
+   node_id   = device-node-node_id;
+   local_node_id = device-card-local_node-node_id;
+
+   if (sbp2_send_management_orb(unit, node_id, generation,
+SBP2_LOGIN_REQUEST, lun, response)  0) {
+   if (sd-retries++  5) {
+   fw_error(login attempt %d for %s failed, 
+rescheduling\n,
+sd-retries, unit-device.bus_id);
+   schedule_delayed_work(sd-work, DIV_ROUND_UP(HZ, 5));
+   } else {
+   fw_error(failed to login to %s\n,
+unit-device.bus_id);
+   remove_scsi_devices(unit);
+   }
+   return;
+   }
+
+   sd-generation   = generation;
+   sd-node_id  = node_id;
+   sd-address_high = local_node_id  16;
+
+   /* Get command block agent offset and login id. */
+   sd-command_block_agent_address =
+   ((u64) response.command_block_agent.high  32) |
+   response.command_block_agent.low;
+   sd-login_id = login_response_get_login_id(response);
+
+   fw_notify(logged in to sbp2 unit %s\n, unit-device.bus_id);
+   fw_notify( - management_agent_address: 0x%012llx\n,
+ (unsigned long long) sd-management_agent_address);
+   fw_notify( - command_block_agent_address: 0x%012llx\n,
+ (unsigned long long) sd-command_block_agent_address);
+   fw_notify( - status write address: 0x%012llx\n,
+ (unsigned long long) sd-address_handler.offset);
+
+#if 0
+   /* FIXME: The linux1394 sbp2 does this last step. */
+   sbp2_set_busy_timeout(scsi_id);
+#endif
+
+   INIT_DELAYED_WORK(sd-work, sbp2_reconnect);
+   sbp2_agent_reset(unit);
+
+   retval = add_scsi_devices(unit);
+   if (retval  0) {
+   sbp2_send_management_orb(unit, sd-node_id, sd-generation,
+SBP2_LOGOUT_REQUEST, sd-login_id,
+NULL);
+   /* Set this back to sbp2_login so we fall back and
+* retry login on bus reset. */
+   INIT_DELAYED_WORK(sd-work, sbp2_login);
+   }
+}
 
 static int sbp2_probe(struct device *dev)
 {
@@ -518,9 +588,7 @@ static int sbp2_probe(struct device *dev)
struct fw_device *device = fw_device(unit-device.parent);
struct sbp2_device *sd;
struct fw_csr_iterator ci;
-   int i, key, value, lun, retval;
-   int node_id, generation, local_node_id;
-   struct sbp2_login_response response;
+   int i, key, value;
u32 model, firmware_revision;
 
sd = kzalloc(sizeof *sd, GFP_KERNEL);
@@ -586,58 +654,10 @@ static int sbp2_probe(struct device *dev)
  unit-device.bus_id,
  sd-workarounds, firmware_revision, model);
 
-   /* FIXME: Make 

firewire: Schedule topology work before calling driver update functions.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=993baca3dde7959567e3c7c262c2bc843ba241de
Commit: 993baca3dde7959567e3c7c262c2bc843ba241de
Parent: 7f37c426c68d34aa221ce29262c1eba39034ac97
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:35 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:53 2007 +0100

firewire: Schedule topology work before calling driver update functions.

This prevents superfluous bus traffic as fw-sbp2 logs in only to
get kicked off the device by another bus reset as the driver core
does bus management.  Scheduling it this way lets the driver core
finish bus management before higher level drivers get the update
callback.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-topology.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
index 27c6cb9..36c9be7 100644
--- a/drivers/firewire/fw-topology.c
+++ b/drivers/firewire/fw-topology.c
@@ -483,6 +483,7 @@ fw_core_handle_bus_reset(struct fw_card *card,
card-generation = generation;
memcpy(card-self_ids, self_ids, self_id_count * 4);
card-reset_jiffies = jiffies;
+   schedule_delayed_work(card-work, 0);
 
local_node = build_tree(card);
 
@@ -498,8 +499,6 @@ fw_core_handle_bus_reset(struct fw_card *card,
update_tree(card, local_node);
}
 
-   schedule_delayed_work(card-work, 0);
-
spin_unlock_irqrestore(card-lock, flags);
 }
 EXPORT_SYMBOL(fw_core_handle_bus_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


firewire: Complete SCSI commands with DID_BUS_BUSY when a bus reset happens.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=374a00392853db6fac4ec4c93139873a368a78af
Commit: 374a00392853db6fac4ec4c93139873a368a78af
Parent: 993baca3dde7959567e3c7c262c2bc843ba241de
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:36 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:53 2007 +0100

firewire: Complete SCSI commands with DID_BUS_BUSY when a bus reset happens.

This lets the SCSI stack retry the command when a SCSI command is
interrupted by a FireWire bus reset.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 432c35a..bd64e18 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -830,7 +830,7 @@ complete_command_orb(struct sbp2_orb *base_orb, struct 
sbp2_status *status)
 * or when sending the write (less likely). */
fw_notify(no command orb status, rcode=%d\n,
  orb-base.rcode);
-   result = DID_ERROR;
+   result = DID_BUS_BUSY;
}
 
dma_unmap_single(device-card-device, orb-base.request_bus,
-
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


firewire: Spell out fw as firewire in sysfs.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=362c2c8ca4a2f33f6e23a85c3b4caf64f1ce4bf9
Commit: 362c2c8ca4a2f33f6e23a85c3b4caf64f1ce4bf9
Parent: 374a00392853db6fac4ec4c93139873a368a78af
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:37 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:54 2007 +0100

firewire: Spell out fw as firewire in sysfs.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index 85b6f2c..db7556c 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -152,7 +152,7 @@ fw_unit_uevent(struct device *dev, char **envp, int 
num_envp,
 }
 
 struct bus_type fw_bus_type = {
-   .name = fw,
+   .name = firewire,
.match = fw_unit_match,
.uevent = fw_unit_uevent,
 };
-
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


firewire: Use atomic_t's for serial numbers.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bbf19db37e8be3fa6d6fe3e26e50da068b44a0e8
Commit: bbf19db37e8be3fa6d6fe3e26e50da068b44a0e8
Parent: 362c2c8ca4a2f33f6e23a85c3b4caf64f1ce4bf9
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:38 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:54 2007 +0100

firewire: Use atomic_t's for serial numbers.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]

Use atomic_inc_return.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-card.c   |4 ++--
 drivers/firewire/fw-device.c |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index f785b10..3f8661a 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -367,9 +367,9 @@ void
 fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
   struct device *device)
 {
-   static int index;
+   static atomic_t index = ATOMIC_INIT(-1);
 
-   card-index = index++;
+   card-index = atomic_inc_return(index);
card-driver = driver;
card-device = device;
card-current_tlabel = 0;
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index db7556c..df2e929 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -434,7 +434,7 @@ static void fw_device_shutdown(struct work_struct *work)
 
 static void fw_device_init(struct work_struct *work)
 {
-   static int serial;
+   static atomic_t serial = ATOMIC_INIT(-1);
struct fw_device *device =
container_of(work, struct fw_device, work.work);
 
@@ -460,7 +460,7 @@ static void fw_device_init(struct work_struct *work)
device-device.release = fw_device_release;
device-device.parent = device-card-device;
snprintf(device-device.bus_id, sizeof device-device.bus_id,
-fw%d, serial++);
+fw%d, atomic_inc_return(serial));
 
if (alloc_chrdev_region(device-device.devt, 0, 1, fw)) {
fw_error(Failed to register char device region.\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


firewire: Credit the old sbp2.c driver for being a good starting point.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27a15e50fb87978d7e1e9f7b561f78692e0b1eb5
Commit: 27a15e50fb87978d7e1e9f7b561f78692e0b1eb5
Parent: bbf19db37e8be3fa6d6fe3e26e50da068b44a0e8
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:39 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:55 2007 +0100

firewire: Credit the old sbp2.c driver for being a good starting point.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index bd64e18..fa59e59 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -1,7 +1,7 @@
 /* -*- c-basic-offset: 8 -*-
  * fw-sbp2.c -- SBP2 driver (SCSI over IEEE1394)
  *
- * Copyright (C) 2005-2006  Kristian Hoegsberg [EMAIL PROTECTED]
+ * Copyright (C) 2005-2007  Kristian Hoegsberg [EMAIL PROTECTED]
  *
  * 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
@@ -18,6 +18,15 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+/* The basic structure of this driver is based the old storage driver,
+ * drivers/ieee1394/sbp2.c, originally written by
+ * James Goodwin [EMAIL PROTECTED]
+ * with later contributions and ongoing maintenance from
+ * Ben Collins [EMAIL PROTECTED],
+ * Stefan Richter [EMAIL PROTECTED]
+ * and many others.
+ */
+
 #include linux/kernel.h
 #include linux/module.h
 #include linux/mod_devicetable.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


firewire: Use dma_mapping_error() for checking for DMA mapping errors.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82eff9db7dc5d8f78898d5051975d14f48be2028
Commit: 82eff9db7dc5d8f78898d5051975d14f48be2028
Parent: 27a15e50fb87978d7e1e9f7b561f78692e0b1eb5
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Tue Feb 6 14:49:40 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:55 2007 +0100

firewire: Use dma_mapping_error() for checking for DMA mapping errors.

Pointed out by Pete Zaitcev.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-iso.c  |   21 +++--
 drivers/firewire/fw-ohci.c |   23 +++
 drivers/firewire/fw-sbp2.c |   28 +---
 3 files changed, 47 insertions(+), 25 deletions(-)

diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index 024fab4..6481e3d 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -33,7 +33,7 @@ setup_iso_buffer(struct fw_iso_context *ctx, size_t size,
 enum dma_data_direction direction)
 {
struct page *page;
-   int i;
+   int i, j;
void *p;
 
ctx-buffer_size = PAGE_ALIGN(size);
@@ -42,24 +42,33 @@ setup_iso_buffer(struct fw_iso_context *ctx, size_t size,
 
ctx-buffer = vmalloc_32_user(ctx-buffer_size);
if (ctx-buffer == NULL)
-   return -ENOMEM;
+   goto fail_buffer_alloc;
 
ctx-page_count = ctx-buffer_size  PAGE_SHIFT;
ctx-pages =
kzalloc(ctx-page_count * sizeof(ctx-pages[0]), GFP_KERNEL);
-   if (ctx-pages == NULL) {
-   vfree(ctx-buffer);
-   return -ENOMEM;
-   }
+   if (ctx-pages == NULL)
+   goto fail_pages_alloc;
 
p = ctx-buffer;
for (i = 0; i  ctx-page_count; i++, p += PAGE_SIZE) {
page = vmalloc_to_page(p);
ctx-pages[i] = dma_map_page(ctx-card-device,
 page, 0, PAGE_SIZE, direction);
+   if (dma_mapping_error(ctx-pages[i]))
+   goto fail_mapping;
}
 
return 0;
+
+ fail_mapping:
+   for (j = 0; j  i; j++)
+   dma_unmap_page(ctx-card-device, ctx-pages[j],
+  PAGE_SIZE, DMA_TO_DEVICE);
+ fail_pages_alloc:
+   vfree(ctx-buffer);
+ fail_buffer_alloc:
+   return -ENOMEM;
 }
 
 static void destroy_iso_buffer(struct fw_iso_context *ctx)
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index e6fa349..4512edb 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -431,7 +431,7 @@ at_context_setup_packet(struct at_context *ctx, struct 
list_head *list)
 packet-payload,
 packet-payload_length,
 DMA_TO_DEVICE);
-   if (packet-payload_bus == 0) {
+   if (dma_mapping_error(packet-payload_bus)) {
complete_transmission(packet, RCODE_SEND_ERROR, list);
return;
}
@@ -590,7 +590,7 @@ at_context_init(struct at_context *ctx, struct fw_ohci 
*ohci, u32 regs)
ctx-descriptor_bus =
dma_map_single(ohci-card.device, ctx-d,
   sizeof ctx-d, DMA_TO_DEVICE);
-   if (ctx-descriptor_bus == 0)
+   if (dma_mapping_error(ctx-descriptor_bus))
return -ENOMEM;
 
ctx-regs = regs;
@@ -1159,16 +1159,14 @@ static struct fw_iso_context 
*ohci_allocate_iso_context(struct fw_card *card,
tasklet_init(ctx-tasklet, tasklet, (unsigned long)ctx);
 
ctx-buffer = kmalloc(ISO_BUFFER_SIZE, GFP_KERNEL);
-   if (ctx-buffer == NULL) {
-   spin_lock_irqsave(ohci-lock, flags);
-   *mask |= 1  index;
-   spin_unlock_irqrestore(ohci-lock, flags);
-   return ERR_PTR(-ENOMEM);
-   }
+   if (ctx-buffer == NULL)
+   goto buffer_alloc_failed;
 
ctx-buffer_bus =
dma_map_single(card-device, ctx-buffer,
   ISO_BUFFER_SIZE, DMA_TO_DEVICE);
+   if (dma_mapping_error(ctx-buffer_bus))
+   goto buffer_map_failed;
 
ctx-head_descriptor  = ctx-buffer;
ctx-prev_descriptor  = ctx-buffer;
@@ -1187,6 +1185,15 @@ static struct fw_iso_context 
*ohci_allocate_iso_context(struct fw_card *card,
ctx-head_descriptor++;
 
return ctx-base;
+
+ buffer_map_failed:
+   kfree(ctx-buffer);
+ buffer_alloc_failed:
+   spin_lock_irqsave(ohci-lock, flags);
+   *mask |= 1  index;
+   spin_unlock_irqrestore(ohci-lock, flags);
+
+   return ERR_PTR(-ENOMEM);
 }
 
 static int ohci_send_iso(struct fw_iso_context *base, s32 cycle)
diff 

firewire: Fix another typo from the bitfield conversion.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cbb59da719e413fcd499d86f49af2327893a9fdb
Commit: cbb59da719e413fcd499d86f49af2327893a9fdb
Parent: 82eff9db7dc5d8f78898d5051975d14f48be2028
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:35 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:56 2007 +0100

firewire: Fix another typo from the bitfield conversion.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 4512edb..4d54ebf 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1352,10 +1352,10 @@ ohci_queue_iso(struct fw_iso_context *base,
else
irq = descriptor_no_irq;
 
-   last-control = cpu_to_le16(descriptor_output_last |
-   descriptor_status |
-   descriptor_branch_always |
-   irq);
+   last-control |= cpu_to_le16(descriptor_output_last |
+descriptor_status |
+descriptor_branch_always |
+irq);
 
dma_sync_single_for_device(ohci-card.device, ctx-buffer_bus,
   ISO_BUFFER_SIZE, DMA_TO_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


firewire: Read the *Clear versions of the iso interrupt register.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c889475fb57bfe30091b42e58eb6b76edd355d45
Commit: c889475fb57bfe30091b42e58eb6b76edd355d45
Parent: cbb59da719e413fcd499d86f49af2327893a9fdb
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:36 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:56 2007 +0100

firewire: Read the *Clear versions of the iso interrupt register.

The *Clear registers returns the masked value when read which is
what we want.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 4d54ebf..72f8036 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -847,7 +847,7 @@ static irqreturn_t irq_handler(int irq, void *data)
if (event  OHCI1394_respTxComplete)
tasklet_schedule(ohci-at_response_ctx.tasklet);
 
-   iso_event = reg_read(ohci, OHCI1394_IsoRecvIntEventSet);
+   iso_event = reg_read(ohci, OHCI1394_IsoRecvIntEventClear);
reg_write(ohci, OHCI1394_IsoRecvIntEventClear, iso_event);
 
while (iso_event) {
@@ -856,7 +856,7 @@ static irqreturn_t irq_handler(int irq, void *data)
iso_event = ~(1  i);
}
 
-   iso_event = reg_read(ohci, OHCI1394_IsoXmitIntEventSet);
+   iso_event = reg_read(ohci, OHCI1394_IsoXmitIntEventClear);
reg_write(ohci, OHCI1394_IsoXmitIntEventClear, iso_event);
 
while (iso_event) {
-
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


firewire: Use correct payload pointer when demarshalling incoming requests.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6e2e8424d310507fa044649435114217826ed78a
Commit: 6e2e8424d310507fa044649435114217826ed78a
Parent: c889475fb57bfe30091b42e58eb6b76edd355d45
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:37 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:57 2007 +0100

firewire: Use correct payload pointer when demarshalling incoming requests.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-transaction.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index 5394569..abc37fa 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -575,7 +575,7 @@ allocate_request(struct fw_packet *p)
request-ack = p-ack;
request-length = length;
if (data)
-   memcpy(request-data, p-payload, length);
+   memcpy(request-data, data, length);
 
memcpy(request-request_header, p-header, sizeof p-header);
 
-
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


firewire: Split the iso buffer out from fw_iso_context and avoid vmalloc.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9aad8125389a7a2990dee72d7892e22330a945eb
Commit: 9aad8125389a7a2990dee72d7892e22330a945eb
Parent: 6e2e8424d310507fa044649435114217826ed78a
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:38 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:57 2007 +0100

firewire: Split the iso buffer out from fw_iso_context and avoid vmalloc.

This patch splits out the iso buffer so we can initialize it at mmap
time with the size provided in the mmap call.  Furthermore, allocate
the backing pages using alloc_page to avoid setting up kernel side
virtual memory mappings for the pages.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   65 ++--
 drivers/firewire/fw-device-cdev.h |2 +-
 drivers/firewire/fw-iso.c |  118 +
 drivers/firewire/fw-ohci.c|   12 +++-
 drivers/firewire/fw-transaction.h |   38 +---
 5 files changed, 151 insertions(+), 84 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 1b9e5f7..6284375 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -71,8 +71,10 @@ struct client {
struct list_head event_list;
struct semaphore event_list_sem;
wait_queue_head_t wait;
-   unsigned long vm_start;
+
struct fw_iso_context *iso_context;
+   struct fw_iso_buffer buffer;
+   unsigned long vm_start;
 };
 
 static inline void __user *
@@ -406,7 +408,6 @@ static int ioctl_create_iso_context(struct client *client, 
void __user *arg)
 
client-iso_context = fw_iso_context_create(client-device-card,
FW_ISO_CONTEXT_TRANSMIT,
-   request.buffer_size,
iso_callback, client);
if (IS_ERR(client-iso_context))
return PTR_ERR(client-iso_context);
@@ -418,8 +419,7 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
 {
struct fw_cdev_queue_iso request;
struct fw_cdev_iso_packet __user *p, *end, *next;
-   void *payload, *payload_end;
-   unsigned long index;
+   unsigned long payload, payload_end;
int count;
struct {
struct fw_iso_packet packet;
@@ -434,20 +434,17 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
/* If the user passes a non-NULL data pointer, has mmap()'ed
 * the iso buffer, and the pointer points inside the buffer,
 * we setup the payload pointers accordingly.  Otherwise we
-* set them both to NULL, which will still let packets with
+* set them both to 0, which will still let packets with
 * payload_length == 0 through.  In other words, if no packets
 * use the indirect payload, the iso buffer need not be mapped
 * and the request.data pointer is ignored.*/
 
-   index = (unsigned long)request.data - client-vm_start;
-   if (request.data != 0  client-vm_start != 0 
-   index = client-iso_context-buffer_size) {
-   payload = client-iso_context-buffer + index;
-   payload_end = client-iso_context-buffer +
-   client-iso_context-buffer_size;
-   } else {
-   payload = NULL;
-   payload_end = NULL;
+   payload = (unsigned long)request.data - client-vm_start;
+   payload_end = payload + (client-buffer.page_count  PAGE_SHIFT);
+   if (request.data == 0 || client-buffer.pages == NULL ||
+   payload = payload_end) {
+   payload = 0;
+   payload_end = 0;
}
 
if (!access_ok(VERIFY_READ, request.packets, request.size))
@@ -473,7 +470,7 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
return -EINVAL;
 
if (fw_iso_context_queue(client-iso_context,
-u.packet, payload))
+u.packet, client-buffer, payload))
break;
 
p = next;
@@ -483,8 +480,7 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
 
request.size-= uptr_to_u64(p) - request.packets;
request.packets  = uptr_to_u64(p);
-   request.data =
-   client-vm_start + (payload - client-iso_context-buffer);
+   request.data = client-vm_start + payload;
 
if (copy_to_user(arg, request, sizeof request))
return -EFAULT;
@@ -549,13 +545,41 @@ fw_device_op_compat_ioctl(struct file *file,
 static int fw_device_op_mmap(struct file *file, 

firewire: Generalize the iso transmit descriptor buffer logic.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=30200739e612932739cc34baf588b39bacc2f427
Commit: 30200739e612932739cc34baf588b39bacc2f427
Parent: 9aad8125389a7a2990dee72d7892e22330a945eb
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:39 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:58 2007 +0100

firewire: Generalize the iso transmit descriptor buffer logic.

The descriptor circular buffer logic used for iso transmission is
useful for async transmit too, so pull the sharable logic out in
a few standalone functions.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |  360 ++-
 1 files changed, 218 insertions(+), 142 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 8499d70..86fe55c 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -75,6 +75,30 @@ struct ar_context {
struct tasklet_struct tasklet;
 };
 
+struct context;
+
+typedef int (*descriptor_callback_t)(struct context *ctx,
+struct descriptor *d,
+struct descriptor *last);
+struct context {
+   struct fw_ohci *ohci;
+   u32 regs;
+ 
+   struct descriptor *buffer;
+   dma_addr_t buffer_bus;
+   size_t buffer_size;
+   struct descriptor *head_descriptor;
+   struct descriptor *tail_descriptor;
+   struct descriptor *tail_descriptor_last;
+   struct descriptor *prev_descriptor;
+
+   descriptor_callback_t callback;
+
+   struct tasklet_struct tasklet;
+};
+ 
+
+
 struct at_context {
struct fw_ohci *ohci;
dma_addr_t descriptor_bus;
@@ -103,15 +127,7 @@ struct at_context {
 
 struct iso_context {
struct fw_iso_context base;
-   struct tasklet_struct tasklet;
-   u32 regs;
-
-   struct descriptor *buffer;
-   dma_addr_t buffer_bus;
-   struct descriptor *head_descriptor;
-   struct descriptor *tail_descriptor;
-   struct descriptor *tail_descriptor_last;
-   struct descriptor *prev_descriptor;
+   struct context context;
 };
 
 #define CONFIG_ROM_SIZE 1024
@@ -394,6 +410,154 @@ ar_context_init(struct ar_context *ctx, struct fw_ohci 
*ohci, u32 regs)
 
return 0;
 }
+ 
+static void context_tasklet(unsigned long data)
+{
+   struct context *ctx = (struct context *) data;
+   struct fw_ohci *ohci = ctx-ohci;
+   struct descriptor *d, *last;
+   u32 address;
+   int z;
+
+   dma_sync_single_for_cpu(ohci-card.device, ctx-buffer_bus,
+   ctx-buffer_size, DMA_TO_DEVICE);
+
+   d= ctx-tail_descriptor;
+   last = ctx-tail_descriptor_last;
+
+   while (last-branch_address != 0) {
+   address = le32_to_cpu(last-branch_address);
+   z = address  0xf;
+   d = ctx-buffer + (address - ctx-buffer_bus) / sizeof *d;
+   last = (z == 2) ? d : d + z - 1;
+
+   if (!ctx-callback(ctx, d, last))
+   break;
+
+   ctx-tail_descriptor  = d;
+   ctx-tail_descriptor_last = last;
+   }
+}
+
+static int
+context_init(struct context *ctx, struct fw_ohci *ohci,
+size_t buffer_size, u32 regs,
+descriptor_callback_t callback)
+{
+   ctx-ohci = ohci;
+   ctx-regs = regs;
+   ctx-buffer_size = buffer_size;
+   ctx-buffer = kmalloc(buffer_size, GFP_KERNEL);
+   if (ctx-buffer == NULL)
+   return -ENOMEM;
+
+   tasklet_init(ctx-tasklet, context_tasklet, (unsigned long)ctx);
+   ctx-callback = callback;
+
+   ctx-buffer_bus =
+   dma_map_single(ohci-card.device, ctx-buffer,
+  buffer_size, DMA_TO_DEVICE);
+   if (dma_mapping_error(ctx-buffer_bus)) {
+   kfree(ctx-buffer);
+   return -ENOMEM;
+   }
+
+   ctx-head_descriptor  = ctx-buffer;
+   ctx-prev_descriptor  = ctx-buffer;
+   ctx-tail_descriptor  = ctx-buffer;
+   ctx-tail_descriptor_last = ctx-buffer;
+
+   /* We put a dummy descriptor in the buffer that has a NULL
+* branch address and looks like it's been sent.  That way we
+* have a descriptor to append DMA programs to.  Also, the
+* ring buffer invariant is that it always has at least one
+* element so that head == tail means buffer full. */
+
+   memset(ctx-head_descriptor, 0, sizeof *ctx-head_descriptor);
+   ctx-head_descriptor-control = cpu_to_le16(descriptor_output_last);
+   ctx-head_descriptor-transfer_status = cpu_to_le16(0x8011);
+   ctx-head_descriptor++;
+
+   return 0;
+}
+
+ static void
+context_release(struct context *ctx)
+{
+   struct fw_card *card = 

firewire: Implement basic isochronous receive functionality.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=295e3feb92e5073ec32a3c626302d4b92c4c8a95
Commit: 295e3feb92e5073ec32a3c626302d4b92c4c8a95
Parent: 30200739e612932739cc34baf588b39bacc2f427
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:40 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:58 2007 +0100

firewire: Implement basic isochronous receive functionality.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   23 -
 drivers/firewire/fw-device-cdev.h |5 +
 drivers/firewire/fw-iso.c |7 +-
 drivers/firewire/fw-ohci.c|  168 
 drivers/firewire/fw-ohci.h|1 +
 drivers/firewire/fw-transaction.h |7 +-
 6 files changed, 181 insertions(+), 30 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 6284375..1101ccd 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -406,8 +406,12 @@ static int ioctl_create_iso_context(struct client *client, 
void __user *arg)
if (copy_from_user(request, arg, sizeof request))
return -EFAULT;
 
+   if (request.type  FW_ISO_CONTEXT_RECEIVE)
+   return -EINVAL;
+
client-iso_context = fw_iso_context_create(client-device-card,
-   FW_ISO_CONTEXT_TRANSMIT,
+   request.type,
+   request.header_size,
iso_callback, client);
if (IS_ERR(client-iso_context))
return PTR_ERR(client-iso_context);
@@ -419,7 +423,7 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
 {
struct fw_cdev_queue_iso request;
struct fw_cdev_iso_packet __user *p, *end, *next;
-   unsigned long payload, payload_end;
+   unsigned long payload, payload_end, header_length;
int count;
struct {
struct fw_iso_packet packet;
@@ -456,12 +460,23 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
while (p  end) {
if (__copy_from_user(u.packet, p, sizeof *p))
return -EFAULT;
+
+   if (client-iso_context-type == FW_ISO_CONTEXT_TRANSMIT) {
+   header_length = u.packet.header_length;
+   } else {
+   /* We require that header_length is a multiple of
+* the fixed header size, ctx-header_size */
+   if (u.packet.header_length % 
client-iso_context-header_size != 0)
+   return -EINVAL;
+   header_length = 0;
+   }
+
next = (struct fw_cdev_iso_packet __user *)
-   p-header[u.packet.header_length / 4];
+   p-header[header_length / 4];
if (next  end)
return -EINVAL;
if (__copy_from_user
-   (u.packet.header, p-header, u.packet.header_length))
+   (u.packet.header, p-header, header_length))
return -EFAULT;
if (u.packet.skip 
u.packet.header_length + u.packet.payload_length  0)
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index 003cc66..4e766ec 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -125,7 +125,12 @@ struct fw_cdev_allocate {
__u32 length;
 };
 
+#define FW_CDEV_ISO_CONTEXT_TRANSMIT   0
+#define FW_CDEV_ISO_CONTEXT_RECEIVE1
+
 struct fw_cdev_create_iso_context {
+   __u32 type;
+   __u32 header_size;
__u32 handle;
 };
 
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index 4e7ba86..4c6dc99 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -105,9 +105,9 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
buffer-pages = NULL;
 }
 
-struct fw_iso_context *fw_iso_context_create(struct fw_card *card, int type,
-fw_iso_callback_t callback,
-void *callback_data)
+struct fw_iso_context *
+fw_iso_context_create(struct fw_card *card, int type, size_t header_size,
+ fw_iso_callback_t callback, void *callback_data)
 {
struct fw_iso_context *ctx;
 
@@ -117,6 +117,7 @@ struct fw_iso_context *fw_iso_context_create(struct fw_card 
*card, int type,
 
ctx-card = card;
ctx-type = type;
+   ctx-header_size = header_size;
ctx-callback = callback;
ctx-callback_data = callback_data;
 
diff 

firewire: Rename 'send_iso' to 'start_iso'.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69cdb7268ca2e644665dae8ea26e35ce4e96679c
Commit: 69cdb7268ca2e644665dae8ea26e35ce4e96679c
Parent: 295e3feb92e5073ec32a3c626302d4b92c4c8a95
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:41 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:59 2007 +0100

firewire: Rename 'send_iso' to 'start_iso'.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   12 ++--
 drivers/firewire/fw-device-cdev.h |4 ++--
 drivers/firewire/fw-iso.c |8 
 drivers/firewire/fw-ohci.c|4 ++--
 drivers/firewire/fw-transaction.h |8 ++--
 5 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 1101ccd..b738c99 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -503,15 +503,15 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
return count;
 }
 
-static int ioctl_send_iso(struct client *client, void __user *arg)
+static int ioctl_start_iso(struct client *client, void __user *arg)
 {
-   struct fw_cdev_send_iso request;
+   struct fw_cdev_start_iso request;
 
if (copy_from_user(request, arg, sizeof request))
return -EFAULT;
 
-   return fw_iso_context_send(client-iso_context, request.channel,
-  request.speed, request.cycle);
+   return fw_iso_context_start(client-iso_context, request.channel,
+   request.speed, request.cycle);
 }
 
 static int
@@ -530,8 +530,8 @@ dispatch_ioctl(struct client *client, unsigned int cmd, 
void __user *arg)
return ioctl_create_iso_context(client, arg);
case FW_CDEV_IOC_QUEUE_ISO:
return ioctl_queue_iso(client, arg);
-   case FW_CDEV_IOC_SEND_ISO:
-   return ioctl_send_iso(client, arg);
+   case FW_CDEV_IOC_START_ISO:
+   return ioctl_start_iso(client, arg);
default:
return -EINVAL;
}
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index 4e766ec..ac91ce5 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -97,7 +97,7 @@ struct fw_cdev_event_iso_interrupt {
 #define FW_CDEV_IOC_SEND_RESPONSE  _IO('#', 0x03)
 #define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IO('#', 0x04)
 #define FW_CDEV_IOC_QUEUE_ISO  _IO('#', 0x05)
-#define FW_CDEV_IOC_SEND_ISO   _IO('#', 0x06)
+#define FW_CDEV_IOC_START_ISO  _IO('#', 0x06)
 
 struct fw_cdev_get_config_rom {
__u32 length;
@@ -150,7 +150,7 @@ struct fw_cdev_queue_iso {
__u64 data;
 };
 
-struct fw_cdev_send_iso {
+struct fw_cdev_start_iso {
__u32 channel;
__u32 speed;
__s32 cycle;
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index 4c6dc99..d84792f 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -134,15 +134,15 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx)
 EXPORT_SYMBOL(fw_iso_context_destroy);
 
 int
-fw_iso_context_send(struct fw_iso_context *ctx,
-   int channel, int speed, int cycle)
+fw_iso_context_start(struct fw_iso_context *ctx,
+int channel, int speed, int cycle)
 {
ctx-channel = channel;
ctx-speed = speed;
 
-   return ctx-card-driver-send_iso(ctx, cycle);
+   return ctx-card-driver-start_iso(ctx, cycle);
 }
-EXPORT_SYMBOL(fw_iso_context_send);
+EXPORT_SYMBOL(fw_iso_context_start);
 
 int
 fw_iso_context_queue(struct fw_iso_context *ctx,
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 90db5a4..faa3844 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1350,7 +1350,7 @@ ohci_allocate_iso_context(struct fw_card *card, int type)
return ctx-base;
 }
 
-static int ohci_send_iso(struct fw_iso_context *base, s32 cycle)
+static int ohci_start_iso(struct fw_iso_context *base, s32 cycle)
 {
struct iso_context *ctx = container_of(base, struct iso_context, base);
struct fw_ohci *ohci = ctx-context.ohci;
@@ -1594,7 +1594,7 @@ static const struct fw_card_driver ohci_driver = {
.allocate_iso_context   = ohci_allocate_iso_context,
.free_iso_context   = ohci_free_iso_context,
.queue_iso  = ohci_queue_iso,
-   .send_iso   = ohci_send_iso,
+   .start_iso  = ohci_start_iso,
 };
 
 static int software_reset(struct fw_ohci *ohci)
diff --git a/drivers/firewire/fw-transaction.h 
b/drivers/firewire/fw-transaction.h
index 9e92eda..9ccbed8 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ 

firewire: Implement functionality to stop isochronous DMA contexts.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b82956685aab4a9d333714300eb8a86fed6c9ab3
Commit: b82956685aab4a9d333714300eb8a86fed6c9ab3
Parent: 69cdb7268ca2e644665dae8ea26e35ce4e96679c
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:42 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:02:59 2007 +0100

firewire: Implement functionality to stop isochronous DMA contexts.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |7 ++
 drivers/firewire/fw-device-cdev.h |1 +
 drivers/firewire/fw-iso.c |7 ++
 drivers/firewire/fw-ohci.c|   44 +++-
 drivers/firewire/fw-transaction.h |5 
 5 files changed, 53 insertions(+), 11 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index b738c99..1ce33d4 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -514,6 +514,11 @@ static int ioctl_start_iso(struct client *client, void 
__user *arg)
request.speed, request.cycle);
 }
 
+static int ioctl_stop_iso(struct client *client, void __user *arg)
+{
+   return fw_iso_context_stop(client-iso_context);
+}
+
 static int
 dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
 {
@@ -532,6 +537,8 @@ dispatch_ioctl(struct client *client, unsigned int cmd, 
void __user *arg)
return ioctl_queue_iso(client, arg);
case FW_CDEV_IOC_START_ISO:
return ioctl_start_iso(client, arg);
+   case FW_CDEV_IOC_STOP_ISO:
+   return ioctl_stop_iso(client, arg);
default:
return -EINVAL;
}
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index ac91ce5..257dc87 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -98,6 +98,7 @@ struct fw_cdev_event_iso_interrupt {
 #define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IO('#', 0x04)
 #define FW_CDEV_IOC_QUEUE_ISO  _IO('#', 0x05)
 #define FW_CDEV_IOC_START_ISO  _IO('#', 0x06)
+#define FW_CDEV_IOC_STOP_ISO   _IO('#', 0x07)
 
 struct fw_cdev_get_config_rom {
__u32 length;
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index d84792f..1605e11 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -155,3 +155,10 @@ fw_iso_context_queue(struct fw_iso_context *ctx,
return card-driver-queue_iso(ctx, packet, buffer, payload);
 }
 EXPORT_SYMBOL(fw_iso_context_queue);
+
+int
+fw_iso_context_stop(struct fw_iso_context *ctx)
+{
+   return ctx-card-driver-stop_iso(ctx);
+}
+EXPORT_SYMBOL(fw_iso_context_stop);
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index faa3844..c0ab868 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -570,13 +570,19 @@ static void context_append(struct context *ctx,
 static void context_stop(struct context *ctx)
 {
u32 reg;
+   int i;
 
reg_write(ctx-ohci, control_clear(ctx-regs), CONTEXT_RUN);
+   flush_writes(ctx-ohci);
 
-   reg = reg_read(ctx-ohci, control_set(ctx-regs));
-   if (reg  CONTEXT_ACTIVE)
-   fw_notify(Tried to stop context, but it is still active 
- (0x%08x).\n, reg);
+   for (i = 0; i  10; i++) {
+   reg = reg_read(ctx-ohci, control_set(ctx-regs));
+   if ((reg  CONTEXT_ACTIVE) == 0)
+   break;
+
+   fw_notify(context_stop: still active (0x%08x)\n, reg);
+   msleep(1);
+   }
 }
 
 static void
@@ -1379,6 +1385,25 @@ static int ohci_start_iso(struct fw_iso_context *base, 
s32 cycle)
return 0;
 }
 
+static int ohci_stop_iso(struct fw_iso_context *base)
+{
+   struct fw_ohci *ohci = fw_ohci(base-card);
+   struct iso_context *ctx = container_of(base, struct iso_context, base);
+   int index;
+
+   if (ctx-base.type == FW_ISO_CONTEXT_TRANSMIT) {
+   index = ctx - ohci-it_context_list;
+   reg_write(ohci, OHCI1394_IsoXmitIntMaskClear, 1  index);
+   } else {
+   index = ctx - ohci-ir_context_list;
+   reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, 1  index);
+   }
+   flush_writes(ohci);
+   context_stop(ctx-context);
+
+   return 0;
+}
+
 static void ohci_free_iso_context(struct fw_iso_context *base)
 {
struct fw_ohci *ohci = fw_ohci(base-card);
@@ -1386,22 +1411,18 @@ static void ohci_free_iso_context(struct fw_iso_context 
*base)
unsigned long flags;
int index;
 
+   ohci_stop_iso(base);
+   context_release(ctx-context);
+
spin_lock_irqsave(ohci-lock, flags);
 
if (ctx-base.type == 

firewire: Log OHCI chipset version in PCI probe.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=500be7251a4af1a87aa48285a23a741f74a97a89
Commit: 500be7251a4af1a87aa48285a23a741f74a97a89
Parent: b82956685aab4a9d333714300eb8a86fed6c9ab3
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:43 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:00 2007 +0100

firewire: Log OHCI chipset version in PCI probe.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index c0ab868..d601ec7 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1672,7 +1672,7 @@ static int __devinit
 pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
 {
struct fw_ohci *ohci;
-   u32 bus_options, max_receive, link_speed;
+   u32 bus_options, max_receive, link_speed, version;
u64 guid;
int error_code;
size_t size;
@@ -1799,7 +1799,9 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id 
*ent)
if (error_code  0)
return cleanup(ohci, CLEANUP_SELF_ID, error_code);
 
-   fw_notify(Added fw-ohci device %s.\n, dev-dev.bus_id);
+   version = reg_read(ohci, OHCI1394_Version);
+   fw_notify(Added fw-ohci device %s, OHCI version %x.%x\n,
+ dev-dev.bus_id, (version  16)  0xff, version  0xff);
 
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


firewire: Acummulate received iso headers and send them back to user space.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b32d5f3074e9b1afaa39a360a59fd77a2214783
Commit: 9b32d5f3074e9b1afaa39a360a59fd77a2214783
Parent: 500be7251a4af1a87aa48285a23a741f74a97a89
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:44 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:00 2007 +0100

firewire: Acummulate received iso headers and send them back to user space.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   25 +--
 drivers/firewire/fw-device-cdev.h |2 +
 drivers/firewire/fw-ohci.c|   49 +---
 drivers/firewire/fw-transaction.h |5 +++-
 4 files changed, 57 insertions(+), 24 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 1ce33d4..6545fb8 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -383,20 +383,24 @@ static int ioctl_send_response(struct client *client, 
void __user *arg)
 }
 
 static void
-iso_callback(struct fw_iso_context *context, int status, u32 cycle, void *data)
+iso_callback(struct fw_iso_context *context, u32 cycle,
+size_t header_length, void *header, void *data)
 {
struct client *client = data;
struct iso_interrupt *interrupt;
 
-   interrupt = kzalloc(sizeof *interrupt, GFP_ATOMIC);
+   interrupt = kzalloc(sizeof *interrupt + header_length, GFP_ATOMIC);
if (interrupt == NULL)
return;
 
interrupt-interrupt.type  = FW_CDEV_EVENT_ISO_INTERRUPT;
interrupt-interrupt.closure   = 0;
interrupt-interrupt.cycle = cycle;
+   interrupt-interrupt.header_length = header_length;
+   memcpy(interrupt-interrupt.header, header, header_length);
queue_event(client, interrupt-event,
-   interrupt-interrupt, sizeof interrupt-interrupt, NULL, 
0);
+   interrupt-interrupt,
+   sizeof interrupt-interrupt + header_length, NULL, 0);
 }
 
 static int ioctl_create_iso_context(struct client *client, void __user *arg)
@@ -423,6 +427,7 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
 {
struct fw_cdev_queue_iso request;
struct fw_cdev_iso_packet __user *p, *end, *next;
+   struct fw_iso_context *ctx = client-iso_context;
unsigned long payload, payload_end, header_length;
int count;
struct {
@@ -430,7 +435,7 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
u8 header[256];
} u;
 
-   if (client-iso_context == NULL)
+   if (ctx == NULL)
return -EINVAL;
if (copy_from_user(request, arg, sizeof request))
return -EFAULT;
@@ -461,13 +466,17 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
if (__copy_from_user(u.packet, p, sizeof *p))
return -EFAULT;
 
-   if (client-iso_context-type == FW_ISO_CONTEXT_TRANSMIT) {
+   if (ctx-type == FW_ISO_CONTEXT_TRANSMIT) {
header_length = u.packet.header_length;
} else {
/* We require that header_length is a multiple of
 * the fixed header size, ctx-header_size */
-   if (u.packet.header_length % 
client-iso_context-header_size != 0)
+   if (ctx-header_size == 0) {
+   if (u.packet.header_length  0)
+   return -EINVAL;
+   } else if (u.packet.header_length % ctx-header_size != 
0) {
return -EINVAL;
+   }
header_length = 0;
}
 
@@ -484,8 +493,8 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
if (payload + u.packet.payload_length  payload_end)
return -EINVAL;
 
-   if (fw_iso_context_queue(client-iso_context,
-u.packet, client-buffer, payload))
+   if (fw_iso_context_queue(ctx, u.packet,
+client-buffer, payload))
break;
 
p = next;
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index 257dc87..e32b39d 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -89,6 +89,8 @@ struct fw_cdev_event_iso_interrupt {
__u32 type;
__u32 cycle;
__u64 closure;
+   __u32 header_length;/* Length in bytes of following headers. */
+   __u32 header[0];
 };
 
 #define FW_CDEV_IOC_GET_CONFIG_ROM _IOR('#', 0x00, 

firewire: Set correct buffer lengths for dualbuffer DMA descriptor.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1e1d196bf5d9258f9583a05c41c1c351ffcdeac2
Commit: 1e1d196bf5d9258f9583a05c41c1c351ffcdeac2
Parent: 9b32d5f3074e9b1afaa39a360a59fd77a2214783
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:45 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:01 2007 +0100

firewire: Set correct buffer lengths for dualbuffer DMA descriptor.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index b5a1545..76ac70a 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1583,10 +1583,7 @@ ohci_queue_iso_receive(struct fw_iso_context *base,
  descriptor_branch_always);
db-first_size = cpu_to_le16(ctx-base.header_size);
db-first_req_count = cpu_to_le16(p-header_length);
-   db-second_req_count = cpu_to_le16(p-payload_length);
-   db-first_res_count = cpu_to_le16(db-first_req_count);
-   db-second_res_count = cpu_to_le16(db-second_req_count);
-
+   db-first_res_count = db-first_req_count;
db-first_buffer = cpu_to_le32(d_bus + sizeof *db);

if (offset + rest  PAGE_SIZE)
@@ -1594,6 +1591,8 @@ ohci_queue_iso_receive(struct fw_iso_context *base,
else
length = PAGE_SIZE - offset;
 
+   db-second_req_count = cpu_to_le16(length);
+   db-second_res_count = db-second_req_count;
page_bus = page_private(buffer-pages[page]);
db-second_buffer = cpu_to_le32(page_bus + offset);
 
-
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


firewire: Use a buffer fill descriptor for receive when header size is 0.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d2746dc192e8b9446ea1cb843e94c30f177b7e54
Commit: d2746dc192e8b9446ea1cb843e94c30f177b7e54
Parent: 1e1d196bf5d9258f9583a05c41c1c351ffcdeac2
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:46 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:01 2007 +0100

firewire: Use a buffer fill descriptor for receive when header size is 0.

When the DMA is setup to not strip any headers, we need to use
the buffer fill descriptor instead of the dual buffer, since the
dual buffer descriptor must strip a non-zero number of header quadlets.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-iso.c |2 +-
 drivers/firewire/fw-ohci.c|  107 +++-
 drivers/firewire/fw-transaction.h |3 +-
 3 files changed, 95 insertions(+), 17 deletions(-)

diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index 1605e11..736b1bf 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -111,7 +111,7 @@ fw_iso_context_create(struct fw_card *card, int type, 
size_t header_size,
 {
struct fw_iso_context *ctx;
 
-   ctx = card-driver-allocate_iso_context(card, type);
+   ctx = card-driver-allocate_iso_context(card, type, header_size);
if (IS_ERR(ctx))
return ctx;
 
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 76ac70a..9b9ea0f 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1267,16 +1267,34 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, 
int generation)
spin_unlock_irqrestore(ohci-lock, flags);
return retval;
 }
+ 
+static int handle_ir_bufferfill_packet(struct context *context,
+  struct descriptor *d,
+  struct descriptor *last)
+{
+   struct iso_context *ctx =
+   container_of(context, struct iso_context, context);
 
-static int handle_ir_packet(struct context *context,
-   struct descriptor *d,
-   struct descriptor *last)
+   if (d-res_count  0)
+   return 0;
+
+   if (le16_to_cpu(last-control)  descriptor_irq_always)
+   ctx-base.callback(ctx-base,
+  le16_to_cpu(last-res_count),
+  0, NULL, ctx-base.callback_data);
+
+   return 1;
+}
+
+static int handle_ir_dualbuffer_packet(struct context *context,
+  struct descriptor *d,
+  struct descriptor *last)
 {
struct iso_context *ctx =
container_of(context, struct iso_context, context);
struct db_descriptor *db = (struct db_descriptor *) d;
size_t header_length;
- 
+
if (db-first_res_count  0  db-second_res_count  0)
/* This descriptor isn't done yet, stop iteration. */
return 0;
@@ -1317,7 +1335,7 @@ static int handle_it_packet(struct context *context,
 }
 
 static struct fw_iso_context *
-ohci_allocate_iso_context(struct fw_card *card, int type)
+ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size)
 {
struct fw_ohci *ohci = fw_ohci(card);
struct iso_context *ctx, *list;
@@ -1333,7 +1351,10 @@ ohci_allocate_iso_context(struct fw_card *card, int type)
} else {
mask = ohci-ir_context_mask;
list = ohci-ir_context_list;
-   callback = handle_ir_packet;
+   if (header_size  0)
+   callback = handle_ir_dualbuffer_packet;
+   else
+   callback = handle_ir_bufferfill_packet;
}
 
spin_lock_irqsave(ohci-lock, flags);
@@ -1378,7 +1399,7 @@ static int ohci_start_iso(struct fw_iso_context *base, 
s32 cycle)
 {
struct iso_context *ctx = container_of(base, struct iso_context, base);
struct fw_ohci *ohci = ctx-context.ohci;
-   u32 cycle_match = 0;
+   u32 cycle_match = 0, mode;
int index;
 
if (ctx-base.type == FW_ISO_CONTEXT_TRANSMIT) {
@@ -1393,11 +1414,15 @@ static int ohci_start_iso(struct fw_iso_context *base, 
s32 cycle)
} else {
index = ctx - ohci-ir_context_list;
 
+   if (ctx-base.header_size  0)
+   mode = IR_CONTEXT_DUAL_BUFFER_MODE;
+   else
+   mode = IR_CONTEXT_BUFFER_FILL;
reg_write(ohci, OHCI1394_IsoRecvIntEventClear, 1  index);
reg_write(ohci, OHCI1394_IsoRecvIntMaskSet, 1  index);
reg_write(ohci, context_match(ctx-context.regs),
  0xf000 | ctx-base.channel);
-   

firewire: Don't touch DMA descriptors after appending.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cb2d2cdbc66d9143159ee0381ad83975de56a57d
Commit: cb2d2cdbc66d9143159ee0381ad83975de56a57d
Parent: d2746dc192e8b9446ea1cb843e94c30f177b7e54
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:47 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:02 2007 +0100

firewire: Don't touch DMA descriptors after appending.

When a DMA descriptor is appended to the context we sync it for
DMA and the device might potentially read it immediately.  So,
we can't set the IRQ bits in the descriptor after appending.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 9b9ea0f..18769d9 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1621,15 +1621,15 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context 
*base,
page_bus = page_private(buffer-pages[page]);
db-second_buffer = cpu_to_le32(page_bus + offset);
 
+   if (p-interrupt  length == rest)
+   db-control |= cpu_to_le16(descriptor_irq_always);
+
context_append(ctx-context, d, z, header_z);
offset = (offset + length)  ~PAGE_MASK;
rest -= length;
page++;
}
 
-   if (p-interrupt)
-   db-control |= cpu_to_le16(descriptor_irq_always);
-
return 0;
 }
  
@@ -1668,6 +1668,9 @@ ohci_queue_iso_receive_bufferfill(struct fw_iso_context 
*base,
d-req_count = cpu_to_le16(length);
d-res_count = cpu_to_le16(length);
 
+   if (packet-interrupt  length == rest)
+   d-control |= cpu_to_le16(descriptor_irq_always);
+
context_append(ctx-context, d, 1, 0);
 
offset = (offset + length)  ~PAGE_MASK;
@@ -1675,9 +1678,6 @@ ohci_queue_iso_receive_bufferfill(struct fw_iso_context 
*base,
page++;
}
 
-   if (packet-interrupt)
-   d-control |= cpu_to_le16(descriptor_irq_always);
-
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


firewire: Get zeroed out pages for mapping to user space.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=68be3fa15a420d96b1aaed4c519607bf2bfcb2e1
Commit: 68be3fa15a420d96b1aaed4c519607bf2bfcb2e1
Parent: cb2d2cdbc66d9143159ee0381ad83975de56a57d
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:48 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:02 2007 +0100

firewire: Get zeroed out pages for mapping to user space.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-iso.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index 736b1bf..deff692 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -44,7 +44,7 @@ fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct 
fw_card *card,
goto out;
 
for (i = 0; i  buffer-page_count; i++) {
-   buffer-pages[i] = alloc_page(GFP_KERNEL | GFP_DMA32);
+   buffer-pages[i] = alloc_page(GFP_KERNEL | GFP_DMA32 | 
__GFP_ZERO);
if (buffer-pages[i] == NULL)
goto out_pages;

-
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


firewire: Store OHCI version and make sure we have at least 1.1 before doing dualbuffer.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e364cf4e0aa245ba2ce5942289e8a43935505e53
Commit: e364cf4e0aa245ba2ce5942289e8a43935505e53
Parent: 68be3fa15a420d96b1aaed4c519607bf2bfcb2e1
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:49 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:03 2007 +0100

firewire: Store OHCI version and make sure we have at least 1.1 before 
doing dualbuffer.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |   19 +++
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 18769d9..12f109d 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -152,6 +152,7 @@ struct iso_context {
 struct fw_ohci {
struct fw_card card;
 
+   u32 version;
__iomem char *registers;
dma_addr_t self_id_bus;
__le32 *self_id_cpu;
@@ -210,6 +211,7 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card)
 #define OHCI1394_PCI_HCI_Control   0x40
 #define SELF_ID_BUF_SIZE   0x800
 #define OHCI_TCODE_PHY_PACKET  0x0e
+#define OHCI_VERSION_1_1   0x010010
 
 static char ohci_driver_name[] = KBUILD_MODNAME;
 
@@ -1357,6 +1359,10 @@ ohci_allocate_iso_context(struct fw_card *card, int 
type, size_t header_size)
callback = handle_ir_bufferfill_packet;
}
 
+   if (callback == handle_ir_dualbuffer_packet 
+   ohci-version  OHCI_VERSION_1_1)
+   return ERR_PTR(-EINVAL);
+
spin_lock_irqsave(ohci-lock, flags);
index = ffs(*mask) - 1;
if (index = 0)
@@ -1687,14 +1693,19 @@ ohci_queue_iso(struct fw_iso_context *base,
   struct fw_iso_buffer *buffer,
   unsigned long payload)
 {
+   struct iso_context *ctx = container_of(base, struct iso_context, base);
+
if (base-type == FW_ISO_CONTEXT_TRANSMIT)
return ohci_queue_iso_transmit(base, packet, buffer, payload);
else if (base-header_size == 0)
return ohci_queue_iso_receive_bufferfill(base, packet,
 buffer, payload);
-   else
+   else if (ctx-context.ohci-version = OHCI_VERSION_1_1)
return ohci_queue_iso_receive_dualbuffer(base, packet,
 buffer, payload);
+   else
+   /* FIXME: Implement fallback for OHCI 1.0 controllers. */
+   return -EINVAL;
 }
 
 static const struct fw_card_driver ohci_driver = {
@@ -1767,7 +1778,7 @@ static int __devinit
 pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
 {
struct fw_ohci *ohci;
-   u32 bus_options, max_receive, link_speed, version;
+   u32 bus_options, max_receive, link_speed;
u64 guid;
int error_code;
size_t size;
@@ -1894,9 +1905,9 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id 
*ent)
if (error_code  0)
return cleanup(ohci, CLEANUP_SELF_ID, error_code);
 
-   version = reg_read(ohci, OHCI1394_Version);
+   ohci-version = reg_read(ohci, OHCI1394_Version)  0x00ff00ff;
fw_notify(Added fw-ohci device %s, OHCI version %x.%x\n,
- dev-dev.bus_id, (version  16)  0xff, version  0xff);
+ dev-dev.bus_id, ohci-version  16, ohci-version  0xff);
 
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


firewire: Configure channel and speed at context creation time.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=21efb3cfc6ed49991638000f58bb23b838c76e25
Commit: 21efb3cfc6ed49991638000f58bb23b838c76e25
Parent: e364cf4e0aa245ba2ce5942289e8a43935505e53
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:50 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:03 2007 +0100

firewire: Configure channel and speed at context creation time.

We need the channel number as we queue up iso packets for transmission
so we can fill out the header correctly.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   11 +--
 drivers/firewire/fw-device-cdev.h |5 ++---
 drivers/firewire/fw-iso.c |   11 +--
 drivers/firewire/fw-ohci.c|4 ++--
 drivers/firewire/fw-transaction.h |6 +++---
 5 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 6545fb8..5c87618 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -413,8 +413,16 @@ static int ioctl_create_iso_context(struct client *client, 
void __user *arg)
if (request.type  FW_ISO_CONTEXT_RECEIVE)
return -EINVAL;
 
+   if (request.channel  63)
+   return -EINVAL;
+
+   if (request.speed  SCODE_3200)
+   return -EINVAL;
+
client-iso_context = fw_iso_context_create(client-device-card,
request.type,
+   request.channel,
+   request.speed,
request.header_size,
iso_callback, client);
if (IS_ERR(client-iso_context))
@@ -519,8 +527,7 @@ static int ioctl_start_iso(struct client *client, void 
__user *arg)
if (copy_from_user(request, arg, sizeof request))
return -EFAULT;
 
-   return fw_iso_context_start(client-iso_context, request.channel,
-   request.speed, request.cycle);
+   return fw_iso_context_start(client-iso_context, request.cycle);
 }
 
 static int ioctl_stop_iso(struct client *client, void __user *arg)
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index e32b39d..99e6aa6 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -134,7 +134,8 @@ struct fw_cdev_allocate {
 struct fw_cdev_create_iso_context {
__u32 type;
__u32 header_size;
-   __u32 handle;
+   __u32 channel;
+   __u32 speed;
 };
 
 struct fw_cdev_iso_packet {
@@ -154,8 +155,6 @@ struct fw_cdev_queue_iso {
 };
 
 struct fw_cdev_start_iso {
-   __u32 channel;
-   __u32 speed;
__s32 cycle;
 };
 
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index deff692..dc5a7e3 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -106,7 +106,8 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
 }
 
 struct fw_iso_context *
-fw_iso_context_create(struct fw_card *card, int type, size_t header_size,
+fw_iso_context_create(struct fw_card *card, int type,
+ int channel, int speed, size_t header_size,
  fw_iso_callback_t callback, void *callback_data)
 {
struct fw_iso_context *ctx;
@@ -117,6 +118,8 @@ fw_iso_context_create(struct fw_card *card, int type, 
size_t header_size,
 
ctx-card = card;
ctx-type = type;
+   ctx-channel = channel;
+   ctx-speed = speed;
ctx-header_size = header_size;
ctx-callback = callback;
ctx-callback_data = callback_data;
@@ -134,12 +137,8 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx)
 EXPORT_SYMBOL(fw_iso_context_destroy);
 
 int
-fw_iso_context_start(struct fw_iso_context *ctx,
-int channel, int speed, int cycle)
+fw_iso_context_start(struct fw_iso_context *ctx, int cycle)
 {
-   ctx-channel = channel;
-   ctx-speed = speed;
-
return ctx-card-driver-start_iso(ctx, cycle);
 }
 EXPORT_SYMBOL(fw_iso_context_start);
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 12f109d..0088acd 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1413,7 +1413,7 @@ static int ohci_start_iso(struct fw_iso_context *base, 
s32 cycle)
if (cycle  0)
cycle_match = IT_CONTEXT_CYCLE_MATCH_ENABLE |
(cycle  0x7fff)  16;
-   
+
reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 1  index);
reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1  index);

firewire: Implement sync and tag matching for isochronous receive.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=98b6cbe83b6e8db54638746c9040c7962d96b322
Commit: 98b6cbe83b6e8db54638746c9040c7962d96b322
Parent: 21efb3cfc6ed49991638000f58bb23b838c76e25
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Fri Feb 16 17:34:51 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:04 2007 +0100

firewire: Implement sync and tag matching for isochronous receive.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   10 +-
 drivers/firewire/fw-device-cdev.h |8 
 drivers/firewire/fw-iso.c |8 ++--
 drivers/firewire/fw-ohci.c|   32 ++--
 drivers/firewire/fw-transaction.h |   13 +++--
 5 files changed, 64 insertions(+), 7 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 5c87618..33fe576 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -416,6 +416,12 @@ static int ioctl_create_iso_context(struct client *client, 
void __user *arg)
if (request.channel  63)
return -EINVAL;
 
+   if (request.sync  15)
+   return -EINVAL;
+
+   if (request.tags == 0 || request.tags  15)
+   return -EINVAL;
+
if (request.speed  SCODE_3200)
return -EINVAL;
 
@@ -424,6 +430,8 @@ static int ioctl_create_iso_context(struct client *client, 
void __user *arg)
request.channel,
request.speed,
request.header_size,
+   request.sync,
+   request.tags,
iso_callback, client);
if (IS_ERR(client-iso_context))
return PTR_ERR(client-iso_context);
@@ -495,7 +503,7 @@ static int ioctl_queue_iso(struct client *client, void 
__user *arg)
if (__copy_from_user
(u.packet.header, p-header, header_length))
return -EFAULT;
-   if (u.packet.skip 
+   if (u.packet.skip  ctx-type == FW_ISO_CONTEXT_TRANSMIT 
u.packet.header_length + u.packet.payload_length  0)
return -EINVAL;
if (payload + u.packet.payload_length  payload_end)
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index 99e6aa6..739f54f 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -131,11 +131,19 @@ struct fw_cdev_allocate {
 #define FW_CDEV_ISO_CONTEXT_TRANSMIT   0
 #define FW_CDEV_ISO_CONTEXT_RECEIVE1
 
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0  1
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1  2
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2  4
+#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3  8
+#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
+
 struct fw_cdev_create_iso_context {
__u32 type;
__u32 header_size;
__u32 channel;
__u32 speed;
+   __u32 sync;
+   __u32 tags;
 };
 
 struct fw_cdev_iso_packet {
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index dc5a7e3..728cbb3 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -107,12 +107,14 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
 
 struct fw_iso_context *
 fw_iso_context_create(struct fw_card *card, int type,
- int channel, int speed, size_t header_size,
+ int channel, int speed,
+ int sync, int tags, size_t header_size,
  fw_iso_callback_t callback, void *callback_data)
 {
struct fw_iso_context *ctx;
 
-   ctx = card-driver-allocate_iso_context(card, type, header_size);
+   ctx = card-driver-allocate_iso_context(card, type,
+sync, tags, header_size);
if (IS_ERR(ctx))
return ctx;
 
@@ -120,6 +122,8 @@ fw_iso_context_create(struct fw_card *card, int type,
ctx-type = type;
ctx-channel = channel;
ctx-speed = speed;
+   ctx-sync = sync;
+   ctx-tags = tags;
ctx-header_size = header_size;
ctx-callback = callback;
ctx-callback_data = callback_data;
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 0088acd..ea43a5e 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1337,7 +1337,8 @@ static int handle_it_packet(struct context *context,
 }
 
 static struct fw_iso_context *
-ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size)

firewire: adjust whitespace

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=373b2edd864b8753419521b715bd1ddafd2f2af3
Commit: 373b2edd864b8753419521b715bd1ddafd2f2af3
Parent: 98b6cbe83b6e8db54638746c9040c7962d96b322
Author: Stefan Richter [EMAIL PROTECTED]
AuthorDate: Sun Mar 4 14:45:18 2007 +0100
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:04 2007 +0100

firewire: adjust whitespace

Remove space before tab and trailing whitespace.
Unify indentation of goto target labels.

Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device.c |6 ++--
 drivers/firewire/fw-iso.c|2 +-
 drivers/firewire/fw-ohci.c   |   46 -
 3 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index df2e929..e8f2dc3 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -145,7 +145,7 @@ fw_unit_uevent(struct device *dev, char **envp, int 
num_envp,
   MODALIAS=%s, modalias))
return -ENOMEM;
 
-  out:
+ out:
envp[i] = NULL;
 
return 0;
@@ -511,9 +511,9 @@ static void fw_device_init(struct work_struct *work)
 
return;
 
-  error_with_device:
+ error_with_device:
device_del(device-device);
-  error:
+ error:
cdev_del(device-cdev);
unregister_chrdev_region(device-device.devt, 1);
put_device(device-device);
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index 728cbb3..3eaf880 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -47,7 +47,7 @@ fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct 
fw_card *card,
buffer-pages[i] = alloc_page(GFP_KERNEL | GFP_DMA32 | 
__GFP_ZERO);
if (buffer-pages[i] == NULL)
goto out_pages;
-   
+
address = dma_map_page(card-device, buffer-pages[i],
   0, PAGE_SIZE, direction);
if (dma_mapping_error(address)) {
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index ea43a5e..57eba70 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -96,9 +96,9 @@ typedef int (*descriptor_callback_t)(struct context *ctx,
 struct descriptor *d,
 struct descriptor *last);
 struct context {
-   struct fw_ohci *ohci;
+   struct fw_ohci *ohci;
u32 regs;
- 
+
struct descriptor *buffer;
dma_addr_t buffer_bus;
size_t buffer_size;
@@ -109,10 +109,8 @@ struct context {
 
descriptor_callback_t callback;
 
-   struct tasklet_struct tasklet;
+   struct tasklet_struct tasklet;
 };
- 
-
 
 struct at_context {
struct fw_ohci *ohci;
@@ -434,7 +432,7 @@ ar_context_init(struct ar_context *ctx, struct fw_ohci 
*ohci, u32 regs)
 
return 0;
 }
- 
+
 static void context_tasklet(unsigned long data)
 {
struct context *ctx = (struct context *) data;
@@ -1269,7 +1267,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, 
int generation)
spin_unlock_irqrestore(ohci-lock, flags);
return retval;
 }
- 
+
 static int handle_ir_bufferfill_packet(struct context *context,
   struct descriptor *d,
   struct descriptor *last)
@@ -1324,7 +1322,7 @@ static int handle_it_packet(struct context *context,
 {
struct iso_context *ctx =
container_of(context, struct iso_context, context);
- 
+
if (last-transfer_status == 0)
/* This descriptor isn't done yet, stop iteration. */
return 0;
@@ -1352,8 +1350,8 @@ ohci_allocate_iso_context(struct fw_card *card, int type,
list = ohci-it_context_list;
callback = handle_it_packet;
} else {
-   mask = ohci-ir_context_mask;
-   list = ohci-ir_context_list;
+   mask = ohci-ir_context_mask;
+   list = ohci-ir_context_list;
if (header_size  0)
callback = handle_ir_dualbuffer_packet;
else
@@ -1373,11 +1371,11 @@ ohci_allocate_iso_context(struct fw_card *card, int 
type,
if (index  0)
return ERR_PTR(-EBUSY);
 
-   if (type == FW_ISO_CONTEXT_TRANSMIT)
-   regs = OHCI1394_IsoXmitContextBase(index);
-   else
-   regs = OHCI1394_IsoRcvContextBase(index);
- 
+   if (type == FW_ISO_CONTEXT_TRANSMIT)
+   regs = OHCI1394_IsoXmitContextBase(index);
+   else
+   regs = OHCI1394_IsoRcvContextBase(index);
+
ctx = list[index];
memset(ctx, 0, sizeof *ctx);
ctx-header_length = 0;
@@ -1404,7 +1402,7 @@ 

firewire: Scheduled removal of SA_xxx interrupt flags fixups 3

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=65efffa8f0cd86a199bf19ede5c91552d35c5a38
Commit: 65efffa8f0cd86a199bf19ede5c91552d35c5a38
Parent: 373b2edd864b8753419521b715bd1ddafd2f2af3
Author: Thomas Gleixner [EMAIL PROTECTED]
AuthorDate: Mon Mar 5 18:19:51 2007 -0800
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:05 2007 +0100

firewire: Scheduled removal of SA_xxx interrupt flags fixups 3

The obsolete SA_xxx interrupt flags have been used despite the scheduled
removal.  Fixup the remaining users in -mm.

Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
Acked-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 57eba70..5081541 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1101,7 +1101,7 @@ static int ohci_enable(struct fw_card *card, u32 
*config_rom, size_t length)
reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x8000);
 
if (request_irq(dev-irq, irq_handler,
-   SA_SHIRQ, ohci_driver_name, ohci)) {
+   IRQF_SHARED, ohci_driver_name, ohci)) {
fw_error(Failed to allocate shared interrupt %d.\n,
 dev-irq);
dma_free_coherent(ohci-card.device, CONFIG_ROM_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


firewire: Let an fw_descriptor specify a leading immediate key/value pair.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=937f687969f77bfeee5efd71cadfa6f1a813665e
Commit: 937f687969f77bfeee5efd71cadfa6f1a813665e
Parent: 65efffa8f0cd86a199bf19ede5c91552d35c5a38
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:36 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:05 2007 +0100

firewire: Let an fw_descriptor specify a leading immediate key/value pair.

This lets us break out Juju as the model name in the config rom.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-card.c|7 ++-
 drivers/firewire/fw-transaction.c |   34 +-
 drivers/firewire/fw-transaction.h |1 +
 3 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 3f8661a..8d7c121 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -100,11 +100,12 @@ generate_config_rom (struct fw_card *card, size_t 
*config_rom_length)
i = 5;
config_rom[i++] = 0;
config_rom[i++] = 0x0c0083c0; /* node capabilities */
-   config_rom[i++] = 0x03d00d1e; /* vendor id */
j = i + descriptor_count;
 
/* Generate root directory entries for descriptors. */
list_for_each_entry (desc, descriptor_list, link) {
+   if (desc-immediate  0)
+   config_rom[i++] = desc-immediate;
config_rom[i] = desc-key | (j - i);
i++;
j += desc-length;
@@ -165,6 +166,8 @@ fw_core_add_descriptor (struct fw_descriptor *desc)
 
list_add_tail (desc-link, descriptor_list);
descriptor_count++;
+   if (desc-immediate  0)
+   descriptor_count++;
update_config_roms();
 
up_write(fw_bus_type.subsys.rwsem);
@@ -180,6 +183,8 @@ fw_core_remove_descriptor (struct fw_descriptor *desc)
 
list_del(desc-link);
descriptor_count--;
+   if (desc-immediate  0)
+   descriptor_count--;
update_config_roms();
 
up_write(fw_bus_type.subsys.rwsem);
diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index abc37fa..8e2b945 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -720,23 +720,37 @@ MODULE_AUTHOR(Kristian Hoegsberg [EMAIL PROTECTED]);
 MODULE_DESCRIPTION(Core IEEE1394 transaction logic);
 MODULE_LICENSE(GPL);
 
-static const u32 vendor_textual_descriptor_data[] = {
+static const u32 vendor_textual_descriptor[] = {
/* textual descriptor leaf () */
-   0x0008,
+   0x0006,
0x,
0x,
0x4c696e75, /* L i n u */
0x78204669, /* x   F i */
0x72657769, /* r e w i */
-   0x72652028, /* r e   ( */
-   0x4a554a55, /* J U J U */
-   0x2900, /* )   */
+   0x7265, /* r e */
 };
 
-static struct fw_descriptor vendor_textual_descriptor = {
-   .length = ARRAY_SIZE(vendor_textual_descriptor_data),
+static const u32 model_textual_descriptor[] = {
+   /* model descriptor leaf () */
+   0x0003,
+   0x,
+   0x,
+   0x4a756a75, /* J u j u */
+};
+
+static struct fw_descriptor vendor_id_descriptor = {
+   .length = ARRAY_SIZE(vendor_textual_descriptor),
+   .immediate = 0x03d00d1e,
.key = 0x8100,
-   .data = vendor_textual_descriptor_data,
+   .data = vendor_textual_descriptor,
+};
+
+static struct fw_descriptor model_id_descriptor = {
+   .length = ARRAY_SIZE(model_textual_descriptor),
+   .immediate = 0x1701,
+   .key = 0x8100,
+   .data = model_textual_descriptor,
 };
 
 static int __init fw_core_init(void)
@@ -748,7 +762,9 @@ static int __init fw_core_init(void)
return retval;
 
/* Add the vendor textual descriptor. */
-   retval = fw_core_add_descriptor(vendor_textual_descriptor);
+   retval = fw_core_add_descriptor(vendor_id_descriptor);
+   BUG_ON(retval  0);
+   retval = fw_core_add_descriptor(model_id_descriptor);
BUG_ON(retval  0);
 
return 0;
diff --git a/drivers/firewire/fw-transaction.h 
b/drivers/firewire/fw-transaction.h
index cbea845..552e9af 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -164,6 +164,7 @@ struct fw_request;
 struct fw_descriptor {
struct list_head link;
size_t length;
+   u32 immediate;
u32 key;
const u32 *data;
 };
-
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


firewire: Drop the unused fw_card device.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=49e1179b16fe54bfa070cd955a24c5ce82e21d16
Commit: 49e1179b16fe54bfa070cd955a24c5ce82e21d16
Parent: 937f687969f77bfeee5efd71cadfa6f1a813665e
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:37 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:06 2007 +0100

firewire: Drop the unused fw_card device.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-card.c|   40 +++-
 drivers/firewire/fw-transaction.h |3 +-
 2 files changed, 13 insertions(+), 30 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 8d7c121..b1deb52 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -352,15 +352,6 @@ fw_card_bm_work(struct work_struct *work)
 }
 
 static void
-release_card(struct device *device)
-{
-   struct fw_card *card =
-   container_of(device, struct fw_card, card_device);
-
-   kfree(card);
-}
-
-static void
 flush_timer_callback(unsigned long data)
 {
struct fw_card *card = (struct fw_card *)data;
@@ -374,6 +365,7 @@ fw_card_initialize(struct fw_card *card, const struct 
fw_card_driver *driver,
 {
static atomic_t index = ATOMIC_INIT(-1);
 
+   kref_init(card-kref);
card-index = atomic_inc_return(index);
card-driver = driver;
card-device = device;
@@ -389,14 +381,6 @@ fw_card_initialize(struct fw_card *card, const struct 
fw_card_driver *driver,
card-local_node = NULL;
 
INIT_DELAYED_WORK(card-work, fw_card_bm_work);
-
-   card-card_device.bus = fw_bus_type;
-   card-card_device.release = release_card;
-   card-card_device.parent  = card-device;
-   snprintf(card-card_device.bus_id, sizeof card-card_device.bus_id,
-fwcard%d, card-index);
-
-   device_initialize(card-card_device);
 }
 EXPORT_SYMBOL(fw_card_initialize);
 
@@ -404,7 +388,6 @@ int
 fw_card_add(struct fw_card *card,
u32 max_receive, u32 link_speed, u64 guid)
 {
-   int retval;
u32 *config_rom;
size_t length;
 
@@ -417,12 +400,6 @@ fw_card_add(struct fw_card *card,
if (card-driver-update_phy_reg(card, 4, 0, 0x80 | 0x40)  0)
return -EIO;
 
-   retval = device_add(card-card_device);
-   if (retval  0) {
-   fw_error(Failed to register card device.);
-   return retval;
-   }
-
/* The subsystem grabs a reference when the card is added and
 * drops it when the driver calls fw_core_remove_card. */
fw_card_get(card);
@@ -520,27 +497,34 @@ fw_core_remove_card(struct fw_card *card)
 
fw_destroy_nodes(card);
 
-   /* This also drops the subsystem reference. */
-   device_unregister(card-card_device);
+   fw_card_put(card);
 }
 EXPORT_SYMBOL(fw_core_remove_card);
 
 struct fw_card *
 fw_card_get(struct fw_card *card)
 {
-   get_device(card-card_device);
+   kref_get(card-kref);
 
return card;
 }
 EXPORT_SYMBOL(fw_card_get);
 
+static void
+release_card(struct kref *kref)
+{
+   struct fw_card *card = container_of(kref, struct fw_card, kref);
+
+   kfree(card);
+}
+
 /* An assumption for fw_card_put() is that the card driver allocates
  * the fw_card struct with kalloc and that it has been shut down
  * before the last ref is dropped. */
 void
 fw_card_put(struct fw_card *card)
 {
-   put_device(card-card_device);
+   kref_put(card-kref, release_card);
 }
 EXPORT_SYMBOL(fw_card_put);
 
diff --git a/drivers/firewire/fw-transaction.h 
b/drivers/firewire/fw-transaction.h
index 552e9af..b0d0575 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -270,6 +270,7 @@ extern struct bus_type fw_bus_type;
 struct fw_card {
const struct fw_card_driver *driver;
struct device *device;
+   struct kref kref;
 
int node_id;
int generation;
@@ -300,8 +301,6 @@ struct fw_card {
 
int index;
 
-   struct device card_device;
-
struct list_head link;
 
/* Work struct for BM duties. */
-
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


firewire: Clear all interrupt bits before shutting down.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e254a4b45f265d9df120b83d5c2c9437902b601b
Commit: e254a4b45f265d9df120b83d5c2c9437902b601b
Parent: 49e1179b16fe54bfa070cd955a24c5ce82e21d16
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:38 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:06 2007 +0100

firewire: Clear all interrupt bits before shutting down.

Some flaky controllers doesn't honor the masterIntEnable bits
and can generate bus reset events even if that bit is cleared.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 5081541..3746792 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1943,7 +1943,8 @@ static void pci_remove(struct pci_dev *dev)
struct fw_ohci *ohci;
 
ohci = pci_get_drvdata(dev);
-   reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_masterIntEnable);
+   reg_write(ohci, OHCI1394_IntMaskClear, ~0);
+   flush_writes(ohci);
fw_core_remove_card(ohci-card);
 
/* FIXME: Fail all pending packets here, now that the upper
-
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


firewire: Iterate through units in a keventd callback for update callbacks.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5f48047756339065df3e6fead381978abb0bc557
Commit: 5f48047756339065df3e6fead381978abb0bc557
Parent: e254a4b45f265d9df120b83d5c2c9437902b601b
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:39 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:07 2007 +0100

firewire: Iterate through units in a keventd callback for update callbacks.

We can't take the klist lock for the child device list in interrupt
context.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device.c |   17 ++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index e8f2dc3..5599265 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -530,6 +530,14 @@ static int update_unit(struct device *dev, void *data)
return 0;
 }
 
+static void fw_device_update(struct work_struct *work)
+{
+   struct fw_device *device =
+   container_of(work, struct fw_device, work.work);
+
+   device_for_each_child(device-device, NULL, update_unit);
+}
+
 void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
 {
struct fw_device *device;
@@ -577,7 +585,10 @@ void fw_node_event(struct fw_card *card, struct fw_node 
*node, int event)
device = node-data;
device-node_id = node-node_id;
device-generation = card-generation;
-   device_for_each_child(device-device, NULL, update_unit);
+   if (atomic_read(device-state) == FW_DEVICE_RUNNING) {
+   PREPARE_DELAYED_WORK(device-work, fw_device_update);
+   schedule_delayed_work(device-work, 0);
+   }
break;
 
case FW_NODE_DESTROYED:
@@ -597,8 +608,8 @@ void fw_node_event(struct fw_card *card, struct fw_node 
*node, int event)
 * to create the device. */
device = node-data;
if (atomic_xchg(device-state,
-FW_DEVICE_SHUTDOWN) == FW_DEVICE_RUNNING) {
-   INIT_DELAYED_WORK(device-work, fw_device_shutdown);
+   FW_DEVICE_SHUTDOWN) == FW_DEVICE_RUNNING) {
+   PREPARE_DELAYED_WORK(device-work, fw_device_shutdown);
schedule_delayed_work(device-work, 0);
}
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


firewire: Only use INIT_DELAYED_WORK for first initialization.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1da0c93b31bb8f374a22f4e20dab02fd79f6c7e6
Commit: 1da0c93b31bb8f374a22f4e20dab02fd79f6c7e6
Parent: 5f48047756339065df3e6fead381978abb0bc557
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:40 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:07 2007 +0100

firewire: Only use INIT_DELAYED_WORK for first initialization.

Use PREPARE_DELAYED_WORK to just change the function pointer.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 2259e22..994914f 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -1,5 +1,5 @@
 /* -*- c-basic-offset: 8 -*-
- * fw-sbp2.c -- SBP2 driver (SCSI over IEEE1394)
+ * fw-spb2.c -- SBP2 driver (SCSI over IEEE1394)
  *
  * Copyright (C) 2005-2007  Kristian Hoegsberg [EMAIL PROTECTED]
  *
@@ -577,7 +577,7 @@ static void sbp2_login(struct work_struct *work)
sbp2_set_busy_timeout(scsi_id);
 #endif
 
-   INIT_DELAYED_WORK(sd-work, sbp2_reconnect);
+   PREPARE_DELAYED_WORK(sd-work, sbp2_reconnect);
sbp2_agent_reset(unit);
 
retval = add_scsi_devices(unit);
@@ -587,7 +587,7 @@ static void sbp2_login(struct work_struct *work)
 NULL);
/* Set this back to sbp2_login so we fall back and
 * retry login on bus reset. */
-   INIT_DELAYED_WORK(sd-work, sbp2_login);
+   PREPARE_DELAYED_WORK(sd-work, sbp2_login);
}
 }
 
@@ -714,7 +714,7 @@ static void sbp2_reconnect(struct work_struct *work)
 unit-device.bus_id);
/* Fall back and try to log in again. */
sd-retries = 0;
-   INIT_DELAYED_WORK(sd-work, sbp2_login);
+   PREPARE_DELAYED_WORK(sd-work, sbp2_login);
}
schedule_delayed_work(sd-work, DIV_ROUND_UP(HZ, 5));
return;
-
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


firewire: Implement ioctl to initiate bus reset.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5371842b723dd04df57171f2c74660966901380c
Commit: 5371842b723dd04df57171f2c74660966901380c
Parent: 97bd9efa5a4d8a70b3bafe0d1e3e1a814fdac5bc
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:42 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:08 2007 +0100

firewire: Implement ioctl to initiate bus reset.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   15 +++
 drivers/firewire/fw-device-cdev.h |   16 
 2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 9f3c96c..79e095e 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -433,6 +433,19 @@ static int ioctl_send_response(struct client *client, void 
__user *arg)
return 0;
 }
 
+static int ioctl_initiate_bus_reset(struct client *client, void __user *arg)
+{
+   struct fw_cdev_initiate_bus_reset request;
+   int short_reset;
+
+   if (copy_from_user(request, arg, sizeof request))
+   return -EFAULT;
+
+   short_reset = (request.type == FW_CDEV_SHORT_RESET);
+
+   return fw_core_initiate_bus_reset(client-device-card, short_reset);
+}
+
 static void
 iso_callback(struct fw_iso_context *context, u32 cycle,
 size_t header_length, void *header, void *data)
@@ -606,6 +619,8 @@ dispatch_ioctl(struct client *client, unsigned int cmd, 
void __user *arg)
return ioctl_allocate(client, arg);
case FW_CDEV_IOC_SEND_RESPONSE:
return ioctl_send_response(client, arg);
+   case FW_CDEV_IOC_INITIATE_BUS_RESET:
+   return ioctl_initiate_bus_reset(client, arg);
case FW_CDEV_IOC_CREATE_ISO_CONTEXT:
return ioctl_create_iso_context(client, arg);
case FW_CDEV_IOC_QUEUE_ISO:
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index 4f94471..8a8b390 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -108,10 +108,11 @@ struct fw_cdev_event_iso_interrupt {
 #define FW_CDEV_IOC_SEND_REQUEST   _IO('#', 0x01)
 #define FW_CDEV_IOC_ALLOCATE   _IO('#', 0x02)
 #define FW_CDEV_IOC_SEND_RESPONSE  _IO('#', 0x03)
-#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IO('#', 0x04)
-#define FW_CDEV_IOC_QUEUE_ISO  _IO('#', 0x05)
-#define FW_CDEV_IOC_START_ISO  _IO('#', 0x06)
-#define FW_CDEV_IOC_STOP_ISO   _IO('#', 0x07)
+#define FW_CDEV_IOC_INITIATE_BUS_RESET _IO('#', 0x04)
+#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IO('#', 0x05)
+#define FW_CDEV_IOC_QUEUE_ISO  _IO('#', 0x06)
+#define FW_CDEV_IOC_START_ISO  _IO('#', 0x07)
+#define FW_CDEV_IOC_STOP_ISO   _IO('#', 0x08)
 
 struct fw_cdev_get_config_rom {
__u32 length;
@@ -139,6 +140,13 @@ struct fw_cdev_allocate {
__u32 length;
 };
 
+#define FW_CDEV_LONG_RESET 0
+#define FW_CDEV_SHORT_RESET1
+
+struct fw_cdev_initiate_bus_reset {
+   __u32 type;
+};
+
 #define FW_CDEV_ISO_CONTEXT_TRANSMIT   0
 #define FW_CDEV_ISO_CONTEXT_RECEIVE1
 
-
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


firewire: Generalize get_config_rom to get_info.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=344bbc4de14e70d03f09bff04bb7d161b8a0d28c
Commit: 344bbc4de14e70d03f09bff04bb7d161b8a0d28c
Parent: 5371842b723dd04df57171f2c74660966901380c
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:43 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:08 2007 +0100

firewire: Generalize get_config_rom to get_info.

Repurpose the get_config_rom ioctl to a general get_info ioctl.
This ioctl is now used for version negotiation, and optionally
returns the config rom, and the current bus info.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   65 +++--
 drivers/firewire/fw-device-cdev.h |   31 +++--
 2 files changed, 75 insertions(+), 21 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 79e095e..d9f3bb2 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -68,6 +68,7 @@ struct iso_interrupt {
 };
 
 struct client {
+   u32 version;
struct fw_device *device;
spinlock_t lock;
struct list_head handler_list;
@@ -190,11 +191,25 @@ fw_device_op_read(struct file *file,
 }
 
 static void
+fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
+struct fw_device *device)
+{
+   struct fw_card *card = device-card;
+
+   event-type  = FW_CDEV_EVENT_BUS_RESET;
+   event-node_id   = device-node_id;
+   event-local_node_id = card-local_node-node_id;
+   event-bm_node_id= 0; /* FIXME: We don't track the BM. */
+   event-irm_node_id   = card-irm_node-node_id;
+   event-root_node_id  = card-root_node-node_id;
+   event-generation= card-generation;
+}
+
+static void
 queue_bus_reset_event(struct client *client)
 {
struct bus_reset *bus_reset;
struct fw_device *device = client-device;
-   struct fw_card *card = device-card;
 
bus_reset = kzalloc(sizeof *bus_reset, GFP_ATOMIC);
if (bus_reset == NULL) {
@@ -202,13 +217,7 @@ queue_bus_reset_event(struct client *client)
return;
}
 
-   bus_reset-reset.type  = FW_CDEV_EVENT_BUS_RESET;
-   bus_reset-reset.node_id   = device-node_id;
-   bus_reset-reset.local_node_id = card-local_node-node_id;
-   bus_reset-reset.bm_node_id= 0; /* FIXME: We don't track the BM. */
-   bus_reset-reset.irm_node_id   = card-irm_node-node_id;
-   bus_reset-reset.root_node_id  = card-root_node-node_id;
-   bus_reset-reset.generation= card-generation;
+   fill_bus_reset_event(bus_reset-reset, device);
 
queue_event(client, bus_reset-event,
bus_reset-reset, sizeof bus_reset-reset, NULL, 0);
@@ -228,14 +237,36 @@ void fw_device_cdev_update(struct fw_device *device)
spin_unlock_irqrestore(card-lock, flags);
 }
 
-static int ioctl_config_rom(struct client *client, void __user *arg)
+static int ioctl_get_info(struct client *client, void __user *arg)
 {
-   struct fw_cdev_get_config_rom rom;
+   struct fw_cdev_get_info get_info;
+   struct fw_cdev_event_bus_reset bus_reset;
+
+   if (copy_from_user(get_info, arg, sizeof get_info))
+   return -EFAULT;
+
+   client-version = get_info.version;
+   get_info.version = FW_CDEV_VERSION;
+
+   if (get_info.rom != 0) {
+   void __user *uptr = u64_to_uptr(get_info.rom);
+   size_t length = min(get_info.rom_length,
+   client-device-config_rom_length * 4);
+
+   if (copy_to_user(uptr, client-device-config_rom, length))
+   return -EFAULT;
+   }
+   get_info.rom_length = client-device-config_rom_length * 4;
+
+   if (get_info.bus_reset != 0) {
+   void __user *uptr = u64_to_uptr(get_info.bus_reset);
+
+   fill_bus_reset_event(bus_reset, client-device);
+   if (copy_to_user(uptr, bus_reset, sizeof bus_reset))
+   return -EFAULT;
+   }
 
-   rom.length = client-device-config_rom_length;
-   memcpy(rom.data, client-device-config_rom, rom.length * 4);
-   if (copy_to_user(arg, rom,
-(char *)rom.data[rom.length] - (char *)rom))
+   if (copy_to_user(arg, get_info, sizeof get_info))
return -EFAULT;
 
return 0;
@@ -290,7 +321,7 @@ static ssize_t ioctl_send_request(struct client *client, 
void __user *arg)
}
 
fw_send_request(device-card, response-transaction,
-   request.tcode,
+   request.tcode  0x1f,
device-node-node_id,
device-card-generation,

firewire: Switch cdev code over to use register_chrdev and keep a list of devices.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a3aca3dabbcf00f2088d472f27755c29acaa992e
Commit: a3aca3dabbcf00f2088d472f27755c29acaa992e
Parent: 344bbc4de14e70d03f09bff04bb7d161b8a0d28c
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:44 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:09 2007 +0100

firewire: Switch cdev code over to use register_chrdev and keep a list of 
devices.

The old mechanism kept a struct cdev for each fw device, but fops-release
would reference this struct after the device got freed in some cases.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |5 ++-
 drivers/firewire/fw-device.c  |   56 +++-
 drivers/firewire/fw-device.h  |5 ++-
 drivers/firewire/fw-transaction.c |7 
 4 files changed, 51 insertions(+), 22 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index d9f3bb2..54ef27b 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -28,6 +28,7 @@
 #include linux/poll.h
 #include linux/delay.h
 #include linux/mm.h
+#include linux/idr.h
 #include linux/compat.h
 #include asm/uaccess.h
 #include fw-transaction.h
@@ -103,7 +104,9 @@ static int fw_device_op_open(struct inode *inode, struct 
file *file)
struct client *client;
unsigned long flags;
 
-   device = container_of(inode-i_cdev, struct fw_device, cdev);
+   device = fw_device_from_devt(inode-i_rdev);
+   if (device == NULL)
+   return -ENODEV;
 
client = kzalloc(sizeof *client, GFP_KERNEL);
if (client == NULL)
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index ccc05e5..b24090a 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -25,6 +25,7 @@
 #include linux/kthread.h
 #include linux/device.h
 #include linux/delay.h
+#include linux/idr.h
 #include fw-transaction.h
 #include fw-topology.h
 #include fw-device.h
@@ -407,14 +408,31 @@ static int shutdown_unit(struct device *device, void 
*data)
return 0;
 }
 
+static DEFINE_IDR(fw_device_idr);
+int fw_cdev_major;
+
+struct fw_device *fw_device_from_devt(dev_t devt)
+{
+   struct fw_device *device;
+
+   down_read(fw_bus_type.subsys.rwsem);
+   device = idr_find(fw_device_idr, MINOR(devt));
+   up_read(fw_bus_type.subsys.rwsem);
+
+   return device;
+}
+
 static void fw_device_shutdown(struct work_struct *work)
 {
struct fw_device *device =
container_of(work, struct fw_device, work.work);
+   int minor = MINOR(device-device.devt);
+
+   down_write(fw_bus_type.subsys.rwsem);
+   idr_remove(fw_device_idr, minor);
+   up_write(fw_bus_type.subsys.rwsem);
 
device_remove_file(device-device, config_rom_attribute);
-   cdev_del(device-cdev);
-   unregister_chrdev_region(device-device.devt, 1);
device_for_each_child(device-device, NULL, shutdown_unit);
device_unregister(device-device);
 }
@@ -434,9 +452,9 @@ static void fw_device_shutdown(struct work_struct *work)
 
 static void fw_device_init(struct work_struct *work)
 {
-   static atomic_t serial = ATOMIC_INIT(-1);
struct fw_device *device =
container_of(work, struct fw_device, work.work);
+   int minor, err;
 
/* All failure paths here set node-data to NULL, so that we
 * don't try to do device_for_each_child() on a kfree()'d
@@ -456,28 +474,24 @@ static void fw_device_init(struct work_struct *work)
return;
}
 
+   err = -ENOMEM;
+   down_write(fw_bus_type.subsys.rwsem);
+   if (idr_pre_get(fw_device_idr, GFP_KERNEL))
+   err = idr_get_new(fw_device_idr, device, minor);
+   up_write(fw_bus_type.subsys.rwsem);
+   if (err  0)
+   goto error;
+
device-device.bus = fw_bus_type;
device-device.release = fw_device_release;
device-device.parent = device-card-device;
+   device-device.devt = MKDEV(fw_cdev_major, minor);
snprintf(device-device.bus_id, sizeof device-device.bus_id,
-fw%d, atomic_inc_return(serial));
-
-   if (alloc_chrdev_region(device-device.devt, 0, 1, fw)) {
-   fw_error(Failed to register char device region.\n);
-   goto error;
-   }
-
-   cdev_init(device-cdev, fw_device_ops);
-   device-cdev.owner = THIS_MODULE;
-   kobject_set_name(device-cdev.kobj, device-device.bus_id);
-   if (cdev_add(device-cdev, device-device.devt, 1)) {
-   fw_error(Failed to register char device.\n);
-   goto error;
-   }
+fw%d, minor);
 
if (device_add(device-device)) {
fw_error(Failed to add 

firewire: Quiet down fw-sbp2 logging a bit, remove stale FIXME.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5c5539d8cdfd13fdb080357fe79f94a7e11a6ef6
Commit: 5c5539d8cdfd13fdb080357fe79f94a7e11a6ef6
Parent: a3aca3dabbcf00f2088d472f27755c29acaa992e
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:45 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:09 2007 +0100

firewire: Quiet down fw-sbp2 logging a bit, remove stale FIXME.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   26 --
 1 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 994914f..07e410b 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -452,8 +452,6 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, 
int generation,
 
wait_for_completion(orb-done);
 
-   /* FIXME: Handle bus reset race here. */
-
retval = -EIO;
if (orb-base.rcode != RCODE_COMPLETE) {
fw_error(management write failed, rcode 0x%02x\n,
@@ -496,7 +494,6 @@ complete_agent_reset_write(struct fw_card *card, int rcode,
 {
struct fw_transaction *t = data;
 
-   fw_notify(agent reset write rcode=%d\n, rcode);
kfree(t);
 }
 
@@ -542,9 +539,6 @@ static void sbp2_login(struct work_struct *work)
if (sbp2_send_management_orb(unit, node_id, generation,
 SBP2_LOGIN_REQUEST, lun, response)  0) {
if (sd-retries++  5) {
-   fw_error(login attempt %d for %s failed, 
-rescheduling\n,
-sd-retries, unit-device.bus_id);
schedule_delayed_work(sd-work, DIV_ROUND_UP(HZ, 5));
} else {
fw_error(failed to login to %s\n,
@@ -560,16 +554,17 @@ static void sbp2_login(struct work_struct *work)
 
/* Get command block agent offset and login id. */
sd-command_block_agent_address =
-   ((u64) response.command_block_agent.high  32) |
+   ((u64) (response.command_block_agent.high  0x)  32) |
response.command_block_agent.low;
sd-login_id = login_response_get_login_id(response);
 
-   fw_notify(logged in to sbp2 unit %s\n, unit-device.bus_id);
-   fw_notify( - management_agent_address: 0x%012llx\n,
+   fw_notify(logged in to sbp2 unit %s (%d retries)\n,
+ unit-device.bus_id, sd-retries);
+   fw_notify( - management_agent_address:0x%012llx\n,
  (unsigned long long) sd-management_agent_address);
fw_notify( - command_block_agent_address: 0x%012llx\n,
  (unsigned long long) sd-command_block_agent_address);
-   fw_notify( - status write address: 0x%012llx\n,
+   fw_notify( - status write address:0x%012llx\n,
  (unsigned long long) sd-address_handler.offset);
 
 #if 0
@@ -705,11 +700,7 @@ static void sbp2_reconnect(struct work_struct *work)
if (sbp2_send_management_orb(unit, node_id, generation,
 SBP2_RECONNECT_REQUEST,
 sd-login_id, NULL)  0) {
-   if (sd-retries++  5) {
-   fw_error(reconnect attempt %d for %s failed, 
-rescheduling\n,
-sd-retries, unit-device.bus_id);
-   } else {
+   if (sd-retries++ = 5) {
fw_error(failed to reconnect to %s\n,
 unit-device.bus_id);
/* Fall back and try to log in again. */
@@ -724,7 +715,8 @@ static void sbp2_reconnect(struct work_struct *work)
sd-node_id  = node_id;
sd-address_high = local_node_id  16;
 
-   fw_notify(reconnected to unit %s\n, unit-device.bus_id);
+   fw_notify(reconnected to unit %s (%d retries)\n,
+ unit-device.bus_id, sd-retries);
sbp2_agent_reset(unit);
sbp2_cancel_orbs(unit);
 }
@@ -837,8 +829,6 @@ complete_command_orb(struct sbp2_orb *base_orb, struct 
sbp2_status *status)
/* If the orb completes with status == NULL, something
 * went wrong, typically a bus reset happened mid-orb
 * or when sending the write (less likely). */
-   fw_notify(no command orb status, rcode=%d\n,
- orb-base.rcode);
result = DID_BUS_BUSY;
}
 
-
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


firewire: Add rom_index attribute for unit sysfs directories.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=048961ef90b584d00ec79c75cb7c7b28403f0c87
Commit: 048961ef90b584d00ec79c75cb7c7b28403f0c87
Parent: 5c5539d8cdfd13fdb080357fe79f94a7e11a6ef6
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:46 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:10 2007 +0100

firewire: Add rom_index attribute for unit sysfs directories.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device.c |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index b24090a..4ade867 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -230,6 +230,22 @@ static struct device_attribute config_rom_attribute = {
.show = show_config_rom_attribute,
 };
 
+static ssize_t
+show_rom_index_attribute(struct device *dev,
+struct device_attribute *attr, char *buf)
+{
+   struct fw_device *device = fw_device(dev-parent);
+   struct fw_unit *unit = fw_unit(dev);
+
+   return snprintf(buf, PAGE_SIZE, %d\n,
+   unit-directory - device-config_rom);
+}
+
+static struct device_attribute rom_index_attribute = {
+   .attr = { .name = rom_index, .mode = S_IRUGO, },
+   .show = show_rom_index_attribute,
+};
+
 struct read_quadlet_callback_data {
struct completion done;
int rcode;
@@ -393,6 +409,11 @@ static void create_units(struct fw_device *device)
device_unregister(unit-device);
kfree(unit);
}
+
+   if (device_create_file(unit-device, rom_index_attribute)  
0) {
+   device_unregister(unit-device);
+   kfree(unit);
+   }
}
 }
 
-
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


firewire: Don't time out command orbs, leave that to the scsi stack.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2aaad97be6b58ae865f402fcd27d138e7346ff81
Commit: 2aaad97be6b58ae865f402fcd27d138e7346ff81
Parent: 048961ef90b584d00ec79c75cb7c7b28403f0c87
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:47 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:10 2007 +0100

firewire: Don't time out command orbs, leave that to the scsi stack.

The mod_timer based timing out of orb was a little to agressive and
would time out legit, but long-lived scsi cmds.  Besides, the scsi
stack keeps track of this already.  Since we're only timing out
management orbs, go back to wait_for_completion_timeout.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   31 +++
 1 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 07e410b..2e5479b 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -68,9 +68,6 @@ struct sbp2_device {
int address_high;
int generation;
 
-   /* Timer for flushing ORBs. */
-   struct timer_list orb_timer;
-
int retries;
struct delayed_work work;
struct Scsi_Host *scsi_host;
@@ -342,9 +339,6 @@ sbp2_send_orb(struct sbp2_orb *orb, struct fw_unit *unit,
list_add_tail(orb-link, sd-orb_list);
spin_unlock_irqrestore(device-card-lock, flags);
 
-   mod_timer(sd-orb_timer,
- jiffies + DIV_ROUND_UP(SBP2_ORB_TIMEOUT * HZ, 1000));
-
fw_send_request(device-card, orb-t, TCODE_WRITE_BLOCK_REQUEST,
node_id, generation,
device-node-max_speed, offset,
@@ -352,13 +346,14 @@ sbp2_send_orb(struct sbp2_orb *orb, struct fw_unit *unit,
complete_transaction, orb);
 }
 
-static void sbp2_cancel_orbs(struct fw_unit *unit)
+static int sbp2_cancel_orbs(struct fw_unit *unit)
 {
struct fw_device *device = fw_device(unit-device.parent);
struct sbp2_device *sd = unit-device.driver_data;
struct sbp2_orb *orb, *next;
struct list_head list;
unsigned long flags;
+   int retval = -ENOENT;
 
INIT_LIST_HEAD(list);
spin_lock_irqsave(device-card-lock, flags);
@@ -366,19 +361,15 @@ static void sbp2_cancel_orbs(struct fw_unit *unit)
spin_unlock_irqrestore(device-card-lock, flags);
 
list_for_each_entry_safe(orb, next, list, link) {
+   retval = 0;
if (fw_cancel_transaction(device-card, orb-t) == 0)
continue;
 
orb-rcode = RCODE_CANCELLED;
orb-callback(orb, NULL);
}
-}
 
-static void orb_timer_callback(unsigned long data)
-{
-   struct sbp2_device *sd = (struct sbp2_device *)data;
-
-   sbp2_cancel_orbs(sd-unit);
+   return retval;
 }
 
 static void
@@ -447,20 +438,22 @@ sbp2_send_management_orb(struct fw_unit *unit, int 
node_id, int generation,
 
init_completion(orb-done);
orb-base.callback = complete_management_orb;
+
sbp2_send_orb(orb-base, unit,
  node_id, generation, sd-management_agent_address);
 
-   wait_for_completion(orb-done);
+   wait_for_completion_timeout(orb-done,
+   msecs_to_jiffies(SBP2_ORB_TIMEOUT));
 
retval = -EIO;
-   if (orb-base.rcode != RCODE_COMPLETE) {
-   fw_error(management write failed, rcode 0x%02x\n,
+   if (sbp2_cancel_orbs(unit) == 0) {
+   fw_error(orb reply timed out, rcode=0x%02x\n,
 orb-base.rcode);
goto out;
}
 
-   if (orb-base.rcode == RCODE_CANCELLED) {
-   fw_error(orb reply timed out, rcode=0x%02x\n,
+   if (orb-base.rcode != RCODE_COMPLETE) {
+   fw_error(management write failed, rcode 0x%02x\n,
 orb-base.rcode);
goto out;
}
@@ -602,7 +595,6 @@ static int sbp2_probe(struct device *dev)
unit-device.driver_data = sd;
sd-unit = unit;
INIT_LIST_HEAD(sd-orb_list);
-   setup_timer(sd-orb_timer, orb_timer_callback, (unsigned long)sd);
 
sd-address_handler.length = 0x100;
sd-address_handler.address_callback = sbp2_status_write;
@@ -675,7 +667,6 @@ static int sbp2_remove(struct device *dev)
 SBP2_LOGOUT_REQUEST, sd-login_id, NULL);
 
remove_scsi_devices(unit);
-   del_timer_sync(sd-orb_timer);
 
fw_core_remove_address_handler(sd-address_handler);
kfree(sd);
-
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  

firewire: Use only a wait queue and terminate poll and read on device removal.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2603bf219e9bef3396b96b65326de7db27958c95
Commit: 2603bf219e9bef3396b96b65326de7db27958c95
Parent: 2aaad97be6b58ae865f402fcd27d138e7346ff81
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:48 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:11 2007 +0100

firewire: Use only a wait queue and terminate poll and read on device 
removal.

Drop the event list semaphore and only use the wait queue and the list
to synchronize queue access.  Break out of a poll or read whenever
the device is disconnected.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   80 +++-
 drivers/firewire/fw-device.c  |1 +
 drivers/firewire/fw-device.h  |7 +++
 3 files changed, 59 insertions(+), 29 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 54ef27b..2d84284 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -76,7 +76,6 @@ struct client {
struct list_head request_list;
u32 request_serial;
struct list_head event_list;
-   struct semaphore event_list_sem;
wait_queue_head_t wait;
 
struct fw_iso_context *iso_context;
@@ -114,7 +113,6 @@ static int fw_device_op_open(struct inode *inode, struct 
file *file)
 
client-device = fw_device_get(device);
INIT_LIST_HEAD(client-event_list);
-   sema_init(client-event_list_sem, 0);
INIT_LIST_HEAD(client-handler_list);
INIT_LIST_HEAD(client-request_list);
spin_lock_init(client-lock);
@@ -142,38 +140,41 @@ static void queue_event(struct client *client, struct 
event *event,
spin_lock_irqsave(client-lock, flags);
 
list_add_tail(event-link, client-event_list);
-
-   up(client-event_list_sem);
wake_up_interruptible(client-wait);
 
spin_unlock_irqrestore(client-lock, flags);
 }
 
-static int dequeue_event(struct client *client, char __user *buffer, size_t 
count)
+static int
+dequeue_event(struct client *client, char __user *buffer, size_t count)
 {
unsigned long flags;
struct event *event;
size_t size, total;
-   int i, retval = -EFAULT;
+   int i, retval;
 
-   if (down_interruptible(client-event_list_sem)  0)
-   return -EINTR;
+   retval = wait_event_interruptible(client-wait,
+ !list_empty(client-event_list) ||
+ 
fw_device_is_shutdown(client-device));
+   if (retval  0)
+   return retval;
 
-   spin_lock_irqsave(client-lock, flags);
+   if (list_empty(client-event_list) 
+  fw_device_is_shutdown(client-device))
+   return -ENODEV;
 
+   spin_lock_irqsave(client-lock, flags);
event = container_of(client-event_list.next, struct event, link);
list_del(event-link);
-
spin_unlock_irqrestore(client-lock, flags);
 
-   if (buffer == NULL)
-   goto out;
-
total = 0;
for (i = 0; i  ARRAY_SIZE(event-v)  total  count; i++) {
size = min(event-v[i].size, count - total);
-   if (copy_to_user(buffer + total, event-v[i].data, size))
+   if (copy_to_user(buffer + total, event-v[i].data, size)) {
+   retval = -EFAULT;
goto out;
+   }
total += size;
}
retval = total;
@@ -209,6 +210,22 @@ fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
 }
 
 static void
+for_each_client(struct fw_device *device,
+   void (*callback)(struct client *client))
+{
+   struct fw_card *card = device-card;
+   struct client *c;
+   unsigned long flags;
+
+   spin_lock_irqsave(card-lock, flags);
+
+   list_for_each_entry(c, device-client_list, link)
+   callback(c);
+
+   spin_unlock_irqrestore(card-lock, flags);
+}
+
+static void
 queue_bus_reset_event(struct client *client)
 {
struct bus_reset *bus_reset;
@@ -228,16 +245,17 @@ queue_bus_reset_event(struct client *client)
 
 void fw_device_cdev_update(struct fw_device *device)
 {
-   struct fw_card *card = device-card;
-   struct client *c;
-   unsigned long flags;
-
-   spin_lock_irqsave(card-lock, flags);
+   for_each_client(device, queue_bus_reset_event);
+}
 
-   list_for_each_entry(c, device-client_list, link)
-   queue_bus_reset_event(c);
+static void wake_up_client(struct client *client)
+{
+   wake_up_interruptible(client-wait);
+}
 
-   spin_unlock_irqrestore(card-lock, flags);
+void fw_device_cdev_remove(struct fw_device *device)
+{
+   

firewire: Move async transmit to use the general context code.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f319b6a02f12c3712eb64eee6a23584367cb3588
Commit: f319b6a02f12c3712eb64eee6a23584367cb3588
Parent: 2603bf219e9bef3396b96b65326de7db27958c95
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:49 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:11 2007 +0100

firewire: Move async transmit to use the general context code.

The old async transmit context handling was starting and stopping
DMA for every packet transmission.  This could cause silently failing
packet transmission, if the DMA was reprogrammed too close to being
stopped.

The general context code keeps DMA running at all times and fixes this
problem.  It's also a nice cleanup.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c|  360 +++--
 drivers/firewire/fw-transaction.h |3 +-
 2 files changed, 149 insertions(+), 214 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 3746792..9e8a8f9 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -112,25 +112,6 @@ struct context {
struct tasklet_struct tasklet;
 };
 
-struct at_context {
-   struct fw_ohci *ohci;
-   dma_addr_t descriptor_bus;
-   dma_addr_t buffer_bus;
-   struct fw_packet *current_packet;
-
-   struct list_head list;
-
-   struct {
-   struct descriptor more;
-   __le32 header[4];
-   struct descriptor last;
-   } d;
-
-   u32 regs;
-
-   struct tasklet_struct tasklet;
-};
-
 #define it_header_sy(v)  ((v)   0)
 #define it_header_tcode(v)   ((v)   4)
 #define it_header_channel(v) ((v)   8)
@@ -173,8 +154,8 @@ struct fw_ohci {
 
struct ar_context ar_request_ctx;
struct ar_context ar_response_ctx;
-   struct at_context at_request_ctx;
-   struct at_context at_response_ctx;
+   struct context at_request_ctx;
+   struct context at_response_ctx;
 
u32 it_context_mask;
struct iso_context *it_context_list;
@@ -210,6 +191,8 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card)
 #define SELF_ID_BUF_SIZE   0x800
 #define OHCI_TCODE_PHY_PACKET  0x0e
 #define OHCI_VERSION_1_1   0x010010
+#define ISO_BUFFER_SIZE(64 * 1024)
+#define AT_BUFFER_SIZE 4096
 
 static char ohci_driver_name[] = KBUILD_MODNAME;
 
@@ -587,210 +570,166 @@ static void context_stop(struct context *ctx)
}
 }
 
-static void
-do_packet_callbacks(struct fw_ohci *ohci, struct list_head *list)
-{
-   struct fw_packet *p, *next;
-
-   list_for_each_entry_safe(p, next, list, link)
-   p-callback(p, ohci-card, p-ack);
-}
-
-static void
-complete_transmission(struct fw_packet *packet,
- int ack, struct list_head *list)
-{
-   list_move_tail(packet-link, list);
-   packet-ack = ack;
-}
+struct driver_data {
+   struct fw_packet *packet;
+};
 
-/* This function prepares the first packet in the context queue for
- * transmission.  Must always be called with the ochi-lock held to
- * ensure proper generation handling and locking around packet queue
- * manipulation. */
-static void
-at_context_setup_packet(struct at_context *ctx, struct list_head *list)
+/* This function apppends a packet to the DMA queue for transmission.
+ * Must always be called with the ochi-lock held to ensure proper
+ * generation handling and locking around packet queue manipulation. */
+static int
+at_context_queue_packet(struct context *ctx, struct fw_packet *packet)
 {
-   struct fw_packet *packet;
struct fw_ohci *ohci = ctx-ohci;
+   dma_addr_t d_bus, payload_bus;
+   struct driver_data *driver_data;
+   struct descriptor *d, *last;
+   __le32 *header;
int z, tcode;
+   u32 reg;
 
-   packet = fw_packet(ctx-list.next);
-
-   memset(ctx-d, 0, sizeof ctx-d);
-   if (packet-payload_length  0) {
-   packet-payload_bus = dma_map_single(ohci-card.device,
-packet-payload,
-packet-payload_length,
-DMA_TO_DEVICE);
-   if (dma_mapping_error(packet-payload_bus)) {
-   complete_transmission(packet, RCODE_SEND_ERROR, list);
-   return;
-   }
-
-   ctx-d.more.control  =
-   cpu_to_le16(descriptor_output_more |
-   descriptor_key_immediate);
-   ctx-d.more.req_count= cpu_to_le16(packet-header_length);
-   ctx-d.more.res_count= 

firewire: Track pending transactions and cancel them on cdev release.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=28cf6a04c82857d562968dc3a8a89726e6ac3dcb
Commit: 28cf6a04c82857d562968dc3a8a89726e6ac3dcb
Parent: f319b6a02f12c3712eb64eee6a23584367cb3588
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:50 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:12 2007 +0100

firewire: Track pending transactions and cancel them on cdev release.

Without this, pending transactions will dereference freed memory
if they complete after the device file has been closed.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   23 ---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 2d84284..2946464 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -60,6 +60,7 @@ struct response {
struct event event;
struct fw_transaction transaction;
struct client *client;
+   struct list_head link;
struct fw_cdev_event_response response;
 };
 
@@ -74,6 +75,7 @@ struct client {
spinlock_t lock;
struct list_head handler_list;
struct list_head request_list;
+   struct list_head transaction_list;
u32 request_serial;
struct list_head event_list;
wait_queue_head_t wait;
@@ -115,6 +117,7 @@ static int fw_device_op_open(struct inode *inode, struct 
file *file)
INIT_LIST_HEAD(client-event_list);
INIT_LIST_HEAD(client-handler_list);
INIT_LIST_HEAD(client-request_list);
+   INIT_LIST_HEAD(client-transaction_list);
spin_lock_init(client-lock);
init_waitqueue_head(client-wait);
 
@@ -299,6 +302,7 @@ complete_transaction(struct fw_card *card, int rcode,
 {
struct response *response = data;
struct client *client = response-client;
+   unsigned long flags;
 
if (length  response-response.length)
response-response.length = length;
@@ -306,6 +310,10 @@ complete_transaction(struct fw_card *card, int rcode,
memcpy(response-response.data, payload,
   response-response.length);
 
+   spin_lock_irqsave(client-lock, flags);
+   list_del(response-link);
+   spin_unlock_irqrestore(client-lock, flags);
+
response-response.type   = FW_CDEV_EVENT_RESPONSE;
response-response.rcode  = rcode;
queue_event(client, response-event,
@@ -318,6 +326,7 @@ static ssize_t ioctl_send_request(struct client *client, 
void __user *arg)
struct fw_device *device = client-device;
struct fw_cdev_send_request request;
struct response *response;
+   unsigned long flags;
 
if (copy_from_user(request, arg, sizeof request))
return -EFAULT;
@@ -341,6 +350,10 @@ static ssize_t ioctl_send_request(struct client *client, 
void __user *arg)
return -EFAULT;
}
 
+   spin_lock_irqsave(client-lock, flags);
+   list_add_tail(response-link, client-transaction_list);
+   spin_unlock_irqrestore(client-lock, flags);
+
fw_send_request(device-card, response-transaction,
request.tcode  0x1f,
device-node-node_id,
@@ -752,6 +765,7 @@ static int fw_device_op_release(struct inode *inode, struct 
file *file)
struct address_handler *h, *next_h;
struct request *r, *next_r;
struct event *e, *next_e;
+   struct response *t, *next_t;
unsigned long flags;
 
if (client-buffer.pages)
@@ -771,9 +785,12 @@ static int fw_device_op_release(struct inode *inode, 
struct file *file)
kfree(r);
}
 
-   /* TODO: wait for all transactions to finish so
-* complete_transaction doesn't try to queue up responses
-* after we free client. */
+   list_for_each_entry_safe(t, next_t, client-transaction_list, link)
+   fw_cancel_transaction(client-device-card, t-transaction);
+
+   /* FIXME: We should wait for the async tasklets to stop
+* running before freeing the memory. */
+
list_for_each_entry_safe(e, next_e, client-event_list, link)
kfree(e);
 
-
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


firewire: Fix order of arguments for iso context creation.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8fbdbb3683770f765afb4f8140a8d7898feeb94c
Commit: 8fbdbb3683770f765afb4f8140a8d7898feeb94c
Parent: 28cf6a04c82857d562968dc3a8a89726e6ac3dcb
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:51 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:12 2007 +0100

firewire: Fix order of arguments for iso context creation.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 2946464..5437ad2 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -558,9 +558,9 @@ static int ioctl_create_iso_context(struct client *client, 
void __user *arg)
request.type,
request.channel,
request.speed,
-   request.header_size,
request.sync,
request.tags,
+   request.header_size,
iso_callback, client);
if (IS_ERR(client-iso_context))
return PTR_ERR(client-iso_context);
-
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


firewire: Add generation field to send_request ioctl struct.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=97e352753820c62fca6d46723e0591e1ff6a3b22
Commit: 97e352753820c62fca6d46723e0591e1ff6a3b22
Parent: e7533505fed97379b03538cf0ff2df0dc853298f
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:53 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:13 2007 +0100

firewire: Add generation field to send_request ioctl struct.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |2 +-
 drivers/firewire/fw-device-cdev.h |1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 68428d0..7b0efcc 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -359,7 +359,7 @@ static ssize_t ioctl_send_request(struct client *client, 
void __user *arg)
fw_send_request(device-card, response-transaction,
request.tcode  0x1f,
device-node-node_id,
-   device-card-generation,
+   request.generation,
device-node-max_speed,
request.offset,
response-response.data, request.length,
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index 0cc4b08..f1c4b74 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -151,6 +151,7 @@ struct fw_cdev_send_request {
__u64 offset;
__u64 closure;
__u64 data;
+   __u32 generation;
 };
 
 struct fw_cdev_send_response {
-
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


firewire: Add card index field to get_info cdev ioctl struct.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7533505fed97379b03538cf0ff2df0dc853298f
Commit: e7533505fed97379b03538cf0ff2df0dc853298f
Parent: 8fbdbb3683770f765afb4f8140a8d7898feeb94c
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:52 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:13 2007 +0100

firewire: Add card index field to get_info cdev ioctl struct.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |2 ++
 drivers/firewire/fw-device-cdev.h |3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 5437ad2..68428d0 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -290,6 +290,8 @@ static int ioctl_get_info(struct client *client, void 
__user *arg)
return -EFAULT;
}
 
+   get_info.card = client-device-card-index;
+
if (copy_to_user(arg, get_info, sizeof get_info))
return -EFAULT;
 
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index c6ea6f3..0cc4b08 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -140,6 +140,9 @@ struct fw_cdev_get_info {
/* If non-zero, a fw_cdev_event_bus_reset struct will be
 * copied here with the current state of the bus. */
__u64 bus_reset;
+
+   /* The index of the card this devices belongs to. */
+   __u32 card;
 };
 
 struct fw_cdev_send_request {
-
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


firewire: Export juju specific rcodes to user space.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c6e647da00883ec2208171d51537f23498dd669
Commit: 7c6e647da00883ec2208171d51537f23498dd669
Parent: 97e352753820c62fca6d46723e0591e1ff6a3b22
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:54 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:14 2007 +0100

firewire: Export juju specific rcodes to user space.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index f1c4b74..440fb74 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -51,6 +51,12 @@
 #define RCODE_TYPE_ERROR   0x6
 #define RCODE_ADDRESS_ERROR0x7
 
+#define RCODE_SEND_ERROR   0x10
+#define RCODE_CANCELLED0x11
+#define RCODE_BUSY 0x12
+#define RCODE_GENERATION   0x13
+#define RCODE_NO_ACK   0x14
+
 #define SCODE_100  0x0
 #define SCODE_200  0x1
 #define SCODE_400  0x2
-
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


firewire: Implement CSR cycle time and bus time registers.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d60d7f1d5ce83d1be8d79256f711d6a645b7a2fa
Commit: d60d7f1d5ce83d1be8d79256f711d6a645b7a2fa
Parent: 473d28c730e2de888c24b226cfe4183868eacde2
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 7 12:12:56 2007 -0500
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Fri Mar 9 22:03:15 2007 +0100

firewire: Implement CSR cycle time and bus time registers.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-ohci.c|   26 ++-
 drivers/firewire/fw-transaction.c |   61 -
 drivers/firewire/fw-transaction.h |2 +
 3 files changed, 86 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index a9e1346..6f9895d 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -139,6 +139,7 @@ struct fw_ohci {
int node_id;
int generation;
int request_generation;
+   u32 bus_seconds;
 
/* Spinlock for accessing fw_ohci data.  Never call out of
 * this driver with this lock held. */
@@ -959,7 +960,7 @@ static void bus_reset_tasklet(unsigned long data)
 static irqreturn_t irq_handler(int irq, void *data)
 {
struct fw_ohci *ohci = data;
-   u32 event, iso_event;
+   u32 event, iso_event, cycle_time;
int i;
 
event = reg_read(ohci, OHCI1394_IntEventClear);
@@ -1002,6 +1003,12 @@ static irqreturn_t irq_handler(int irq, void *data)
iso_event = ~(1  i);
}
 
+   if (event  OHCI1394_cycle64Seconds) {
+   cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer);
+   if ((cycle_time  0x8000) == 0)
+   ohci-bus_seconds++;
+   }
+
return IRQ_HANDLED;
 }
 
@@ -1213,6 +1220,19 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, 
int generation)
return retval;
 }
 
+static u64
+ohci_get_bus_time(struct fw_card *card)
+{
+   struct fw_ohci *ohci = fw_ohci(card);
+   u32 cycle_time;
+   u64 bus_time;
+
+   cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer);
+   bus_time = ((u64) ohci-bus_seconds  32) | cycle_time;
+
+   return bus_time;
+}
+
 static int handle_ir_bufferfill_packet(struct context *context,
   struct descriptor *d,
   struct descriptor *last)
@@ -1686,6 +1706,7 @@ static const struct fw_card_driver ohci_driver = {
.send_response  = ohci_send_response,
.cancel_packet  = ohci_cancel_packet,
.enable_phys_dma= ohci_enable_phys_dma,
+   .get_bus_time   = ohci_get_bus_time,
 
.allocate_iso_context   = ohci_allocate_iso_context,
.free_iso_context   = ohci_free_iso_context,
@@ -1862,7 +1883,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id 
*ent)
  OHCI1394_RQPkt | OHCI1394_RSPkt |
  OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
  OHCI1394_isochRx | OHCI1394_isochTx |
- OHCI1394_masterIntEnable);
+ OHCI1394_masterIntEnable |
+ OHCI1394_cycle64Seconds);
 
bus_options = reg_read(ohci, OHCI1394_BusOptions);
max_receive = (bus_options  12)  0xf;
diff --git a/drivers/firewire/fw-transaction.c 
b/drivers/firewire/fw-transaction.c
index 38b286e..d36dd51 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -752,10 +752,65 @@ handle_topology_map(struct fw_card *card, struct 
fw_request *request,
 }
 
 static struct fw_address_handler topology_map = {
-   .length = 0x400,
+   .length = 0x200,
.address_callback   = handle_topology_map,
 };
 
+const struct fw_address_region registers_region =
+   { .start = 0xf000ull, .end = 0xf400ull, };
+
+static void
+handle_registers(struct fw_card *card, struct fw_request *request,
+int tcode, int destination, int source,
+int generation, int speed,
+unsigned long long offset,
+void *payload, size_t length, void *callback_data)
+{
+   int reg = offset - CSR_REGISTER_BASE;
+   unsigned long long bus_time;
+   __be32 *data = payload;
+
+   switch (reg) {
+   case CSR_CYCLE_TIME:
+   case CSR_BUS_TIME:
+   if (!TCODE_IS_READ_REQUEST(tcode) || length != 4) {
+   fw_send_response(card, request, RCODE_TYPE_ERROR);
+   break;
+   }
+
+   bus_time = card-driver-get_bus_time(card);
+   if (reg == CSR_CYCLE_TIME)
+   *data = cpu_to_be32(bus_time);
+   else
+   *data = 

firewire: Fix dualbuffer iso receive mode and drop buffer fill mode.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c70dc788fd8d3870b41231b6a53a64afb98cfd13
Commit: c70dc788fd8d3870b41231b6a53a64afb98cfd13
Parent: d60d7f1d5ce83d1be8d79256f711d6a645b7a2fa
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 14 17:34:53 2007 -0400
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Thu Mar 15 18:21:36 2007 +0100

firewire: Fix dualbuffer iso receive mode and drop buffer fill mode.

The dualbuffer DMA setup did not account for the iso trailer word
and thus didn't  work correctly.  With this fixed we can drop the
dual buffer fallback mode.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   28 +--
 drivers/firewire/fw-ohci.c|  160 +++--
 2 files changed, 66 insertions(+), 122 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 7b0efcc..be6bfcf 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -541,20 +541,32 @@ static int ioctl_create_iso_context(struct client 
*client, void __user *arg)
if (copy_from_user(request, arg, sizeof request))
return -EFAULT;
 
-   if (request.type  FW_ISO_CONTEXT_RECEIVE)
-   return -EINVAL;
-
if (request.channel  63)
return -EINVAL;
 
-   if (request.sync  15)
-   return -EINVAL;
+   switch (request.type) {
+   case FW_ISO_CONTEXT_RECEIVE:
+   if (request.sync  15)
+   return -EINVAL;
 
-   if (request.tags == 0 || request.tags  15)
-   return -EINVAL;
+   if (request.tags == 0 || request.tags  15)
+   return -EINVAL;
+
+   if (request.header_size  4 || (request.header_size  3))
+   return -EINVAL;
 
-   if (request.speed  SCODE_3200)
+   break;
+
+   case FW_ISO_CONTEXT_TRANSMIT:
+   if (request.speed  SCODE_3200)
+   return -EINVAL;
+
+   break;
+
+   default:
return -EINVAL;
+   }
+
 
client-iso_context = fw_iso_context_create(client-device-card,
request.type,
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 6f9895d..17e13d0 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1233,24 +1233,6 @@ ohci_get_bus_time(struct fw_card *card)
return bus_time;
 }
 
-static int handle_ir_bufferfill_packet(struct context *context,
-  struct descriptor *d,
-  struct descriptor *last)
-{
-   struct iso_context *ctx =
-   container_of(context, struct iso_context, context);
-
-   if (d-res_count  0)
-   return 0;
-
-   if (le16_to_cpu(last-control)  descriptor_irq_always)
-   ctx-base.callback(ctx-base,
-  le16_to_cpu(last-res_count),
-  0, NULL, ctx-base.callback_data);
-
-   return 1;
-}
-
 static int handle_ir_dualbuffer_packet(struct context *context,
   struct descriptor *d,
   struct descriptor *last)
@@ -1258,19 +1240,33 @@ static int handle_ir_dualbuffer_packet(struct context 
*context,
struct iso_context *ctx =
container_of(context, struct iso_context, context);
struct db_descriptor *db = (struct db_descriptor *) d;
+   __le32 *ir_header;
size_t header_length;
+   void *p, *end;
+   int i;
 
if (db-first_res_count  0  db-second_res_count  0)
/* This descriptor isn't done yet, stop iteration. */
return 0;
 
-   header_length = db-first_req_count - db-first_res_count;
-   if (ctx-header_length + header_length = PAGE_SIZE)
-   memcpy(ctx-header + ctx-header_length, db + 1, header_length);
-   ctx-header_length += header_length;
+   header_length = le16_to_cpu(db-first_req_count) -
+   le16_to_cpu(db-first_res_count);
+
+   i = ctx-header_length;
+   p = db + 1;
+   end = p + header_length;
+   while (p  end  i + ctx-base.header_size = PAGE_SIZE) {
+   memcpy(ctx-header + i, p + 4, ctx-base.header_size);
+   i += ctx-base.header_size;
+   p += ctx-base.header_size + 4;
+   }
+
+   ctx-header_length = i;
 
if (le16_to_cpu(db-control)  descriptor_irq_always) {
-   ctx-base.callback(ctx-base, 0,
+   ir_header = (__le32 *) (db + 1);
+   ctx-base.callback(ctx-base,
+  le32_to_cpu(ir_header[0])  0x,

firewire: Move sync and tag parameters to start_iso ioctl.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eb0306eac0aad0b7da18d8fbfb777f155b2c010d
Commit: eb0306eac0aad0b7da18d8fbfb777f155b2c010d
Parent: c70dc788fd8d3870b41231b6a53a64afb98cfd13
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 14 17:34:54 2007 -0400
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Thu Mar 15 18:21:36 2007 +0100

firewire: Move sync and tag parameters to start_iso ioctl.

Setting these at create_context time or start_iso time doesn't matter
much, but raw1394 sets them at start_iso time so that will be easier to
emulate this way.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   20 ++--
 drivers/firewire/fw-device-cdev.h |4 ++--
 drivers/firewire/fw-iso.c |   12 
 drivers/firewire/fw-ohci.c|9 -
 drivers/firewire/fw-transaction.h |   13 ++---
 5 files changed, 26 insertions(+), 32 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index be6bfcf..175ea04 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -546,12 +546,6 @@ static int ioctl_create_iso_context(struct client *client, 
void __user *arg)
 
switch (request.type) {
case FW_ISO_CONTEXT_RECEIVE:
-   if (request.sync  15)
-   return -EINVAL;
-
-   if (request.tags == 0 || request.tags  15)
-   return -EINVAL;
-
if (request.header_size  4 || (request.header_size  3))
return -EINVAL;
 
@@ -567,13 +561,10 @@ static int ioctl_create_iso_context(struct client 
*client, void __user *arg)
return -EINVAL;
}
 
-
client-iso_context = fw_iso_context_create(client-device-card,
request.type,
request.channel,
request.speed,
-   request.sync,
-   request.tags,
request.header_size,
iso_callback, client);
if (IS_ERR(client-iso_context))
@@ -678,7 +669,16 @@ static int ioctl_start_iso(struct client *client, void 
__user *arg)
if (copy_from_user(request, arg, sizeof request))
return -EFAULT;
 
-   return fw_iso_context_start(client-iso_context, request.cycle);
+   if (client-iso_context-type == FW_ISO_CONTEXT_RECEIVE) {
+   if (request.tags == 0 || request.tags  15)
+   return -EINVAL;
+
+   if (request.sync  15)
+   return -EINVAL;
+   }
+
+   return fw_iso_context_start(client-iso_context,
+   request.cycle, request.sync, request.tags);
 }
 
 static int ioctl_stop_iso(struct client *client, void __user *arg)
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index 440fb74..3437a36 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -194,8 +194,6 @@ struct fw_cdev_create_iso_context {
__u32 header_size;
__u32 channel;
__u32 speed;
-   __u32 sync;
-   __u32 tags;
 };
 
 struct fw_cdev_iso_packet {
@@ -216,6 +214,8 @@ struct fw_cdev_queue_iso {
 
 struct fw_cdev_start_iso {
__s32 cycle;
+   __u32 sync;
+   __u32 tags;
 };
 
 #endif /* __fw_cdev_h */
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index 3eaf880..2ce26db 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -107,14 +107,12 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
 
 struct fw_iso_context *
 fw_iso_context_create(struct fw_card *card, int type,
- int channel, int speed,
- int sync, int tags, size_t header_size,
+ int channel, int speed, size_t header_size,
  fw_iso_callback_t callback, void *callback_data)
 {
struct fw_iso_context *ctx;
 
-   ctx = card-driver-allocate_iso_context(card, type,
-sync, tags, header_size);
+   ctx = card-driver-allocate_iso_context(card, type, header_size);
if (IS_ERR(ctx))
return ctx;
 
@@ -122,8 +120,6 @@ fw_iso_context_create(struct fw_card *card, int type,
ctx-type = type;
ctx-channel = channel;
ctx-speed = speed;
-   ctx-sync = sync;
-   ctx-tags = tags;
ctx-header_size = header_size;
ctx-callback = callback;
ctx-callback_data = callback_data;
@@ -141,9 +137,9 @@ 

firewire: Implement deallocation of address ranges.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9472316b6eab3500ded544f6e86700c33541ef4e
Commit: 9472316b6eab3500ded544f6e86700c33541ef4e
Parent: eb0306eac0aad0b7da18d8fbfb777f155b2c010d
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 14 17:34:55 2007 -0400
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Thu Mar 15 18:21:36 2007 +0100

firewire: Implement deallocation of address ranges.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |   28 
 drivers/firewire/fw-device-cdev.h |   17 +++--
 2 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index 175ea04..ebf0d10 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -467,6 +467,32 @@ static int ioctl_allocate(struct client *client, void 
__user *arg)
return 0;
 }
 
+static int ioctl_deallocate(struct client *client, void __user *arg)
+{
+   struct fw_cdev_deallocate request;
+   struct address_handler *handler;
+   unsigned long flags;
+
+   if (copy_from_user(request, arg, sizeof request))
+   return -EFAULT;
+
+   spin_lock_irqsave(client-lock, flags);
+   list_for_each_entry(handler, client-handler_list, link) {
+   if (handler-handler.offset == request.offset) {
+   list_del(handler-link);
+   break;
+   }
+   }
+   spin_unlock_irqrestore(client-lock, flags);
+
+   if (handler-link == client-handler_list)
+   return -EINVAL;
+
+   fw_core_remove_address_handler(handler-handler);
+
+   return 0;
+}
+
 static int ioctl_send_response(struct client *client, void __user *arg)
 {
struct fw_cdev_send_response request;
@@ -696,6 +722,8 @@ dispatch_ioctl(struct client *client, unsigned int cmd, 
void __user *arg)
return ioctl_send_request(client, arg);
case FW_CDEV_IOC_ALLOCATE:
return ioctl_allocate(client, arg);
+   case FW_CDEV_IOC_DEALLOCATE:
+   return ioctl_deallocate(client, arg);
case FW_CDEV_IOC_SEND_RESPONSE:
return ioctl_send_response(client, arg);
case FW_CDEV_IOC_INITIATE_BUS_RESET:
diff --git a/drivers/firewire/fw-device-cdev.h 
b/drivers/firewire/fw-device-cdev.h
index 3437a36..10b8322 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -113,12 +113,13 @@ struct fw_cdev_event_iso_interrupt {
 #define FW_CDEV_IOC_GET_INFO   _IO('#', 0x00)
 #define FW_CDEV_IOC_SEND_REQUEST   _IO('#', 0x01)
 #define FW_CDEV_IOC_ALLOCATE   _IO('#', 0x02)
-#define FW_CDEV_IOC_SEND_RESPONSE  _IO('#', 0x03)
-#define FW_CDEV_IOC_INITIATE_BUS_RESET _IO('#', 0x04)
-#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IO('#', 0x05)
-#define FW_CDEV_IOC_QUEUE_ISO  _IO('#', 0x06)
-#define FW_CDEV_IOC_START_ISO  _IO('#', 0x07)
-#define FW_CDEV_IOC_STOP_ISO   _IO('#', 0x08)
+#define FW_CDEV_IOC_DEALLOCATE _IO('#', 0x03)
+#define FW_CDEV_IOC_SEND_RESPONSE  _IO('#', 0x04)
+#define FW_CDEV_IOC_INITIATE_BUS_RESET _IO('#', 0x05)
+#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IO('#', 0x06)
+#define FW_CDEV_IOC_QUEUE_ISO  _IO('#', 0x07)
+#define FW_CDEV_IOC_START_ISO  _IO('#', 0x08)
+#define FW_CDEV_IOC_STOP_ISO   _IO('#', 0x09)
 
 /* FW_CDEV_VERSION History
  *
@@ -173,6 +174,10 @@ struct fw_cdev_allocate {
__u32 length;
 };
 
+struct fw_cdev_deallocate {
+   __u64 offset;
+};
+
 #define FW_CDEV_LONG_RESET 0
 #define FW_CDEV_SHORT_RESET1
 
-
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


firewire: Zero out sd-scsi_host if we fail to register with the SCSI stack.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=693b9021767750cbac2c92e918d25ddadbab7c61
Commit: 693b9021767750cbac2c92e918d25ddadbab7c61
Parent: 9472316b6eab3500ded544f6e86700c33541ef4e
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 14 17:34:56 2007 -0400
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Thu Mar 15 18:21:36 2007 +0100

firewire: Zero out sd-scsi_host if we fail to register with the SCSI stack.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 2e5479b..0c87724 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -1099,6 +1099,7 @@ static int add_scsi_devices(struct fw_unit *unit)
if (retval  0) {
fw_error(failed to add scsi host\n);
scsi_host_put(sd-scsi_host);
+   sd-scsi_host = NULL;
return retval;
}
 
@@ -1109,6 +1110,7 @@ static int add_scsi_devices(struct fw_unit *unit)
fw_error(failed to add scsi device\n);
scsi_remove_host(sd-scsi_host);
scsi_host_put(sd-scsi_host);
+   sd-scsi_host = NULL;
return retval;
}
 
-
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


firewire: Free pending transactions on cdev release.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7e35f7f318168f1b735abc87754108c06955f50d
Commit: 7e35f7f318168f1b735abc87754108c06955f50d
Parent: 693b9021767750cbac2c92e918d25ddadbab7c61
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 14 17:34:57 2007 -0400
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Thu Mar 15 18:21:36 2007 +0100

firewire: Free pending transactions on cdev release.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-device-cdev.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/fw-device-cdev.c 
b/drivers/firewire/fw-device-cdev.c
index ebf0d10..b1b7edb 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -827,8 +827,10 @@ static int fw_device_op_release(struct inode *inode, 
struct file *file)
kfree(r);
}
 
-   list_for_each_entry_safe(t, next_t, client-transaction_list, link)
+   list_for_each_entry_safe(t, next_t, client-transaction_list, link) {
fw_cancel_transaction(client-device-card, t-transaction);
+   kfree(t);
+   }
 
/* FIXME: We should wait for the async tasklets to stop
 * running before freeing the memory. */
-
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


firewire: Add ref-counting for sbp2_device and hold a ref while we have work scheduled.

2007-05-10 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3d6e151142c6d22abdf1e3e7bde0f6d828df945
Commit: b3d6e151142c6d22abdf1e3e7bde0f6d828df945
Parent: 7e35f7f318168f1b735abc87754108c06955f50d
Author: Kristian Høgsberg [EMAIL PROTECTED]
AuthorDate: Wed Mar 14 17:34:58 2007 -0400
Committer:  Stefan Richter [EMAIL PROTECTED]
CommitDate: Thu Mar 15 18:27:40 2007 +0100

firewire: Add ref-counting for sbp2_device and hold a ref while we have 
work scheduled.

Signed-off-by: Kristian Høgsberg [EMAIL PROTECTED]
Signed-off-by: Stefan Richter [EMAIL PROTECTED]
---
 drivers/firewire/fw-sbp2.c |   42 ++
 1 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 0c87724..d7940db 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -51,6 +51,7 @@ typedef void (*scsi_done_fn_t) (struct scsi_cmnd *);
 static const char sbp2_driver_name[] = sbp2;
 
 struct sbp2_device {
+   struct kref kref;
struct fw_unit *unit;
struct fw_address_handler address_handler;
struct list_head orb_list;
@@ -513,6 +514,22 @@ static int add_scsi_devices(struct fw_unit *unit);
 static void remove_scsi_devices(struct fw_unit *unit);
 static void sbp2_reconnect(struct work_struct *work);
 
+static void
+release_sbp2_device(struct kref *kref)
+{
+   struct sbp2_device *sd = container_of(kref, struct sbp2_device, kref);
+
+   sbp2_send_management_orb(sd-unit, sd-node_id, sd-generation,
+SBP2_LOGOUT_REQUEST, sd-login_id, NULL);
+
+   remove_scsi_devices(sd-unit);
+
+   fw_core_remove_address_handler(sd-address_handler);
+   fw_notify(removed sbp2 unit %s\n, sd-unit-device.bus_id);
+   put_device(sd-unit-device);
+   kfree(sd);
+}
+
 static void sbp2_login(struct work_struct *work)
 {
struct sbp2_device *sd =
@@ -537,6 +554,7 @@ static void sbp2_login(struct work_struct *work)
fw_error(failed to login to %s\n,
 unit-device.bus_id);
remove_scsi_devices(unit);
+   kref_put(sd-kref, release_sbp2_device);
}
return;
}
@@ -577,6 +595,7 @@ static void sbp2_login(struct work_struct *work)
 * retry login on bus reset. */
PREPARE_DELAYED_WORK(sd-work, sbp2_login);
}
+   kref_put(sd-kref, release_sbp2_device);
 }
 
 static int sbp2_probe(struct device *dev)
@@ -595,6 +614,7 @@ static int sbp2_probe(struct device *dev)
unit-device.driver_data = sd;
sd-unit = unit;
INIT_LIST_HEAD(sd-orb_list);
+   kref_init(sd-kref);
 
sd-address_handler.length = 0x100;
sd-address_handler.address_callback = sbp2_status_write;
@@ -650,10 +670,14 @@ static int sbp2_probe(struct device *dev)
  unit-device.bus_id,
  sd-workarounds, firmware_revision, model);
 
+   get_device(unit-device);
+
/* We schedule work to do the login so we can easily
-* reschedule retries. */
+* reschedule retries. Always get the ref before scheduling
+* work.*/
INIT_DELAYED_WORK(sd-work, sbp2_login);
-   schedule_delayed_work(sd-work, 0);
+   if (schedule_delayed_work(sd-work, 0))
+   kref_get(sd-kref);
 
return 0;
 }
@@ -663,15 +687,7 @@ static int sbp2_remove(struct device *dev)
struct fw_unit *unit = fw_unit(dev);
struct sbp2_device *sd = unit-device.driver_data;
 
-   sbp2_send_management_orb(unit, sd-node_id, sd-generation,
-SBP2_LOGOUT_REQUEST, sd-login_id, NULL);
-
-   remove_scsi_devices(unit);
-
-   fw_core_remove_address_handler(sd-address_handler);
-   kfree(sd);
-
-   fw_notify(removed sbp2 unit %s\n, dev-bus_id);
+   kref_put(sd-kref, release_sbp2_device);
 
return 0;
 }
@@ -710,6 +726,7 @@ static void sbp2_reconnect(struct work_struct *work)
  unit-device.bus_id, sd-retries);
sbp2_agent_reset(unit);
sbp2_cancel_orbs(unit);
+   kref_put(sd-kref, release_sbp2_device);
 }
 
 static void sbp2_update(struct fw_unit *unit)
@@ -719,7 +736,8 @@ static void sbp2_update(struct fw_unit *unit)
 
sd-retries = 0;
fw_device_enable_phys_dma(device);
-   schedule_delayed_work(sd-work, 0);
+   if (schedule_delayed_work(sd-work, 0))
+   kref_get(sd-kref);
 }
 
 #define SBP2_UNIT_SPEC_ID_ENTRY0x609e
-
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   >