Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259545
b: refs/heads/master
c: eb9af0a
h: refs/heads/master
i:
  259543: 814765f
v: v3
  • Loading branch information
Tomas Winkler authored and Greg Kroah-Hartman committed Jun 28, 2011
1 parent 5eaae2b commit 98b5cd4
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 52 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: c95efb741f1db9c804a582a3ba52413b9cbd8f7f
refs/heads/master: eb9af0acec3858d835276935df5d5eecd62535d0
20 changes: 10 additions & 10 deletions trunk/drivers/staging/mei/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ static void mei_reset_iamthif_params(struct mei_device *dev)
dev->iamthif_current_cb = NULL;
dev->iamthif_msg_buf_size = 0;
dev->iamthif_msg_buf_index = 0;
dev->iamthif_canceled = 0;
dev->iamthif_ioctl = 0;
dev->iamthif_canceled = false;
dev->iamthif_ioctl = false;
dev->iamthif_state = MEI_IAMTHIF_IDLE;
dev->iamthif_timer = 0;
}
Expand Down Expand Up @@ -173,7 +173,7 @@ int mei_hw_init(struct mei_device *dev)
if ((dev->host_hw_state & H_IS) == H_IS)
mei_reg_write(dev, H_CSR, dev->host_hw_state);

dev->recvd_msg = 0;
dev->recvd_msg = false;
dev_dbg(&dev->pdev->dev, "reset in start the mei device.\n");

mei_reset(dev, 1);
Expand Down Expand Up @@ -223,7 +223,7 @@ int mei_hw_init(struct mei_device *dev)
goto out;
}

dev->recvd_msg = 0;
dev->recvd_msg = false;
dev_dbg(&dev->pdev->dev, "host_hw_state = 0x%08x, me_hw_state = 0x%08x.\n",
dev->host_hw_state, dev->me_hw_state);
dev_dbg(&dev->pdev->dev, "ME turn on ME_RDY and host turn on H_RDY.\n");
Expand Down Expand Up @@ -267,7 +267,7 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
bool unexpected;

if (dev->mei_state == MEI_RECOVERING_FROM_RESET) {
dev->need_reset = 1;
dev->need_reset = true;
return;
}

Expand All @@ -291,7 +291,7 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
dev_dbg(&dev->pdev->dev, "currently saved host_hw_state = 0x%08x.\n",
dev->host_hw_state);

dev->need_reset = 0;
dev->need_reset = false;

