Skip to contentSkip to conversation

What's in linux1394-2.6.git?

DISCUSSION Stefan Richter 1 participant 3 messages Jan 17, 2008 Firewire

lore
Share & tools
lore
#0 lore raw

Not much, and all of it is meant to be merged post 2.6.24. The most notable updates are fixes to firewire-ohci which fundamentally improve isochronous reception via libdc1394 v2.

After these fixes, the most notable remaining issues with drivers/firewire are:
- difficulties to detect SBP-2 (storage) devices on some hosts (need to collect debug data for this ASAP),
- DV reception broken on OHCI 1.0 variants of VIA VT630x,
- IP over 1394 still not implemented/ ported.

So, distributors of kernel packages, be advised that the firewire drivers are still not as functional as the classic ieee1394 driver stack. As always, more details on this are captured at wiki.linux1394.org.

I will follow up to this post with two combo patches, reflecting the merge queue for drivers/ieee1394 and drivers/firewire respectively, because several of the patches have not been seen on lkml yet, only on linux1394-devel. All of the patches have been in -mm though (except for a refresh of two small patches which happened after -rc8-mm1).

Shortlog and diffstat:

David Moore (3):
firewire: fw-ohci: Fix for dualbuffer three-or-more buffers
firewire: fw-ohci: Bug fixes for packet-per-buffer support
firewire: fw-ohci: Dynamically allocate buffers for DMA descriptors

Jay Fenlason (1):
firewire: fw-sbp2: quiet logout errors on device removal

Joe Perches (1):
ieee1394: Add missing "space"

Nick Piggin (1):

      ieee1394: nopage

Rabin Vincent (1):
firewire: Fix extraction of source node id

Stefan Richter (11):
ieee1394: sbp2: prepare for s/g chaining
ieee1394: sbp2: s/g list access cosmetics
ieee1394: small cleanup after "nopage"
ieee1394: remove unused code
ieee1394: sbp2: raise default transfer size limit
ieee1394: ohci1394: don't schedule IT tasklets on IR events
firewire: fw-sbp2: refactor workq and kref handling
firewire: fw-sbp2: prepare for s/g chaining
firewire: fw-sbp2: remove unused misleading macro
firewire: fw-ohci: CycleTooLong interrupt management firewire vs. ieee1394: clarify MAINTAINERS

 MAINTAINERS                              |    4 +-
 drivers/firewire/fw-ohci.c               |  390 +++++++++++++---------
 drivers/firewire/fw-sbp2.c               |   84 +++--
 drivers/firewire/fw-transaction.c        |    2 +-
 drivers/ieee1394/dma.c                   |   39 +--
 drivers/ieee1394/ieee1394_transactions.c |   68 ----
 drivers/ieee1394/ohci1394.c              |   12 +-
 drivers/ieee1394/raw1394.c               |    4 +-
 drivers/ieee1394/sbp2.c                  |   52 ++--
 drivers/ieee1394/sbp2.h                  |    1 -
 10 files changed, 340 insertions(+), 316 deletions(-)
Signature · 3 lines
Stefan Richter
-=====-==--- ---= =---=
http://arcgraph.de/sr/
#1 lore raw

What's in linux1394-2.6.git? - drivers/ieee1394 queue

commit 95d0449d39ec13c88b46e7f6d7f7e8862c186fbf

Author: Stefan Richter <[email protected]>
Date:   Sun Dec 16 20:53:13 2007 +0100

ieee1394: ohci1394: don't schedule IT tasklets on IR events

Bug noted by Pieter Palmers: Isochronous transmit tasklets were scheduled on isochronous receive events, in addition to the proper isochronous receive tasklets.

http://marc.info/?l=linux1394-devel&m=119783196222802

drivers/ieee1394/ohci1394.c +8 -4
index 372c5c1..969de2a 100644
@@ -2126,10 +2126,14 @@ static void ohci_schedule_iso_tasklets(struct ti_ohci *ohci,
 	list_for_each_entry(t, &ohci->iso_tasklet_list, link) {
 		mask = 1 << t->context;
 
-		if (t->type == OHCI_ISO_TRANSMIT && tx_event & mask)
-			tasklet_schedule(&t->tasklet);
-		else if (rx_event & mask)
-			tasklet_schedule(&t->tasklet);
+		if (t->type == OHCI_ISO_TRANSMIT) {
+			if (tx_event & mask)
+				tasklet_schedule(&t->tasklet);
+		} else {
+			/* OHCI_ISO_RECEIVE or OHCI_ISO_MULTICHANNEL_RECEIVE */
+			if (rx_event & mask)
+				tasklet_schedule(&t->tasklet);
+		}
 	}
 
 	spin_unlock_irqrestore(&ohci->iso_tasklet_list_lock, flags);

commit 35331124d1af257c546fa550dc00e111ed65790a

Author: Stefan Richter <[email protected]>
Date:   Sun Dec 16 17:31:26 2007 +0100

ieee1394: sbp2: raise default transfer size limit

This patch speeds up sbp2 a little bit --- but more importantly, it brings the behavior of sbp2 and fw-sbp2 closer to each other. Like fw-sbp2, sbp2 now does not limit the size of single transfers to 255 sectors anymore, unless told so by a blacklist flag or by module load parameters.

Only very old bridge chips have been known to need the 255 sectors limit, and we have got one such chip in our hardwired blacklist. There certainly is a danger that more bridges need that limit; but I prefer to have this issue present in both fw-sbp2 and sbp2 rather than just one of them.

An OXUF922 with 400GB 7200RPM disk on an S400 controller is sped up by this patch from 22.9 to 23.5 MB/s according to hdparm. The same effect could be achieved before by setting a higher max_sectors module parameter. On buses which use 1394b beta mode, sbp2 and fw-sbp2 will now achieve virtually the same bandwidth. Fw-sbp2 only remains faster on 1394a buses due to fw-core's gap count optimization.

drivers/ieee1394/sbp2.c +15 -11
index 2a7ceaf..273b6cb 100644
@@ -51,6 +51,7 @@
  * Grep for inline FIXME comments below.
  */
 
+#include <linux/blkdev.h>
 #include <linux/compiler.h>
 #include <linux/delay.h>
 #include <linux/device.h>
@@ -127,17 +128,21 @@ MODULE_PARM_DESC(serialize_io, "Serialize requests coming from SCSI drivers "
 		 "(default = Y, faster but buggy = N)");
 
 /*
- * Bump up max_sectors if you'd like to support very large sized
- * transfers. Please note that some older sbp2 bridge chips are broken for
- * transfers greater or equal to 128KB.  Default is a value of 255
- * sectors, or just under 128KB (at 512 byte sector size). I can note that
- * the Oxsemi sbp2 chipsets have no problems supporting very large
- * transfer sizes.
+ * Adjust max_sectors if you'd like to influence how many sectors each SCSI
+ * command can transfer at most. Please note that some older SBP-2 bridge
+ * chips are broken for transfers greater or equal to 128KB, therefore
+ * max_sectors used to be a safe 255 sectors for many years. We now have a
+ * default of 0 here which means that we let the SCSI stack choose a limit.
+ *
+ * The SBP2_WORKAROUND_128K_MAX_TRANS flag, if set either in the workarounds
+ * module parameter or in the sbp2_workarounds_table[], will override the
+ * value of max_sectors. We should use sbp2_workarounds_table[] to cover any
+ * bridge chip which becomes known to need the 255 sectors limit.
  */
-static int sbp2_max_sectors = SBP2_MAX_SECTORS;
+static int sbp2_max_sectors;
 module_param_named(max_sectors, sbp2_max_sectors, int, 0444);
 MODULE_PARM_DESC(max_sectors, "Change max sectors per I/O supported "
-		 "(default = " __stringify(SBP2_MAX_SECTORS) ")");
+		 "(default = 0 = use SCSI stack's default)");
 
 /*
  * Exclusive login to sbp2 device? In most cases, the sbp2 driver should
@@ -1979,6 +1984,8 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev)
 		sdev->skip_ms_page_8 = 1;
 	if (lu->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
 		sdev->fix_capacity = 1;
+	if (lu->workarounds & SBP2_WORKAROUND_128K_MAX_TRANS)
+		blk_queue_max_sectors(sdev->request_queue, 128 * 1024 / 512);
 	return 0;
 }
 
@@ -2085,9 +2092,6 @@ static int sbp2_module_init(void)
 		sbp2_shost_template.cmd_per_lun = 1;
 	}
 
-	if (sbp2_default_workarounds & SBP2_WORKAROUND_128K_MAX_TRANS &&
-	    (sbp2_max_sectors * 512) > (128 * 1024))
-		sbp2_max_sectors = 128 * 1024 / 512;
 	sbp2_shost_template.max_sectors = sbp2_max_sectors;
 
 	hpsb_register_highlevel(&sbp2_highlevel);
drivers/ieee1394/sbp2.h +0 -1
index 333a4bb..d2ecb0d 100644
@@ -222,7 +222,6 @@ struct sbp2_status_block {
  */
 
 #define SBP2_MAX_SG_ELEMENT_LENGTH		0xf000
