Loading Documentation/devicetree/bindings/arm/msm/heap-sharing.txt +22 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,13 @@ Optional properties for child nodes: - qcom,allocate-boot-time: Indicates whether clients needs boot time memory allocation. Example: - qcom,allocate-on-request: Indicates memory allocation happens only upon client request Note: qcom,allocate-boot-time and qcom,allocate-on-request are mutually exclusive rite now. - qcom,guard-band: Indicates addition of a guard band memory allocation in addition to the client's memory region. Example 1: qcom,memshare { compatible = "qcom,memshare"; Loading @@ -42,3 +48,18 @@ qcom,memshare { label = "modem"; }; }; Example 2: qcom,memshare { compatible = "qcom,memshare"; qcom,client_3 { compatible = "qcom,memshare-peripheral"; qcom,peripheral-size = <0x500000>; qcom,client-id = <1>; qcom,allocate-on-request; qcom,guard-band; label = "modem"; }; }; No newline at end of file drivers/soc/qcom/memshare/msm_memshare.c +19 −19 Original line number Diff line number Diff line Loading @@ -371,13 +371,11 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code, memblock[i].hyp_mapping = 0; } } if (memblock[i].client_id == 1) { if (memblock[i].guard_band) { /* * Check if the client id * is of diag so that free * the memory region of * client's size + guard * bytes of 4K. * Check if the client required guard band * support so the memory region of client's * size + guard bytes of 4K can be freed. */ size += MEMSHARE_GUARD_BYTES; } Loading Loading @@ -463,7 +461,7 @@ static void handle_alloc_generic_req(struct qmi_handle *handle, } if (!memblock[client_id].allotted) { if (alloc_req->client_id == 1 && alloc_req->num_bytes > 0) if (memblock[client_id].guard_band && alloc_req->num_bytes > 0) size = alloc_req->num_bytes + MEMSHARE_GUARD_BYTES; else size = alloc_req->num_bytes; Loading Loading @@ -555,13 +553,11 @@ static void handle_free_generic_req(struct qmi_handle *handle, __func__, client_id); } size = memblock[client_id].size; if (memblock[client_id].client_id == 1) { if (memblock[client_id].guard_band) { /* * Check if the client id * is of diag so that free * the memory region of * client's size + guard * bytes of 4K. * Check if the client required guard band support so * the memory region of client's size + guard * bytes of 4K can be freed */ size += MEMSHARE_GUARD_BYTES; } Loading Loading @@ -655,7 +651,7 @@ static void handle_query_size_req(struct qmi_handle *handle, static void mem_share_svc_disconnect_cb(struct qmi_handle *qmi, unsigned int node, unsigned int port) { pr_debug("memshare: Received QMI client disconnect event\n"); return; } static struct qmi_ops server_ops = { Loading Loading @@ -787,6 +783,10 @@ static int memshare_child_probe(struct platform_device *pdev) pdev->dev.of_node, "qcom,allocate-on-request"); memblock[num_clients].guard_band = of_property_read_bool( pdev->dev.of_node, "qcom,guard-band"); rc = of_property_read_string(pdev->dev.of_node, "label", &name); if (rc) { Loading @@ -809,7 +809,7 @@ static int memshare_child_probe(struct platform_device *pdev) * Memshare allocation for guaranteed clients */ if (memblock[num_clients].guarantee && size > 0) { if (client_id == 1) if (memblock[num_clients].guard_band) size += MEMSHARE_GUARD_BYTES; rc = memshare_alloc(memsh_child->dev, size, Loading drivers/soc/qcom/memshare/msm_memshare.h +2 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ struct mem_blocks { uint32_t alloc_request; /* Allocation on request from a client*/ uint32_t client_request; /* Guard band around the allotted region*/ uint32_t guard_band; /* Size required for client */ uint32_t size; /* Loading Loading
Documentation/devicetree/bindings/arm/msm/heap-sharing.txt +22 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,13 @@ Optional properties for child nodes: - qcom,allocate-boot-time: Indicates whether clients needs boot time memory allocation. Example: - qcom,allocate-on-request: Indicates memory allocation happens only upon client request Note: qcom,allocate-boot-time and qcom,allocate-on-request are mutually exclusive rite now. - qcom,guard-band: Indicates addition of a guard band memory allocation in addition to the client's memory region. Example 1: qcom,memshare { compatible = "qcom,memshare"; Loading @@ -42,3 +48,18 @@ qcom,memshare { label = "modem"; }; }; Example 2: qcom,memshare { compatible = "qcom,memshare"; qcom,client_3 { compatible = "qcom,memshare-peripheral"; qcom,peripheral-size = <0x500000>; qcom,client-id = <1>; qcom,allocate-on-request; qcom,guard-band; label = "modem"; }; }; No newline at end of file
drivers/soc/qcom/memshare/msm_memshare.c +19 −19 Original line number Diff line number Diff line Loading @@ -371,13 +371,11 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code, memblock[i].hyp_mapping = 0; } } if (memblock[i].client_id == 1) { if (memblock[i].guard_band) { /* * Check if the client id * is of diag so that free * the memory region of * client's size + guard * bytes of 4K. * Check if the client required guard band * support so the memory region of client's * size + guard bytes of 4K can be freed. */ size += MEMSHARE_GUARD_BYTES; } Loading Loading @@ -463,7 +461,7 @@ static void handle_alloc_generic_req(struct qmi_handle *handle, } if (!memblock[client_id].allotted) { if (alloc_req->client_id == 1 && alloc_req->num_bytes > 0) if (memblock[client_id].guard_band && alloc_req->num_bytes > 0) size = alloc_req->num_bytes + MEMSHARE_GUARD_BYTES; else size = alloc_req->num_bytes; Loading Loading @@ -555,13 +553,11 @@ static void handle_free_generic_req(struct qmi_handle *handle, __func__, client_id); } size = memblock[client_id].size; if (memblock[client_id].client_id == 1) { if (memblock[client_id].guard_band) { /* * Check if the client id * is of diag so that free * the memory region of * client's size + guard * bytes of 4K. * Check if the client required guard band support so * the memory region of client's size + guard * bytes of 4K can be freed */ size += MEMSHARE_GUARD_BYTES; } Loading Loading @@ -655,7 +651,7 @@ static void handle_query_size_req(struct qmi_handle *handle, static void mem_share_svc_disconnect_cb(struct qmi_handle *qmi, unsigned int node, unsigned int port) { pr_debug("memshare: Received QMI client disconnect event\n"); return; } static struct qmi_ops server_ops = { Loading Loading @@ -787,6 +783,10 @@ static int memshare_child_probe(struct platform_device *pdev) pdev->dev.of_node, "qcom,allocate-on-request"); memblock[num_clients].guard_band = of_property_read_bool( pdev->dev.of_node, "qcom,guard-band"); rc = of_property_read_string(pdev->dev.of_node, "label", &name); if (rc) { Loading @@ -809,7 +809,7 @@ static int memshare_child_probe(struct platform_device *pdev) * Memshare allocation for guaranteed clients */ if (memblock[num_clients].guarantee && size > 0) { if (client_id == 1) if (memblock[num_clients].guard_band) size += MEMSHARE_GUARD_BYTES; rc = memshare_alloc(memsh_child->dev, size, Loading
drivers/soc/qcom/memshare/msm_memshare.h +2 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ struct mem_blocks { uint32_t alloc_request; /* Allocation on request from a client*/ uint32_t client_request; /* Guard band around the allotted region*/ uint32_t guard_band; /* Size required for client */ uint32_t size; /* Loading