sbp2 workqueue patches
Just for the record: I inserted the following two patches into my local git tree while preparing the patch queue for Linus and will push them to linux1394-2.6.git now.
Signature · 3 lines
Stefan Richter -=====-=-==- ==-- --=== http://arcgraph.de/sr/
Quoted 1 line
From
d19c77641412a257fa651662b96fec826e9e7e60Mon Sep 17 00:00:00 2001
From: Stefan Richter <[email protected]>
Date: Thu, 7 Dec 2006 22:40:33 +0100
Subject: [PATCH] ieee1394: sbp2: delayed_work -> work_struct
This work is not delayed.
Also bring the code format in a state which reduces my work to merge pending sbp2 patchs.
--- drivers/ieee1394/sbp2.c | 26 +++++++++++--------------- drivers/ieee1394/sbp2.h | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-)
drivers/ieee1394/sbp2.c +11 -15
@@ -462,23 +462,18 @@ static void sbp2util_notify_fetch_agent(static void sbp2util_write_orb_pointer (struct work_struct *work) { -struct scsi_id_instance_data *scsi_id = - container_of(work, struct scsi_id_instance_data, - protocol_work.work);quadlet_t data[2 ]; - data[0 ] =ORB_SET_NODE_ID (scsi_id->hi->host->node_id); - data[1 ] = scsi_id->last_orb_dma; + data[0 ] =ORB_SET_NODE_ID ( + (container_of(work, struct scsi_id_instance_data, protocol_work))->hi->host->node_id); + data[1] = (container_of(work, struct scsi_id_instance_data, protocol_work))->last_orb_dma;sbp2util_cpu_to_be32_buffer (data,8 ); -sbp2util_notify_fetch_agent (scsi_id,SBP2_ORB_POINTER_OFFSET , data,8 ); + sbp2util_notify_fetch_agent(container_of(work, struct scsi_id_instance_data, protocol_work), SBP2_ORB_POINTER_OFFSET, data, 8); }static void sbp2util_write_doorbell (struct work_struct *work) { -struct scsi_id_instance_data *scsi_id = - container_of(work, struct scsi_id_instance_data, - protocol_work.work); -sbp2util_notify_fetch_agent (scsi_id,SBP2_DOORBELL_OFFSET ,NULL ,4 ); + sbp2util_notify_fetch_agent(container_of(work, struct scsi_id_instance_data, protocol_work), SBP2_DOORBELL_OFFSET, NULL, 4); }/*
@@ -795,7 +790,7 @@ static struct scsi_id_instance_data *sbpINIT_LIST_HEAD (&scsi_id->scsi_list);spin_lock_init (&scsi_id->sbp2_command_orb_lock);atomic_set (&scsi_id->state,SBP2LU_STATE_RUNNING ); -INIT_DELAYED_WORK (&scsi_id->protocol_work,NULL ); +INIT_WORK (&scsi_id->protocol_work,NULL ); ud->device.driver_data = scsi_id;
@@ -1578,7 +1573,7 @@ static int sbp2_agent_reset(struct scsi_int retval;unsigned long flags; -cancel_delayed_work (&scsi_id->protocol_work); +/* cancel_delayed_work(&scsi_id->protocol_work); */ if (wait)flush_scheduled_work ();
@@ -1889,10 +1884,11 @@ static void sbp2_link_orb_command(struct* We do not accept new commands until the job is over. */ scsi_block_requests (scsi_id->scsi_host); -PREPARE_DELAYED_WORK (&scsi_id->protocol_work, +PREPARE_WORK (&scsi_id->protocol_work, last_orb ? sbp2util_write_doorbell: - sbp2util_write_orb_pointer); -schedule_delayed_work (&scsi_id->protocol_work,0 ); + sbp2util_write_orb_pointer +/* */ ); +schedule_work (&scsi_id->protocol_work); } }
drivers/ieee1394/sbp2.h +1 -1
@@ -342,7 +342,7 @@ struct scsi_id_instance_data {unsigned workarounds;atomic_t state; -struct delayed_work protocol_work; +struct work_struct protocol_work; };/* For use in scsi_id_instance_data.state */
Signature · 1 line
1.4.2.4
Quoted 1 line
From
ec9b7e1044d718723d16390179abc6d4c8d9b0a1Mon Sep 17 00:00:00 2001
From: Stefan Richter <[email protected]>
Date: Thu, 7 Dec 2006 23:23:25 +0100
Subject: [PATCH] ieee1394: sbp2: code formatting around work_struct stuff
Merge is finished, can bring the code in readable style again.
--- drivers/ieee1394/sbp2.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
drivers/ieee1394/sbp2.c +9 -7
@@ -458,17 +458,20 @@ static void sbp2util_notify_fetch_agent(static void sbp2util_write_orb_pointer (struct work_struct *work) { + struct sbp2_lu *lu = container_of(work, struct sbp2_lu, protocol_work);quadlet_t data[2 ]; - data[0] = ORB_SET_NODE_ID((container_of(work, struct sbp2_lu, protocol_work))->hi->host->node_id); - data[1] = (container_of(work, struct sbp2_lu, protocol_work))->last_orb_dma; + data[0 ] =ORB_SET_NODE_ID (lu->hi->host->node_id); + data[1 ] = lu->last_orb_dma;sbp2util_cpu_to_be32_buffer (data,8 ); - sbp2util_notify_fetch_agent(container_of(work, struct sbp2_lu, protocol_work), SBP2_ORB_POINTER_OFFSET, data, 8); +sbp2util_notify_fetch_agent (lu,SBP2_ORB_POINTER_OFFSET , data,8 ); }static void sbp2util_write_doorbell (struct work_struct *work) { - sbp2util_notify_fetch_agent(container_of(work, struct sbp2_lu, protocol_work), SBP2_DOORBELL_OFFSET, NULL, 4); + struct sbp2_lu *lu = container_of(work, struct sbp2_lu, protocol_work); + +sbp2util_notify_fetch_agent (lu,SBP2_DOORBELL_OFFSET ,NULL ,4 ); }static int sbp2util_create_command_orb_pool (struct sbp2_lu *lu)
@@ -1399,7 +1402,7 @@ static int sbp2_agent_reset(struct sbp2_int retval;unsigned long flags; -/* cancel_delayed_work(&lu->protocol_work); */ +/* flush lu->protocol_work */ if (wait)flush_scheduled_work ();
@@ -1682,8 +1685,7 @@ static void sbp2_link_orb_command(structscsi_block_requests (lu->shost);PREPARE_WORK (&lu->protocol_work, last_orb ? sbp2util_write_doorbell: - sbp2util_write_orb_pointer -/* */ ); + sbp2util_write_orb_pointer);schedule_work (&lu->protocol_work); } }
Signature · 1 line
1.4.2.4