diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-10 20:59:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-10 20:59:04 -0400 |
commit | d71fc239b6915a8b750e9a447311029ff45b6580 (patch) | |
tree | eba70a9d2a9c5c60050a47bff317592cea326660 /drivers/soc | |
parent | 519f526d391b0ef775aeb04c4b6f632ea6b3ee50 (diff) | |
parent | c6e59bdac940e63cfabd40a89d342eb470b009b9 (diff) |
Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull late ARM SoC updates from Kevin Hilman:
"This is a collection of a few late fixes and other misc stuff that had
dependencies on things being merged from other trees.
The bulk of the changes are for samsung/exynos SoCs for some changes
that needed a few minor reworks so ended up a bit late. The others
are mainly for qcom SoCs: a couple fixes and some DTS updates"
* tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (37 commits)
ARM: multi_v7_defconfig: Enable PBIAS regulator
soc: qcom: smd: Correct fBLOCKREADINTR handling
soc: qcom: smd: Use correct remote processor ID
soc: qcom: smem: Fix errant private access
ARM: dts: qcom: msm8974-sony-xperia-honami: Use stdout-path
ARM: dts: qcom: msm8960-cdp: Use stdout-path
ARM: dts: qcom: msm8660-surf: Use stdout-path
ARM: dts: qcom: ipq8064-ap148: Use stdout-path
ARM: dts: qcom: apq8084-mtp: Use stdout-path
ARM: dts: qcom: apq8084-ifc6540: Use stdout-path
ARM: dts: qcom: apq8074-dragonboard: Use stdout-path
ARM: dts: qcom: apq8064-ifc6410: Use stdout-path
ARM: dts: qcom: apq8064-cm-qs600: Use stdout-path
ARM: dts: qcom: Label serial nodes for aliasing and stdout-path
reset: ath79: Fix missing spin_lock_init
reset: Add (devm_)reset_control_get stub functions
ARM: EXYNOS: switch to using generic cpufreq driver for exynos4x12
cpufreq: exynos: Remove unselectable rule for arm-exynos-cpufreq.o
ARM: dts: add iommu property to JPEG device for exynos4
ARM: dts: enable SPI1 for exynos4412-odroidu3
...
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/qcom/smd.c | 22 | ||||
-rw-r--r-- | drivers/soc/qcom/smem.c | 18 |
2 files changed, 21 insertions, 19 deletions
diff --git a/drivers/soc/qcom/smd.c b/drivers/soc/qcom/smd.c index 327adcf117c1..a6155c917d52 100644 --- a/drivers/soc/qcom/smd.c +++ b/drivers/soc/qcom/smd.c | |||
@@ -96,6 +96,7 @@ static const struct { | |||
96 | * @smd: handle to qcom_smd | 96 | * @smd: handle to qcom_smd |
97 | * @of_node: of_node handle for information related to this edge | 97 | * @of_node: of_node handle for information related to this edge |
98 | * @edge_id: identifier of this edge | 98 | * @edge_id: identifier of this edge |
99 | * @remote_pid: identifier of remote processor | ||
99 | * @irq: interrupt for signals on this edge | 100 | * @irq: interrupt for signals on this edge |
100 | * @ipc_regmap: regmap handle holding the outgoing ipc register | 101 | * @ipc_regmap: regmap handle holding the outgoing ipc register |
101 | * @ipc_offset: offset within @ipc_regmap of the register for ipc | 102 | * @ipc_offset: offset within @ipc_regmap of the register for ipc |
@@ -111,6 +112,7 @@ struct qcom_smd_edge { | |||
111 | struct qcom_smd *smd; | 112 | struct qcom_smd *smd; |
112 | struct device_node *of_node; | 113 | struct device_node *of_node; |
113 | unsigned edge_id; | 114 | unsigned edge_id; |
115 | unsigned remote_pid; | ||
114 | 116 | ||
115 | int irq; | 117 | int irq; |
116 | 118 | ||
@@ -310,7 +312,7 @@ static void qcom_smd_channel_reset(struct qcom_smd_channel *channel) | |||
310 | SET_TX_CHANNEL_INFO(channel, fHEAD, 0); | 312 | SET_TX_CHANNEL_INFO(channel, fHEAD, 0); |
311 | SET_TX_CHANNEL_INFO(channel, fTAIL, 0); | 313 | SET_TX_CHANNEL_INFO(channel, fTAIL, 0); |
312 | SET_TX_CHANNEL_INFO(channel, fSTATE, 1); | 314 | SET_TX_CHANNEL_INFO(channel, fSTATE, 1); |
313 | SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 0); | 315 | SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 1); |
314 | SET_TX_CHANNEL_INFO(channel, head, 0); | 316 | SET_TX_CHANNEL_INFO(channel, head, 0); |
315 | SET_TX_CHANNEL_INFO(channel, tail, 0); | 317 | SET_TX_CHANNEL_INFO(channel, tail, 0); |
316 | 318 | ||
@@ -572,7 +574,7 @@ static irqreturn_t qcom_smd_edge_intr(int irq, void *data) | |||
572 | * have to scan if the amount of available space in smem have changed | 574 | * have to scan if the amount of available space in smem have changed |
573 | * since last scan. | 575 | * since last scan. |
574 | */ | 576 | */ |
575 | available = qcom_smem_get_free_space(edge->edge_id); | 577 | available = qcom_smem_get_free_space(edge->remote_pid); |
576 | if (available != edge->smem_available) { | 578 | if (available != edge->smem_available) { |
577 | edge->smem_available = available; | 579 | edge->smem_available = available; |
578 | edge->need_rescan = true; | 580 | edge->need_rescan = true; |
@@ -681,7 +683,7 @@ int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len) | |||
681 | goto out; | 683 | goto out; |
682 | } | 684 | } |
683 | 685 | ||
684 | SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 1); | 686 | SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 0); |
685 | 687 | ||
686 | ret = wait_event_interruptible(channel->fblockread_event, | 688 | ret = wait_event_interruptible(channel->fblockread_event, |
687 | qcom_smd_get_tx_avail(channel) >= tlen || | 689 | qcom_smd_get_tx_avail(channel) >= tlen || |
@@ -689,7 +691,7 @@ int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len) | |||
689 | if (ret) | 691 | if (ret) |
690 | goto out; | 692 | goto out; |
691 | 693 | ||
692 | SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 0); | 694 | SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 1); |
693 | } | 695 | } |
694 | 696 | ||
695 | SET_TX_CHANNEL_INFO(channel, fTAIL, 0); | 697 | SET_TX_CHANNEL_INFO(channel, fTAIL, 0); |
@@ -976,7 +978,8 @@ static struct qcom_smd_channel *qcom_smd_create_channel(struct qcom_smd_edge *ed | |||
976 | spin_lock_init(&channel->recv_lock); | 978 | spin_lock_init(&channel->recv_lock); |
977 | init_waitqueue_head(&channel->fblockread_event); | 979 | init_waitqueue_head(&channel->fblockread_event); |
978 | 980 | ||
979 | ret = qcom_smem_get(edge->edge_id, smem_info_item, (void **)&info, &info_size); | 981 | ret = qcom_smem_get(edge->remote_pid, smem_info_item, (void **)&info, |
982 | &info_size); | ||
980 | if (ret) | 983 | if (ret) |
981 | goto free_name_and_channel; | 984 | goto free_name_and_channel; |
982 | 985 | ||
@@ -997,7 +1000,8 @@ static struct qcom_smd_channel *qcom_smd_create_channel(struct qcom_smd_edge *ed | |||
997 | goto free_name_and_channel; | 1000 | goto free_name_and_channel; |
998 | } | 1001 | } |
999 | 1002 | ||
1000 | ret = qcom_smem_get(edge->edge_id, smem_fifo_item, &fifo_base, &fifo_size); | 1003 | ret = qcom_smem_get(edge->remote_pid, smem_fifo_item, &fifo_base, |
1004 | &fifo_size); | ||
1001 | if (ret) | 1005 | if (ret) |
1002 | goto free_name_and_channel; | 1006 | goto free_name_and_channel; |
1003 | 1007 | ||
@@ -1041,7 +1045,7 @@ static void qcom_discover_channels(struct qcom_smd_edge *edge) | |||
1041 | int i; | 1045 | int i; |
1042 | 1046 | ||
1043 | for (tbl = 0; tbl < SMD_ALLOC_TBL_COUNT; tbl++) { | 1047 | for (tbl = 0; tbl < SMD_ALLOC_TBL_COUNT; tbl++) { |
1044 | ret = qcom_smem_get(edge->edge_id, | 1048 | ret = qcom_smem_get(edge->remote_pid, |
1045 | smem_items[tbl].alloc_tbl_id, | 1049 | smem_items[tbl].alloc_tbl_id, |
1046 | (void **)&alloc_tbl, | 1050 | (void **)&alloc_tbl, |
1047 | NULL); | 1051 | NULL); |
@@ -1184,6 +1188,10 @@ static int qcom_smd_parse_edge(struct device *dev, | |||
1184 | return -EINVAL; | 1188 | return -EINVAL; |
1185 | } | 1189 | } |
1186 | 1190 | ||
1191 | edge->remote_pid = QCOM_SMEM_HOST_ANY; | ||
1192 | key = "qcom,remote-pid"; | ||
1193 | of_property_read_u32(node, key, &edge->remote_pid); | ||
1194 | |||
1187 | syscon_np = of_parse_phandle(node, "qcom,ipc", 0); | 1195 | syscon_np = of_parse_phandle(node, "qcom,ipc", 0); |
1188 | if (!syscon_np) { | 1196 | if (!syscon_np) { |
1189 | dev_err(dev, "no qcom,ipc node\n"); | 1197 | dev_err(dev, "no qcom,ipc node\n"); |
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 7c2c324c4b10..52365188a1c2 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c | |||
@@ -258,10 +258,6 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem, | |||
258 | size_t alloc_size; | 258 | size_t alloc_size; |
259 | void *p; | 259 | void *p; |
260 | 260 | ||
261 | /* We're not going to find it if there's no matching partition */ | ||
262 | if (host >= SMEM_HOST_COUNT || !smem->partitions[host]) | ||
263 | return -ENOENT; | ||
264 | |||
265 | phdr = smem->partitions[host]; | 261 | phdr = smem->partitions[host]; |
266 | 262 | ||
267 | p = (void *)phdr + sizeof(*phdr); | 263 | p = (void *)phdr + sizeof(*phdr); |
@@ -371,8 +367,9 @@ int qcom_smem_alloc(unsigned host, unsigned item, size_t size) | |||
371 | if (ret) | 367 | if (ret) |
372 | return ret; | 368 | return ret; |
373 | 369 | ||
374 | ret = qcom_smem_alloc_private(__smem, host, item, size); | 370 | if (host < SMEM_HOST_COUNT && __smem->partitions[host]) |
375 | if (ret == -ENOENT) | 371 | ret = qcom_smem_alloc_private(__smem, host, item, size); |
372 | else | ||
376 | ret = qcom_smem_alloc_global(__smem, item, size); | 373 | ret = qcom_smem_alloc_global(__smem, item, size); |
377 | 374 | ||
378 | hwspin_unlock_irqrestore(__smem->hwlock, &flags); | 375 | hwspin_unlock_irqrestore(__smem->hwlock, &flags); |
@@ -428,10 +425,6 @@ static int qcom_smem_get_private(struct qcom_smem *smem, | |||
428 | struct smem_private_entry *hdr; | 425 | struct smem_private_entry *hdr; |
429 | void *p; | 426 | void *p; |
430 | 427 | ||
431 | /* We're not going to find it if there's no matching partition */ | ||
432 | if (host >= SMEM_HOST_COUNT || !smem->partitions[host]) | ||
433 | return -ENOENT; | ||
434 | |||
435 | phdr = smem->partitions[host]; | 428 | phdr = smem->partitions[host]; |
436 | 429 | ||
437 | p = (void *)phdr + sizeof(*phdr); | 430 | p = (void *)phdr + sizeof(*phdr); |
@@ -484,8 +477,9 @@ int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size) | |||
484 | if (ret) | 477 | if (ret) |
485 | return ret; | 478 | return ret; |
486 | 479 | ||
487 | ret = qcom_smem_get_private(__smem, host, item, ptr, size); | 480 | if (host < SMEM_HOST_COUNT && __smem->partitions[host]) |
488 | if (ret == -ENOENT) | 481 | ret = qcom_smem_get_private(__smem, host, item, ptr, size); |
482 | else | ||
489 | ret = qcom_smem_get_global(__smem, item, ptr, size); | 483 | ret = qcom_smem_get_global(__smem, item, ptr, size); |
490 | 484 | ||
491 | hwspin_unlock_irqrestore(__smem->hwlock, &flags); | 485 | hwspin_unlock_irqrestore(__smem->hwlock, &flags); |