812-flexspi-support-layerscape.patch 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. From 31d0f8f19246c9a2fbecb5ca0a03ef6bb70eee2d Mon Sep 17 00:00:00 2001
  2. From: Biwen Li <[email protected]>
  3. Date: Fri, 9 Nov 2018 19:32:53 +0800
  4. Subject: [PATCH] flexspi: support layerscape
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This is an integrated patch of flexspi for layerscape
  9. Signed-off-by: Alistair Strachan <[email protected]>
  10. Signed-off-by: Ariel Elior <[email protected]>
  11. Signed-off-by: Brandon Maier <[email protected]>
  12. Signed-off-by: David S. Miller <[email protected]>
  13. Signed-off-by: Geert Uytterhoeven <[email protected]>
  14. Signed-off-by: Greg Kroah-Hartman <[email protected]>
  15. Signed-off-by: Joe Thornber <[email protected]>
  16. Signed-off-by: Kirill Kapranov <[email protected]>
  17. Signed-off-by: Liam Girdwood <[email protected]>
  18. Signed-off-by: Marcel Ziswiler <[email protected]>
  19. Signed-off-by: Mark Brown <[email protected]>
  20. Signed-off-by: Mike Snitzer <[email protected]>
  21. Signed-off-by: Peng Li <[email protected]>
  22. Signed-off-by: Reinette Chatre <[email protected]>
  23. Signed-off-by: Sasha Levin <[email protected]>
  24. Signed-off-by: Thomas Gleixner <[email protected]>
  25. Signed-off-by: Tomer Tayar <[email protected]>
  26. Signed-off-by: Uwe Kleine-König <[email protected]>
  27. Signed-off-by: Biwen Li <[email protected]>
  28. ---
  29. drivers/md/dm-thin.c | 13 +++++++++++++
  30. drivers/net/ethernet/qlogic/qed/qed_mcp.c | 7 +++++++
  31. drivers/net/phy/xilinx_gmii2rgmii.c | 5 +++++
  32. drivers/spi/spi-tegra20-slink.c | 18 ++++++++++++++++++
  33. drivers/staging/android/ashmem.c | 6 ++++++
  34. drivers/tty/serial/imx.c | 8 ++++++++
  35. kernel/events/core.c | 6 ++++++
  36. sound/soc/soc-dapm.c | 7 +++++++
  37. 8 files changed, 70 insertions(+)
  38. --- a/drivers/md/dm-thin.c
  39. +++ b/drivers/md/dm-thin.c
  40. @@ -3697,6 +3697,19 @@ static int process_create_thin_mesg(unsi
  41. return r;
  42. }
  43. + r = dm_pool_get_free_metadata_block_count(pool->pmd, &free_blocks);
  44. + if (r) {
  45. + metadata_operation_failed(pool, "dm_pool_get_free_metadata_block_count", r);
  46. + return r;
  47. + }
  48. +
  49. + if (!free_blocks) {
  50. + /* Let's commit before we use up the metadata reserve. */
  51. + r = commit(pool);
  52. + if (r)
  53. + return r;
  54. + }
  55. +
  56. return 0;
  57. }
  58. --- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c
  59. +++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
  60. @@ -616,6 +616,13 @@ static int qed_mcp_cmd_and_union(struct
  61. return -EBUSY;
  62. }
  63. + if (p_hwfn->mcp_info->b_block_cmd) {
  64. + DP_NOTICE(p_hwfn,
  65. + "The MFW is not responsive. Avoid sending mailbox command 0x%08x [param 0x%08x].\n",
  66. + p_mb_params->cmd, p_mb_params->param);
  67. + return -EBUSY;
  68. + }
  69. +
  70. if (p_mb_params->data_src_size > union_data_size ||
  71. p_mb_params->data_dst_size > union_data_size) {
  72. DP_ERR(p_hwfn,
  73. --- a/drivers/net/phy/xilinx_gmii2rgmii.c
  74. +++ b/drivers/net/phy/xilinx_gmii2rgmii.c
  75. @@ -92,6 +92,11 @@ static int xgmiitorgmii_probe(struct mdi
  76. return -EPROBE_DEFER;
  77. }
  78. + if (!priv->phy_dev->drv) {
  79. + dev_info(dev, "Attached phy not ready\n");
  80. + return -EPROBE_DEFER;
  81. + }
  82. +
  83. priv->addr = mdiodev->addr;
  84. priv->phy_drv = priv->phy_dev->drv;
  85. memcpy(&priv->conv_phy_drv, priv->phy_dev->drv,
  86. --- a/drivers/spi/spi-tegra20-slink.c
  87. +++ b/drivers/spi/spi-tegra20-slink.c
  88. @@ -1081,6 +1081,24 @@ static int tegra_slink_probe(struct plat
  89. goto exit_free_master;
  90. }
  91. + /* disabled clock may cause interrupt storm upon request */
  92. + tspi->clk = devm_clk_get(&pdev->dev, NULL);
  93. + if (IS_ERR(tspi->clk)) {
  94. + ret = PTR_ERR(tspi->clk);
  95. + dev_err(&pdev->dev, "Can not get clock %d\n", ret);
  96. + goto exit_free_master;
  97. + }
  98. + ret = clk_prepare(tspi->clk);
  99. + if (ret < 0) {
  100. + dev_err(&pdev->dev, "Clock prepare failed %d\n", ret);
  101. + goto exit_free_master;
  102. + }
  103. + ret = clk_enable(tspi->clk);
  104. + if (ret < 0) {
  105. + dev_err(&pdev->dev, "Clock enable failed %d\n", ret);
  106. + goto exit_free_master;
  107. + }
  108. +
  109. spi_irq = platform_get_irq(pdev, 0);
  110. tspi->irq = spi_irq;
  111. ret = request_threaded_irq(tspi->irq, tegra_slink_isr,
  112. --- a/drivers/staging/android/ashmem.c
  113. +++ b/drivers/staging/android/ashmem.c
  114. @@ -380,6 +380,12 @@ static int ashmem_mmap(struct file *file
  115. goto out;
  116. }
  117. + /* requested mapping size larger than object size */
  118. + if (vma->vm_end - vma->vm_start > PAGE_ALIGN(asma->size)) {
  119. + ret = -EINVAL;
  120. + goto out;
  121. + }
  122. +
  123. /* requested protection bits must match our allowed protection mask */
  124. if (unlikely((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask, 0)) &
  125. calc_vm_prot_bits(PROT_MASK, 0))) {
  126. --- a/drivers/tty/serial/imx.c
  127. +++ b/drivers/tty/serial/imx.c
  128. @@ -2221,6 +2221,14 @@ static int serial_imx_probe(struct platf
  129. ret);
  130. return ret;
  131. }
  132. +
  133. + ret = devm_request_irq(&pdev->dev, rtsirq, imx_rtsint, 0,
  134. + dev_name(&pdev->dev), sport);
  135. + if (ret) {
  136. + dev_err(&pdev->dev, "failed to request rts irq: %d\n",
  137. + ret);
  138. + return ret;
  139. + }
  140. } else {
  141. ret = devm_request_irq(&pdev->dev, rxirq, imx_int, 0,
  142. dev_name(&pdev->dev), sport);
  143. --- a/kernel/events/core.c
  144. +++ b/kernel/events/core.c
  145. @@ -3763,6 +3763,12 @@ int perf_event_read_local(struct perf_ev
  146. goto out;
  147. }
  148. + /* If this is a pinned event it must be running on this CPU */
  149. + if (event->attr.pinned && event->oncpu != smp_processor_id()) {
  150. + ret = -EBUSY;
  151. + goto out;
  152. + }
  153. +
  154. /*
  155. * If the event is currently on this CPU, its either a per-task event,
  156. * or local to this CPU. Furthermore it means its ACTIVE (otherwise
  157. --- a/sound/soc/soc-dapm.c
  158. +++ b/sound/soc/soc-dapm.c
  159. @@ -4036,6 +4036,13 @@ int snd_soc_dapm_link_dai_widgets(struct
  160. continue;
  161. }
  162. + /* let users know there is no DAI to link */
  163. + if (!dai_w->priv) {
  164. + dev_dbg(card->dev, "dai widget %s has no DAI\n",
  165. + dai_w->name);
  166. + continue;
  167. + }
  168. +
  169. dai = dai_w->priv;
  170. /* ...find all widgets with the same stream and link them */