From: Greg Kroah-Hartman Date: Wed, 12 Aug 2015 05:14:06 +0000 (-0700) Subject: greybus: Merge branch 'master' into branch 'svc'. X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d706ef8f1b2add4abbbeacbbaaf0c304b25f4476;p=openwrt%2Fstaging%2Fblogic.git greybus: Merge branch 'master' into branch 'svc'. This drags in the firmware driver, and the start of some loopback changes. Signed-off-by: Greg Kroah-Hartman --- d706ef8f1b2add4abbbeacbbaaf0c304b25f4476 diff --cc drivers/staging/greybus/es1.c index c1fab375bb0b,7fe1eaa17024..2aa271751ac1 --- a/drivers/staging/greybus/es1.c +++ b/drivers/staging/greybus/es1.c @@@ -14,9 -14,12 +14,10 @@@ #include #include "greybus.h" -#include "svc_msg.h" #include "kernel_ver.h" + #include "connection.h" /* Memory sizes for the buffers sent to/from the ES1 controller */ -#define ES1_SVC_MSG_SIZE (sizeof(struct svc_msg) + SZ_64K) #define ES1_GBUF_MSG_SIZE_MAX 2048 static const struct usb_device_id id_table[] = { diff --cc drivers/staging/greybus/es2.c index 558345cd80af,43cbc4d06e5f..008685b2b15b --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@@ -14,9 -14,12 +14,10 @@@ #include #include "greybus.h" -#include "svc_msg.h" #include "kernel_ver.h" + #include "connection.h" /* Memory sizes for the buffers sent to/from the ES1 controller */ -#define ES1_SVC_MSG_SIZE (sizeof(struct svc_msg) + SZ_64K) #define ES1_GBUF_MSG_SIZE_MAX 2048 static const struct usb_device_id id_table[] = { diff --cc drivers/staging/greybus/svc.c index 16a37f22135c,73e7947fadba..5ff7cf3b2f0b --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@@ -261,43 -223,44 +261,40 @@@ static int gb_svc_hello(struct gb_opera return 0; } -static int gb_svc_intf_hotplug_recv(struct gb_operation *op) +/* + * 'struct svc_hotplug' should be freed by svc_process_hotplug() before it + * returns, irrespective of success or Failure in bringing up the module. + */ +static void svc_process_hotplug(struct work_struct *work) { - struct gb_message *request = op->request; - struct gb_svc_intf_hotplug_request *hotplug = request->payload; - struct gb_svc *svc = op->connection->private; - struct greybus_host_device *hd = op->connection->bundle->intf->hd; - struct device *dev = &op->connection->dev; + struct svc_hotplug *svc_hotplug = container_of(work, struct svc_hotplug, + work); + struct gb_svc_intf_hotplug_request *hotplug = &svc_hotplug->data; + struct gb_connection *connection = svc_hotplug->connection; + struct gb_svc *svc = connection->private; + struct greybus_host_device *hd = connection->bundle->intf->hd; + struct device *dev = &connection->dev; struct gb_interface *intf; u8 intf_id, device_id; - u32 unipro_mfg_id; - u32 unipro_prod_id; - u32 ara_vend_id; - u32 ara_prod_id; int ret; - if (request->payload_size < sizeof(*hotplug)) { - dev_err(dev, "%s: short hotplug request received\n", __func__); - return -EINVAL; - } - /* * Grab the information we need. - * - * XXX I'd really like to acknowledge receipt, and then - * XXX continue processing the request. There's no need - * XXX for the SVC to wait. In fact, it might be best to - * XXX have the SVC get acknowledgement before we proceed. */ intf_id = hotplug->intf_id; - unipro_mfg_id = le32_to_cpu(hotplug->data.unipro_mfg_id); - unipro_prod_id = le32_to_cpu(hotplug->data.unipro_prod_id); - ara_vend_id = le32_to_cpu(hotplug->data.ara_vend_id); - ara_prod_id = le32_to_cpu(hotplug->data.ara_prod_id); intf = gb_interface_create(hd, intf_id); if (!intf) { dev_err(dev, "%s: Failed to create interface with id %hhu\n", __func__, intf_id); - return -EINVAL; + goto free_svc_hotplug; } + intf->unipro_mfg_id = le32_to_cpu(hotplug->data.unipro_mfg_id); + intf->unipro_prod_id = le32_to_cpu(hotplug->data.unipro_prod_id); + intf->ara_vend_id = le32_to_cpu(hotplug->data.ara_vend_id); + intf->ara_prod_id = le32_to_cpu(hotplug->data.ara_prod_id); + /* * Create a device id for the interface: * - device id 0 (GB_DEVICE_ID_SVC) belongs to the SVC