Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit daf4b805 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: reorder struct fw_card for better cache efficiency
  firewire: fix resetting of bus manager retry counter
  firewire: improve refcounting of fw_card
  firewire: typo in comment
  firewire: fix small memory leak at module removal
  firewire: fw-sbp2: remove unnecessary locking
  ieee1934: dv1394: interrupt enabling/disabling broken on big-endian
  ieee1394: dv1394: annotate frame input/output structs as little endian
  ieee1394: eth1394: trivial sparse annotations
  ieee1394: mark bus_info_data as a __be32 array
  ieee1394: replace CSR_SET_BUS_INFO_GENERATION macro
  ieee1394: pcilynx: trivial endian annotation
  ieee1394: ignore nonzero Bus_Info_Block.max_rom, fetch config ROM in quadlets
  ieee1394: consolidate uses of IEEE1934_BUSID_MAGIC
  ieee1394: ohci1394: flush MMIO writes before delay in initialization
  ieee1394: ohci1394: pass error codes from request_irq through
  ieee1394: ohci1394: don't leave interrupts enabled during suspend/resume
  ieee1394: mark all hpsb_address_ops instances as const
  ieee1394: replace a GFP_ATOMIC by GFP_KERNEL allocation
parents a0c9f240 c8a12d45
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ generate_config_rom(struct fw_card *card, size_t *config_rom_length)
	 * controller, block reads to the config rom accesses the host
	 * memory, but quadlet read access the hardware bus info block
	 * registers.  That's just crack, but it means we should make
	 * sure the contents of bus info block in host memory mathces
	 * sure the contents of bus info block in host memory matches
	 * the version stored in the OHCI registers.
	 */

@@ -189,6 +189,17 @@ static const char gap_count_table[] = {
	63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40
};

void
fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
{
	int scheduled;

	fw_card_get(card);
	scheduled = schedule_delayed_work(&card->work, delay);
	if (!scheduled)
		fw_card_put(card);
}

static void
fw_card_bm_work(struct work_struct *work)
{
@@ -206,7 +217,7 @@ fw_card_bm_work(struct work_struct *work)

	if (local_node == NULL) {
		spin_unlock_irqrestore(&card->lock, flags);
		return;
		goto out_put_card;
	}
	fw_node_get(local_node);
	fw_node_get(root_node);
@@ -280,7 +291,7 @@ fw_card_bm_work(struct work_struct *work)
		 * this task 100ms from now.
		 */
		spin_unlock_irqrestore(&card->lock, flags);
		schedule_delayed_work(&card->work, DIV_ROUND_UP(HZ, 10));
		fw_schedule_bm_work(card, DIV_ROUND_UP(HZ, 10));
		goto out;
	}

@@ -355,6 +366,8 @@ fw_card_bm_work(struct work_struct *work)
		fw_device_put(root_device);
	fw_node_put(root_node);
	fw_node_put(local_node);
 out_put_card:
	fw_card_put(card);
}

static void
@@ -510,7 +523,6 @@ fw_core_remove_card(struct fw_card *card)
	fw_card_put(card);
	wait_for_completion(&card->done);

	cancel_delayed_work_sync(&card->work);
	WARN_ON(!list_empty(&card->transaction_list));
	del_timer_sync(&card->flush_timer);
}
+4 −4
Original line number Diff line number Diff line
@@ -617,7 +617,7 @@ static int shutdown_unit(struct device *device, void *data)
 */
DECLARE_RWSEM(fw_device_rwsem);

static DEFINE_IDR(fw_device_idr);
DEFINE_IDR(fw_device_idr);
int fw_cdev_major;

struct fw_device *fw_device_get_by_devt(dev_t devt)
@@ -689,7 +689,7 @@ static void fw_device_init(struct work_struct *work)
			fw_notify("giving up on config rom for node id %x\n",
				  device->node_id);
			if (device->node == device->card->root_node)
				schedule_delayed_work(&device->card->work, 0);
				fw_schedule_bm_work(device->card, 0);
			fw_device_release(&device->device);
		}
		return;
@@ -758,7 +758,7 @@ static void fw_device_init(struct work_struct *work)
	 * pretty harmless.
	 */
	if (device->node == device->card->root_node)
		schedule_delayed_work(&device->card->work, 0);
		fw_schedule_bm_work(device->card, 0);

	return;