-#define SBP2_MAX_SECTORS			255
 /* There is no real limitation of the queue depth (i.e. length of the linked
  * list of command ORBs) at the target. The chosen depth is merely an
  * implementation detail of the sbp2 driver. */

commit c0dc4201c05734c2af8b6667c361ee520290e341

Author: Stefan Richter <[email protected]>
Date:   Sat Dec 15 14:11:41 2007 +0100

ieee1394: remove unused code

The code has been in "#if 0 - #endif" since Linux 2.6.12.

drivers/ieee1394/ieee1394_transactions.c +0 -68

71 lines not on this page · raw message

commit 004a57d0931e171e5f70cd09d06ecbb266a94dd4

Author: Stefan Richter <[email protected]>
Date:   Sat Dec 15 14:04:42 2007 +0100

ieee1394: small cleanup after "nopage"

drivers/ieee1394/dma.c +4 -12
index ec024b5..73685e7 100644
@@ -231,28 +231,20 @@ void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset,
 
 #ifdef CONFIG_MMU
 
-/* fault() handler for mmap access */
-
 static int dma_region_pagefault(struct vm_area_struct *vma,
-					struct vm_fault *vmf)
+				struct vm_fault *vmf)
 {
-	unsigned long kernel_virt_addr;
-
 	struct dma_region *dma = (struct dma_region *)vma->vm_private_data;
 
 	if (!dma->kvirt)
-		goto error;
+		return VM_FAULT_SIGBUS;
 
 	if (vmf->pgoff >= dma->n_pages)
-		goto error;
+		return VM_FAULT_SIGBUS;
 
-	kernel_virt_addr = (unsigned long)dma->kvirt + (vmf->pgoff << PAGE_SHIFT);
-	vmf->page = vmalloc_to_page((void *)kernel_virt_addr);
+	vmf->page = vmalloc_to_page(dma->kvirt + (vmf->pgoff << PAGE_SHIFT));
 	get_page(vmf->page);
 	return 0;
-
-      error:
-	return VM_FAULT_SIGBUS;
 }
 
 static struct vm_operations_struct dma_region_vm_ops = {

commit d8f26b4379c5801be20ae073ef0ef8d3900a00c3

Author: Nick Piggin <[email protected]>
Date:   Wed Dec 5 18:15:53 2007 +1100

ieee1394: nopage

Convert ieee1394 from nopage to fault.
Remove redundant vma range checks (correct resource range check is retained).

drivers/ieee1394/dma.c +18 -23

62 lines not on this page · raw message

commit 09d0fee3e92fcf68335bbd24f9fd27ca299135a3

Author: Joe Perches <[email protected]>
Date:   Mon Nov 19 17:48:10 2007 -0800

ieee1394: Add missing "space"

drivers/ieee1394/raw1394.c +2 -2
index cadf047..37e7e10 100644
@@ -858,7 +858,7 @@ static int arm_read(struct hpsb_host *host, int nodeid, quadlet_t * buffer,
 	int found = 0, size = 0, rcode = -1;
 	struct arm_request_response *arm_req_resp = NULL;
 
-	DBGMSG("arm_read  called by node: %X"
+	DBGMSG("arm_read  called by node: %X "
 	       "addr: %4.4x %8.8x length: %Zu", nodeid,
 	       (u16) ((addr >> 32) & 0xFFFF), (u32) (addr & 0xFFFFFFFF),
 	       length);
@@ -1012,7 +1012,7 @@ static int arm_write(struct hpsb_host *host, int nodeid, int destid,
 	int found = 0, size = 0, rcode = -1, length_conflict = 0;
 	struct arm_request_response *arm_req_resp = NULL;
 
-	DBGMSG("arm_write called by node: %X"
+	DBGMSG("arm_write called by node: %X "
 	       "addr: %4.4x %8.8x length: %Zu", nodeid,
 	       (u16) ((addr >> 32) & 0xFFFF), (u32) (addr & 0xFFFFFFFF),
 	       length);

commit 9de7e0bcd8d6bf4ccdf1ecfafde5c435bd3f34d6

Author: Stefan Richter <[email protected]>
Date:   Sun Nov 4 14:59:24 2007 +0100

ieee1394: sbp2: s/g list access cosmetics

Replace sg->length by sg_dma_len(sg). Rename a variable for shorter line lengths and eliminate some superfluous local variables.

drivers/ieee1394/sbp2.c +12 -14
index 08923dc..2a7ceaf 100644
@@ -1451,7 +1451,7 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
 				     struct sbp2_fwhost_info *hi,
 				     struct sbp2_command_info *cmd,
 				     unsigned int scsi_use_sg,
-				     struct scatterlist *sgpnt,
+				     struct scatterlist *sg,
 				     u32 orb_direction,
 				     enum dma_data_direction dma_dir)
 {
@@ -1461,12 +1461,12 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
 
 	/* special case if only one element (and less than 64KB in size) */
 	if ((scsi_use_sg == 1) &&
-	    (sgpnt[0].length <= SBP2_MAX_SG_ELEMENT_LENGTH)) {
+	    (sg_dma_len(sg) <= SBP2_MAX_SG_ELEMENT_LENGTH)) {
 
-		cmd->dma_size = sgpnt[0].length;
+		cmd->dma_size = sg_dma_len(sg);
 		cmd->dma_type = CMD_DMA_PAGE;
 		cmd->cmd_dma = dma_map_page(hi->host->device.parent,
-					    sg_page(&sgpnt[0]), sgpnt[0].offset,
+					    sg_page(sg), sg->offset,
 					    cmd->dma_size, cmd->dma_dir);
 
 		orb->data_descriptor_lo = cmd->cmd_dma;
@@ -1477,11 +1477,11 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
 						&cmd->scatter_gather_element[0];
 		u32 sg_count, sg_len;
 		dma_addr_t sg_addr;
-		int i, count = dma_map_sg(hi->host->device.parent, sgpnt,
+		int i, count = dma_map_sg(hi->host->device.parent, sg,
 					  scsi_use_sg, dma_dir);
 
 		cmd->dma_size = scsi_use_sg;
-		cmd->sge_buffer = sgpnt;
+		cmd->sge_buffer = sg;
 
 		/* use page tables (s/g) */
 		orb->misc |= ORB_SET_PAGE_TABLE_PRESENT(0x1);
@@ -1489,9 +1489,9 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
 
 		/* loop through and fill out our SBP-2 page tables
 		 * (and split up anything too large) */
-		for (i = 0, sg_count = 0; i < count; i++, sgpnt = sg_next(sgpnt)) {
-			sg_len = sg_dma_len(sgpnt);
-			sg_addr = sg_dma_address(sgpnt);
+		for (i = 0, sg_count = 0; i < count; i++, sg = sg_next(sg)) {
+			sg_len = sg_dma_len(sg);
+			sg_addr = sg_dma_address(sg);
 			while (sg_len) {
 				sg_element[sg_count].segment_base_lo = sg_addr;
 				if (sg_len > SBP2_MAX_SG_ELEMENT_LENGTH) {
@@ -1521,11 +1521,10 @@ static void sbp2_create_command_orb(struct sbp2_lu *lu,
 				    unchar *scsi_cmd,
 				    unsigned int scsi_use_sg,
 				    unsigned int scsi_request_bufflen,
-				    void *scsi_request_buffer,
+				    struct scatterlist *sg,
 				    enum dma_data_direction dma_dir)
 {
 	struct sbp2_fwhost_info *hi = lu->hi;
-	struct scatterlist *sgpnt = (struct scatterlist *)scsi_request_buffer;
 	struct sbp2_command_orb *orb = &cmd->command_orb;
 	u32 orb_direction;
 
@@ -1560,7 +1559,7 @@ static void sbp2_create_command_orb(struct sbp2_lu *lu,
 		orb->data_descriptor_lo = 0x0;
 		orb->misc |= ORB_SET_DIRECTION(1);
 	} else
-		sbp2_prep_command_orb_sg(orb, hi, cmd, scsi_use_sg, sgpnt,
+		sbp2_prep_command_orb_sg(orb, hi, cmd, scsi_use_sg, sg,
 					 orb_direction, dma_dir);
 
 	sbp2util_cpu_to_be32_buffer(orb, sizeof(*orb));
@@ -1650,7 +1649,6 @@ static int sbp2_send_command(struct sbp2_lu *lu, struct scsi_cmnd *SCpnt,
 			     void (*done)(struct scsi_cmnd *))
 {
 	unchar *scsi_cmd = (unchar *)SCpnt->cmnd;
-	unsigned int request_bufflen = scsi_bufflen(SCpnt);
 	struct sbp2_command_info *cmd;
 
 	cmd = sbp2util_allocate_command_orb(lu, SCpnt, done);
@@ -1658,7 +1656,7 @@ static int sbp2_send_command(struct sbp2_lu *lu, struct scsi_cmnd *SCpnt,
 		return -EIO;
 
 	sbp2_create_command_orb(lu, cmd, scsi_cmd, scsi_sg_count(SCpnt),
-				request_bufflen, scsi_sglist(SCpnt),
+				scsi_bufflen(SCpnt), scsi_sglist(SCpnt),
 				SCpnt->sc_data_direction);
 	sbp2_link_orb_command(lu, cmd);
 

commit 3a498bf2fb8d411e5560b32aec532e74b4987b18

Author: Stefan Richter <[email protected]>
Date:   Tue Jan 15 21:11:28 2008 +0100

ieee1394: sbp2: prepare for s/g chaining

drivers/ieee1394/sbp2.c +1 -1
index b83d254..08923dc 100644
@@ -1489,7 +1489,7 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
 
 		/* loop through and fill out our SBP-2 page tables
 		 * (and split up anything too large) */
-		for (i = 0, sg_count = 0 ; i < count; i++, sgpnt++) {
+		for (i = 0, sg_count = 0; i < count; i++, sgpnt = sg_next(sgpnt)) {
 			sg_len = sg_dma_len(sgpnt);
 			sg_addr = sg_dma_address(sgpnt);
 			while (sg_len) {
Signature · 3 lines
Stefan Richter
-=====-==--- ---= =---=
http://arcgraph.de/sr/
#2 lore raw

What's in linux1394-2.6.git? - drivers/firewire queue

In reply to Stefan Richter

commit e1d65076dd7009a35a83b408e8095597a243c447

Author: Stefan Richter <[email protected]>
Date:   Sat Jan 12 12:32:44 2008 +0100

firewire vs. ieee1394: clarify MAINTAINERS

Maintainers like to receive less mail, and submitters like to have to Cc less recipients.

MAINTAINERS +2 -2
index f3d7256..974617f 100644
@@ -1573,7 +1573,7 @@ P:	Alexander Viro
 M:	[email protected]
 S:	Maintained
 
-FIREWIRE SUBSYSTEM
+FIREWIRE SUBSYSTEM (drivers/firewire, <linux/firewire*.h>)
 P:	Kristian Hoegsberg, Stefan Richter
 M:	[email protected], [email protected]
 L:	[email protected]
@@ -1893,7 +1893,7 @@ L:	[email protected]
 L:	[email protected]
 S:	Orphan
 
-IEEE 1394 SUBSYSTEM
+IEEE 1394 SUBSYSTEM (drivers/ieee1394)
 P:	Ben Collins
 M:	[email protected]
 P:	Stefan Richter

commit 6f81353c95c9538371d23964c17338198e38ad3f

Author: David Moore <[email protected]>
Date:   Sun Jan 6 17:21:41 2008 -0500

firewire: fw-ohci: Dynamically allocate buffers for DMA descriptors

Previously, the fw-ohci driver used fixed-length buffers for storing descriptors for isochronous receive DMA programs. If an application (such as libdc1394) generated a DMA program that was too large, fw-ohci would reach the limit of its fixed-sized buffer and return an error to userspace.

This patch replaces the fixed-length ring-buffer with a linked-list of page-sized buffers. Additional buffers can be dynamically allocated and appended to the list when necessary. For a particular context, buffers are kept around after use and reused as necessary, so there is no allocation taking place after the DMA program is generated for the first time.

In addition, the buffers it uses are coherent for DMA so there is no syncing required before and after writes. This syncing wasn't properly done in the previous version of the code.

-

This is the fourth version of my patch that replaces a fixed-length buffer for DMA descriptors with a dynamically allocated linked-list of buffers.

As we discovered with the last attempt, new context programs are sometimes queued from interrupt context, making it unacceptable to call tasklet_disable() from context_get_descriptors().

This version of the patch uses ohci->lock for all locking needs instead of tasklet_disable/enable. There is a new requirement that context_get_descriptors() be called while holding ohci->lock. It was already held for the AT context, so adding the requirement for the iso context did not seem particularly onerous. In addition, this has the side benefit of allowing iso queue to be safely called from concurrent user-space threads, which previously was not safe.

-

Fixes the following issues:
- Isochronous reception stopped prematurely if an application used a larger buffer. (Reproduced with coriander.)
- Isochronous reception stopped after one or a few frames on VT630x in OHCI 1.0 mode. (Fixes reception in coriander, but dvgrab still doesn't work with these chips.)

Patch update: struct member alignment, whitespace nits

drivers/firewire/fw-ohci.c +156 -80

343 lines not on this page · raw message

commit 5f22f2ebc5bd28c6a5501b1c0e47c0eda5b1c9db

Author: Stefan Richter <[email protected]>
Date:   Sat Dec 22 22:14:52 2007 +0100

firewire: fw-ohci: CycleTooLong interrupt management

The firewire-ohci driver so far lacked the ability to resume cycle master duty after that condition happened, as added to ohci1394 in Linux 2.6.18 by commit 57fdb58fa5a140bdd52cf4c4ffc30df73676f0a5. This ports this patch to fw-ohci.

The "cycle too long" condition has been seen in practice
- with IIDC cameras if a mode with packets too large for a speed is chosen,
- sporadically when capturing DV on a VIA VT6306 card with ohci1394/ ieee1394/ raw1394/ dvgrab 2.
https://bugzilla.redhat.com/show_bug.cgi?id=415841#c7
(This does not fix Fedora bug 415841.)

drivers/firewire/fw-ohci.c +9 -2
index a9f2d07..74d5d94 100644
@@ -1079,6 +1079,13 @@ static irqreturn_t irq_handler(int irq, void *data)
 	if (unlikely(event & OHCI1394_postedWriteErr))
 		fw_error("PCI posted write error\n");
 
+	if (unlikely(event & OHCI1394_cycleTooLong)) {
+		if (printk_ratelimit())
+			fw_notify("isochronous cycle too long\n");
+		reg_write(ohci, OHCI1394_LinkControlSet,
+			  OHCI1394_LinkControl_cycleMaster);
+	}
+
 	if (event & OHCI1394_cycle64Seconds) {
 		cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer);
 		if ((cycle_time & 0x80000000) == 0)
@@ -1152,8 +1159,8 @@ static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
 		  OHCI1394_RQPkt | OHCI1394_RSPkt |
 		  OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
 		  OHCI1394_isochRx | OHCI1394_isochTx |
-		  OHCI1394_postedWriteErr | OHCI1394_cycle64Seconds |
-		  OHCI1394_masterIntEnable);
+		  OHCI1394_postedWriteErr | OHCI1394_cycleTooLong |
+		  OHCI1394_cycle64Seconds | OHCI1394_masterIntEnable);
 
 	/* Activate link_on bit and contender bit in our self ID packets.*/
 	if (ohci_update_phy_reg(card, 4, 0,

commit c31a331aa8e073f15578423217fec270a0060ddc

Author: Rabin Vincent <[email protected]>
Date:   Fri Dec 21 23:02:15 2007 +0530

firewire: Fix extraction of source node id

Fix extraction of the source node id from the packet header.

drivers/firewire/fw-transaction.c +1 -1
index c00d4a9..8018c3b 100644
@@ -650,7 +650,7 @@ fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
 		 HEADER_GET_OFFSET_HIGH(p->header[1]) << 32) | p->header[2];
 	tcode       = HEADER_GET_TCODE(p->header[0]);
 	destination = HEADER_GET_DESTINATION(p->header[0]);
-	source      = HEADER_GET_SOURCE(p->header[0]);
+	source      = HEADER_GET_SOURCE(p->header[1]);
 
 	spin_lock_irqsave(&address_handler_lock, flags);
 	handler = lookup_enclosing_address_handler(&address_handler_list,

commit 3fa7597d1ee9a616ca39acb38f23fdc88168be80

Author: David Moore <[email protected]>
Date:   Wed Dec 19 15:26:38 2007 -0500

firewire: fw-ohci: Bug fixes for packet-per-buffer support

This patch corrects a number of bugs in the current OHCI 1.0 packet-per-buffer support:

1. Correctly deal with payloads that cross a page boundary. The previous version would not split the descriptor at such a boundary, potentially corrupting unrelated memory.

2. Allow user-space to specify multiple packets per struct fw_cdev_iso_packet in the same way that dual-buffer allows. This is signaled by header_length being a multiple of header_size. This multiple determines the number of packets. The payload size allocated per packet is determined by dividing the total payload size by the number of packets.

3. Make sync support work properly for packet-per-buffer.

I have tested this patch with libdc1394 by forcing my OHCI 1.1 controller to use the packet-per-buffer support instead of dual-buffer.

I would greatly appreciate testing by those who have a DV devices and other types of iso streamers to make sure I didn't cause any regressions.

Stefan, with this patch, I'm hoping that libdc1394 will work with all your OHCI 1.0 controllers now.

The one bit of future work that remains for packet-per-buffer support is the automatic compaction of short payloads that I discussed with Kristian.

drivers/firewire/fw-ohci.c +49 -50

161 lines not on this page · raw message

commit 736287c63aa037b675150d4e13af8f4d11912434

Author: David Moore <[email protected]>
Date:   Wed Dec 19 03:09:18 2007 -0500

firewire: fw-ohci: Fix for dualbuffer three-or-more buffers

This patch fixes the problem where different OHCI 1.1 controllers behave differently when a received iso packet straddles three or more buffers when using the dual-buffer receive mode. Two changes are made in order to handle this situation:

1. The packet sync DMA descriptor is given a non-zero header length and non-zero payload length. This is because zero-payload descriptors are not discussed in the OHCI 1.1 specs and their behavior is thus undefined. Instead we use a header size just large enough for a single header and a payload length of 4 bytes for this first descriptor.

2. As we process received packets in the context's tasklet, read the packet length out of the headers. Keep track of the running total of the packet length as "excess_bytes", so we can ignore any descriptors where no packet starts or ends. These descriptors may not have had their first_res_count or second_res_count fields updated by the controller so we cannot rely on those values.

The main drawback of this patch is that the excess_bytes value might get "out of sync" with the packet descriptors if something strange happens to the DMA program. I'm not if such a thing could ever happen, but I appreciate any suggestions in making it more robust.

Also, the packet-per-buffer support may need a similar fix to deal with issue 1, but I haven't done any work on that yet.

Stefan, I'm hoping that with this patch, all your OHCI 1.1 controllers will work properly with an unmodified version of libdc1394.

drivers/firewire/fw-ohci.c +24 -20

87 lines not on this page · raw message

commit 485c755abaec14690375eaf2697d187cc7d39903

Author: Stefan Richter <[email protected]>
Date:   Sun Dec 16 17:32:11 2007 +0100

firewire: fw-sbp2: remove unused misleading macro

SBP2_MAX_SECTORS is nowhere used in fw-sbp2.
It merely got copied over from sbp2 where it played a role in the past.

drivers/firewire/fw-sbp2.c +0 -2
index 0b458e2..6064c6e 100644
@@ -151,9 +151,7 @@ struct sbp2_target {
 };
 
 #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			0x80000000
 
 #define SBP2_DIRECTION_TO_MEDIA		0x0

commit 1cc5d8ba2bcafe54fa17337d299fa474685eda89

Author: Jay Fenlason <[email protected]>
Date:   Wed Nov 7 17:39:00 2007 -0500

firewire: fw-sbp2: quiet logout errors on device removal

This suppresses both reply timed out and management write failed errors on LOGOUT requests.

drivers/firewire/fw-sbp2.c +16 -4
index aa0e89c..0b458e2 100644
@@ -540,14 +540,26 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
 
 	retval = -EIO;
 	if (sbp2_cancel_orbs(lu) == 0) {
-		fw_error("orb reply timed out, rcode=0x%02x\n",
-			 orb->base.rcode);
+		/*
+		 * Logout requests frequently get sent to devices that aren't
+		 * there any more, resulting in extraneous error messages in
+		 * the logs.  Unfortunately, this means logout requests that
+		 * actually fail don't get logged.
+		 */
+		if (function != SBP2_LOGOUT_REQUEST)
+			fw_error("orb reply timed out, rcode=0x%02x\n",
+				 orb->base.rcode);
 		goto out;
 	}
 
 	if (orb->base.rcode != RCODE_COMPLETE) {
-		fw_error("management write failed, rcode 0x%02x\n",
-			 orb->base.rcode);
+		/*
+		 * On device removal from the bus, sometimes the logout
+		 * request times out, sometimes it just fails.
+		 */
+		if (function != SBP2_LOGOUT_REQUEST)
+			fw_error("management write failed, rcode 0x%02x\n",
+				 orb->base.rcode);
 		goto out;
 	}
 

commit 2f0b83b7b1d9f304e8d2805a2922168848f56d8f

Author: Stefan Richter <[email protected]>
Date:   Tue Jan 15 21:10:50 2008 +0100

firewire: fw-sbp2: prepare for s/g chaining

drivers/firewire/fw-sbp2.c +3 -3
index 35f47a2..aa0e89c 100644
@@ -1107,9 +1107,9 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
 	 * elements larger than 65535 bytes, some IOMMUs may merge sg elements
 	 * during DMA mapping, and Linux currently doesn't prevent this.
 	 */
-	for (i = 0, j = 0; i < count; i++) {
-		sg_len = sg_dma_len(sg + i);
-		sg_addr = sg_dma_address(sg + i);
+	for (i = 0, j = 0; i < count; i++, sg = sg_next(sg)) {
+		sg_len = sg_dma_len(sg);
+		sg_addr = sg_dma_address(sg);
 		while (sg_len) {
 			/* FIXME: This won't get us out of the pinch. */
 			if (unlikely(j >= ARRAY_SIZE(orb->page_table))) {

commit aa982a37874003320f2399395a6839e74553f5e3

Author: Stefan Richter <[email protected]>
Date:   Wed Nov 7 01:12:51 2007 +0100

firewire: fw-sbp2: refactor workq and kref handling

This somewhat reduces the size of firewire-sbp2.ko.

drivers/firewire/fw-sbp2.c +30 -26

110 lines not on this page · raw message

Signature · 3 lines
Stefan Richter
-=====-==--- ---= =---=
http://arcgraph.de/sr/