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