Commit eddeb0e2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (43 commits)
  firewire: cleanups
  firewire: fix synchronization of gap counts
  firewire: wait until PHY configuration packet was transmitted (fix bus reset loop)
  firewire: remove unused struct member
  firewire: use bitwise and to get reg in handle_registers
  firewire: replace more hex values with defined csr constants
  firewire: reread config ROM when device reset the bus
  firewire: replace static ROM cache by allocated cache
  firewire: fw-ohci: work around generation bug in TI controllers (fix AV/C and more)
  firewire: fw-ohci: extend logging of bus generations and node ID
  firewire: fw-ohci: conditionally log busReset interrupts
  firewire: fw-ohci: don't append to AT context when it's not active
  firewire: fw-ohci: log regAccessFail events
  firewire: fw-ohci: make sure HCControl register LPS bit is set
  firewire: fw-ohci: missing PPC PMac feature calls in failure path
  firewire: fw-ohci: untangle a mixed unsigned/signed expression
  firewire: debug interrupt events
  firewire: fw-ohci: catch self_id_count == 0
  firewire: fw-ohci: add self ID error check
  firewire: fw-ohci: refactor probe, remove, suspend, resume
  ...
parents 855d854a db8be076
...@@ -41,15 +41,19 @@ to a working state and enables physical DMA by default for all remote nodes. ...@@ -41,15 +41,19 @@ to a working state and enables physical DMA by default for all remote nodes.
This can be turned off by ohci1394's module parameter phys_dma=0. This can be turned off by ohci1394's module parameter phys_dma=0.
The alternative firewire-ohci driver in drivers/firewire uses filtered physical The alternative firewire-ohci driver in drivers/firewire uses filtered physical
DMA, hence is not yet suitable for remote debugging. DMA by default, which is more secure but not suitable for remote debugging.
Compile the driver with CONFIG_FIREWIRE_OHCI_REMOTE_DMA (Kernel hacking menu:
Remote debugging over FireWire with firewire-ohci) to get unfiltered physical
DMA.
Because ohci1394 depends on the PCI enumeration to be completed, an Because ohci1394 and firewire-ohci depend on the PCI enumeration to be
initialization routine which runs pretty early (long before console_init() completed, an initialization routine which runs pretty early has been
which makes the printk buffer appear on the console can be called) was written. implemented for x86. This routine runs long before console_init() can be
called, i.e. before the printk buffer appears on the console.
To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu: 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 Remote debugging over FireWire early on boot) and pass the parameter
parameter "ohci1394_dma=early" to the recompiled kernel on boot. "ohci1394_dma=early" to the recompiled kernel on boot.
Tools Tools
----- -----
......
...@@ -54,6 +54,11 @@ config FIREWIRE_OHCI ...@@ -54,6 +54,11 @@ config FIREWIRE_OHCI
directive, use "install modulename /bin/true" for the modules to be directive, use "install modulename /bin/true" for the modules to be
blacklisted. blacklisted.
config FIREWIRE_OHCI_DEBUG
bool
depends on FIREWIRE_OHCI
default y
config FIREWIRE_SBP2 config FIREWIRE_SBP2
tristate "Support for storage devices (SBP-2 protocol driver)" tristate "Support for storage devices (SBP-2 protocol driver)"
depends on FIREWIRE && SCSI depends on FIREWIRE && SCSI
......
...@@ -167,7 +167,6 @@ fw_core_add_descriptor(struct fw_descriptor *desc) ...@@ -167,7 +167,6 @@ fw_core_add_descriptor(struct fw_descriptor *desc)
return 0; return 0;
} }
EXPORT_SYMBOL(fw_core_add_descriptor);
void void
fw_core_remove_descriptor(struct fw_descriptor *desc) fw_core_remove_descriptor(struct fw_descriptor *desc)
...@@ -182,7 +181,6 @@ fw_core_remove_descriptor(struct fw_descriptor *desc) ...@@ -182,7 +181,6 @@ fw_core_remove_descriptor(struct fw_descriptor *desc)
mutex_unlock(&card_mutex); mutex_unlock(&card_mutex);
} }
EXPORT_SYMBOL(fw_core_remove_descriptor);
static const char gap_count_table[] = { static const char gap_count_table[] = {
63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40 63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40
...@@ -220,7 +218,7 @@ fw_card_bm_work(struct work_struct *work) ...@@ -220,7 +218,7 @@ fw_card_bm_work(struct work_struct *work)
struct bm_data bmd; struct bm_data bmd;
unsigned long flags; unsigned long flags;
int root_id, new_root_id, irm_id, gap_count, generation, grace; int root_id, new_root_id, irm_id, gap_count, generation, grace;
int do_reset = 0; bool do_reset = false;
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
local_node = card->local_node; local_node = card->local_node;
...@@ -331,7 +329,7 @@ fw_card_bm_work(struct work_struct *work) ...@@ -331,7 +329,7 @@ fw_card_bm_work(struct work_struct *work)
*/ */
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
goto out; goto out;
} else if (root_device->config_rom[2] & BIB_CMC) { } else if (root_device->cmc) {
/* /*
* FIXME: I suppose we should set the cmstr bit in the * FIXME: I suppose we should set the cmstr bit in the
* STATE_CLEAR register of this node, as described in * STATE_CLEAR register of this node, as described in
...@@ -360,14 +358,14 @@ fw_card_bm_work(struct work_struct *work) ...@@ -360,14 +358,14 @@ fw_card_bm_work(struct work_struct *work)
gap_count = 63; gap_count = 63;
/* /*
* Finally, figure out if we should do a reset or not. If we've * Finally, figure out if we should do a reset or not. If we have
* done less that 5 resets with the same physical topology and we * done less than 5 resets with the same physical topology and we
* have either a new root or a new gap count setting, let's do it. * have either a new root or a new gap count setting, let's do it.
*/ */
if (card->bm_retries++ < 5 && if (card->bm_retries++ < 5 &&
(card->gap_count != gap_count || new_root_id != root_id)) (card->gap_count != gap_count || new_root_id != root_id))
do_reset = 1; do_reset = true;
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
...@@ -398,7 +396,6 @@ fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver, ...@@ -398,7 +396,6 @@ fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
{ {
static atomic_t index = ATOMIC_INIT(-1); static atomic_t index = ATOMIC_INIT(-1);
kref_init(&card->kref);
atomic_set(&card->device_count, 0); atomic_set(&card->device_count, 0);
card->index = atomic_inc_return(&index); card->index = atomic_inc_return(&index);
card->driver = driver; card->driver = driver;
...@@ -429,12 +426,6 @@ fw_card_add(struct fw_card *card, ...@@ -429,12 +426,6 @@ fw_card_add(struct fw_card *card,
card->link_speed = link_speed; card->link_speed = link_speed;
card->guid = guid; card->guid = guid;
/*
* 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);
mutex_lock(&card_mutex); mutex_lock(&card_mutex);
config_rom = generate_config_rom(card, &length); config_rom = generate_config_rom(card, &length);
list_add_tail(&card->link, &card_list); list_add_tail(&card->link, &card_list);
...@@ -540,40 +531,9 @@ fw_core_remove_card(struct fw_card *card) ...@@ -540,40 +531,9 @@ fw_core_remove_card(struct fw_card *card)
cancel_delayed_work_sync(&card->work); cancel_delayed_work_sync(&card->work);
fw_flush_transactions(card); fw_flush_transactions(card);
del_timer_sync(&card->flush_timer); del_timer_sync(&card->flush_timer);
fw_card_put(card);
} }
EXPORT_SYMBOL(fw_core_remove_card); EXPORT_SYMBOL(fw_core_remove_card);
struct fw_card *
fw_card_get(struct fw_card *card)
{
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)
{
kref_put(&card->kref, release_card);
}
EXPORT_SYMBOL(fw_card_put);
int int
fw_core_initiate_bus_reset(struct fw_card *card, int short_reset) fw_core_initiate_bus_reset(struct fw_card *card, int short_reset)
{ {
......
...@@ -269,21 +269,28 @@ static int ioctl_get_info(struct client *client, void *buffer) ...@@ -269,21 +269,28 @@ static int ioctl_get_info(struct client *client, void *buffer)
{ {
struct fw_cdev_get_info *get_info = buffer; struct fw_cdev_get_info *get_info = buffer;
struct fw_cdev_event_bus_reset bus_reset; struct fw_cdev_event_bus_reset bus_reset;
unsigned long ret = 0;
client->version = get_info->version; client->version = get_info->version;
get_info->version = FW_CDEV_VERSION; get_info->version = FW_CDEV_VERSION;
down_read(&fw_device_rwsem);
if (get_info->rom != 0) { if (get_info->rom != 0) {
void __user *uptr = u64_to_uptr(get_info->rom); void __user *uptr = u64_to_uptr(get_info->rom);
size_t want = get_info->rom_length; size_t want = get_info->rom_length;
size_t have = client->device->config_rom_length * 4; size_t have = client->device->config_rom_length * 4;
if (copy_to_user(uptr, client->device->config_rom, ret = copy_to_user(uptr, client->device->config_rom,
min(want, have))) min(want, have));
return -EFAULT;
} }
get_info->rom_length = client->device->config_rom_length * 4; get_info->rom_length = client->device->config_rom_length * 4;
up_read(&fw_device_rwsem);
if (ret != 0)
return -EFAULT;
client->bus_reset_closure = get_info->bus_reset_closure; client->bus_reset_closure = get_info->bus_reset_closure;
if (get_info->bus_reset != 0) { if (get_info->bus_reset != 0) {
void __user *uptr = u64_to_uptr(get_info->bus_reset); void __user *uptr = u64_to_uptr(get_info->bus_reset);
......
This diff is collapsed.
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/cdev.h> #include <linux/cdev.h>
#include <linux/rwsem.h>
#include <asm/atomic.h> #include <asm/atomic.h>
enum fw_device_state { enum fw_device_state {
...@@ -46,6 +47,11 @@ struct fw_attribute_group { ...@@ -46,6 +47,11 @@ struct fw_attribute_group {
* fw_device.node_id is guaranteed to be current too. * fw_device.node_id is guaranteed to be current too.
* *
* The same applies to fw_device.card->node_id vs. fw_device.generation. * The same applies to fw_device.card->node_id vs. fw_device.generation.
*
* fw_device.config_rom and fw_device.config_rom_length may be accessed during
* the lifetime of any fw_unit belonging to the fw_device, before device_del()
* was called on the last fw_unit. Alternatively, they may be accessed while
* holding fw_device_rwsem.
*/ */
struct fw_device { struct fw_device {
atomic_t state; atomic_t state;
...@@ -53,6 +59,7 @@ struct fw_device { ...@@ -53,6 +59,7 @@ struct fw_device {
int node_id; int node_id;
int generation; int generation;
unsigned max_speed; unsigned max_speed;
bool cmc;
struct fw_card *card; struct fw_card *card;
struct device device; struct device device;
struct list_head link; struct list_head link;
...@@ -64,28 +71,24 @@ struct fw_device { ...@@ -64,28 +71,24 @@ struct fw_device {
struct fw_attribute_group attribute_group; struct fw_attribute_group attribute_group;
}; };
static inline struct fw_device * static inline struct fw_device *fw_device(struct device *dev)
fw_device(struct device *dev)
{ {
return container_of(dev, struct fw_device, device); return container_of(dev, struct fw_device, device);
} }
static inline int static inline int fw_device_is_shutdown(struct fw_device *device)
fw_device_is_shutdown(struct fw_device *device)
{ {
return atomic_read(&device->state) == FW_DEVICE_SHUTDOWN; return atomic_read(&device->state) == FW_DEVICE_SHUTDOWN;
} }
static inline struct fw_device * static inline struct fw_device *fw_device_get(struct fw_device *device)
fw_device_get(struct fw_device *device)
{ {
get_device(&device->device); get_device(&device->device);
return device; return device;
} }
static inline void static inline void fw_device_put(struct fw_device *device)
fw_device_put(struct fw_device *device)
{ {
put_device(&device->device); put_device(&device->device);
} }
...@@ -96,20 +99,35 @@ int fw_device_enable_phys_dma(struct fw_device *device); ...@@ -96,20 +99,35 @@ int fw_device_enable_phys_dma(struct fw_device *device);
void fw_device_cdev_update(struct fw_device *device); void fw_device_cdev_update(struct fw_device *device);
void fw_device_cdev_remove(struct fw_device *device); void fw_device_cdev_remove(struct fw_device *device);
extern struct rw_semaphore fw_device_rwsem;
extern int fw_cdev_major; extern int fw_cdev_major;
/*
* fw_unit.directory must not be accessed after device_del(&fw_unit.device).
*/
struct fw_unit { struct fw_unit {
struct device device; struct device device;
u32 *directory; u32 *directory;
struct fw_attribute_group attribute_group; struct fw_attribute_group attribute_group;
}; };
static inline struct fw_unit * static inline struct fw_unit *fw_unit(struct device *dev)
fw_unit(struct device *dev)
{ {
return container_of(dev, struct fw_unit, device); return container_of(dev, struct fw_unit, device);
} }
static inline struct fw_unit *fw_unit_get(struct fw_unit *unit)
{
get_device(&unit->device);
return unit;
}
static inline void fw_unit_put(struct fw_unit *unit)
{
put_device(&unit->device);
}
#define CSR_OFFSET 0x40 #define CSR_OFFSET 0x40
#define CSR_LEAF 0x80 #define CSR_LEAF 0x80
#define CSR_DIRECTORY 0xc0 #define CSR_DIRECTORY 0xc0
......
...@@ -126,7 +126,6 @@ fw_iso_context_create(struct fw_card *card, int type, ...@@ -126,7 +126,6 @@ fw_iso_context_create(struct fw_card *card, int type,
return ctx; return ctx;
} }
EXPORT_SYMBOL(fw_iso_context_create);
void fw_iso_context_destroy(struct fw_iso_context *ctx) void fw_iso_context_destroy(struct fw_iso_context *ctx)
{ {
...@@ -134,14 +133,12 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx) ...@@ -134,14 +133,12 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx)
card->driver->free_iso_context(ctx); card->driver->free_iso_context(ctx);
} }
EXPORT_SYMBOL(fw_iso_context_destroy);
int int
fw_iso_context_start(struct fw_iso_context *ctx, int cycle, int sync, int tags) fw_iso_context_start(struct fw_iso_context *ctx, int cycle, int sync, int tags)
{ {
return ctx->card->driver->start_iso(ctx, cycle, sync, tags); return ctx->card->driver->start_iso(ctx, cycle, sync, tags);
} }
EXPORT_SYMBOL(fw_iso_context_start);
int int
fw_iso_context_queue(struct fw_iso_context *ctx, fw_iso_context_queue(struct fw_iso_context *ctx,
...@@ -153,11 +150,9 @@ fw_iso_context_queue(struct fw_iso_context *ctx, ...@@ -153,11 +150,9 @@ fw_iso_context_queue(struct fw_iso_context *ctx,
return card->driver->queue_iso(ctx, packet, buffer, payload); return card->driver->queue_iso(ctx, packet, buffer, payload);
} }
EXPORT_SYMBOL(fw_iso_context_queue);
int int
fw_iso_context_stop(struct fw_iso_context *ctx) fw_iso_context_stop(struct fw_iso_context *ctx)
{ {
return ctx->card->driver->stop_iso(ctx); return ctx->card->driver->stop_iso(ctx);
} }
EXPORT_SYMBOL(fw_iso_context_stop);
This diff is collapsed.
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#define OHCI1394_HCControl_softReset 0x00010000 #define OHCI1394_HCControl_softReset 0x00010000
#define OHCI1394_SelfIDBuffer 0x064 #define OHCI1394_SelfIDBuffer 0x064
#define OHCI1394_SelfIDCount 0x068 #define OHCI1394_SelfIDCount 0x068
#define OHCI1394_SelfIDCount_selfIDError 0x80000000
#define OHCI1394_IRMultiChanMaskHiSet 0x070 #define OHCI1394_IRMultiChanMaskHiSet 0x070
#define OHCI1394_IRMultiChanMaskHiClear 0x074 #define OHCI1394_IRMultiChanMaskHiClear 0x074
#define OHCI1394_IRMultiChanMaskLoSet 0x078 #define OHCI1394_IRMultiChanMaskLoSet 0x078
...@@ -124,6 +125,7 @@ ...@@ -124,6 +125,7 @@
#define OHCI1394_lockRespErr 0x00000200 #define OHCI1394_lockRespErr 0x00000200
#define OHCI1394_selfIDComplete 0x00010000 #define OHCI1394_selfIDComplete 0x00010000
#define OHCI1394_busReset 0x00020000 #define OHCI1394_busReset 0x00020000
#define OHCI1394_regAccessFail 0x00040000
#define OHCI1394_phy 0x00080000 #define OHCI1394_phy 0x00080000
#define OHCI1394_cycleSynch 0x00100000 #define OHCI1394_cycleSynch 0x00100000
#define OHCI1394_cycle64Seconds 0x00200000 #define OHCI1394_cycle64Seconds 0x00200000
......
This diff is collapsed.
...@@ -108,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->node_id = LOCAL_BUS | SELF_ID_PHY_ID(sid);
node->link_on = SELF_ID_LINK_ON(sid); node->link_on = SELF_ID_LINK_ON(sid);
node->phy_speed = SELF_ID_PHY_SPEED(sid); node->phy_speed = SELF_ID_PHY_SPEED(sid);
node->initiated_reset = SELF_ID_PHY_INITIATOR(sid);
node->port_count = port_count; node->port_count = port_count;
atomic_set(&node->ref_count, 1); atomic_set(&node->ref_count, 1);
...@@ -289,12 +290,11 @@ static struct fw_node *build_tree(struct fw_card *card, ...@@ -289,12 +290,11 @@ static struct fw_node *build_tree(struct fw_card *card,
beta_repeaters_present = true; beta_repeaters_present = true;
/* /*
* If all PHYs does not report the same gap count * If PHYs report different gap counts, set an invalid count
* setting, we fall back to 63 which will force a gap * which will force a gap count reconfiguration and a reset.
* count reconfiguration and a reset.
*/ */
if (SELF_ID_GAP_COUNT(q) != gap_count) if (SELF_ID_GAP_COUNT(q) != gap_count)
gap_count = 63; gap_count = 0;
update_hop_count(node); update_hop_count(node);
...@@ -431,6 +431,8 @@ update_tree(struct fw_card *card, struct fw_node *root) ...@@ -431,6 +431,8 @@ update_tree(struct fw_card *card, struct fw_node *root)
event = FW_NODE_LINK_OFF; event = FW_NODE_LINK_OFF;
else if (!node0->link_on && node1->link_on) else if (!node0->link_on && node1->link_on)
event = FW_NODE_LINK_ON; event = FW_NODE_LINK_ON;
else if (node1->initiated_reset && node1->link_on)
event = FW_NODE_INITIATED_RESET;
else else
event = FW_NODE_UPDATED; event = FW_NODE_UPDATED;
......
...@@ -20,11 +20,12 @@ ...@@ -20,11 +20,12 @@
#define __fw_topology_h #define __fw_topology_h
enum { enum {
FW_NODE_CREATED = 0x00, FW_NODE_CREATED,
FW_NODE_UPDATED = 0x01, FW_NODE_UPDATED,
FW_NODE_DESTROYED = 0x02, FW_NODE_DESTROYED,
FW_NODE_LINK_ON = 0x03, FW_NODE_LINK_ON,
FW_NODE_LINK_OFF = 0x04, FW_NODE_LINK_OFF,
FW_NODE_INITIATED_RESET,
}; };
struct fw_node { struct fw_node {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <linux/completion.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -294,42 +295,40 @@ fw_send_request(struct fw_card *card, struct fw_transaction *t, ...@@ -294,42 +295,40 @@ fw_send_request(struct fw_card *card, struct fw_transaction *t,
} }
EXPORT_SYMBOL(fw_send_request); EXPORT_SYMBOL(fw_send_request);
struct fw_phy_packet {
struct fw_packet packet;
struct completion done;
};
static void static void
transmit_phy_packet_callback(struct fw_packet *packet, transmit_phy_packet_callback(struct fw_packet *packet,
struct fw_card *card, int status) struct fw_card *card, int status)
{ {
kfree(packet); struct fw_phy_packet *p =
} container_of(packet, struct fw_phy_packet, packet);
static void send_phy_packet(struct fw_card *card, u32 data, int generation)
{
struct fw_packet *packet;
packet = kzalloc(sizeof(*packet), GFP_ATOMIC);
if (packet == NULL)
return;
packet->header[0] = data;
packet->header[1] = ~data;
packet->header_length = 8;
packet->payload_length = 0;
packet->speed = SCODE_100;
packet->generation = generation;
packet->callback = transmit_phy_packet_callback;
card->driver->send_request(card, packet); complete(&p->done);
} }
void fw_send_phy_config(struct fw_card *card, void fw_send_phy_config(struct fw_card *card,
int node_id, int generation, int gap_count) int node_id, int generation, int gap_count)
{ {
u32 q; struct fw_phy_packet p;
u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG) |
q = PHY_IDENTIFIER(PHY_PACKET_CONFIG) | PHY_CONFIG_ROOT_ID(node_id) |
PHY_CONFIG_ROOT_ID(node_id) | PHY_CONFIG_GAP_COUNT(gap_count);
PHY_CONFIG_GAP_COUNT(gap_count);
p.packet.header[0] = data;
send_phy_packet(card, q, generation); p.packet.header[1] = ~data;
p.packet.header_length = 8;
p.packet.payload_length = 0;
p.packet.speed = SCODE_100;
p.packet.generation = generation;
p.packet.callback = transmit_phy_packet_callback;
init_completion(&p.done);
card->driver->send_request(card, &p.packet);
wait_for_completion(&p.done);
} }
void fw_flush_transactions(struct fw_card *card) void fw_flush_transactions(struct fw_card *card)
...@@ -389,21 +388,21 @@ lookup_enclosing_address_handler(struct list_head *list, ...@@ -389,21 +388,21 @@ lookup_enclosing_address_handler(struct list_head *list,
static DEFINE_SPINLOCK(address_handler_lock); static DEFINE_SPINLOCK(address_handler_lock);
static LIST_HEAD(address_handler_list); static LIST_HEAD(address_handler_list);
const struct fw_address_region fw_low_memory_region =
{ .start = 0x000000000000ULL, .end = 0x000100000000ULL, };
const struct fw_address_region fw_high_memory_region = const struct fw_address_region fw_high_memory_region =
{ .start = 0x000100000000ULL, .end = 0xffffe0000000ULL, }; { .start = 0x000100000000ULL, .end = 0xffffe0000000ULL, };
EXPORT_SYMBOL(fw_high_memory_region);
#if 0
const struct fw_address_region fw_low_memory_region =
{ .start = 0x000000000000ULL, .end = 0x000100000000ULL, };
const struct fw_address_region fw_private_region = const struct fw_address_region fw_private_region =
{ .start = 0xffffe0000000ULL, .end = 0xfffff0000000ULL, }; { .start = 0xffffe0000000ULL, .end = 0xfffff0000000ULL, };
const struct fw_address_region fw_csr_region = const struct fw_address_region fw_csr_region =
{ .start = 0xfffff0000000ULL, .end = 0xfffff0000800ULL, }; { .start = CSR_REGISTER_BASE,
.end = CSR_REGISTER_BASE | CSR_CONFIG_ROM_END, };
const struct fw_address_region fw_unit_space_region = const struct fw_address_region fw_unit_space_region =
{ .start = 0xfffff0000900ULL, .end = 0x1000000000000ULL, }; { .start = 0xfffff0000900ULL, .end = 0x1000000000000ULL, };
EXPORT_SYMBOL(fw_low_memory_region); #endif /* 0 */
EXPORT_SYMBOL(fw_high_memory_region);
EXPORT_SYMBOL(fw_private_region);
EXPORT_SYMBOL(fw_csr_region);
EXPORT_SYMBOL(fw_unit_space_region);
/** /**
* Allocate a range of addresses in the node space of the OHCI * Allocate a range of addresses in the node space of the OHCI
...@@ -747,7 +746,8 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p) ...@@ -747,7 +746,8 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
EXPORT_SYMBOL(fw_core_handle_response); EXPORT_SYMBOL(fw_core_handle_response);
static const struct fw_address_region topology_map_region = static const struct fw_address_region topology_map_region =
{ .start = 0xfffff0001000ull, .end = 0xfffff0001400ull, }; { .start = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP,
.end = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP_END, };
static void static void
handle_topology_map(struct fw_card *card, struct fw_request *request, handle_topology_map(struct fw_card *card, struct fw_request *request,
...@@ -785,7 +785,8 @@ static struct fw_address_handler topology_map = { ...@@ -785,7 +785,8 @@ static struct fw_address_handler topology_map = {
}; };
static const struct fw_address_region registers_region = static const struct fw_address_region registers_region =
{ .start = 0xfffff0000000ull, .end = 0xfffff0000400ull, }; { .start = CSR_REGISTER_BASE,
.end = CSR_REGISTER_BASE | CSR_CONFIG_ROM, };
static void static void
handle_registers(struct fw_card *card, struct fw_request *request, handle_registers(struct fw_card *card, struct fw_request *request,
...@@ -794,7 +795,7 @@ handle_registers(struct fw_card *card, struct fw_request *request, ...@@ -794,7 +795,7 @@ handle_registers(struct fw_card *card, struct fw_request *request,
unsigned long long offset, unsigned long long offset,
void *payload, size_t length, void *callback_data) void *payload, size_t length, void *callback_data)
{ {
int reg = offset - CSR_REGISTER_BASE; int reg = offset & ~CSR_REGISTER_BASE;
unsigned long long bus_time; unsigned long long bus_time;
__be32 *data = payload; __be32 *data = payload;
......
...@@ -201,11 +201,7 @@ struct fw_address_region { ...@@ -201,11 +201,7 @@ struct fw_address_region {
u64 end; u64 end;
}; };
extern const struct fw_address_region fw_low_memory_region;
extern const struct fw_address_region fw_high_memory_region; extern const struct fw_address_region fw_high_memory_region;
extern const struct fw_address_region fw_private_region;
extern const struct fw_address_region fw_csr_region;
extern const struct fw_address_region fw_unit_space_region;
int fw_core_add_address_handler(struct fw_address_handler *handler, int fw_core_add_address_handler(struct fw_address_handler *handler,
const struct fw_address_region *region); const struct fw_address_region *region);
...@@ -221,12 +217,9 @@ struct fw_card { ...@@ -221,12 +217,9 @@ struct fw_card {
const struct fw_card_driver *driver; const struct fw_card_driver *driver;
struct device *device; struct device *device;
atomic_t device_count; atomic_t device_count;
struct kref kref;
int node_id; int node_id;
int generation; int generation;
/* This is the generation used for timestamping incoming requests. */
int request_generation;
int current_tlabel, tlabel_mask; int current_tlabel, tlabel_mask;
struct list_head transaction_list; struct list_head transaction_list;
struct timer_list flush_timer; struct timer_list flush_timer;
...@@ -263,9 +256,6 @@ struct fw_card { ...@@ -263,9 +256,6 @@ struct fw_card {
int bm_generation; int bm_generation;
}; };
struct fw_card *fw_card_get(struct fw_card *card);
void fw_card_put(struct fw_card *card);
/* /*
* The iso packet format allows for an immediate header/payload part * The iso packet format allows for an immediate header/payload part
* stored in 'header' immediately after the packet info plus an * stored in 'header' immediately after the packet info plus an
......
...@@ -133,8 +133,7 @@ static void host_reset(struct hpsb_host *host) ...@@ -133,8 +133,7 @@ static void host_reset(struct hpsb_host *host)
host->csr.state &= ~0x100; host->csr.state &= ~0x100;
} }
host->csr.topology_map[1] = be32_add_cpu(&host->csr.topology_map[1], 1);
cpu_to_be32(be32_to_cpu(host->csr.topology_map[1]) + 1);
host->csr.topology_map[2] = cpu_to_be32(host->node_count << 16 host->csr.topology_map[2] = cpu_to_be32(host->node_count << 16
| host->selfid_count); | host->selfid_count);
host->csr.topology_map[0] = host->csr.topology_map[0] =
...@@ -142,8 +141,7 @@ static void host_reset(struct hpsb_host *host) ...@@ -142,8 +141,7 @@ static void host_reset(struct hpsb_host *host)
| csr_crc16(host->csr.topology_map + 1, | csr_crc16(host->csr.topology_map + 1,
host->selfid_count + 2)); host->selfid_count + 2));
host->csr.speed_map[1] = be32_add_cpu(&host->csr.speed_map[1], 1);
cpu_to_be32(be32_to_cpu(host->csr.speed_map[1]) + 1);
host->csr.speed_map[0] = cpu_to_be32(0x3f1 << 16 host->csr.speed_map[0] = cpu_to_be32(0x3f1 << 16
| csr_crc16(host->csr.speed_map+1, | csr_crc16(host->csr.speed_map+1,
0x3f1)); 0x3f1));
......
...@@ -2179,8 +2179,7 @@ static struct ieee1394_device_id dv1394_id_table[] = { ...@@ -2179,8 +2179,7 @@ static struct ieee1394_device_id dv1394_id_table[] = {
MODULE_DEVICE_TABLE(ieee1394, dv1394_id_table); MODULE_DEVICE_TABLE(ieee1394, dv1394_id_table);
static struct hpsb_protocol_driver dv1394_driver = { static struct hpsb_protocol_driver dv1394_driver = {
.name = "dv1394", .name = "dv1394",
.id_table = dv1394_id_table,
}; };
...@@ -2568,7 +2567,6 @@ static int __init dv1394_init_module(void) ...@@ -2568,7 +2567,6 @@ static int __init dv1394_init_module(void)
cdev_init(&dv1394_cdev, &dv1394_fops); cdev_init(&dv1394_cdev, &dv1394_fops);
dv1394_cdev.owner = THIS_MODULE; dv1394_cdev.owner = THIS_MODULE;
kobject_set_name(&dv1394_cdev.kobj, "dv1394");
ret = cdev_add(&dv1394_cdev, IEEE1394_DV1394_DEV, 16); ret = cdev_add(&dv1394_cdev, IEEE1394_DV1394_DEV, 16);
if (ret) { if (ret) {
printk(KERN_ERR "dv1394: unable to register character device\n"); printk(KERN_ERR "dv1394: unable to register character device\n");
......
...@@ -339,7 +339,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, ...@@ -339,7 +339,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
if ((alignment & 3) || (alignment > 0x800000000000ULL) || if ((alignment & 3) || (alignment > 0x800000000000ULL) ||
(hweight64(alignment) != 1)) { (hweight64(alignment) != 1)) {
HPSB_ERR("%s called with invalid alignment: 0x%048llx", HPSB_ERR("%s called with invalid alignment: 0x%048llx",
__FUNCTION__, (unsigned long long)alignment); __func__, (unsigned long long)alignment);
return retval; return retval;
} }
...@@ -354,7 +354,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, ...@@ -354,7 +354,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
if (((start|end) & ~align_mask) || (start >= end) || if (((start|end) & ~align_mask) || (start >= end) ||
(end > CSR1212_ALL_SPACE_END)) { (end > CSR1212_ALL_SPACE_END)) {
HPSB_ERR("%s called with invalid addresses " HPSB_ERR("%s called with invalid addresses "
"(start = %012Lx end = %012Lx)", __FUNCTION__, "(start = %012Lx end = %012Lx)", __func__,
(unsigned long long)start,(unsigned long long)end); (unsigned long long)start,(unsigned long long)end);
return retval; return retval;
} }
...@@ -422,7 +422,7 @@ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, ...@@ -422,7 +422,7 @@ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
if (((start|end) & 3) || (start >= end) || if (((start|end) & 3) || (start >= end) ||
(end > CSR1212_ALL_SPACE_END)) { (end > CSR1212_ALL_SPACE_END)) {
HPSB_ERR("%s called with invalid addresses", __FUNCTION__); HPSB_ERR("%s called with invalid addresses", __func__);
return 0; return 0;
} }
......
...@@ -242,7 +242,7 @@ int hpsb_bus_reset(struct hpsb_host *host) ...@@ -242,7 +242,7 @@ int hpsb_bus_reset(struct hpsb_host *host)
{ {
if (host->in_bus_reset) { if (host->in_bus_reset) {
HPSB_NOTICE("%s called while bus reset already in progress", HPSB_NOTICE("%s called while bus reset already in progress",
__FUNCTION__); __func__);
return 1; return 1;
} }
...@@ -373,6 +373,8 @@ static void build_speed_map(struct hpsb_host *host, int nodecount) ...@@ -373,6 +373,8 @@ static void build_speed_map(struct hpsb_host *host, int nodecount)
if (sid->port2 == SELFID_PORT_CHILD) cldcnt[n]++; if (sid->port2 == SELFID_PORT_CHILD) cldcnt[n]++;
speedcap[n] = sid->speed; speedcap[n] = sid->speed;
if (speedcap[n] > host->csr.lnk_spd)
speedcap[n] = host->csr.lnk_spd;
n--; n--;
} }
} }
......
...@@ -701,7 +701,11 @@ static int nodemgr_bus_match(struct device * dev, struct device_driver * drv) ...@@ -701,7 +701,11 @@ static int nodemgr_bus_match(struct device * dev, struct device_driver * drv)
return 0; return 0;
driver = container_of(drv, struct hpsb_protocol_driver, driver); driver = container_of(drv, struct hpsb_protocol_driver, driver);
for (id = driver->id_table; id->match_flags != 0; id++) { id = driver->id_table;
if (!id)
return 0;
for (; id->match_flags != 0; id++) {
if ((id->match_flags & IEEE1394_MATCH_VENDOR_ID) && if ((id->match_flags & IEEE1394_MATCH_VENDOR_ID) &&
id->vendor_id != ud->vendor_id) id->vendor_id != ud->vendor_id)
continue; continue;
......
This diff is collapsed.
...@@ -226,7 +226,7 @@ static int get_phy_reg(struct ti_lynx *lynx, int addr) ...@@ -226,7 +226,7 @@ static int get_phy_reg(struct ti_lynx *lynx, int addr)
if (addr > 15) { if (addr > 15) {
PRINT(KERN_ERR, lynx->id, PRINT(KERN_ERR, lynx->id,
"%s: PHY register address %d out of range", "%s: PHY register address %d out of range",
__FUNCTION__, addr); __func__, addr);
return -1; return -1;
} }
...@@ -238,7 +238,7 @@ static int get_phy_reg(struct ti_lynx *lynx, int addr) ...@@ -238,7 +238,7 @@ static int get_phy_reg(struct ti_lynx *lynx, int addr)
if (i > 10000) { if (i > 10000) {
PRINT(KERN_ERR, lynx->id, "%s: runaway loop, aborting", PRINT(KERN_ERR, lynx->id, "%s: runaway loop, aborting",
__FUNCTION__); __func__);
retval = -1; retval = -1;
break; break;
} }
...@@ -261,13 +261,13 @@ static int set_phy_reg(struct ti_lynx *lynx, int addr, int val) ...@@ -261,13 +261,13 @@ static int set_phy_reg(struct ti_lynx *lynx, int addr, int val)
if (addr > 15) { if (addr > 15) {
PRINT(KERN_ERR, lynx->id, PRINT(KERN_ERR, lynx->id,
"%s: PHY register address %d out of range", __FUNCTION__, addr); "%s: PHY register address %d out of range", __func__, addr);
return -1; return -1;
} }
if (val > 0xff) { if (val > 0xff) {
PRINT(KERN_ERR, lynx->id, PRINT(KERN_ERR, lynx->id,
"%s: PHY register value %d out of range", __FUNCTION__, val); "%s: PHY register value %d out of range", __func__, val);
return -1; return -1;
} }
...@@ -287,7 +287,7 @@ static int sel_phy_reg_page(struct ti_lynx *lynx, int page) ...@@ -287,7 +287,7 @@ static int sel_phy_reg_page(struct ti_lynx *lynx, int page)
if (page > 7) { if (page > 7) {
PRINT(KERN_ERR, lynx->id, PRINT(KERN_ERR, lynx->id,
"%s: PHY page %d out of range", __FUNCTION__, page); "%s: PHY page %d out of range", __func__, page);
return -1; return -1;
} }
...@@ -309,7 +309,7 @@ static int sel_phy_reg_port(struct ti_lynx *lynx, int port) ...@@ -309,7 +309,7 @@ static int sel_phy_reg_port(struct ti_lynx *lynx, int port)
if (port > 15) { if (port > 15) {
PRINT(KERN_ERR, lynx->id, PRINT(KERN_ERR, lynx->id,
"%s: PHY port %d out of range", __FUNCTION__, port); "%s: PHY port %d out of range", __func__, port);
return -1; return -1;
} }
...@@ -738,8 +738,7 @@ static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg) ...@@ -738,8 +738,7 @@ static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
spin_lock_irqsave(&lynx->async.queue_lock, flags); spin_lock_irqsave(&lynx->async.queue_lock, flags);
reg_write(lynx, DMA_CHAN_CTRL(CHANNEL_ASYNC_SEND), 0); reg_write(lynx, DMA_CHAN_CTRL(CHANNEL_ASYNC_SEND), 0);
list_splice(&lynx->async.queue, &packet_list); list_splice_init(&lynx->async.queue, &packet_list);
INIT_LIST_HEAD(&lynx->async.queue);
if (list_empty(&lynx->async.pcl_queue)) { if (list_empty(&lynx->async.pcl_queue)) {
spin_unlock_irqrestore(&lynx->async.queue_lock, flags); spin_unlock_irqrestore(&lynx->async.queue_lock, flags);
......
...@@ -2959,7 +2959,6 @@ MODULE_DEVICE_TABLE(ieee1394, raw1394_id_table); ...@@ -2959,7 +2959,6 @@ MODULE_DEVICE_TABLE(ieee1394, raw1394_id_table);
static struct hpsb_protocol_driver raw1394_driver = { static struct hpsb_protocol_driver raw1394_driver = {
.name = "raw1394", .name = "raw1394",
.id_table = raw1394_id_table,
}; };
/******************************************************************************/ /******************************************************************************/
...@@ -3004,7 +3003,6 @@ static int __init init_raw1394(void) ...@@ -3004,7 +3003,6 @@ static int __init init_raw1394(void)
cdev_init(&raw1394_cdev, &raw1394_fops); cdev_init(&raw1394_cdev, &raw1394_fops);
raw1394_cdev.owner = THIS_MODULE; raw1394_cdev.owner = THIS_MODULE;
kobject_set_name(&raw1394_cdev.kobj, RAW1394_DEVICE_NAME);
ret = cdev_add(&raw1394_cdev, IEEE1394_RAW1394_DEV, 1); ret = cdev_add(&raw1394_cdev, IEEE1394_RAW1394_DEV, 1);
if (ret) { if (ret) {
HPSB_ERR("raw1394 failed to register minor device block"); HPSB_ERR("raw1394 failed to register minor device block");
......
...@@ -615,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; cmd->Current_SCpnt = Current_SCpnt;
list_add_tail(&cmd->list, &lu->cmd_orb_inuse); list_add_tail(&cmd->list, &lu->cmd_orb_inuse);
} else } else
SBP2_ERR("%s: no orbs available", __FUNCTION__); SBP2_ERR("%s: no orbs available", __func__);
spin_unlock_irqrestore(&lu->cmd_orb_lock, flags); spin_unlock_irqrestore(&lu->cmd_orb_lock, flags);
return cmd; return cmd;
} }
...@@ -1294,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); data = cpu_to_be32(SBP2_BUSY_TIMEOUT_VALUE);
if (hpsb_node_write(lu->ne, SBP2_BUSY_TIMEOUT_ADDRESS, &data, 4)) if (hpsb_node_write(lu->ne, SBP2_BUSY_TIMEOUT_ADDRESS, &data, 4))
SBP2_ERR("%s error", __FUNCTION__); SBP2_ERR("%s error", __func__);
return 0; return 0;
} }
...@@ -1985,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; lu->sdev = sdev;
sdev->allow_restart = 1; sdev->allow_restart = 1;
/* /* SBP-2 requires quadlet alignment of the data buffers. */
* Update the dma alignment (minimum alignment requirements for blk_queue_update_dma_alignment(sdev->request_queue, 4 - 1);
* start and end of DMA transfers) to be a sector
*/
blk_queue_update_dma_alignment(sdev->request_queue, 511);
if (lu->workarounds & SBP2_WORKAROUND_INQUIRY_36) if (lu->workarounds & SBP2_WORKAROUND_INQUIRY_36)
sdev->inquiry_len = 36; sdev->inquiry_len = 36;
......
...@@ -1315,8 +1315,7 @@ static struct ieee1394_device_id video1394_id_table[] = { ...@@ -1315,8 +1315,7 @@ static struct ieee1394_device_id video1394_id_table[] = {
MODULE_DEVICE_TABLE(ieee1394, video1394_id_table); MODULE_DEVICE_TABLE(ieee1394, video1394_id_table);
static struct hpsb_protocol_driver video1394_driver = { static struct hpsb_protocol_driver video1394_driver = {
.name = VIDEO1394_DRIVER_NAME, .name = VIDEO1394_DRIVER_NAME,
.id_table = video1394_id_table,
}; };
...@@ -1504,7 +1503,6 @@ static int __init video1394_init_module (void) ...@@ -1504,7 +1503,6 @@ static int __init video1394_init_module (void)
cdev_init(&video1394_cdev, &video1394_fops); cdev_init(&video1394_cdev, &video1394_fops);
video1394_cdev.owner = THIS_MODULE; video1394_cdev.owner = THIS_MODULE;
kobject_set_name(&video1394_cdev.kobj, VIDEO1394_DRIVER_NAME);
ret = cdev_add(&video1394_cdev, IEEE1394_VIDEO1394_DEV, 16); ret = cdev_add(&video1394_cdev, IEEE1394_VIDEO1394_DEV, 16);
if (ret) { if (ret) {
PRINT_G(KERN_ERR, "video1394: unable to get minor device block"); PRINT_G(KERN_ERR, "video1394: unable to get minor device block");
......
...@@ -583,7 +583,7 @@ config LATENCYTOP ...@@ -583,7 +583,7 @@ config LATENCYTOP
to find out which userspace is blocking on what kernel operations. to find out which userspace is blocking on what kernel operations.
config PROVIDE_OHCI1394_DMA_INIT config PROVIDE_OHCI1394_DMA_INIT
bool "Provide code for enabling DMA over FireWire early on boot" bool "Remote debugging over FireWire early on boot"
depends on PCI && X86 depends on PCI && X86
help help
If you want to debug problems which hang or crash the kernel early If you want to debug problems which hang or crash the kernel early
...@@ -611,6 +611,17 @@ config PROVIDE_OHCI1394_DMA_INIT ...@@ -611,6 +611,17 @@ config PROVIDE_OHCI1394_DMA_INIT
See Documentation/debugging-via-ohci1394.txt for more information. See Documentation/debugging-via-ohci1394.txt for more information.
config FIREWIRE_OHCI_REMOTE_DMA
bool "Remote debugging over FireWire with firewire-ohci"
depends on FIREWIRE_OHCI
help
This option lets you use the FireWire bus for remote debugging
with help of the firewire-ohci driver. It enables unfiltered
remote DMA in firewire-ohci.
See Documentation/debugging-via-ohci1394.txt for more information.
If unsure, say N.
source "samples/Kconfig" source "samples/Kconfig"
source "lib/Kconfig.kgdb" source "lib/Kconfig.kgdb"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment