Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235955
b: refs/heads/master
c: 121e8f9
h: refs/heads/master
i:
  235953: bc05add
  235951: f7f348a
v: v3
  • Loading branch information
Rene Sapiens authored and Omar Ramirez Luna committed Feb 5, 2011
1 parent fe988d7 commit 2a12063
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 110 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee4317f78c24cf85efd067f4c09319e281c4fa4a
refs/heads/master: 121e8f9b9fca6a05602cea1245450e653f0d4ba1
2 changes: 1 addition & 1 deletion trunk/drivers/staging/tidspbridge/core/_msg_sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct msg_mgr {
/* Function interface to Bridge driver */
struct bridge_drv_interface *intf_fxns;

struct io_mgr *hio_mgr; /* IO manager */
struct io_mgr *iomgr; /* IO manager */
struct list_head queue_list; /* List of MSG_QUEUEs */
spinlock_t msg_mgr_lock; /* For critical sections */
/* Signalled when MsgFrame is available */
Expand Down
66 changes: 33 additions & 33 deletions trunk/drivers/staging/tidspbridge/core/chnl_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
* which may cause timeouts and/or failure offunction sync_wait_on_event.
* This invariant condition is:
*
* list_empty(&pchnl->pio_completions) ==> pchnl->sync_event is reset
* list_empty(&pchnl->io_completions) ==> pchnl->sync_event is reset
* and
* !list_empty(&pchnl->pio_completions) ==> pchnl->sync_event is set.
* !list_empty(&pchnl->io_completions) ==> pchnl->sync_event is set.
*/

#include <linux/types.h>
Expand Down Expand Up @@ -164,7 +164,7 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf,
if (CHNL_IS_OUTPUT(pchnl->chnl_mode)) {
/* Check buffer size on output channels for fit. */
if (byte_size > io_buf_size(
pchnl->chnl_mgr_obj->hio_mgr)) {
pchnl->chnl_mgr_obj->iomgr)) {
status = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -199,7 +199,7 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf,
chnl_packet_obj->arg = dw_arg;
chnl_packet_obj->status = (is_eos ? CHNL_IOCSTATEOS :
CHNL_IOCSTATCOMPLETE);
list_add_tail(&chnl_packet_obj->link, &pchnl->pio_requests);
list_add_tail(&chnl_packet_obj->link, &pchnl->io_requests);
pchnl->cio_reqs++;
DBC_ASSERT(pchnl->cio_reqs <= pchnl->chnl_packets);
/*
Expand All @@ -212,7 +212,7 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf,
/* Legacy DSM Processor-Copy */
DBC_ASSERT(pchnl->chnl_type == CHNL_PCPY);
/* Request IO from the DSP */
io_request_chnl(chnl_mgr_obj->hio_mgr, pchnl,
io_request_chnl(chnl_mgr_obj->iomgr, pchnl,
(CHNL_IS_INPUT(pchnl->chnl_mode) ? IO_INPUT :
IO_OUTPUT), &mb_val);
sched_dpc = true;
Expand All @@ -224,7 +224,7 @@ int bridge_chnl_add_io_req(struct chnl_object *chnl_obj, void *host_buf,

/* Schedule a DPC, to do the actual data transfer */
if (sched_dpc)
iosm_schedule(chnl_mgr_obj->hio_mgr);
iosm_schedule(chnl_mgr_obj->iomgr);

return status;
}
Expand Down Expand Up @@ -260,27 +260,27 @@ int bridge_chnl_cancel_io(struct chnl_object *chnl_obj)

pchnl->state |= CHNL_STATECANCEL;

if (list_empty(&pchnl->pio_requests)) {
if (list_empty(&pchnl->io_requests)) {
spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock);
return 0;
}

if (pchnl->chnl_type == CHNL_PCPY) {
/* Indicate we have no more buffers available for transfer: */
if (CHNL_IS_INPUT(pchnl->chnl_mode)) {
io_cancel_chnl(chnl_mgr_obj->hio_mgr, chnl_id);
io_cancel_chnl(chnl_mgr_obj->iomgr, chnl_id);
} else {
/* Record that we no longer have output buffers
* available: */
chnl_mgr_obj->output_mask &= ~(1 << chnl_id);
}
}
/* Move all IOR's to IOC queue: */
list_for_each_entry_safe(chirp, tmp, &pchnl->pio_requests, link) {
list_for_each_entry_safe(chirp, tmp, &pchnl->io_requests, link) {
list_del(&chirp->link);
chirp->byte_size = 0;
chirp->status |= CHNL_IOCSTATCANCEL;
list_add_tail(&chirp->link, &pchnl->pio_completions);
list_add_tail(&chirp->link, &pchnl->io_completions);
pchnl->cio_cs++;
pchnl->cio_reqs--;
DBC_ASSERT(pchnl->cio_reqs >= 0);
Expand Down Expand Up @@ -315,7 +315,7 @@ int bridge_chnl_close(struct chnl_object *chnl_obj)
DBC_ASSERT((pchnl->state & CHNL_STATECANCEL));
/* Invalidate channel object: Protects from CHNL_GetIOCompletion() */
/* Free the slot in the channel manager: */
pchnl->chnl_mgr_obj->ap_channel[pchnl->chnl_id] = NULL;
pchnl->chnl_mgr_obj->channels[pchnl->chnl_id] = NULL;
spin_lock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock);
pchnl->chnl_mgr_obj->open_channels -= 1;
spin_unlock_bh(&pchnl->chnl_mgr_obj->chnl_mgr_lock);
Expand All @@ -331,10 +331,10 @@ int bridge_chnl_close(struct chnl_object *chnl_obj)
pchnl->sync_event = NULL;
}
/* Free I/O request and I/O completion queues: */
free_chirp_list(&pchnl->pio_completions);
free_chirp_list(&pchnl->io_completions);
pchnl->cio_cs = 0;

free_chirp_list(&pchnl->pio_requests);
free_chirp_list(&pchnl->io_requests);
pchnl->cio_reqs = 0;

free_chirp_list(&pchnl->free_packets_list);
Expand Down Expand Up @@ -377,9 +377,9 @@ int bridge_chnl_create(struct chnl_mgr **channel_mgr,
DBC_ASSERT(mgr_attrts->max_channels == CHNL_MAXCHANNELS);
max_channels = CHNL_MAXCHANNELS + CHNL_MAXCHANNELS * CHNL_PCPY;
/* Create array of channels */
chnl_mgr_obj->ap_channel = kzalloc(sizeof(struct chnl_object *)
chnl_mgr_obj->channels = kzalloc(sizeof(struct chnl_object *)
* max_channels, GFP_KERNEL);
if (chnl_mgr_obj->ap_channel) {
if (chnl_mgr_obj->channels) {
/* Initialize chnl_mgr object */
chnl_mgr_obj->type = CHNL_TYPESM;
chnl_mgr_obj->word_size = mgr_attrts->word_size;
Expand Down Expand Up @@ -423,15 +423,15 @@ int bridge_chnl_destroy(struct chnl_mgr *hchnl_mgr)
for (chnl_id = 0; chnl_id < chnl_mgr_obj->max_channels;
chnl_id++) {
status =
bridge_chnl_close(chnl_mgr_obj->ap_channel
bridge_chnl_close(chnl_mgr_obj->channels
[chnl_id]);
if (status)
dev_dbg(bridge, "%s: Error status 0x%x\n",
__func__, status);
}

/* Free channel manager object: */
kfree(chnl_mgr_obj->ap_channel);
kfree(chnl_mgr_obj->channels);

/* Set hchnl_mgr to NULL in device object. */
dev_set_chnl_mgr(chnl_mgr_obj->dev_obj, NULL);
Expand Down Expand Up @@ -475,7 +475,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 timeout)
&& (pchnl->chnl_type == CHNL_PCPY)) {
/* Wait for IO completions, up to the specified
* timeout: */
while (!list_empty(&pchnl->pio_requests) && !status) {
while (!list_empty(&pchnl->io_requests) && !status) {
status = bridge_chnl_get_ioc(chnl_obj,
timeout, &chnl_ioc_obj);
if (status)
Expand All @@ -491,7 +491,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 timeout)
pchnl->state &= ~CHNL_STATECANCEL;
}
}
DBC_ENSURE(status || list_empty(&pchnl->pio_requests));
DBC_ENSURE(status || list_empty(&pchnl->io_requests));
return status;
}

Expand Down Expand Up @@ -551,7 +551,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
if (!chan_ioc || !pchnl) {
status = -EFAULT;
} else if (timeout == CHNL_IOCNOWAIT) {
if (list_empty(&pchnl->pio_completions))
if (list_empty(&pchnl->io_completions))
status = -EREMOTEIO;

}
Expand All @@ -566,7 +566,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,

ioc.status = CHNL_IOCSTATCOMPLETE;
if (timeout !=
CHNL_IOCNOWAIT && list_empty(&pchnl->pio_completions)) {
CHNL_IOCNOWAIT && list_empty(&pchnl->io_completions)) {
if (timeout == CHNL_IOCINFINITE)
timeout = SYNC_INFINITE;

Expand All @@ -581,7 +581,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
* fails due to unkown causes. */
/* Even though Wait failed, there may be something in
* the Q: */
if (list_empty(&pchnl->pio_completions)) {
if (list_empty(&pchnl->io_completions)) {
ioc.status |= CHNL_IOCSTATCANCEL;
dequeue_ioc = false;
}
Expand All @@ -592,8 +592,8 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
omap_mbox_disable_irq(dev_ctxt->mbox, IRQ_RX);
if (dequeue_ioc) {
/* Dequeue IOC and set chan_ioc; */
DBC_ASSERT(!list_empty(&pchnl->pio_completions));
chnl_packet_obj = list_first_entry(&pchnl->pio_completions,
DBC_ASSERT(!list_empty(&pchnl->io_completions));
chnl_packet_obj = list_first_entry(&pchnl->io_completions,
struct chnl_irp, link);
list_del(&chnl_packet_obj->link);
/* Update chan_ioc from channel state and chirp: */
Expand All @@ -619,7 +619,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
ioc.buf_size = 0;
}
/* Ensure invariant: If any IOC's are queued for this channel... */
if (!list_empty(&pchnl->pio_completions)) {
if (!list_empty(&pchnl->io_completions)) {
/* Since DSPStream_Reclaim() does not take a timeout
* parameter, we pass the stream's timeout value to
* bridge_chnl_get_ioc. We cannot determine whether or not
Expand Down Expand Up @@ -685,7 +685,7 @@ int bridge_chnl_get_mgr_info(struct chnl_mgr *hchnl_mgr, u32 ch_id,
return -ECHRNG;

/* Return the requested information: */
mgr_info->chnl_obj = chnl_mgr_obj->ap_channel[ch_id];
mgr_info->chnl_obj = chnl_mgr_obj->channels[ch_id];
mgr_info->open_channels = chnl_mgr_obj->open_channels;
mgr_info->type = chnl_mgr_obj->type;
/* total # of chnls */
Expand Down Expand Up @@ -752,7 +752,7 @@ int bridge_chnl_open(struct chnl_object **chnl,
if (ch_id != CHNL_PICKFREE) {
if (ch_id >= chnl_mgr_obj->max_channels)
return -ECHRNG;
if (chnl_mgr_obj->ap_channel[ch_id] != NULL)
if (chnl_mgr_obj->channels[ch_id] != NULL)
return -EALREADY;
} else {
/* Check for free channel */
Expand All @@ -777,8 +777,8 @@ int bridge_chnl_open(struct chnl_object **chnl,
if (status)
goto out_err;

INIT_LIST_HEAD(&pchnl->pio_requests);
INIT_LIST_HEAD(&pchnl->pio_completions);
INIT_LIST_HEAD(&pchnl->io_requests);
INIT_LIST_HEAD(&pchnl->io_completions);

pchnl->chnl_packets = pattrs->uio_reqs;
pchnl->cio_cs = 0;
Expand Down Expand Up @@ -812,7 +812,7 @@ int bridge_chnl_open(struct chnl_object **chnl,
pchnl->chnl_type = CHNL_PCPY;

/* Insert channel object in channel manager: */
chnl_mgr_obj->ap_channel[pchnl->chnl_id] = pchnl;
chnl_mgr_obj->channels[pchnl->chnl_id] = pchnl;
spin_lock_bh(&chnl_mgr_obj->chnl_mgr_lock);
chnl_mgr_obj->open_channels++;
spin_unlock_bh(&chnl_mgr_obj->chnl_mgr_lock);
Expand All @@ -824,8 +824,8 @@ int bridge_chnl_open(struct chnl_object **chnl,

out_err:
/* Free memory */
free_chirp_list(&pchnl->pio_completions);
free_chirp_list(&pchnl->pio_requests);
free_chirp_list(&pchnl->io_completions);
free_chirp_list(&pchnl->io_requests);
free_chirp_list(&pchnl->free_packets_list);

if (sync_event)
Expand Down Expand Up @@ -928,7 +928,7 @@ static int search_free_channel(struct chnl_mgr *chnl_mgr_obj,
DBC_REQUIRE(chnl_mgr_obj);

for (i = 0; i < chnl_mgr_obj->max_channels; i++) {
if (chnl_mgr_obj->ap_channel[i] == NULL) {
if (chnl_mgr_obj->channels[i] == NULL) {
status = 0;
*chnl = i;
break;
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/staging/tidspbridge/core/io_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int bridge_io_create(struct io_mgr **io_man,
*io_man = NULL;

dev_get_chnl_mgr(hdev_obj, &hchnl_mgr);
if (!hchnl_mgr || hchnl_mgr->hio_mgr)
if (!hchnl_mgr || hchnl_mgr->iomgr)
return -EFAULT;

/*
Expand Down Expand Up @@ -228,7 +228,7 @@ int bridge_io_create(struct io_mgr **io_man,
}

/* Return IO manager object to caller... */
hchnl_mgr->hio_mgr = pio_mgr;
hchnl_mgr->iomgr = pio_mgr;
*io_man = pio_mgr;

return 0;
Expand Down Expand Up @@ -1090,16 +1090,16 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
DBC_ASSERT(chnl_id);
goto func_end;
}
pchnl = chnl_mgr_obj->ap_channel[chnl_id];
pchnl = chnl_mgr_obj->channels[chnl_id];
if ((pchnl != NULL) && CHNL_IS_INPUT(pchnl->chnl_mode)) {
if ((pchnl->state & ~CHNL_STATEEOS) == CHNL_STATEREADY) {
/* Get the I/O request, and attempt a transfer */
if (!list_empty(&pchnl->pio_requests)) {
if (!list_empty(&pchnl->io_requests)) {
if (!pchnl->cio_reqs)
goto func_end;

chnl_packet_obj = list_first_entry(
&pchnl->pio_requests,
&pchnl->io_requests,
struct chnl_irp, link);
list_del(&chnl_packet_obj->link);
pchnl->cio_reqs--;
Expand Down Expand Up @@ -1140,7 +1140,7 @@ static void input_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
DSP_STREAMDONE);
}
/* Tell DSP if no more I/O buffers available */
if (list_empty(&pchnl->pio_requests))
if (list_empty(&pchnl->io_requests))
set_chnl_free(sm, pchnl->chnl_id);
clear_chnl = true;
notify_client = true;
Expand Down Expand Up @@ -1292,9 +1292,9 @@ static void notify_chnl_complete(struct chnl_object *pchnl,
* signalled by the only IO completion list consumer:
* bridge_chnl_get_ioc().
*/
signal_event = list_empty(&pchnl->pio_completions);
signal_event = list_empty(&pchnl->io_completions);
/* Enqueue the IO completion info for the client */
list_add_tail(&chnl_packet_obj->link, &pchnl->pio_completions);
list_add_tail(&chnl_packet_obj->link, &pchnl->io_completions);
pchnl->cio_cs++;

if (pchnl->cio_cs > pchnl->chnl_packets)
Expand Down Expand Up @@ -1340,8 +1340,8 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
if (chnl_id == OUTPUTNOTREADY)
goto func_end;

pchnl = chnl_mgr_obj->ap_channel[chnl_id];
if (!pchnl || list_empty(&pchnl->pio_requests)) {
pchnl = chnl_mgr_obj->channels[chnl_id];
if (!pchnl || list_empty(&pchnl->io_requests)) {
/* Shouldn't get here */
goto func_end;
}
Expand All @@ -1350,14 +1350,14 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
goto func_end;

/* Get the I/O request, and attempt a transfer */
chnl_packet_obj = list_first_entry(&pchnl->pio_requests,
chnl_packet_obj = list_first_entry(&pchnl->io_requests,
struct chnl_irp, link);
list_del(&chnl_packet_obj->link);

pchnl->cio_reqs--;

/* Record fact that no more I/O buffers available */
if (list_empty(&pchnl->pio_requests))
if (list_empty(&pchnl->io_requests))
chnl_mgr_obj->output_mask &= ~(1 << chnl_id);

/* Transfer buffer to DSP side */
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/staging/tidspbridge/core/msg_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int bridge_msg_create(struct msg_mgr **msg_man,
return -ENOMEM;

msg_mgr_obj->on_exit = msg_callback;
msg_mgr_obj->hio_mgr = hio_mgr;
msg_mgr_obj->iomgr = hio_mgr;
/* List of MSG_QUEUEs */
INIT_LIST_HEAD(&msg_mgr_obj->queue_list);
/*
Expand Down Expand Up @@ -356,7 +356,7 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj,
/* Release critical section before scheduling DPC */
spin_unlock_bh(&hmsg_mgr->msg_mgr_lock);
/* Schedule a DPC, to do the actual data transfer: */
iosm_schedule(hmsg_mgr->hio_mgr);
iosm_schedule(hmsg_mgr->iomgr);
return 0;
}

Expand Down Expand Up @@ -410,7 +410,7 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj,
* Schedule a DPC, to do the actual
* data transfer.
*/
iosm_schedule(hmsg_mgr->hio_mgr);
iosm_schedule(hmsg_mgr->iomgr);

msg_queue_obj->io_msg_pend--;
/* Reset event if there are still frames available */
Expand Down
Loading

0 comments on commit 2a12063

Please sign in to comment.