rpms/kernel/devel kernel.spec, 1.507, 1.508 linux-2.6-firewire-git-update.patch, 1.10, 1.11
Jarod Wilson (jwilson)
fedora-extras-commits at redhat.com
Mon Mar 17 13:38:39 UTC 2008
Author: jwilson
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31970
Modified Files:
kernel.spec linux-2.6-firewire-git-update.patch
Log Message:
* Mon Mar 17 2008 Jarod Wilson <jwilson at redhat.com>
- Fix up firewire patches for 2.6.25-rc6
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.507
retrieving revision 1.508
diff -u -r1.507 -r1.508
--- kernel.spec 17 Mar 2008 04:24:19 -0000 1.507
+++ kernel.spec 17 Mar 2008 13:37:48 -0000 1.508
@@ -638,8 +638,8 @@
Patch2100: linux-2.6-ext4-stable-queue.patch
# linux1394 git patches
-#Patch2200: linux-2.6-firewire-git-update.patch
-#Patch2201: linux-2.6-firewire-git-pending.patch
+Patch2200: linux-2.6-firewire-git-update.patch
+Patch2201: linux-2.6-firewire-git-pending.patch
# make USB EHCI driver respect "nousb" parameter
Patch2300: linux-2.6-usb-ehci-hcd-respect-nousb.patch
@@ -1158,11 +1158,11 @@
#ApplyPatch linux-2.6-ext4-stable-queue.patch
# linux1394 git patches
-#ApplyPatch linux-2.6-firewire-git-update.patch
+ApplyPatch linux-2.6-firewire-git-update.patch
C=$(wc -l $RPM_SOURCE_DIR/linux-2.6-firewire-git-pending.patch | awk '{print $1}')
-#if [ "$C" -gt 10 ]; then
-#ApplyPatch linux-2.6-firewire-git-pending.patch
-#fi
+if [ "$C" -gt 10 ]; then
+ApplyPatch linux-2.6-firewire-git-pending.patch
+fi
# usb video
ApplyPatch linux-2.6-uvcvideo.patch
@@ -1756,6 +1756,9 @@
%kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL} -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.conf %{with_xen} xen
%changelog
+* Mon Mar 17 2008 Jarod Wilson <jwilson at redhat.com>
+- Fix up firewire patches for 2.6.25-rc6
+
* Sun Mar 16 2008 Chuck Ebbert <cebbert at redhat.com>
- 2.6.25-rc6
- Temporarily drop firewire patches.
linux-2.6-firewire-git-update.patch:
Index: linux-2.6-firewire-git-update.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-firewire-git-update.patch,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- linux-2.6-firewire-git-update.patch 14 Mar 2008 18:15:31 -0000 1.10
+++ linux-2.6-firewire-git-update.patch 17 Mar 2008 13:37:48 -0000 1.11
@@ -1,17 +1,16 @@
-git diff in linux1394-2.6.git vs. v2.6.25-rc5 as of 04.14.2008
+git diff in linux1394-2.6.git vs. v2.6.25-rc6, March 17, 2008.
Documentation/debugging-via-ohci1394.txt | 13 +-
- drivers/firewire/Kconfig | 50 ++----
drivers/firewire/fw-card.c | 40 +-----
drivers/firewire/fw-cdev.c | 13 +-
drivers/firewire/fw-device.c | 263 ++++++++++++++++++++++++------
drivers/firewire/fw-device.h | 38 +++-
- drivers/firewire/fw-ohci.c | 136 +++++++++++-----
- drivers/firewire/fw-sbp2.c | 180 +++++++++++---------
- drivers/firewire/fw-topology.c | 6 +-
+ drivers/firewire/fw-ohci.c | 114 +++++++-------
+ drivers/firewire/fw-sbp2.c | 150 ++++++++---------
+ drivers/firewire/fw-topology.c | 3 +
drivers/firewire/fw-topology.h | 11 +-
- drivers/firewire/fw-transaction.c | 13 +-
- drivers/firewire/fw-transaction.h | 12 +-
+ drivers/firewire/fw-transaction.c | 11 +-
+ drivers/firewire/fw-transaction.h | 6 -
drivers/ieee1394/csr.c | 6 +-
drivers/ieee1394/dv1394.c | 3 +-
drivers/ieee1394/highlevel.c | 6 +-
@@ -20,10 +19,10 @@
drivers/ieee1394/ohci1394.c | 111 ++++++-------
drivers/ieee1394/pcilynx.c | 12 +-
drivers/ieee1394/raw1394.c | 1 -
- drivers/ieee1394/sbp2.c | 16 +-
+ drivers/ieee1394/sbp2.c | 11 +-
drivers/ieee1394/video1394.c | 3 +-
lib/Kconfig.debug | 10 +
- 23 files changed, 584 insertions(+), 367 deletions(-)
+ 22 files changed, 487 insertions(+), 346 deletions(-)
diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt
index c360d4e..371ba27 100644
@@ -49,82 +48,6 @@
To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu:
Provide code for enabling DMA over FireWire early on boot) and pass the
-diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig
-index fe9e768..25bdc2d 100644
---- a/drivers/firewire/Kconfig
-+++ b/drivers/firewire/Kconfig
-@@ -1,5 +1,3 @@
--# -*- shell-script -*-
--
- comment "An alternative FireWire stack is available with EXPERIMENTAL=y"
- depends on EXPERIMENTAL=n
-
-@@ -21,27 +19,7 @@ config FIREWIRE
- 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.
-+ you are doing.
-
- config FIREWIRE_OHCI
- tristate "Support for OHCI FireWire host controllers"
-@@ -57,8 +35,24 @@ config FIREWIRE_OHCI
-
- NOTE:
-
-- If you also build ohci1394 of the classic stack, blacklist either
-- ohci1394 or firewire-ohci to let hotplug load only the desired driver.
-+ You should only build ohci1394 or firewire-ohci, but not both.
-+ If you nevertheless want to install both, you should configure them
-+ only as modules and blacklist the driver(s) which you don't want to
-+ have auto-loaded. Add either
-+
-+ blacklist firewire-ohci
-+ or
-+ blacklist ohci1394
-+ blacklist video1394
-+ blacklist dv1394
-+
-+ to /etc/modprobe.conf or /etc/modprobe.d/* and update modprobe.conf
-+ depending on your distribution. The latter two modules should be
-+ blacklisted together with ohci1394 because they depend on ohci1394.
-+
-+ If you have an old modprobe which doesn't implement the blacklist
-+ directive, use "install modulename /bin/true" for the modules to be
-+ blacklisted.
-
- config FIREWIRE_SBP2
- tristate "Support for storage devices (SBP-2 protocol driver)"
-@@ -75,9 +69,3 @@ config FIREWIRE_SBP2
-
- You should also enable support for disks, CD-ROMs, etc. in the SCSI
- configuration section.
--
-- NOTE:
--
-- If you also build sbp2 of the classic stack, blacklist either sbp2
-- or firewire-sbp2 to let hotplug load only the desired driver.
--
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index a034627..7e4012d 100644
--- a/drivers/firewire/fw-card.c
@@ -834,180 +757,19 @@
#define CSR_LEAF 0x80
#define CSR_DIRECTORY 0xc0
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
-index 7ebad3c..0f02b8d 100644
+index 996d61f..0f02b8d 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
-@@ -33,6 +33,10 @@
- #include <asm/page.h>
- #include <asm/system.h>
-
-+#ifdef CONFIG_PPC_PMAC
-+#include <asm/pmac_feature.h>
-+#endif
-+
- #include "fw-ohci.h"
- #include "fw-transaction.h"
-
-@@ -173,8 +177,9 @@ struct fw_ohci {
+@@ -177,7 +177,7 @@ struct fw_ohci {
struct tasklet_struct bus_reset_tasklet;
int node_id;
int generation;
- int request_generation;
+ int request_generation; /* for timestamping incoming requests */
u32 bus_seconds;
-+ bool old_uninorth;
-
- /*
- * Spinlock for accessing fw_ohci data. Never call out of
-@@ -276,19 +281,13 @@ static int ar_context_add_page(struct ar_context *ctx)
- {
- struct device *dev = ctx->ohci->card.device;
- struct ar_buffer *ab;
-- dma_addr_t ab_bus;
-+ dma_addr_t uninitialized_var(ab_bus);
- size_t offset;
-
-- ab = (struct ar_buffer *) __get_free_page(GFP_ATOMIC);
-+ ab = dma_alloc_coherent(dev, PAGE_SIZE, &ab_bus, 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 |
-@@ -299,8 +298,6 @@ static int ar_context_add_page(struct ar_context *ctx)
- 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 = cpu_to_le32(ab_bus | 1);
- ctx->last_buffer->next = ab;
- ctx->last_buffer = ab;
-@@ -311,15 +308,22 @@ static int ar_context_add_page(struct ar_context *ctx)
- return 0;
- }
+ bool old_uninorth;
-+#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
-+#define cond_le32_to_cpu(v) \
-+ (ohci->old_uninorth ? (__force __u32)(v) : le32_to_cpu(v))
-+#else
-+#define cond_le32_to_cpu(v) le32_to_cpu(v)
-+#endif
-+
- static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
- {
- struct fw_ohci *ohci = ctx->ohci;
- struct fw_packet p;
- u32 status, length, tcode;
-
-- p.header[0] = le32_to_cpu(buffer[0]);
-- p.header[1] = le32_to_cpu(buffer[1]);
-- p.header[2] = le32_to_cpu(buffer[2]);
-+ p.header[0] = cond_le32_to_cpu(buffer[0]);
-+ p.header[1] = cond_le32_to_cpu(buffer[1]);
-+ p.header[2] = cond_le32_to_cpu(buffer[2]);
-
- tcode = (p.header[0] >> 4) & 0x0f;
- switch (tcode) {
-@@ -331,7 +335,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
- break;
-
- case TCODE_READ_BLOCK_REQUEST :
-- p.header[3] = le32_to_cpu(buffer[3]);
-+ p.header[3] = cond_le32_to_cpu(buffer[3]);
- p.header_length = 16;
- p.payload_length = 0;
- break;
-@@ -340,7 +344,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
- case TCODE_READ_BLOCK_RESPONSE:
- case TCODE_LOCK_REQUEST:
- case TCODE_LOCK_RESPONSE:
-- p.header[3] = le32_to_cpu(buffer[3]);
-+ p.header[3] = cond_le32_to_cpu(buffer[3]);
- p.header_length = 16;
- p.payload_length = p.header[3] >> 16;
- break;
-@@ -357,7 +361,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
-
- /* FIXME: What to do about evt_* errors? */
- length = (p.header_length + p.payload_length + 3) / 4;
-- status = le32_to_cpu(buffer[length]);
-+ status = cond_le32_to_cpu(buffer[length]);
-
- p.ack = ((status >> 16) & 0x1f) - 16;
- p.speed = (status >> 21) & 0x7;
-@@ -375,7 +379,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
- */
-
- if (p.ack + 16 == 0x09)
-- ohci->request_generation = (buffer[2] >> 16) & 0xff;
-+ ohci->request_generation = (p.header[2] >> 16) & 0xff;
- else if (ctx == &ohci->ar_request_ctx)
- fw_core_handle_request(&ohci->card, &p);
- else
-@@ -397,6 +401,7 @@ static void ar_context_tasklet(unsigned long data)
-
- if (d->res_count == 0) {
- size_t size, rest, offset;
-+ dma_addr_t buffer_bus;
-
- /*
- * This descriptor is finished and we may have a
-@@ -405,9 +410,7 @@ static void ar_context_tasklet(unsigned long data)
- */
-
- offset = offsetof(struct ar_buffer, data);
-- dma_unmap_single(ohci->card.device,
-- le32_to_cpu(ab->descriptor.data_address) - offset,
-- PAGE_SIZE, DMA_BIDIRECTIONAL);
-+ buffer_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
-
- buffer = ab;
- ab = ab->next;
-@@ -423,7 +426,8 @@ static void ar_context_tasklet(unsigned long data)
- while (buffer < end)
- buffer = handle_ar_packet(ctx, buffer);
-
-- free_page((unsigned long)buffer);
-+ dma_free_coherent(ohci->card.device, PAGE_SIZE,
-+ buffer, buffer_bus);
- ar_context_add_page(ctx);
- } else {
- buffer = ctx->pointer;
-@@ -532,7 +536,7 @@ static int
- context_add_buffer(struct context *ctx)
- {
- struct descriptor_buffer *desc;
-- dma_addr_t bus_addr;
-+ dma_addr_t uninitialized_var(bus_addr);
- int offset;
-
- /*
-@@ -1022,13 +1026,14 @@ static void bus_reset_tasklet(unsigned long data)
- */
-
- self_id_count = (reg_read(ohci, OHCI1394_SelfIDCount) >> 3) & 0x3ff;
-- generation = (le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
-+ generation = (cond_le32_to_cpu(ohci->self_id_cpu[0]) >> 16) & 0xff;
- rmb();
-
- for (i = 1, j = 0; j < self_id_count; i += 2, j++) {
- if (ohci->self_id_cpu[i] != ~ohci->self_id_cpu[i + 1])
- fw_error("inconsistent self IDs\n");
-- ohci->self_id_buffer[j] = le32_to_cpu(ohci->self_id_cpu[i]);
-+ ohci->self_id_buffer[j] =
-+ cond_le32_to_cpu(ohci->self_id_cpu[i]);
- }
- rmb();
-
-@@ -1091,6 +1096,11 @@ static void bus_reset_tasklet(unsigned long data)
+@@ -1096,6 +1096,11 @@ static void bus_reset_tasklet(unsigned long data)
reg_write(ohci, OHCI1394_ConfigROMhdr, ohci->next_header);
}
@@ -1019,16 +781,7 @@
spin_unlock_irqrestore(&ohci->lock, flags);
if (free_rom)
-@@ -1316,7 +1326,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
- unsigned long flags;
- int retval = -EBUSY;
- __be32 *next_config_rom;
-- dma_addr_t next_config_rom_bus;
-+ dma_addr_t uninitialized_var(next_config_rom_bus);
-
- ohci = fw_ohci(card);
-
-@@ -1429,6 +1439,9 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
+@@ -1434,6 +1439,9 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
static int
ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
{
@@ -1038,7 +791,7 @@
struct fw_ohci *ohci = fw_ohci(card);
unsigned long flags;
int n, retval = 0;
-@@ -1460,6 +1473,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
+@@ -1465,6 +1473,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
out:
spin_unlock_irqrestore(&ohci->lock, flags);
return retval;
@@ -1046,39 +799,30 @@
}
static u64
-@@ -1487,7 +1501,7 @@ static int handle_ir_dualbuffer_packet(struct context *context,
- void *p, *end;
- int i;
-
-- if (db->first_res_count > 0 && db->second_res_count > 0) {
-+ if (db->first_res_count != 0 && db->second_res_count != 0) {
- if (ctx->excess_bytes <= le16_to_cpu(db->second_req_count)) {
- /* This descriptor isn't done yet, stop iteration. */
- return 0;
-@@ -1513,7 +1527,7 @@ static int handle_ir_dualbuffer_packet(struct context *context,
- memcpy(ctx->header + i + 4, p + 8, ctx->base.header_size - 4);
- i += ctx->base.header_size;
- ctx->excess_bytes +=
-- (le32_to_cpu(*(u32 *)(p + 4)) >> 16) & 0xffff;
-+ (le32_to_cpu(*(__le32 *)(p + 4)) >> 16) & 0xffff;
- p += ctx->base.header_size + 4;
- }
- ctx->header_length = i;
-@@ -2039,6 +2053,35 @@ static const struct fw_card_driver ohci_driver = {
+@@ -2044,17 +2053,9 @@ static const struct fw_card_driver ohci_driver = {
.stop_iso = ohci_stop_iso,
};
-+#ifdef CONFIG_PPC_PMAC
+-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;
+- u64 guid;
+- int err;
+- size_t size;
+-
+ #ifdef CONFIG_PPC_PMAC
+- /* Necessary on some machines if fw-ohci was loaded/ unloaded before */
+static void ohci_pmac_on(struct pci_dev *dev)
+{
-+ if (machine_is(powermac)) {
-+ struct device_node *ofn = pci_device_to_OF_node(dev);
-+
-+ if (ofn) {
-+ pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 1);
-+ pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
-+ }
-+ }
+ if (machine_is(powermac)) {
+ struct device_node *ofn = pci_device_to_OF_node(dev);
+
+@@ -2063,8 +2064,35 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+ pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
+ }
+ }
+}
+
+static void ohci_pmac_off(struct pci_dev *dev)
@@ -1095,21 +839,23 @@
+#else
+#define ohci_pmac_on(dev)
+#define ohci_pmac_off(dev)
-+#endif /* CONFIG_PPC_PMAC */
-+
- static int __devinit
- pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
- {
-@@ -2048,6 +2091,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
- int err;
- size_t size;
+ #endif /* CONFIG_PPC_PMAC */
++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;
++ u64 guid;
++ int err;
++ size_t size;
++
+ ohci_pmac_on(dev);
+
ohci = kzalloc(sizeof(*ohci), GFP_KERNEL);
if (ohci == NULL) {
fw_error("Could not malloc fw_ohci data.\n");
-@@ -2059,13 +2104,17 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+@@ -2076,7 +2104,7 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
err = pci_enable_device(dev);
if (err) {
fw_error("Failed to enable OHCI hardware.\n");
@@ -1118,17 +864,7 @@
}
pci_set_master(dev);
- pci_write_config_dword(dev, OHCI1394_PCI_HCI_Control, 0);
- pci_set_drvdata(dev, ohci);
-
-+#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
-+ ohci->old_uninorth = dev->vendor == PCI_VENDOR_ID_APPLE &&
-+ dev->device == PCI_DEVICE_ID_APPLE_UNI_N_FW;
-+#endif
- spin_lock_init(&ohci->lock);
-
- tasklet_init(&ohci->bus_reset_tasklet,
-@@ -2151,8 +2200,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
+@@ -2172,8 +2200,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
pci_release_region(dev, 0);
fail_disable:
pci_disable_device(dev);
@@ -1139,11 +875,24 @@
return err;
}
-@@ -2180,39 +2229,42 @@ static void pci_remove(struct pci_dev *dev)
+@@ -2201,72 +2229,42 @@ static void pci_remove(struct pci_dev *dev)
pci_iounmap(dev, ohci->registers);
pci_release_region(dev, 0);
pci_disable_device(dev);
- fw_card_put(&ohci->card);
+-
+-#ifdef CONFIG_PPC_PMAC
+- /* On UniNorth, power down the cable and turn off the chip clock
+- * to save power on laptops */
+- if (machine_is(powermac)) {
+- struct device_node *ofn = pci_device_to_OF_node(dev);
+-
+- if (ofn) {
+- pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
+- pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 0);
+- }
+- }
+-#endif /* CONFIG_PPC_PMAC */
+ kfree(&ohci->card);
+ ohci_pmac_off(dev);
@@ -1171,6 +920,16 @@
+ err = pci_set_power_state(dev, pci_choose_state(dev, state));
if (err)
fw_error("pci_set_power_state failed with %d\n", err);
+-
+-/* PowerMac suspend code comes last */
+-#ifdef CONFIG_PPC_PMAC
+- if (machine_is(powermac)) {
+- struct device_node *ofn = pci_device_to_OF_node(pdev);
+-
+- if (ofn)
+- pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
+- }
+-#endif /* CONFIG_PPC_PMAC */
+ ohci_pmac_off(dev);
return 0;
@@ -1183,6 +942,16 @@
+ struct fw_ohci *ohci = pci_get_drvdata(dev);
int err;
+-/* PowerMac resume code comes first */
+-#ifdef CONFIG_PPC_PMAC
+- if (machine_is(powermac)) {
+- struct device_node *ofn = pci_device_to_OF_node(pdev);
+-
+- if (ofn)
+- pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
+- }
+-#endif /* CONFIG_PPC_PMAC */
+-
- pci_set_power_state(pdev, PCI_D0);
- pci_restore_state(pdev);
- err = pci_enable_device(pdev);
@@ -1194,7 +963,7 @@
fw_error("pci_enable_device failed\n");
return err;
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
-index 03069a4..2a99937 100644
+index 62b4e47..2a99937 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -153,6 +153,7 @@ struct sbp2_target {
@@ -1205,10 +974,11 @@
int directory_id;
int node_id;
int address_high;
-@@ -173,9 +174,8 @@ struct sbp2_target {
+@@ -173,10 +174,8 @@ struct sbp2_target {
#define SBP2_ORB_TIMEOUT 2000U /* Timeout in ms */
#define SBP2_ORB_NULL 0x80000000
#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
+-#define SBP2_RETRY_LIMIT 0xf /* 15 retries */
-
-#define SBP2_DIRECTION_TO_MEDIA 0x0
-#define SBP2_DIRECTION_FROM_MEDIA 0x1
@@ -1217,7 +987,7 @@
/* Unit directory keys */
#define SBP2_CSR_UNIT_CHARACTERISTICS 0x3a
-@@ -223,8 +223,8 @@ struct sbp2_status {
+@@ -224,8 +223,8 @@ struct sbp2_status {
};
struct sbp2_pointer {
@@ -1228,7 +998,7 @@
};
struct sbp2_orb {
-@@ -252,8 +252,8 @@ struct sbp2_management_orb {
+@@ -253,8 +252,8 @@ struct sbp2_management_orb {
struct {
struct sbp2_pointer password;
struct sbp2_pointer response;
@@ -1239,7 +1009,7 @@
struct sbp2_pointer status_fifo;
} request;
__be32 response[4];
-@@ -262,20 +262,17 @@ struct sbp2_management_orb {
+@@ -263,20 +262,17 @@ struct sbp2_management_orb {
struct sbp2_status status;
};
@@ -1263,7 +1033,7 @@
#define COMMAND_ORB_REQUEST_FORMAT(v) ((v) << 29)
#define COMMAND_ORB_NOTIFY ((1) << 31)
-@@ -284,7 +281,7 @@ struct sbp2_command_orb {
+@@ -285,7 +281,7 @@ struct sbp2_command_orb {
struct {
struct sbp2_pointer next;
struct sbp2_pointer data_descriptor;
@@ -1272,19 +1042,7 @@
u8 command_block[12];
} request;
struct scsi_cmnd *cmd;
-@@ -330,6 +327,11 @@ static const struct {
- .model = ~0,
- .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
- },
-+ /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ {
-+ .firmware_revision = 0x002600,
-+ .model = ~0,
-+ .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
-+ },
-
- /*
- * There are iPods (2nd gen, 3rd gen) with model_id == 0, but
-@@ -453,8 +455,7 @@ sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu,
+@@ -459,8 +455,7 @@ sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu,
unsigned long flags;
orb->pointer.high = 0;
@@ -1294,7 +1052,7 @@
spin_lock_irqsave(&device->card->lock, flags);
list_add_tail(&orb->link, &lu->orb_list);
-@@ -530,31 +531,31 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
+@@ -536,31 +531,31 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
if (dma_mapping_error(orb->response_bus))
goto fail_mapping_response;
@@ -1338,7 +1096,7 @@
init_completion(&orb->done);
orb->base.callback = complete_management_orb;
-@@ -599,8 +600,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
+@@ -605,8 +600,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
sizeof(orb->response), DMA_FROM_DEVICE);
fail_mapping_response:
if (response)
@@ -1348,7 +1106,7 @@
kref_put(&orb->base.kref, free_orb);
return retval;
-@@ -695,10 +695,8 @@ static void sbp2_conditionally_block(struct sbp2_logical_unit *lu)
+@@ -701,10 +695,8 @@ static void sbp2_conditionally_block(struct sbp2_logical_unit *lu)
if (!tgt->dont_block && !lu->blocked &&
lu->generation != card->generation) {
lu->blocked = true;
@@ -1360,7 +1118,7 @@
}
spin_unlock_irqrestore(&card->lock, flags);
}
-@@ -725,10 +723,8 @@ static void sbp2_conditionally_unblock(struct sbp2_logical_unit *lu)
+@@ -731,10 +723,8 @@ static void sbp2_conditionally_unblock(struct sbp2_logical_unit *lu)
}
spin_unlock_irqrestore(&card->lock, flags);
@@ -1372,7 +1130,7 @@
}
/*
-@@ -790,7 +786,7 @@ static void sbp2_release_target(struct kref *kref)
+@@ -796,7 +786,7 @@ static void sbp2_release_target(struct kref *kref)
scsi_remove_host(shost);
fw_notify("released %s\n", tgt->bus_id);
@@ -1381,17 +1139,10 @@
scsi_host_put(shost);
fw_device_put(device);
}
-@@ -812,6 +808,45 @@ static void sbp2_target_put(struct sbp2_target *tgt)
- kref_put(&tgt->kref, sbp2_release_target);
+@@ -825,6 +815,22 @@ complete_set_busy_timeout(struct fw_card *card, int rcode,
+ complete(done);
}
-+static void
-+complete_set_busy_timeout(struct fw_card *card, int rcode,
-+ void *payload, size_t length, void *done)
-+{
-+ complete(done);
-+}
-+
+/*
+ * Write retransmit retry values into the BUSY_TIMEOUT register.
+ * - The single-phase retry protocol is supported by all SBP-2 devices, but the
@@ -1408,26 +1159,20 @@
+ * See section 8.3.2.3.5 of the 1394-1995 spec, section 6.2 of the SBP-2 spec,
+ * and section 6.4 of the SBP-3 spec for further details.
+ */
-+static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
-+{
-+ struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
-+ DECLARE_COMPLETION_ONSTACK(done);
-+ struct fw_transaction t;
-+ static __be32 busy_timeout;
-+
+ static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
+ {
+ struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
+@@ -832,8 +838,7 @@ static void sbp2_set_busy_timeout(struct sbp2_logical_unit *lu)
+ struct fw_transaction t;
+ static __be32 busy_timeout;
+
+- /* FIXME: we should try to set dual-phase cycle_limit too */
+- busy_timeout = cpu_to_be32(SBP2_RETRY_LIMIT);
+ busy_timeout = cpu_to_be32(SBP2_CYCLE_LIMIT | SBP2_RETRY_LIMIT);
-+
-+ fw_send_request(device->card, &t, TCODE_WRITE_QUADLET_REQUEST,
-+ lu->tgt->node_id, lu->generation, device->max_speed,
-+ CSR_REGISTER_BASE + CSR_BUSY_TIMEOUT, &busy_timeout,
-+ sizeof(busy_timeout), complete_set_busy_timeout, &done);
-+ wait_for_completion(&done);
-+}
-+
- static void sbp2_reconnect(struct work_struct *work);
- static void sbp2_login(struct work_struct *work)
-@@ -855,19 +890,16 @@ static void sbp2_login(struct work_struct *work)
+ fw_send_request(device->card, &t, TCODE_WRITE_QUADLET_REQUEST,
+ lu->tgt->node_id, lu->generation, device->max_speed,
+@@ -885,11 +890,10 @@ static void sbp2_login(struct work_struct *work)
tgt->address_high = local_node_id << 16;
sbp2_set_generation(lu, generation);
@@ -1442,17 +1187,7 @@
fw_notify("%s: logged in to LUN %04x (%d retries)\n",
tgt->bus_id, lu->lun, lu->retries);
-
--#if 0
-- /* FIXME: The linux1394 sbp2 does this last step. */
-- sbp2_set_busy_timeout(scsi_id);
--#endif
-+ /* set appropriate retry limit(s) in BUSY_TIMEOUT register */
-+ sbp2_set_busy_timeout(lu);
-
- PREPARE_DELAYED_WORK(&lu->work, sbp2_reconnect);
- sbp2_agent_reset(lu);
-@@ -1083,6 +1115,7 @@ static int sbp2_probe(struct device *dev)
+@@ -1111,6 +1115,7 @@ static int sbp2_probe(struct device *dev)
kref_init(&tgt->kref);
INIT_LIST_HEAD(&tgt->lu_list);
tgt->bus_id = unit->device.bus_id;
@@ -1460,7 +1195,7 @@
if (fw_device_enable_phys_dma(device) < 0)
goto fail_shost_put;
-@@ -1091,6 +1124,7 @@ static int sbp2_probe(struct device *dev)
+@@ -1119,6 +1124,7 @@ static int sbp2_probe(struct device *dev)
goto fail_shost_put;
fw_device_get(device);
@@ -1468,7 +1203,7 @@
/* Initialize to values that won't match anything in our table. */
firmware_revision = 0xff000000;
-@@ -1106,8 +1140,6 @@ static int sbp2_probe(struct device *dev)
+@@ -1134,8 +1140,6 @@ static int sbp2_probe(struct device *dev)
sbp2_init_workarounds(tgt, model, firmware_revision);
@@ -1477,7 +1212,7 @@
/* Do the login in a workqueue so we can easily reschedule retries. */
list_for_each_entry(lu, &tgt->lu_list, link)
sbp2_queue_work(lu, 0);
-@@ -1339,9 +1371,12 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
+@@ -1367,9 +1371,12 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
* tables.
*/
if (count == 1 && sg_dma_len(sg) < SBP2_MAX_SG_ELEMENT_LENGTH) {
@@ -1493,7 +1228,7 @@
return 0;
}
-@@ -1362,16 +1397,14 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
+@@ -1390,16 +1397,14 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
goto fail_page_table;
}
l = min(sg_len, SBP2_MAX_SG_ELEMENT_LENGTH);
@@ -1512,7 +1247,7 @@
orb->page_table_bus =
dma_map_single(device->card->device, orb->page_table,
sizeof(orb->page_table), DMA_TO_DEVICE);
-@@ -1385,11 +1418,10 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
+@@ -1413,11 +1418,10 @@ sbp2_map_scatterlist(struct sbp2_command_orb *orb, struct fw_device *device,
* initiator (i.e. us), but data_descriptor can refer to data
* on other nodes so we need to put our ID in descriptor.high.
*/
@@ -1528,7 +1263,7 @@
return 0;
-@@ -1435,8 +1467,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
+@@ -1463,8 +1467,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
orb->done = done;
orb->cmd = cmd;
@@ -1538,7 +1273,7 @@
/*
* At speed 100 we can do 512 bytes per packet, at speed 200,
* 1024 bytes per packet etc. The SBP-2 max_payload field
-@@ -1445,25 +1476,17 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
+@@ -1473,25 +1476,17 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
*/
max_payload = min(device->max_speed + 7,
device->card->max_receive - 1);
@@ -1567,7 +1302,7 @@
memcpy(orb->request.command_block, cmd->cmnd, COMMAND_SIZE(*cmd->cmnd));
orb->base.callback = complete_command_orb;
-@@ -1491,11 +1514,8 @@ static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
+@@ -1519,11 +1514,8 @@ static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
sdev->allow_restart = 1;
@@ -1581,7 +1316,7 @@
if (lu->tgt->workarounds & SBP2_WORKAROUND_INQUIRY_36)
sdev->inquiry_len = 36;
-@@ -1553,16 +1573,14 @@ sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr,
+@@ -1581,16 +1573,14 @@ sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr,
{
struct scsi_device *sdev = to_scsi_device(dev);
struct sbp2_logical_unit *lu;
@@ -1601,18 +1336,10 @@
}
diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
-index e47bb04..ebdec4c 100644
+index d2c7a3d..ebdec4c 100644
--- a/drivers/firewire/fw-topology.c
+++ b/drivers/firewire/fw-topology.c
-@@ -21,6 +21,7 @@
- #include <linux/module.h>
- #include <linux/wait.h>
- #include <linux/errno.h>
-+#include <asm/bug.h>
- #include <asm/system.h>
- #include "fw-transaction.h"
- #include "fw-topology.h"
-@@ -107,6 +108,7 @@ static struct fw_node *fw_node_create(u32 sid, int port_count, int color)
+@@ -108,6 +108,7 @@ static struct fw_node *fw_node_create(u32 sid, int port_count, int color)
node->node_id = LOCAL_BUS | SELF_ID_PHY_ID(sid);
node->link_on = SELF_ID_LINK_ON(sid);
node->phy_speed = SELF_ID_PHY_SPEED(sid);
@@ -1620,14 +1347,7 @@
node->port_count = port_count;
atomic_set(&node->ref_count, 1);
-@@ -424,12 +426,14 @@ update_tree(struct fw_card *card, struct fw_node *root)
- node1 = fw_node(list1.next);
-
- while (&node0->link != &list0) {
-+ WARN_ON(node0->port_count != node1->port_count);
-
-- /* assert(node0->port_count == node1->port_count); */
- if (node0->link_on && !node1->link_on)
+@@ -431,6 +432,8 @@ update_tree(struct fw_card *card, struct fw_node *root)
event = FW_NODE_LINK_OFF;
else if (!node0->link_on && node1->link_on)
event = FW_NODE_LINK_ON;
@@ -1659,7 +1379,7 @@
struct fw_node {
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
-index 7fcc59d..e550535 100644
+index 99529e5..e550535 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -396,7 +396,8 @@ const struct fw_address_region fw_high_memory_region =
@@ -1682,15 +1402,6 @@
static void
handle_topology_map(struct fw_card *card, struct fw_request *request,
-@@ -751,7 +753,7 @@ handle_topology_map(struct fw_card *card, struct fw_request *request,
- void *payload, size_t length, void *callback_data)
- {
- int i, start, end;
-- u32 *map;
-+ __be32 *map;
-
- if (!TCODE_IS_READ_REQUEST(tcode)) {
- fw_send_response(card, request, RCODE_TYPE_ERROR);
@@ -779,7 +781,8 @@ static struct fw_address_handler topology_map = {
};
@@ -1711,25 +1422,9 @@
__be32 *data = payload;
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
-index 09cb728..8d1987f 100644
+index a43bb22..8d1987f 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
-@@ -86,12 +86,12 @@
- static inline void
- fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
- {
-- u32 *dst = _dst;
-- u32 *src = _src;
-+ u32 *dst = _dst;
-+ __be32 *src = _src;
- int i;
-
- for (i = 0; i < size / 4; i++)
-- dst[i] = cpu_to_be32(src[i]);
-+ dst[i] = be32_to_cpu(src[i]);
- }
-
- static inline void
@@ -221,12 +221,9 @@ struct fw_card {
const struct fw_card_driver *driver;
struct device *device;
@@ -2135,22 +1830,10 @@
/******************************************************************************/
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
-index 9e2b196..16b9d0a 100644
+index f53f72d..16b9d0a 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
-@@ -376,6 +376,11 @@ static const struct {
- .model_id = SBP2_ROM_VALUE_WILDCARD,
- .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
- },
-+ /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ {
-+ .firmware_revision = 0x002600,
-+ .model_id = SBP2_ROM_VALUE_WILDCARD,
-+ .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
-+ },
- /* iPod 4th generation */ {
- .firmware_revision = 0x0a2700,
- .model_id = 0x000021,
-@@ -610,7 +615,7 @@ static struct sbp2_command_info *sbp2util_allocate_command_orb(
+@@ -615,7 +615,7 @@ static struct sbp2_command_info *sbp2util_allocate_command_orb(
cmd->Current_SCpnt = Current_SCpnt;
list_add_tail(&cmd->list, &lu->cmd_orb_inuse);
} else
@@ -2159,7 +1842,7 @@
spin_unlock_irqrestore(&lu->cmd_orb_lock, flags);
return cmd;
}
-@@ -1289,7 +1294,7 @@ static int sbp2_set_busy_timeout(struct sbp2_lu *lu)
+@@ -1294,7 +1294,7 @@ static int sbp2_set_busy_timeout(struct sbp2_lu *lu)
data = cpu_to_be32(SBP2_BUSY_TIMEOUT_VALUE);
if (hpsb_node_write(lu->ne, SBP2_BUSY_TIMEOUT_ADDRESS, &data, 4))
@@ -2168,7 +1851,7 @@
return 0;
}
-@@ -1980,11 +1985,8 @@ static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
+@@ -1985,11 +1985,8 @@ static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
lu->sdev = sdev;
sdev->allow_restart = 1;
More information about the fedora-extras-commits
mailing list