mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL] ieee1394 fixes
@ 2007-06-01 12:09 Stefan Richter
  2007-06-01 12:11 ` Stefan Richter
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Richter @ 2007-06-01 12:09 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux1394-devel

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive the following updates to the old and the new IEEE 1394 subsystem:

  - fix hang in s2ram,
  - port a sysfs attribute from sbp2 to firewire-sbp2,
  - fix userspace-exported headers,
  - list new firewire stack in MAINTAINERS.

I'm sorry that the s2ram fix is rather large for an -rc fix but I think
it is acceptable in preparation of the very first release of the new
firewire stack.  Things will get back to normal from now on.


The diff will follow in a reply.  The stat and shortlog:

 MAINTAINERS                   |    8 ++
 drivers/firewire/fw-card.c    |    5 -
 drivers/firewire/fw-cdev.c    |   17 +++-
 drivers/firewire/fw-device.h  |    1 +
 drivers/firewire/fw-ohci.c    |  187 +++++++++++++++++++++-----------
 drivers/firewire/fw-sbp2.c    |   53 +++++++++
 drivers/ieee1394/nodemgr.c    |    7 +-
 drivers/ieee1394/nodemgr.h    |    1 +
 drivers/ieee1394/sbp2.c       |   31 +++++-
 include/linux/Kbuild          |    2 +
 include/linux/firewire-cdev.h |   14 ++-
 11 files changed, 247 insertions(+), 79 deletions(-)

Kristian Høgsberg (3):
      firewire: Implement suspend/resume PCI driver hooks.
      firewire: Change struct fw_cdev_iso_packet to not use bitfields.
      firewire: Install firewire-constants.h and firewire-cdev.h for userspace.

Stefan Richter (4):
      ieee1394: fix calculation of sysfs attribute "address"
      ieee1394: sbp2: offer SAM-conforming target port ID in sysfs
      firewire: fw-sbp2: implement sysfs ieee1394_id
      firewire: add to MAINTAINERS

-- 
Stefan Richter
-=====-=-=== -==- ----=
http://arcgraph.de/sr/


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [GIT PULL] ieee1394 fixes
@ 2007-06-29 15:41 Stefan Richter
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Richter @ 2007-06-29 15:41 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux1394-devel

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive the following updates.

Stefan Richter (2):
      firewire: fix async reception on big endian machines
      firewire: add Kconfig help on building both stacks


 drivers/firewire/Kconfig   |   65 +++++++++++++++++++++++------------
 drivers/firewire/fw-ohci.c |    6 ++--
 2 files changed, 46 insertions(+), 25 deletions(-)


commit 0a9972baa7454c747fd5f67ce864420dff99d383
Author: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date:   Sat Jun 23 20:28:17 2007 +0200

    firewire: fix async reception on big endian machines
    
    descriptor.data_address is little endian
    
    Tested-by: Olaf Hering <olh@suse.de>
    Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
    Signed-off-by: Kristian Høgsberg <krh@redhat.com>
---

diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index b72a5c1..96c8ac5 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -373,8 +373,8 @@ static void ar_context_tasklet(unsigned long data)
 
 		offset = offsetof(struct ar_buffer, data);
 		dma_unmap_single(ohci->card.device,
-				 ab->descriptor.data_address - offset,
-				 PAGE_SIZE, DMA_BIDIRECTIONAL);
+			le32_to_cpu(ab->descriptor.data_address) - offset,
+			PAGE_SIZE, DMA_BIDIRECTIONAL);
 
 		buffer = ab;
 		ab = ab->next;
@@ -427,7 +427,7 @@ static void ar_context_run(struct ar_context *ctx)
 	size_t offset;
 
 	offset = offsetof(struct ar_buffer, data);
-	ab_bus = ab->descriptor.data_address - offset;
+	ab_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
 
 	reg_write(ctx->ohci, COMMAND_PTR(ctx->regs), ab_bus | 1);
 	reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN);


commit fe77d4f283e840879f0e23b86a5d6a486823fdef
Author: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date:   Mon Jun 25 22:18:40 2007 +0200

    firewire: add Kconfig help on building both stacks
    
    Alas that won't work so good, because nobody reads help texts.
    
    I thought about adding some crude multiple choice selection (build the
    old stack, build the new stack, build both stacks).  It's possible, but
    it would introduce awkward dummy config variables.
    
    Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---

diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig
index 396dade..d011a76 100644
--- a/drivers/firewire/Kconfig
+++ b/drivers/firewire/Kconfig
@@ -4,27 +4,44 @@ comment "An alternative FireWire stack is available with EXPERIMENTAL=y"
 	depends on EXPERIMENTAL=n
 
 config FIREWIRE
-	tristate "IEEE 1394 (FireWire) support (JUJU alternative stack, experimental)"
+	tristate "IEEE 1394 (FireWire) support - alternative stack, EXPERIMENTAL"
 	depends on EXPERIMENTAL
 	select CRC_ITU_T
 	help
-	  IEEE 1394 describes a high performance serial bus, which is also
-	  known as FireWire(tm) or i.Link(tm) and is used for connecting all
-	  sorts of devices (most notably digital video cameras) to your
-	  computer.
-
-	  If you have FireWire hardware and want to use it, say Y here.  This
-	  is the core support only, you will also need to select a driver for
-	  your IEEE 1394 adapter.
-
-	  To compile this driver as a module, say M here: the module will be
-	  called firewire-core.
-
-	  This is the "JUJU" FireWire stack, an alternative implementation
+	  This is the "Juju" FireWire stack, a new alternative implementation
 	  designed for robustness and simplicity.  You can build either this
 	  stack, or the classic stack (the ieee1394 driver, ohci1394 etc.)
 	  or both.
 
+	  To compile this driver as a module, say M here: the module will be
+	  called firewire-core.  It functionally replaces ieee1394, raw1394,
+	  and video1394.
+
+          NOTE:
+
+	  You should only build ONE of the stacks, unless you REALLY know what
+	  you are doing.  If you install both, you should configure them only as
+	  modules rather than link them statically, and you should blacklist one
+	  of the concurrent low-level drivers in /etc/modprobe.conf.  Add either
+
+	      blacklist firewire-ohci
+	  or
+	      blacklist ohci1394
+
+	  there depending on which driver you DON'T want to have auto-loaded.
+	  You can optionally do the same with the other IEEE 1394/ FireWire
+	  drivers.
+
+	  If you have an old modprobe which doesn't implement the blacklist
+	  directive, use either
+
+	       install firewire-ohci /bin/true
+	  or
+	       install ohci1394 /bin/true
+
+	  and so on, depending on which modules you DON't want to have
+	  auto-loaded.
+
 config FIREWIRE_OHCI
 	tristate "Support for OHCI FireWire host controllers"
 	depends on PCI && FIREWIRE
@@ -34,11 +51,13 @@ config FIREWIRE_OHCI
 	  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 firewire-ohci.
+	  called firewire-ohci.  It replaces ohci1394 of the classic IEEE 1394
+	  stack.
+
+          NOTE:
 
-	  If you also build ohci1394 of the classic IEEE 1394 driver stack,
-	  blacklist either ohci1394 or firewire-ohci to let hotplug load the
-	  desired driver.
+	  If you also build ohci1394 of the classic stack, blacklist either
+	  ohci1394 or firewire-ohci to let hotplug load only the desired driver.
 
 config FIREWIRE_SBP2
 	tristate "Support for storage devices (SBP-2 protocol driver)"
@@ -50,12 +69,14 @@ config FIREWIRE_SBP2
 	  like scanners.
 
 	  To compile this driver as a module, say M here:  The module will be
-	  called firewire-sbp2.
+	  called firewire-sbp2.  It replaces sbp2 of the classic IEEE 1394
+	  stack.
 
 	  You should also enable support for disks, CD-ROMs, etc. in the SCSI
 	  configuration section.
 
-	  If you also build sbp2 of the classic IEEE 1394 driver stack,
-	  blacklist either sbp2 or firewire-sbp2 to let hotplug load the
-	  desired driver.
+          NOTE:
+
+	  If you also build sbp2 of the classic stack, blacklist either sbp2
+	  or firewire-sbp2 to let hotplug load only the desired driver.
 

-- 
Stefan Richter
-=====-=-=== -==- ===-=
http://arcgraph.de/sr/


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [GIT PULL] ieee1394 fixes
@ 2007-06-20 22:26 Stefan Richter
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Richter @ 2007-06-20 22:26 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux1394-devel

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive the following fixes for a lockup in IRQ, an oops (AFAIK with
lockup), and packet corruption.  Two commits are the same as in the
pull request last week (http://lkml.org/lkml/2007/6/16/82), one is new.


 drivers/firewire/fw-cdev.c |   19 +++++++++++--------
 drivers/firewire/fw-ohci.c |    2 +-
 drivers/ieee1394/eth1394.c |   21 +++++++++++++++------
 3 files changed, 27 insertions(+), 15 deletions(-)

Carlos E. Ugarte (1):
      ieee1394: fix to ether1394_tx in ether1394.c

Kristian Høgsberg (1):
      firewire: Only set client->iso_context if allocation was successful.

Stefan Richter (1):
      firewire: fix hang after card ejection


diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 5d402d6..dbb7642 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -640,6 +640,7 @@ iso_callback(struct fw_iso_context *context, u32 cycle,
 static int ioctl_create_iso_context(struct client *client, void *buffer)
 {
 	struct fw_cdev_create_iso_context *request = buffer;
+	struct fw_iso_context *context;
 
 	if (request->channel > 63)
 		return -EINVAL;
@@ -661,15 +662,17 @@ static int ioctl_create_iso_context(struct client *client, void *buffer)
 		return -EINVAL;
 	}
 
+	context =  fw_iso_context_create(client->device->card,
+					 request->type,
+					 request->channel,
+					 request->speed,
+					 request->header_size,
+					 iso_callback, client);
+	if (IS_ERR(context))
+		return PTR_ERR(context);
+
 	client->iso_closure = request->closure;
-	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))
-		return PTR_ERR(client->iso_context);
+	client->iso_context = context;
 
 	/* We only support one context at this time. */
 	request->handle = 0;
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 0d08bf9..b72a5c1 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1001,7 +1001,7 @@ static irqreturn_t irq_handler(int irq, void *data)
 
 	event = reg_read(ohci, OHCI1394_IntEventClear);
 
-	if (!event)
+	if (!event || !~event)
 		return IRQ_NONE;
 
 	reg_write(ohci, OHCI1394_IntEventClear, event);
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index 5f026b5..7c13fb3 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -1565,7 +1565,7 @@ static void ether1394_complete_cb(void *__ptask)
 /* Transmit a packet (called by kernel) */
 static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
 {
-	struct eth1394hdr *eth;
+	struct eth1394hdr hdr_buf;
 	struct eth1394_priv *priv = netdev_priv(dev);
 	__be16 proto;
 	unsigned long flags;
@@ -1595,16 +1595,17 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
 	if (!skb)
 		goto fail;
 
-	/* Get rid of the fake eth1394 header, but save a pointer */
-	eth = (struct eth1394hdr *)skb->data;
+	/* Get rid of the fake eth1394 header, but first make a copy.
+	 * We might need to rebuild the header on tx failure. */
+	memcpy(&hdr_buf, skb->data, sizeof(hdr_buf));
 	skb_pull(skb, ETH1394_HLEN);
 
-	proto = eth->h_proto;
+	proto = hdr_buf.h_proto;
 	dg_size = skb->len;
 
 	/* Set the transmission type for the packet.  ARP packets and IP
 	 * broadcast packets are sent via GASP. */
-	if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
+	if (memcmp(hdr_buf.h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
 	    proto == htons(ETH_P_ARP) ||
 	    (proto == htons(ETH_P_IP) &&
 	     IN_MULTICAST(ntohl(ip_hdr(skb)->daddr)))) {
@@ -1616,7 +1617,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
 		if (max_payload < dg_size + hdr_type_len[ETH1394_HDR_LF_UF])
 			priv->bc_dgl++;
 	} else {
-		__be64 guid = get_unaligned((u64 *)eth->h_dest);
+		__be64 guid = get_unaligned((u64 *)hdr_buf.h_dest);
 
 		node = eth1394_find_node_guid(&priv->ip_node_list,
 					      be64_to_cpu(guid));
@@ -1673,6 +1674,14 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
 		if (dest_node == (LOCAL_BUS | ALL_NODES))
 			goto fail;
 
+		/* At this point we want to restore the packet.  When we return
+		 * here with NETDEV_TX_BUSY we will get another entrance in this
+		 * routine with the same skb and we need it to look the same.
+		 * So we pull 4 more bytes, then build the header again. */
+		skb_pull(skb, 4);
+		ether1394_header(skb, dev, ntohs(hdr_buf.h_proto),
+				 hdr_buf.h_dest, NULL, 0);
+
 		/* Most failures of ether1394_send_packet are recoverable. */
 		netif_stop_queue(dev);
 		priv->wake_node = dest_node;


-- 
Stefan Richter
-=====-=-=== -==- =-=-=
http://arcgraph.de/sr/


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [GIT PULL] ieee1394 fixes
@ 2007-06-16 11:03 Stefan Richter
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Richter @ 2007-06-16 11:03 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux1394-devel

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive the following updates to the old and the new IEEE 1394 subsystem:

 drivers/firewire/fw-ohci.c |    2 +-
 drivers/ieee1394/eth1394.c |   21 +++++++++++++++------
 2 files changed, 16 insertions(+), 7 deletions(-)

Carlos E. Ugarte (1):
      ieee1394: fix to ether1394_tx in ether1394.c

Stefan Richter (1):
      firewire: fix hang after card ejection


diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 0d08bf9..b72a5c1 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1001,7 +1001,7 @@ static irqreturn_t irq_handler(int irq, void *data)
 
 	event = reg_read(ohci, OHCI1394_IntEventClear);
 
-	if (!event)
+	if (!event || !~event)
 		return IRQ_NONE;
 
 	reg_write(ohci, OHCI1394_IntEventClear, event);
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index 5f026b5..7c13fb3 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -1565,7 +1565,7 @@ static void ether1394_complete_cb(void *__ptask)
 /* Transmit a packet (called by kernel) */
 static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
 {
-	struct eth1394hdr *eth;
+	struct eth1394hdr hdr_buf;
 	struct eth1394_priv *priv = netdev_priv(dev);
 	__be16 proto;
 	unsigned long flags;
@@ -1595,16 +1595,17 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
 	if (!skb)
 		goto fail;
 
-	/* Get rid of the fake eth1394 header, but save a pointer */
-	eth = (struct eth1394hdr *)skb->data;
+	/* Get rid of the fake eth1394 header, but first make a copy.
+	 * We might need to rebuild the header on tx failure. */
+	memcpy(&hdr_buf, skb->data, sizeof(hdr_buf));
 	skb_pull(skb, ETH1394_HLEN);
 
-	proto = eth->h_proto;
+	proto = hdr_buf.h_proto;
 	dg_size = skb->len;
 
 	/* Set the transmission type for the packet.  ARP packets and IP
 	 * broadcast packets are sent via GASP. */
-	if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
+	if (memcmp(hdr_buf.h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
 	    proto == htons(ETH_P_ARP) ||
 	    (proto == htons(ETH_P_IP) &&
 	     IN_MULTICAST(ntohl(ip_hdr(skb)->daddr)))) {
@@ -1616,7 +1617,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
 		if (max_payload < dg_size + hdr_type_len[ETH1394_HDR_LF_UF])
 			priv->bc_dgl++;
 	} else {
-		__be64 guid = get_unaligned((u64 *)eth->h_dest);
+		__be64 guid = get_unaligned((u64 *)hdr_buf.h_dest);
 
 		node = eth1394_find_node_guid(&priv->ip_node_list,
 					      be64_to_cpu(guid));
@@ -1673,6 +1674,14 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
 		if (dest_node == (LOCAL_BUS | ALL_NODES))
 			goto fail;
 
+		/* At this point we want to restore the packet.  When we return
+		 * here with NETDEV_TX_BUSY we will get another entrance in this
+		 * routine with the same skb and we need it to look the same.
+		 * So we pull 4 more bytes, then build the header again. */
+		skb_pull(skb, 4);
+		ether1394_header(skb, dev, ntohs(hdr_buf.h_proto),
+				 hdr_buf.h_dest, NULL, 0);
+
 		/* Most failures of ether1394_send_packet are recoverable. */
 		netif_stop_queue(dev);
 		priv->wake_node = dest_node;

-- 
Stefan Richter
-=====-=-=== -==- =----
http://arcgraph.de/sr/


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [GIT PULL] ieee1394 fixes
@ 2006-12-30 13:53 Stefan Richter
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Richter @ 2006-12-30 13:53 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux1394-devel, linux-kernel

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive two IEEE 1394 subsystem fixes for 2.6.20-rc2.
One addresses a grossly incorrect patch of mine after 2.6.19.
(Andreas Schwab 2006-12-29, "2.6.20-rc2: kernel BUG at
include/asm/dma-mapping.h:110!")

The other fixes an old minor bug which was discovered recently.
(Jeff Garzik 2006-12-05, "Re: [PATCH 3/3] Import fw-sbp2 driver.")


 drivers/ieee1394/sbp2.c |   83 +++++++++++++++++++++++------------------------
 1 files changed, 40 insertions(+), 43 deletions(-)


commit 97d552e35d9404df3254e1157df3340e4e2eaedc
Author: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date:   Fri Dec 29 23:47:04 2006 +0100

    ieee1394: sbp2: fix bogus dma mapping
    
    Need to use a PCI device, not a FireWire host device.  Problem found by
    Andreas Schwab, mistake pointed out by Benjamin Herrenschmidt.
    http://ozlabs.org/pipermail/linuxppc-dev/2006-December/029595.html
    
    Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
    Tested-by: Andreas Schwab <schwab@suse.de>

commit b2bb550c4a10c44e99fe469cfaee81e2e3109994
Author: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date:   Thu Dec 28 19:57:49 2006 +0100

    ieee1394: sbp2: pass REQUEST_SENSE through to the target
    
    Delete some incorrect code, left over from the initial driver submission
    in March 2001.
    
    SBP-2 targets should provide sense data via the SBP-2 status block
    (autosense).  We have to pass the REQUEST_SENSE command through to
    targets which don't implement autosense, if there are any, and to
    accomodate application clients which use this command.
    
    Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

-- 
Stefan Richter
-=====-=-==- ==-- ====-
http://arcgraph.de/sr/


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-29 15:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-01 12:09 [GIT PULL] ieee1394 fixes Stefan Richter
2007-06-01 12:11 ` Stefan Richter
  -- strict thread matches above, loose matches on Subject: below --
2007-06-29 15:41 Stefan Richter
2007-06-20 22:26 Stefan Richter
2007-06-16 11:03 Stefan Richter
2006-12-30 13:53 Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®