Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268307
b: refs/heads/master
c: 55d3385
h: refs/heads/master
i:
  268305: a946ced
  268303: 9c0b19e
v: v3
  • Loading branch information
Oren Weil authored and Greg Kroah-Hartman committed Sep 9, 2011
1 parent d12a9e0 commit 21f1e56
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 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: 8c4a59a789dfee1e66d7597521e860d2fd8cd638
refs/heads/master: 55d3385672ba6315d45b396e9668e2660e426179
2 changes: 1 addition & 1 deletion trunk/drivers/staging/mei/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int mei_flow_ctrl_creds(struct mei_device *dev, struct mei_cl *cl);
int mei_wd_send(struct mei_device *dev);
int mei_wd_stop(struct mei_device *dev, bool preserve);
bool mei_wd_host_init(struct mei_device *dev);
void mei_wd_start_setup(struct mei_device *dev);
void mei_wd_set_start_timeout(struct mei_device *dev, u16 timeout);

int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl);

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/mei/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,6 @@ static int mei_pci_resume(struct device *device)

/* Start watchdog if stopped in suspend */
if (dev->wd_timeout) {
mei_wd_start_setup(dev);
dev->wd_due_counter = 1;
schedule_delayed_work(&dev->wd_work, HZ);
}
Expand Down
40 changes: 35 additions & 5 deletions trunk/drivers/staging/mei/wd.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ const uuid_le mei_wd_guid = UUID_LE(0x05B79A6F, 0x4628, 0x4D7F, 0x89,
0x32, 0xAB);


void mei_wd_start_setup(struct mei_device *dev)
void mei_wd_set_start_timeout(struct mei_device *dev, u16 timeout)
{
dev_dbg(&dev->pdev->dev, "dev->wd_timeout=%d.\n", dev->wd_timeout);
dev_dbg(&dev->pdev->dev, "timeout=%d.\n", timeout);
memcpy(dev->wd_data, mei_start_wd_params, MEI_WD_PARAMS_SIZE);
memcpy(dev->wd_data + MEI_WD_PARAMS_SIZE,
&dev->wd_timeout, sizeof(u16));
&timeout, sizeof(u16));
}

/**
Expand All @@ -75,7 +75,6 @@ bool mei_wd_host_init(struct mei_device *dev)
dev->wd_timeout = watchdog_timeout;

if (dev->wd_timeout > 0) {
mei_wd_start_setup(dev);
/* find ME WD client */
mei_find_me_client_update_filext(dev, &dev->wd_cl,
&mei_wd_guid, MEI_WD_HOST_CLIENT_ID);
Expand Down Expand Up @@ -224,7 +223,7 @@ static int mei_wd_ops_start(struct watchdog_device *wd_dev)
goto end_unlock;
}

mei_wd_start_setup(dev);
mei_wd_set_start_timeout(dev, dev->wd_timeout);

err = 0;
end_unlock:
Expand Down Expand Up @@ -306,6 +305,36 @@ static int mei_wd_ops_ping(struct watchdog_device *wd_dev)
return ret;
}

/*
* mei_wd_ops_set_timeout - wd set timeout command from the watchdog core.
*
* @wd_dev - watchdog device struct
* @timeout - timeout value to set
*
* returns 0 if success, negative errno code for failure
*/
static int mei_wd_ops_set_timeout(struct watchdog_device *wd_dev, unsigned int timeout)
{
struct mei_device *dev;
dev = pci_get_drvdata(mei_device);

if (!dev)
return -ENODEV;

/* Check Timeout value */
if (timeout < AMT_WD_MIN_TIMEOUT || timeout > AMT_WD_MAX_TIMEOUT)
return -EINVAL;

mutex_lock(&dev->device_lock);

dev->wd_timeout = timeout;
mei_wd_set_start_timeout(dev, dev->wd_timeout);

mutex_unlock(&dev->device_lock);

return 0;
}

/*
* Watchdog Device structs
*/
Expand All @@ -314,6 +343,7 @@ const struct watchdog_ops wd_ops = {
.start = mei_wd_ops_start,
.stop = mei_wd_ops_stop,
.ping = mei_wd_ops_ping,
.set_timeout = mei_wd_ops_set_timeout,
};
const struct watchdog_info wd_info = {
.identity = INTEL_AMT_WATCHDOG_ID,
Expand Down

0 comments on commit 21f1e56

Please sign in to comment.