@@ -892,7 +892,7 @@ static void fw_device_refresh(struct work_struct *work)
	fw_device_shutdown(work);
 out:
	if (node_id == card->root_node->node_id)
		schedule_delayed_work(&card->work, 0);
		fw_schedule_bm_work(card, 0);
}

void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@

#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/idr.h>
#include <linux/rwsem.h>
#include <asm/atomic.h>

@@ -99,6 +100,7 @@ void fw_device_cdev_update(struct fw_device *device);
void fw_device_cdev_remove(struct fw_device *device);

extern struct rw_semaphore fw_device_rwsem;
extern struct idr fw_device_idr;
extern int fw_cdev_major;

/*
+6 −15
Original line number Diff line number Diff line
@@ -670,17 +670,6 @@ static void sbp2_agent_reset_no_wait(struct sbp2_logical_unit *lu)
			&d, sizeof(d), complete_agent_reset_write_no_wait, t);
}

static void sbp2_set_generation(struct sbp2_logical_unit *lu, int generation)
{
	struct fw_card *card = fw_device(lu->tgt->unit->device.parent)->card;
	unsigned long flags;

	/* serialize with comparisons of lu->generation and card->generation */
	spin_lock_irqsave(&card->lock, flags);
	lu->generation = generation;
	spin_unlock_irqrestore(&card->lock, flags);
}

static inline void sbp2_allow_block(struct sbp2_logical_unit *lu)
{
	/*
@@ -884,7 +873,7 @@ static void sbp2_login(struct work_struct *work)
		goto out;

	generation    = device->generation;
	smp_rmb();    /* node_id must not be older than generation */
	smp_rmb();    /* node IDs must not be older than generation */
	node_id       = device->node_id;
	local_node_id = device->card->node_id;

@@ -908,7 +897,8 @@ static void sbp2_login(struct work_struct *work)

	tgt->node_id	  = node_id;
	tgt->address_high = local_node_id << 16;
	sbp2_set_generation(lu, generation);
	smp_wmb();	  /* node IDs must not be older than generation */
	lu->generation	  = generation;

	lu->command_block_agent_address =
		((u64)(be32_to_cpu(response.command_block_agent.high) & 0xffff)
@@ -1201,7 +1191,7 @@ static void sbp2_reconnect(struct work_struct *work)
		goto out;

	generation    = device->generation;
	smp_rmb();    /* node_id must not be older than generation */
	smp_rmb();    /* node IDs must not be older than generation */
	node_id       = device->node_id;
	local_node_id = device->card->node_id;

@@ -1228,7 +1218,8 @@ static void sbp2_reconnect(struct work_struct *work)

	tgt->node_id      = node_id;
	tgt->address_high = local_node_id << 16;
	sbp2_set_generation(lu, generation);
	smp_wmb();	  /* node IDs must not be older than generation */
	lu->generation	  = generation;

	fw_notify("%s: reconnected to LUN %04x (%d retries)\n",
		  tgt->bus_id, lu->lun, lu->retries);
+7 −9
Original line number Diff line number Diff line
@@ -355,6 +355,9 @@ report_lost_node(struct fw_card *card,
{
	fw_node_event(card, node, FW_NODE_DESTROYED);
	fw_node_put(node);

	/* Topology has changed - reset bus manager retry counter */
	card->bm_retries = 0;
}

static void
@@ -374,6 +377,9 @@ report_found_node(struct fw_card *card,
	}

	fw_node_event(card, node, FW_NODE_CREATED);

	/* Topology has changed - reset bus manager retry counter */
	card->bm_retries = 0;
}

void fw_destroy_nodes(struct fw_card *card)
@@ -514,14 +520,6 @@ fw_core_handle_bus_reset(struct fw_card *card,

	spin_lock_irqsave(&card->lock, flags);

	/*
	 * If the new topology has a different self_id_count the topology
	 * changed, either nodes were added or removed. In that case we
	 * reset the IRM reset counter.
	 */
	if (card->self_id_count != self_id_count)
		card->bm_retries = 0;

	card->node_id = node_id;
	/*
	 * Update node_id before generation to prevent anybody from using
@@ -530,7 +528,7 @@ fw_core_handle_bus_reset(struct fw_card *card,
	smp_wmb();
	card->generation = generation;
	card->reset_jiffies = jiffies;
	schedule_delayed_work(&card->work, 0);
	fw_schedule_bm_work(card, 0);

	local_node = build_tree(card, self_ids, self_id_count);

Loading