if (dev->mei_state != MEI_INITIALIZING) {
if (dev->mei_state != MEI_DISABLED &&
Expand Down Expand Up @@ -320,8 +320,8 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)

dev->num_mei_me_clients = 0;
dev->rd_msg_hdr = 0;
dev->stop = 0;
dev->wd_pending = 0;
dev->stop = false;
dev->wd_pending = false;

/* update the state of the registers after reset */
dev->host_hw_state = mei_hcsr_read(dev);
Expand Down Expand Up @@ -382,7 +382,7 @@ void mei_host_start_message(struct mei_device *dev)
host_start_req->cmd.cmd = HOST_START_REQ_CMD;
host_start_req->host_version.major_version = HBM_MAJOR_VERSION;
host_start_req->host_version.minor_version = HBM_MINOR_VERSION;
dev->recvd_msg = 0;
dev->recvd_msg = false;
if (!mei_write_message(dev, mei_hdr,
(unsigned char *) (host_start_req),
mei_hdr->length)) {
Expand Down Expand Up @@ -701,7 +701,7 @@ int mei_disconnect_host_client(struct mei_device *dev, struct mei_cl *cl)
cb->file_private = cl;
cb->major_file_operations = MEI_CLOSE;
if (dev->mei_host_buffer_is_empty) {
dev->mei_host_buffer_is_empty = 0;
dev->mei_host_buffer_is_empty = false;
if (mei_disconnect(dev, cl)) {
mdelay(10); /* Wait for hardware disconnection ready */
list_add_tail(&cb->cb_list,
Expand Down
22 changes: 11 additions & 11 deletions trunk/drivers/staging/mei/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static int _mei_irq_thread_iamthif_read(struct mei_device *dev, s32 *slots)
} else {
dev_dbg(&dev->pdev->dev, "iamthif flow control success\n");
dev->iamthif_state = MEI_IAMTHIF_READING;
dev->iamthif_flow_control_pending = 0;
dev->iamthif_flow_control_pending = false;
dev->iamthif_msg_buf_index = 0;
dev->iamthif_msg_buf_size = 0;
dev->iamthif_stall_timer = IAMTHIF_STALL_TIMER;
Expand Down Expand Up @@ -593,7 +593,7 @@ static void mei_client_disconnect_request(struct mei_device *dev,
cl_pos->timer_count = 0;
if (cl_pos == &dev->wd_cl) {
dev->wd_due_counter = 0;
dev->wd_pending = 0;
dev->wd_pending = false;
} else if (cl_pos == &dev->iamthif_cl)
dev->iamthif_timer = 0;

Expand Down Expand Up @@ -661,7 +661,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
dev->init_clients_timer = 0;
mei_host_enum_clients_message(dev);
} else {
dev->recvd_msg = 0;
dev->recvd_msg = false;
dev_dbg(&dev->pdev->dev, "IMEI reset due to received host start response bus message.\n");
mei_reset(dev, 1);
return;
Expand Down Expand Up @@ -690,7 +690,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
return;
}

dev->recvd_msg = 1;
dev->recvd_msg = true;
dev_dbg(&dev->pdev->dev, "host start response message received.\n");
break;

Expand Down Expand Up @@ -1028,7 +1028,7 @@ static int _mei_irq_thread_cmpl_iamthif(struct mei_device *dev, s32 *slots,
cb_pos->information = dev->iamthif_msg_buf_index;
cl->status = 0;
dev->iamthif_state = MEI_IAMTHIF_FLOW_CONTROL;
dev->iamthif_flow_control_pending = 1;
dev->iamthif_flow_control_pending = true;
/* save iamthif cb sent to amthi client */
dev->iamthif_current_cb = cb_pos;
list_move_tail(&cb_pos->cb_list,
Expand Down Expand Up @@ -1232,7 +1232,7 @@ static int mei_irq_thread_write_handler(struct mei_io_list *cmpl_list,
}

if (dev->stop && !dev->wd_pending) {
dev->wd_stopped = 1;
dev->wd_stopped = true;
wake_up_interruptible(&dev->wait_stop_wd);
return 0;
}
Expand All @@ -1256,7 +1256,7 @@ static int mei_irq_thread_write_handler(struct mei_io_list *cmpl_list,
if (mei_flow_ctrl_reduce(dev, &dev->wd_cl))
return -ENODEV;

dev->wd_pending = 0;
dev->wd_pending = false;

if (dev->wd_timeout) {
*slots -= (sizeof(struct mei_msg_hdr) +
Expand Down Expand Up @@ -1427,7 +1427,7 @@ void mei_wd_timer(struct work_struct *work)
if (--dev->wd_due_counter == 0) {
if (dev->mei_host_buffer_is_empty &&
mei_flow_ctrl_creds(dev, &dev->wd_cl) > 0) {
dev->mei_host_buffer_is_empty = 0;
dev->mei_host_buffer_is_empty = false;
dev_dbg(&dev->pdev->dev, "send watchdog.\n");

if (mei_wd_send(dev))
Expand All @@ -1442,7 +1442,7 @@ void mei_wd_timer(struct work_struct *work)
dev->wd_due_counter = 0;

} else
dev->wd_pending = 1;
dev->wd_pending = true;

}
}
Expand All @@ -1452,8 +1452,8 @@ void mei_wd_timer(struct work_struct *work)
mei_reset(dev, 1);
dev->iamthif_msg_buf_size = 0;
dev->iamthif_msg_buf_index = 0;
dev->iamthif_canceled = 0;
dev->iamthif_ioctl = 1;
dev->iamthif_canceled = false;
dev->iamthif_ioctl = true;
dev->iamthif_state = MEI_IAMTHIF_IDLE;
dev->iamthif_timer = 0;

Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/staging/mei/iorw.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ int mei_ioctl_connect_client(struct file *file,
if (dev->mei_host_buffer_is_empty
&& !mei_other_client_is_connecting(dev, cl)) {
dev_dbg(&dev->pdev->dev, "Sending Connect Message\n");
dev->mei_host_buffer_is_empty = 0;
dev->mei_host_buffer_is_empty = false;
if (!mei_connect(dev, cl)) {
dev_dbg(&dev->pdev->dev, "Sending connect message - failed\n");
rets = -ENODEV;
Expand Down Expand Up @@ -439,7 +439,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl)
cb->file_private = (void *) cl;
cl->read_cb = cb;
if (dev->mei_host_buffer_is_empty) {
dev->mei_host_buffer_is_empty = 0;
dev->mei_host_buffer_is_empty = false;
if (!mei_send_flow_control(dev, cl)) {
rets = -ENODEV;
goto unlock;
Expand Down Expand Up @@ -478,8 +478,8 @@ int amthi_write(struct mei_device *dev, struct mei_cl_cb *cb)
dev->iamthif_state = MEI_IAMTHIF_WRITING;
dev->iamthif_current_cb = cb;
dev->iamthif_file_object = cb->file_object;
dev->iamthif_canceled = 0;
dev->iamthif_ioctl = 1;
dev->iamthif_canceled = false;
dev->iamthif_ioctl = true;
dev->iamthif_msg_buf_size = cb->request_buffer.size;
memcpy(dev->iamthif_msg_buf, cb->request_buffer.data,
cb->request_buffer.size);
Expand All @@ -490,7 +490,7 @@ int amthi_write(struct mei_device *dev, struct mei_cl_cb *cb)

if (ret && dev->mei_host_buffer_is_empty) {
ret = 0;
dev->mei_host_buffer_is_empty = 0;
dev->mei_host_buffer_is_empty = false;
if (cb->request_buffer.size >
(((dev->host_hw_state & H_CBD) >> 24) * sizeof(u32))
-sizeof(struct mei_msg_hdr)) {
Expand All @@ -515,7 +515,7 @@ int amthi_write(struct mei_device *dev, struct mei_cl_cb *cb)
if (mei_hdr.msg_complete) {
if (mei_flow_ctrl_reduce(dev, &dev->iamthif_cl))
return -ENODEV;
dev->iamthif_flow_control_pending = 1;
dev->iamthif_flow_control_pending = true;
dev->iamthif_state = MEI_IAMTHIF_FLOW_CONTROL;
dev_dbg(&dev->pdev->dev, "add amthi cb to write waiting list\n");
dev->iamthif_current_cb = cb;
Expand Down Expand Up @@ -559,8 +559,8 @@ void mei_run_next_iamthif_cmd(struct mei_device *dev)

dev->iamthif_msg_buf_size = 0;
dev->iamthif_msg_buf_index = 0;
dev->iamthif_canceled = 0;
dev->iamthif_ioctl = 1;
dev->iamthif_canceled = false;
dev->iamthif_ioctl = true;
dev->iamthif_state = MEI_IAMTHIF_IDLE;
dev->iamthif_timer = 0;
dev->iamthif_file_object = NULL;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/mei/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ static int mei_release(struct inode *inode, struct file *file)

dev_dbg(&dev->pdev->dev, "amthi canceled iamthif state %d\n",
dev->iamthif_state);
dev->iamthif_canceled = 1;
dev->iamthif_canceled = true;
if (dev->iamthif_state == MEI_IAMTHIF_READ_COMPLETE) {
dev_dbg(&dev->pdev->dev, "run next amthi iamthif cb\n");
mei_run_next_iamthif_cmd(dev);
Expand Down Expand Up @@ -893,7 +893,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,

if (rets && dev->mei_host_buffer_is_empty) {
rets = 0;
dev->mei_host_buffer_is_empty = 0;
dev->mei_host_buffer_is_empty = false;
if (length > ((((dev->host_hw_state & H_CBD) >> 24) *
sizeof(u32)) - sizeof(struct mei_msg_hdr))) {

Expand Down
29 changes: 14 additions & 15 deletions trunk/drivers/staging/mei/mei_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ struct mei_device {
* list of files
*/
struct list_head file_list;
long open_handle_count;
/*
* memory of device
*/
Expand All @@ -203,8 +204,8 @@ struct mei_device {
* lock for the device
*/
struct mutex device_lock; /* device lock */
int recvd_msg;
struct delayed_work wd_work; /* watch dog deleye work */
bool recvd_msg;
/*
* hw states of host and fw(ME)
*/
Expand All @@ -222,7 +223,8 @@ struct mei_device {
enum mei_states mei_state;
enum mei_init_clients_states init_clients_state;
u16 init_clients_timer;
int stop;
bool stop;
bool need_reset;

u32 extra_write_index;
u32 rd_msg_buf[128]; /* used for control messages */
Expand All @@ -232,41 +234,38 @@ struct mei_device {

struct hbm_version version;

int mei_host_buffer_is_empty;
struct mei_cl wd_cl;
struct mei_me_client *me_clients; /* Note: memory has to be allocated */
DECLARE_BITMAP(me_clients_map, MEI_CLIENTS_MAX);
DECLARE_BITMAP(host_clients_map, MEI_CLIENTS_MAX);
u8 num_mei_me_clients;
u8 me_client_presentation_num;
u8 me_client_index;
bool mei_host_buffer_is_empty;

int wd_pending;
int wd_stopped;
struct mei_cl wd_cl;
bool wd_pending;
bool wd_stopped;
bool wd_bypass; /* if false, don't refresh watchdog ME client */
u16 wd_timeout; /* seconds ((wd_data[1] << 8) + wd_data[0]) */
u16 wd_due_counter;
unsigned char wd_data[MEI_START_WD_DATA_SIZE];


u16 wd_due_counter;
bool wd_bypass; /* if false, don't refresh watchdog ME client */

struct file *iamthif_file_object;
struct mei_cl iamthif_cl;
int iamthif_ioctl;
int iamthif_canceled;
struct mei_cl_cb *iamthif_current_cb;
int iamthif_mtu;
unsigned long iamthif_timer;
u32 iamthif_stall_timer;
unsigned char *iamthif_msg_buf; /* Note: memory has to be allocated */
u32 iamthif_msg_buf_size;
u32 iamthif_msg_buf_index;
int iamthif_flow_control_pending;
enum iamthif_states iamthif_state;
struct mei_cl_cb *iamthif_current_cb;
bool iamthif_flow_control_pending;
bool iamthif_ioctl;
bool iamthif_canceled;
u8 write_hang;
int need_reset;
long open_handle_count;

};


Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/staging/mei/wd.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ int mei_wd_stop(struct mei_device *dev, bool preserve)
dev->wd_timeout = 0;
dev->wd_due_counter = 0;
memcpy(dev->wd_data, mei_stop_wd_params, MEI_WD_PARAMS_SIZE);
dev->stop = 1;
dev->stop = true;

ret = mei_flow_ctrl_creds(dev, &dev->wd_cl);
if (ret < 0)
goto out;

if (ret && dev->mei_host_buffer_is_empty) {
ret = 0;
dev->mei_host_buffer_is_empty = 0;
dev->mei_host_buffer_is_empty = false;

if (!mei_wd_send(dev)) {
ret = mei_flow_ctrl_reduce(dev, &dev->wd_cl);
Expand All @@ -159,11 +159,11 @@ int mei_wd_stop(struct mei_device *dev, bool preserve)
dev_dbg(&dev->pdev->dev, "send stop WD failed\n");
}

dev->wd_pending = 0;
dev->wd_pending = false;
} else {
dev->wd_pending = 1;
dev->wd_pending = true;
}
dev->wd_stopped = 0;
dev->wd_stopped = false;
mutex_unlock(&dev->device_lock);

ret = wait_event_interruptible_timeout(dev->wait_stop_wd,
Expand Down

0 comments on commit 98b5cd4

Please sign in to comment.