summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus
diff options
context:
space:
mode:
authorDavid Kershner <david.kershner@unisys.com>2016-11-03 11:44:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-07 10:56:39 +0100
commit3e0e8db92fef5dea189d740bed2d8e3d7a25dfe8 (patch)
treeacbab618364245bc074b55d138b33a99878d919b /drivers/staging/unisys/visorbus
parent8f334e30c3c766b1b7e7f89cbbdd8d9d02fce91c (diff)
downloadop-kernel-dev-3e0e8db92fef5dea189d740bed2d8e3d7a25dfe8.zip
op-kernel-dev-3e0e8db92fef5dea189d740bed2d8e3d7a25dfe8.tar.gz
staging: unisys: visorbus: bus_destroy do not call bus_epilog
Have bus_destroy call chipset_bus_destroy directly instead of going through bus_epilog. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorbus')
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 3847788..fa1db9d 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -902,18 +902,47 @@ static void
bus_destroy(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
+ struct controlvm_message_header *pmsg_hdr = NULL;
u32 bus_no = cmd->destroy_bus.bus_no;
struct visor_device *bus_info;
int rc = CONTROLVM_RESP_SUCCESS;
bus_info = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL);
- if (!bus_info)
+ if (!bus_info) {
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
- else if (bus_info->state.created == 0)
+ goto out_respond;
+ }
+ if (bus_info->state.created == 0) {
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
+ goto out_respond;
+ }
+ if (bus_info->pending_msg_hdr) {
+ /* only non-NULL if dev is still waiting on a response */
+ rc = -CONTROLVM_RESP_ERROR_MESSAGE_ID_INVALID_FOR_CLIENT;
+ goto out_respond;
+ }
+ if (inmsg->hdr.flags.response_expected == 1) {
+ pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL);
+ if (!pmsg_hdr) {
+ POSTCODE_LINUX_4(MALLOC_FAILURE_PC, cmd,
+ bus_info->chipset_bus_no,
+ POSTCODE_SEVERITY_ERR);
+ rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
+ goto out_respond;
+ }
- bus_epilog(bus_info, CONTROLVM_BUS_DESTROY, &inmsg->hdr,
- rc, inmsg->hdr.flags.response_expected == 1);
+ memcpy(pmsg_hdr, &inmsg->hdr,
+ sizeof(struct controlvm_message_header));
+ bus_info->pending_msg_hdr = pmsg_hdr;
+ }
+
+ /* Response will be handled by chipset_bus_destroy */
+ chipset_bus_destroy(bus_info);
+ return;
+
+out_respond:
+ if (inmsg->hdr.flags.response_expected == 1)
+ bus_responder(inmsg->hdr.id, &inmsg->hdr, rc);
/* bus_info is freed as part of the busdevice_release function */
}
OpenPOWER on IntegriCloud