diff options
author | Bartlomiej Zolnierkiewicz | 2018-09-26 15:54:31 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz | 2018-09-26 15:54:31 +0200 |
commit | aaccf3c97418f169afdbb5855e9cbcbda34e90fd (patch) | |
tree | 5d4207e67958bdbc23288cf30178692f5534e1a0 /drivers/rpmsg | |
parent | f39684524b391c5a7ed0ac44db4fec3357af1c5d (diff) | |
parent | 6bf4ca7fbc85d80446ac01c0d1d77db4d91a6d84 (diff) |
Merge tag 'v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next
Sync with upstream (which now contains fbdev-v4.19 changes) to
prepare a base for fbdev-v4.20 changes.
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r-- | drivers/rpmsg/qcom_glink_native.c | 51 | ||||
-rw-r--r-- | drivers/rpmsg/qcom_smd.c | 10 | ||||
-rw-r--r-- | drivers/rpmsg/rpmsg_char.c | 2 | ||||
-rw-r--r-- | drivers/rpmsg/rpmsg_core.c | 7 |
4 files changed, 48 insertions, 22 deletions
diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index f505f58b797d..e2ce4e638258 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -40,7 +40,7 @@ struct glink_msg { * struct glink_defer_cmd - deferred incoming control message * @node: list node * @msg: message header - * data: payload of the message + * @data: payload of the message * * Copy of a received control message, to be added to @rx_queue and processed * by @rx_work of @qcom_glink. @@ -56,12 +56,13 @@ struct glink_defer_cmd { * struct glink_core_rx_intent - RX intent * RX intent * - * data: pointer to the data (may be NULL for zero-copy) - * id: remote or local intent ID - * size: size of the original intent (do not modify) - * reuse: To mark if the intent can be reused after first use - * in_use: To mark if intent is already in use for the channel - * offset: next write offset (initially 0) + * @data: pointer to the data (may be NULL for zero-copy) + * @id: remote or local intent ID + * @size: size of the original intent (do not modify) + * @reuse: To mark if the intent can be reused after first use + * @in_use: To mark if intent is already in use for the channel + * @offset: next write offset (initially 0) + * @node: list node */ struct glink_core_rx_intent { void *data; @@ -89,10 +90,14 @@ struct glink_core_rx_intent { * @idr_lock: synchronizes @lcids and @rcids modifications * @lcids: idr of all channels with a known local channel id * @rcids: idr of all channels with a known remote channel id + * @features: remote features + * @intentless: flag to indicate that there is no intent */ struct qcom_glink { struct device *dev; + const char *name; + struct mbox_client mbox_client; struct mbox_chan *mbox_chan; @@ -512,8 +517,8 @@ static void qcom_glink_rx_done(struct qcom_glink *glink, * qcom_glink_receive_version() - receive version/features from remote system * * @glink: pointer to transport interface - * @r_version: remote version - * @r_features: remote features + * @version: remote version + * @features: remote features * * This function is called in response to a remote-initiated version/feature * negotiation sequence. @@ -538,8 +543,8 @@ static void qcom_glink_receive_version(struct qcom_glink *glink, * qcom_glink_receive_version_ack() - receive negotiation ack from remote system * * @glink: pointer to transport interface - * @r_version: remote version response - * @r_features: remote features response + * @version: remote version response + * @features: remote features response * * This function is called in response to a local-initiated version/feature * negotiation sequence and is the counter-offer from the remote side based @@ -567,7 +572,7 @@ static void qcom_glink_receive_version_ack(struct qcom_glink *glink, /** * qcom_glink_send_intent_req_ack() - convert an rx intent request ack cmd to - wire format and transmit + * wire format and transmit * @glink: The transport to transmit on. * @channel: The glink channel * @granted: The request response to encode. @@ -594,7 +599,7 @@ static int qcom_glink_send_intent_req_ack(struct qcom_glink *glink, * transmit * @glink: The transport to transmit on. * @channel: The local channel - * @size: The intent to pass on to remote. + * @intent: The intent to pass on to remote. * * Return: 0 on success or standard Linux error code. */ @@ -603,11 +608,11 @@ static int qcom_glink_advertise_intent(struct qcom_glink *glink, struct glink_core_rx_intent *intent) { struct command { - u16 id; - u16 lcid; - u32 count; - u32 size; - u32 liid; + __le16 id; + __le16 lcid; + __le32 count; + __le32 size; + __le32 liid; } __packed; struct command cmd; @@ -698,9 +703,9 @@ static void qcom_glink_handle_rx_done(struct qcom_glink *glink, /** * qcom_glink_handle_intent_req() - Receive a request for rx_intent * from remote side - * if_ptr: Pointer to the transport interface - * rcid: Remote channel ID - * size: size of the intent + * @glink: Pointer to the transport interface + * @cid: Remote channel ID + * @size: size of the intent * * The function searches for the local channel to which the request for * rx_intent has arrived and allocates and notifies the remote back @@ -1572,6 +1577,10 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev, idr_init(&glink->lcids); idr_init(&glink->rcids); + ret = of_property_read_string(dev->of_node, "label", &glink->name); + if (ret < 0) + glink->name = dev->of_node->name; + glink->mbox_client.dev = dev; glink->mbox_client.knows_txdone = true; glink->mbox_chan = mbox_request_channel(&glink->mbox_client, 0); diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c index 6437bbeebc91..8da83a4ebadc 100644 --- a/drivers/rpmsg/qcom_smd.c +++ b/drivers/rpmsg/qcom_smd.c @@ -14,6 +14,7 @@ #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/sched.h> +#include <linux/sizes.h> #include <linux/slab.h> #include <linux/soc/qcom/smem.h> #include <linux/wait.h> @@ -93,6 +94,8 @@ static const struct { /** * struct qcom_smd_edge - representing a remote processor + * @dev: device associated with this edge + * @name: name of this edge * @of_node: of_node handle for information related to this edge * @edge_id: identifier of this edge * @remote_pid: identifier of remote processor @@ -106,6 +109,7 @@ static const struct { * @channels_lock: guard for modifications of @channels * @allocated: array of bitmaps representing already allocated channels * @smem_available: last available amount of smem triggering a channel scan + * @new_channel_event: wait queue for new channel events * @scan_work: work item for discovering new channels * @state_work: work item for edge state changes */ @@ -172,10 +176,12 @@ struct qcom_smd_endpoint { /** * struct qcom_smd_channel - smd channel struct * @edge: qcom_smd_edge this channel is living on - * @qsdev: reference to a associated smd client device + * @qsept: reference to a associated smd endpoint + * @registered: flag to indicate if the channel is registered * @name: name of the channel * @state: local state of the channel * @remote_state: remote state of the channel + * @state_change_event: state change event * @info: byte aligned outgoing/incoming channel info * @info_word: word aligned outgoing/incoming channel info * @tx_lock: lock to make writes to the channel mutually exclusive @@ -187,6 +193,7 @@ struct qcom_smd_endpoint { * @cb: callback function registered for this channel * @recv_lock: guard for rx info modifications and cb pointer * @pkt_size: size of the currently handled packet + * @drvdata: driver private data * @list: lite entry for @channels in qcom_smd_edge */ struct qcom_smd_channel { @@ -726,6 +733,7 @@ static int qcom_smd_write_fifo(struct qcom_smd_channel *channel, * @channel: channel handle * @data: buffer of data to write * @len: number of bytes to write + * @wait: flag to indicate if write has ca wait * * This is a blocking write of len bytes into the channel's tx ring buffer and * signal the remote end. It will sleep until there is enough space available diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c index 76a4477c6364..a76b963a7e50 100644 --- a/drivers/rpmsg/rpmsg_char.c +++ b/drivers/rpmsg/rpmsg_char.c @@ -285,6 +285,7 @@ static const struct file_operations rpmsg_eptdev_fops = { .write = rpmsg_eptdev_write, .poll = rpmsg_eptdev_poll, .unlocked_ioctl = rpmsg_eptdev_ioctl, + .compat_ioctl = rpmsg_eptdev_ioctl, }; static ssize_t name_show(struct device *dev, struct device_attribute *attr, @@ -445,6 +446,7 @@ static const struct file_operations rpmsg_ctrldev_fops = { .open = rpmsg_ctrldev_open, .release = rpmsg_ctrldev_release, .unlocked_ioctl = rpmsg_ctrldev_ioctl, + .compat_ioctl = rpmsg_ctrldev_ioctl, }; static void rpmsg_ctrldev_release_device(struct device *dev) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index b714a543a91d..8122807db380 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -15,6 +15,7 @@ #include <linux/module.h> #include <linux/rpmsg.h> #include <linux/of_device.h> +#include <linux/pm_domain.h> #include <linux/slab.h> #include "rpmsg_internal.h" @@ -449,6 +450,10 @@ static int rpmsg_dev_probe(struct device *dev) struct rpmsg_endpoint *ept = NULL; int err; + err = dev_pm_domain_attach(dev, true); + if (err) + goto out; + if (rpdrv->callback) { strncpy(chinfo.name, rpdev->id.name, RPMSG_NAME_SIZE); chinfo.src = rpdev->src; @@ -490,6 +495,8 @@ static int rpmsg_dev_remove(struct device *dev) rpdrv->remove(rpdev); + dev_pm_domain_detach(dev, true); + if (rpdev->ept) rpmsg_destroy_ept(rpdev->ept); |