diff options
-rw-r--r-- | drivers/staging/unisys/visorbus/visorchipset.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 1f7c6bfbdecf..0ea20bb21843 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c | |||
@@ -41,9 +41,9 @@ static const guid_t visor_controlvm_channel_guid = VISOR_CONTROLVM_CHANNEL_GUID; | |||
41 | #define UNISYS_VISOR_ID_EDX 0x34367261 | 41 | #define UNISYS_VISOR_ID_EDX 0x34367261 |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * When the controlvm channel is idle for at least MIN_IDLE_SECONDS, | 44 | * When the controlvm channel is idle for at least MIN_IDLE_SECONDS, we switch |
45 | * we switch to slow polling mode. As soon as we get a controlvm | 45 | * to slow polling mode. As soon as we get a controlvm message, we switch back |
46 | * message, we switch back to fast polling mode. | 46 | * to fast polling mode. |
47 | */ | 47 | */ |
48 | #define MIN_IDLE_SECONDS 10 | 48 | #define MIN_IDLE_SECONDS 10 |
49 | 49 | ||
@@ -377,15 +377,15 @@ static int chipset_init(struct controlvm_message *inmsg) | |||
377 | chipset_inited = 1; | 377 | chipset_inited = 1; |
378 | 378 | ||
379 | /* | 379 | /* |
380 | * Set features to indicate we support parahotplug (if Command | 380 | * Set features to indicate we support parahotplug (if Command also |
381 | * also supports it). | 381 | * supports it). |
382 | */ | 382 | */ |
383 | features = inmsg->cmd.init_chipset.features & | 383 | features = inmsg->cmd.init_chipset.features & |
384 | VISOR_CHIPSET_FEATURE_PARA_HOTPLUG; | 384 | VISOR_CHIPSET_FEATURE_PARA_HOTPLUG; |
385 | 385 | ||
386 | /* | 386 | /* |
387 | * Set the "reply" bit so Command knows this is a | 387 | * Set the "reply" bit so Command knows this is a features-aware |
388 | * features-aware driver. | 388 | * driver. |
389 | */ | 389 | */ |
390 | features |= VISOR_CHIPSET_FEATURE_REPLY; | 390 | features |= VISOR_CHIPSET_FEATURE_REPLY; |
391 | 391 | ||
@@ -1210,10 +1210,9 @@ static int parahotplug_process_message(struct controlvm_message *inmsg) | |||
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | /* | 1212 | /* |
1213 | * For disable messages, add the request to the | 1213 | * For disable messages, add the request to the request list before |
1214 | * request list before kicking off the udev script. It | 1214 | * kicking off the udev script. It won't get responded to until the |
1215 | * won't get responded to until the script has | 1215 | * script has indicated it's done. |
1216 | * indicated it's done. | ||
1217 | */ | 1216 | */ |
1218 | spin_lock(¶hotplug_request_list_lock); | 1217 | spin_lock(¶hotplug_request_list_lock); |
1219 | list_add_tail(&req->list, ¶hotplug_request_list); | 1218 | list_add_tail(&req->list, ¶hotplug_request_list); |
@@ -1554,8 +1553,8 @@ static int handle_command(struct controlvm_message inmsg, u64 channel_addr) | |||
1554 | err = parahotplug_process_message(&inmsg); | 1553 | err = parahotplug_process_message(&inmsg); |
1555 | } else { | 1554 | } else { |
1556 | /* | 1555 | /* |
1557 | * save the hdr and cmd structures for later use | 1556 | * save the hdr and cmd structures for later use when |
1558 | * when sending back the response to Command | 1557 | * sending back the response to Command |
1559 | */ | 1558 | */ |
1560 | err = visorbus_device_changestate(&inmsg); | 1559 | err = visorbus_device_changestate(&inmsg); |
1561 | break; | 1560 | break; |
@@ -1664,9 +1663,8 @@ static void controlvm_periodic_work(struct work_struct *work) | |||
1664 | 1663 | ||
1665 | if (chipset_dev->controlvm_pending_msg_valid) { | 1664 | if (chipset_dev->controlvm_pending_msg_valid) { |
1666 | /* | 1665 | /* |
1667 | * we throttled processing of a prior | 1666 | * we throttled processing of a prior msg, so try to process |
1668 | * msg, so try to process it again | 1667 | * it again rather than reading a new one |
1669 | * rather than reading a new one | ||
1670 | */ | 1668 | */ |
1671 | inmsg = chipset_dev->controlvm_pending_msg; | 1669 | inmsg = chipset_dev->controlvm_pending_msg; |
1672 | chipset_dev->controlvm_pending_msg_valid = false; | 1670 | chipset_dev->controlvm_pending_msg_valid = false; |
@@ -1701,9 +1699,8 @@ schedule_out: | |||
1701 | if (time_after(jiffies, chipset_dev->most_recent_message_jiffies + | 1699 | if (time_after(jiffies, chipset_dev->most_recent_message_jiffies + |
1702 | (HZ * MIN_IDLE_SECONDS))) { | 1700 | (HZ * MIN_IDLE_SECONDS))) { |
1703 | /* | 1701 | /* |
1704 | * it's been longer than MIN_IDLE_SECONDS since we | 1702 | * it's been longer than MIN_IDLE_SECONDS since we processed |
1705 | * processed our last controlvm message; slow down the | 1703 | * our last controlvm message; slow down the polling |
1706 | * polling | ||
1707 | */ | 1704 | */ |
1708 | if (chipset_dev->poll_jiffies != | 1705 | if (chipset_dev->poll_jiffies != |
1709 | POLLJIFFIES_CONTROLVMCHANNEL_SLOW) | 1706 | POLLJIFFIES_CONTROLVMCHANNEL_SLOW) |