From 030e6f92048b2729f8b3b71ab070e8a3a4d30d5d Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Tue, 15 Apr 2014 12:39:01 +0800 Subject: ENGR00308397 video: mxsfb: unblank fb explicitly in probe() The following two commits for backlight core driver introduce an usecount for each backlight device and on/off usage info of each framebuffer associated with it so that we may enable/disable a backlight device when necessary. commit dcb7e61054b959dc4d601a96cce5cc85ad1568ef commit b48b097319587422195adc3f8b2b3b0c067943cc The problem is that some framebuffer drivers would enable their display controllers in probe() and some backlight device drivers would enable their backlights in probe() so that the backlight device usecounts and the on/off usage info of framebuffers are out of counting at the probing stage. This causes a backlight cannot be disabled by blanking the relevant framebuffer(s) before any fb unblanking operation, though it's quite reasonable for the userland to unblank the framebuffer(s) before using it. In order to avoid the potential unnecessary lighten backlight left behind for the mxsfb driver, this patch unblanks framebuffer explicitly in probe() since the LCDIF display controller is actually enabled there. Signed-off-by: Liu Ying (cherry picked from commit 61667ae1430849af17e2431bbe9290295e0ec492) --- drivers/video/mxsfb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 60a760b0a6da..c9fcd8d0af0d 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -1368,10 +1368,20 @@ static int mxsfb_probe(struct platform_device *pdev) goto fb_destroy; } + console_lock(); + ret = fb_blank(fb_info, FB_BLANK_UNBLANK); + console_unlock(); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to unblank framebuffer\n"); + goto fb_unregister; + } + dev_info(&pdev->dev, "initialized\n"); return 0; +fb_unregister: + unregister_framebuffer(fb_info); fb_destroy: if (host->enabled) clk_disable_unprepare(host->clk_pix); -- cgit v1.2.3 From b8297f9f09dacb90f0363aa9d8dc7a6e4c8984ea Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Fri, 18 Apr 2014 14:12:34 +0800 Subject: ENGR00309297-1 ASoC: imx-cs42888: Error out if failed to get p2p params There's a possiblity that ASRC P2P would error out during its probe() due to missing some DT bindings for example. If that happens, this asrc_p2p would be a NULL pointer and accessing it would cause Kernel Panic. Thus this patch adds an error out here to keep it safe. Acked-by: Wang Shengjiu Signed-off-by: Nicolin Chen (cherry picked from commit cc678a578ef873127b8237680282f1cd55fe1873) --- sound/soc/fsl/imx-cs42888.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/fsl/imx-cs42888.c b/sound/soc/fsl/imx-cs42888.c index db9f58d89868..a56f4f1984ed 100644 --- a/sound/soc/fsl/imx-cs42888.c +++ b/sound/soc/fsl/imx-cs42888.c @@ -247,6 +247,11 @@ static int imx_cs42888_probe(struct platform_device *pdev) if (asrc_pdev) { struct fsl_asrc_p2p *asrc_p2p; asrc_p2p = platform_get_drvdata(asrc_pdev); + if (!asrc_p2p) { + dev_err(&pdev->dev, "failed to get p2p params\n"); + ret = -EINVAL; + goto fail; + } asrc_p2p->per_dev = ESAI; priv->fe_p2p_rate = asrc_p2p->p2p_rate; priv->fe_p2p_width = asrc_p2p->p2p_width; -- cgit v1.2.3 From 2065e03869bb3ae5f04fe5d42fec1a489d8c56ae Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Fri, 18 Apr 2014 14:19:32 +0800 Subject: ENGR00309297-2 ARM: imx6sx: Updata asrc_p2p DT bindings Since we changed asrc_p2p's DT bindings to support record case, we should update it in imx6sx platform as well. Acked-by: Wang Shengjiu Signed-off-by: Nicolin Chen (cherry picked from commit 94b2a00e1a6f17669975dcaa9fdd02fa695b7600) --- arch/arm/boot/dts/imx6sx.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi index 140fbcb4ea74..46a65cc9d258 100644 --- a/arch/arm/boot/dts/imx6sx.dtsi +++ b/arch/arm/boot/dts/imx6sx.dtsi @@ -272,8 +272,8 @@ asrc_p2p: asrc_p2p { compatible = "fsl,imx6q-asrc-p2p"; - fsl,output-rate = <48000>; - fsl,output-width = <16>; + fsl,p2p-rate = <48000>; + fsl,p2p-width = <16>; fsl,asrc-dma-rx-events = <17 18 19>; fsl,asrc-dma-tx-events = <20 21 22>; status = "okay"; -- cgit v1.2.3 From e85df6ff7002d084d067d7cd0316e55efc6e31ab Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Thu, 17 Apr 2014 15:30:07 +0800 Subject: ENGR00309055 net: fec_ptp: optimize 1588 convergent performance 1588 convergence process (setup time about 15s) is not ideal: Applied a time jump on the reference master which causes both slaves to apply a time jump as well and then synchronize back to the nanoseconds. Optimize the 1588 adjust algorithm to get better convergent action. Signed-off-by: Fugang Duan (cherry picked from commit 46a727f7ef469ae7c77c3458efd8a0de2396c360) --- drivers/net/ethernet/freescale/fec_ptp.c | 51 +++++++++++--------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index 03e10de40e94..93e55bc441a6 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -473,8 +473,7 @@ static void fec_handle_ptpdrift(struct fec_enet_private *priv, struct ptp_set_comp *comp, struct ptp_time_correct *ptc) { u32 ndrift; - u32 i, adj_inc, adj_period; - u32 tmp_current, tmp_winner; + u32 i; u32 ptp_ts_clk, ptp_inc; ptp_ts_clk = clk_get_rate(priv->clk_ptp); @@ -486,40 +485,26 @@ static void fec_handle_ptpdrift(struct fec_enet_private *priv, ptc->corr_inc = 0; ptc->corr_period = 0; return; - } else if (ndrift >= ptp_ts_clk) { - ptc->corr_inc = (u32)(ndrift / ptp_ts_clk); - ptc->corr_period = 1; - return; - } else { - tmp_winner = 0xFFFFFFFF; - adj_inc = 1; - - if (ndrift > (ptp_ts_clk / ptp_inc)) { - adj_inc = ptp_inc / FEC_PTP_SPINNER_2; - } else if (ndrift > (ptp_ts_clk / - (ptp_inc * FEC_PTP_SPINNER_4))) { - adj_inc = ptp_inc / FEC_PTP_SPINNER_4; - adj_period = FEC_PTP_SPINNER_2; - } else { - adj_inc = FEC_PTP_SPINNER_4; - adj_period = FEC_PTP_SPINNER_4; - } + } - for (i = 1; i < adj_inc; i++) { - tmp_current = (ptp_ts_clk * i) % ndrift; - if (tmp_current == 0) { - ptc->corr_inc = i; - ptc->corr_period = (u32)((ptp_ts_clk * - adj_period * i) / ndrift); - break; - } else if (tmp_current < tmp_winner) { - ptc->corr_inc = i; - ptc->corr_period = (u32)((ptp_ts_clk * - adj_period * i) / ndrift); - tmp_winner = tmp_current; - } + for (i = 1; i <= ptp_inc; i++) { + if (((i * FEC_T_PERIOD_ONE_SEC) / ndrift) > ptp_inc) { + ptc->corr_inc = i; + ptc->corr_period = ((i * FEC_T_PERIOD_ONE_SEC) / + (ptp_inc * ndrift)); + break; } } + + /* not found ? */ + if (i > ptp_inc) { + /* + * set it to high value - double speed + * correct in every clock step. + */ + ptc->corr_inc = ptp_inc; + ptc->corr_period = 1; + } } static void fec_set_drift(struct fec_enet_private *priv, -- cgit v1.2.3 From c9ebe60d3dc649fc07b05809af500a1d0c108c6c Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Thu, 17 Apr 2014 15:40:00 +0800 Subject: ENGR00309045 net: fec_ptp: fix timestamp errors when do stress test "FSL_stressPTP" tool is supposed to test the capability characteristics of a ptp stack porting. The stresstest shall measure the overall load of the stack under test by sending delay request and signalling messages.The higher the overall load on the stack is, the higher your packet loss will be. The patch fix the timestamp error in high overall load stress test like: ./FSL_stressPTP -u -b 10.192.242.10 -d 10.192.242.6 -e eth0 -m 00:01:02:04:04:19 -i 100 -t 10 -f -6 -s -6 -c 10 And enet interrupt coalescing feature introduce ptp packet latency, which may cause that the timestamp don't store the related timestamp buffer when stack use ioctl interface to access the message. So add some 4ms delay after getting timestamp fail to let the next looking up success. Suggest to disable interrupt coalescing feature by ethtool when run 1588 cases. Signed-off-by: Fugang Duan (cherry picked from commit 11107938cc5a4a7cb4e5fc5e00d248183ed43d93) --- drivers/net/ethernet/freescale/fec_ptp.c | 37 ++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c index 93e55bc441a6..02077d5f4666 100644 --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -130,12 +130,12 @@ static int fec_ptp_insert(struct fec_ptp_circular *ptp_buf, { struct fec_ptp_ts_data *tmp; - if (fec_ptp_is_full(ptp_buf)) - ptp_buf->end = fec_ptp_calc_index(ptp_buf->size, - ptp_buf->end, 1); - tmp = (ptp_buf->data_buf + ptp_buf->end); memcpy(tmp, data, sizeof(struct fec_ptp_ts_data)); + if (fec_ptp_is_full(ptp_buf)) + /* drop one in front */ + ptp_buf->front = + fec_ptp_calc_index(ptp_buf->size, ptp_buf->front, 1); ptp_buf->end = fec_ptp_calc_index(ptp_buf->size, ptp_buf->end, 1); return 0; @@ -186,7 +186,6 @@ static int fec_ptp_find_and_remove(struct fec_ptp_circular *ptp_buf, return 1; } *ts = (ptp_buf->data_buf + i)->ts; - ptp_buf->front = fec_ptp_calc_index(size, ptp_buf->front, 1); return 0; } @@ -823,11 +822,14 @@ int fec_ptp_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) if (0 != copy_from_user(&p_ts.ident, &p_ts_user->ident, sizeof(p_ts.ident))) return -EINVAL; - retval = fec_ptp_find_and_remove(&fep->rx_timestamps, - &p_ts.ident, &rx_time); - if (retval == 0 && - copy_to_user((void __user *)(&p_ts_user->ts), - &rx_time, sizeof(rx_time))) + + if (fec_ptp_find_and_remove(&fep->rx_timestamps, + &p_ts.ident, &rx_time)) { + usleep_range(4000, 5000); + return -EAGAIN; + } + if (copy_to_user((void __user *)(&p_ts_user->ts), + &rx_time, sizeof(rx_time))) return -EFAULT; break; case PTP_GET_TX_TIMESTAMP: @@ -835,12 +837,15 @@ int fec_ptp_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) if (0 != copy_from_user(&p_ts.ident, &p_ts_user->ident, sizeof(p_ts.ident))) return -EINVAL; - retval = fec_ptp_find_and_remove(&fep->tx_timestamps, - &p_ts.ident, &tx_time); - if (retval == 0 && - copy_to_user((void __user *)(&p_ts_user->ts), - &tx_time, sizeof(tx_time))) - retval = -EFAULT; + + if (fec_ptp_find_and_remove(&fep->tx_timestamps, + &p_ts.ident, &tx_time)) { + usleep_range(4000, 5000); + return -EAGAIN; + } + if (copy_to_user((void __user *)(&p_ts_user->ts), + &tx_time, sizeof(tx_time))) + return -EFAULT; break; case PTP_GET_CURRENT_TIME: fec_get_curr_cnt(fep, &curr_time); -- cgit v1.2.3 From f1d29ccf7157e5c5e2443339de582ac604b1c826 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 5 Mar 2014 23:11:08 +0100 Subject: clocksource: vf_pit_timer: use complement for sched_clock reading commit 224aa3ed45c8735ae02bb2ecca002409fa6aa772 upstream. Vybrids PIT register is monitonic decreasing. However, sched_clock reading needs to be monitonic increasing. Use bitwise not to get the complement of the clock register. This fixes the clock going backward. Also, the clock now starts at 0 since we load the register with the maximum value at start. Signed-off-by: Stefan Agner Acked-by: Shawn Guo Cc: daniel.lezcano@linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux@arm.linux.org.uk Link: http://lkml.kernel.org/r/d25af915993aec1b486be653eb86f748ddef54fe.1394057313.git.stefan@agner.ch Cc: stable@vger.kernel.org Signed-off-by: Thomas Gleixner Signed-off-by: Shawn Guo --- drivers/clocksource/vf_pit_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/vf_pit_timer.c b/drivers/clocksource/vf_pit_timer.c index 598399d57fc5..01cb26fb0fc6 100644 --- a/drivers/clocksource/vf_pit_timer.c +++ b/drivers/clocksource/vf_pit_timer.c @@ -54,7 +54,7 @@ static inline void pit_irq_acknowledge(void) static unsigned int pit_read_sched_clock(void) { - return __raw_readl(clksrc_base + PITCVAL); + return ~__raw_readl(clksrc_base + PITCVAL); } static int __init pit_clocksource_init(unsigned long rate) -- cgit v1.2.3 From 8eda444cf3776aeb3f4ee3ecddc0eb7b0f3071ca Mon Sep 17 00:00:00 2001 From: Iain Paton Date: Wed, 16 Apr 2014 19:33:24 +0100 Subject: ARM: imx6: clk: i.MX6 DualLite/Solo i2c4 clock Compared to i.MX6 Quad/Dual the CCM_CCGR1 register in the i.MX6 Solo/DualLite replaces the ecspi5 clock with the i2c4 clock. Handle this difference using cpu_is_imx6dl(). Signed-off-by: Iain Paton Signed-off-by: Shawn Guo --- arch/arm/mach-imx/clk-imx6q.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 97a02e3b54a8..6efe6f2316f5 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -476,7 +476,11 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) clk[ecspi2] = imx_clk_gate2("ecspi2", "ecspi_root", base + 0x6c, 2); clk[ecspi3] = imx_clk_gate2("ecspi3", "ecspi_root", base + 0x6c, 4); clk[ecspi4] = imx_clk_gate2("ecspi4", "ecspi_root", base + 0x6c, 6); - clk[ecspi5] = imx_clk_gate2("ecspi5", "ecspi_root", base + 0x6c, 8); + if (cpu_is_imx6dl()) + /* ecspi5 is replaced with i2c4 on imx6dl & imx6s */ + clk[ecspi5] = imx_clk_gate2("i2c4", "ipg_per", base + 0x6c, 8); + else + clk[ecspi5] = imx_clk_gate2("ecspi5", "ecspi_root", base + 0x6c, 8); clk[enet] = imx_clk_gate2("enet", "ipg", base + 0x6c, 10); clk[epit1] = imx_clk_gate2("epit1", "ipg", base + 0x6c, 12); clk[epit2] = imx_clk_gate2("epit2", "ipg", base + 0x6c, 14); -- cgit v1.2.3 From 074c77681ed887825634d693d7bfed6e6919cc5c Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Wed, 16 Apr 2014 08:26:11 +0800 Subject: ENGR00308631 usb: chipidea: fix oops if unload module too fast We have a 2s timer once the wakeup occurs, if we unload module within 2s before wakeup occurs, the timer is still active, so we need to delete the timer before the destroy of struct ci_hdrc, otherwise, the below oops will occur. ci_hdrc ci_hdrc.1: remove, state 1 usb usb1: USB disconnect, device number 1 usb 1-1: USB disconnect, device number 2 ci_hdrc ci_hdrc.1: USB bus 1 deregistered ci_hdrc ci_hdrc.1: ci_otg_thread quits Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = a9474000 [00000000] *pgd=a84b1831, *pte=00000000, *ppte=00000000 Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM Modules linked in: ci_hdrc_imx(-) usbmisc_imx ci_hdrc ehci_hcd udc_core phy_mxs_usb evbug [last unloaded: configfs] CPU: 0 PID: 11542 Comm: modprobe Not tainted 3.10.17-01265-ga8a6771-dirty #561 task: a81243c0 ti: a94b4000 task.ti: a94b4000 PC is at 0x0 LR is at call_timer_fn.isra.29+0x24/0x84 pc : [<00000000>] lr : [<8003189c>] psr: 200b0113 sp : a94b5d68 ip : 00000000 fp : 00000000 r10: a94b5d88 r9 : 00000000 r8 : 00200200 r7 : 00000000 r6 : 80c320c0 r5 : 00000100 r4 : a94b4000 r3 : a94b5d68 r2 : a94b5d80 r1 : 00000000 r0 : 00000000 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c53c7d Table: a947404a DAC: 00000015 Process modprobe (pid: 11542, stack limit = 0xa94b4238) Stack: (0xa94b5d68 to 0xa94b6000) 5d60: 000797ae 00015220 80c2c620 80cc1ac0 00000000 80c320c0 5d80: 80cc22d4 80031ab4 a94b5d88 a94b5d88 00000000 00000101 80c32084 a94b4000 5da0: 00000100 80cc1880 00000000 80c32080 00000001 8002c4b4 000000c3 a8009240 5dc0: 00000004 0000000a 000797af 00404100 018c8300 600b0193 00000057 00000000 5de0: c0802100 8000e2c4 a94b4000 00000000 018c8300 8002c624 a94b4000 8002c898 5e00: 80c2cef0 8000ea04 c080210c 80c38904 a94b5e30 80008538 80115b7c 80115b8c 5e20: a00b0013 ffffffff a94b5e64 8000dd40 80c45808 00000000 00000001 00000000 5e40: a83f8900 00000000 a94b5e98 00000081 8000e2c4 a94b4000 00000000 018c8300 5e60: 00000001 a94b5e78 80115b7c 80115b8c a00b0013 ffffffff 00000000 00000000 5e80: a83f83c0 a83f83c0 a83f83c0 80b349b4 00000000 801140fc a83f83c0 a83f8900 5ea0: 80c56ae8 a83f83c0 a80c4610 80117454 00000000 80c56aa0 a88bc018 8030b9ac 5ec0: ffffffff a88bc010 a80c4610 8030437c a88bc000 a80c4600 a80c4610 80308510 5ee0: 7f7d21c0 a88bc000 a80c4600 803088b4 00000000 7f7c0500 a83c4c10 7f7d21e0 5f00: a80c4610 7f7d3250 a80c4644 8030827c 80308264 80306b70 7f7d3250 a80c4610 5f20: 7f7d3250 80307360 7f7d3290 7f7d3250 80c56710 803069a0 7f7d3290 00000000 5f40: a94b4000 800679d0 00000020 685f6963 5f637264 00786d69 a81243c0 800495b4 5f60: 80c2ceac 00000000 018c8300 80049578 018c8300 8003f614 8000e2c4 000f000f 5f80: a89b7840 004b4000 7f7d3290 00000800 a94b5f94 00000000 018c8300 018c8334 5fa0: 018c8334 8000e140 018c8300 018c8334 018c8334 00000800 7ee8aa50 0002e6b0 5fc0: 018c8300 018c8334 018c8334 00000081 00000001 7ee8be0c 7ee8be04 018c8300 5fe0: 76ebcf40 7ee8aa2c 00019268 76ebcf4c 60070010 018c8334 abf58811 abf58c11 [<8003189c>] (call_timer_fn.isra.29+0x24/0x84) from [<80031ab4>] (run_timer_softirq+0x1b8/0x1cc) [<80031ab4>] (run_timer_softirq+0x1b8/0x1cc) from [<8002c4b4>] (__do_softirq+0xd8/0x1b8) [<8002c4b4>] (__do_softirq+0xd8/0x1b8) from [<8002c624>] (do_softirq+0x4c/0x58) [<8002c624>] (do_softirq+0x4c/0x58) from [<8002c898>] (irq_exit+0x90/0xc8) [<8002c898>] (irq_exit+0x90/0xc8) from [<8000ea04>] (handle_IRQ+0x3c/0x90) [<8000ea04>] (handle_IRQ+0x3c/0x90) from [<80008538>] (gic_handle_irq+0x28/0x5c) [<80008538>] (gic_handle_irq+0x28/0x5c) from [<8000dd40>] (__irq_svc+0x40/0x70) Exception stack(0xa94b5e30 to 0xa94b5e78) 5e20: 80c45808 00000000 00000001 00000000 5e40: a83f8900 00000000 a94b5e98 00000081 8000e2c4 a94b4000 00000000 018c8300 5e60: 00000001 a94b5e78 80115b7c 80115b8c a00b0013 ffffffff [<8000dd40>] (__irq_svc+0x40/0x70) from [<80115b8c>] (sysfs_addrm_finish+0x24/0xd4) [<80115b8c>] (sysfs_addrm_finish+0x24/0xd4) from [<801140fc>] (sysfs_hash_and_remove+0x4c/0x88) [<801140fc>] (sysfs_hash_and_remove+0x4c/0x88) from [<80117454>] (sysfs_unmerge_group+0x40/0x7c) [<80117454>] (sysfs_unmerge_group+0x40/0x7c) from [<8030b9ac>] (dpm_sysfs_remove+0x20/0x3c) [<8030b9ac>] (dpm_sysfs_remove+0x20/0x3c) from [<8030437c>] (device_del+0x34/0x178) [<8030437c>] (device_del+0x34/0x178) from [<80308510>] (platform_device_del+0x14/0xa8) [<80308510>] (platform_device_del+0x14/0xa8) from [<803088b4>] (platform_device_unregister+0xc/0x18) [<803088b4>] (platform_device_unregister+0xc/0x18) from [<7f7c0500>] (ci_hdrc_remove_device+0xc/0x20 [ci_hdrc]) [<7f7c0500>] (ci_hdrc_remove_device+0xc/0x20 [ci_hdrc]) from [<7f7d21e0>] (ci_hdrc_imx_remove+0x20/0xc8 [ci_hdrc_imx]) [<7f7d21e0>] (ci_hdrc_imx_remove+0x20/0xc8 [ci_hdrc_imx]) from [<8030827c>] (platform_drv_remove+0x18/0x1c) [<8030827c>] (platform_drv_remove+0x18/0x1c) from [<80306b70>] (__device_release_driver+0x70/0xcc) [<80306b70>] (__device_release_driver+0x70/0xcc) from [<80307360>] (driver_detach+0xac/0xb0) [<80307360>] (driver_detach+0xac/0xb0) from [<803069a0>] (bus_remove_driver+0x7c/0xc0) [<803069a0>] (bus_remove_driver+0x7c/0xc0) from [<800679d0>] (SyS_delete_module+0x144/0x1f8) [<800679d0>] (SyS_delete_module+0x144/0x1f8) from [<8000e140>] (ret_fast_syscall+0x0/0x30) Code: bad PC value Signed-off-by: Peter Chen --- drivers/usb/chipidea/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index d2e98edc5b17..9d8f3fdb54fc 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -791,6 +791,7 @@ static int ci_hdrc_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); pm_runtime_put_noidle(&pdev->dev); } + del_timer_sync(&ci->timer); dbg_remove_files(ci); free_irq(ci->irq, ci); ci_role_destroy(ci); -- cgit v1.2.3 From b25d7b62951ee53cf504b493e87fd5cd1f31f4ca Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Fri, 18 Apr 2014 17:32:08 +0800 Subject: ASoC: fsl_spdif: Fix wrong OFFSET of STC_SYSCLK_DIV It should use STC_SYSCLK_DIV_OFFSET. Thus fix it. Signed-off-by: Nicolin Chen Signed-off-by: Mark Brown (cherry picked from commit 6ae6698276ca36f37afc2ad38054092021519ad4) --- sound/soc/fsl/fsl_spdif.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.h b/sound/soc/fsl/fsl_spdif.h index dbbbb1e00228..f9241e7974ec 100644 --- a/sound/soc/fsl/fsl_spdif.h +++ b/sound/soc/fsl/fsl_spdif.h @@ -144,8 +144,8 @@ enum spdif_gainsel { /* SPDIF Clock register */ #define STC_SYSCLK_DIV_OFFSET 11 -#define STC_SYSCLK_DIV_MASK (0x1ff << STC_TXCLK_SRC_OFFSET) -#define STC_SYSCLK_DIV(x) ((((x) - 1) << STC_TXCLK_DIV_OFFSET) & STC_SYSCLK_DIV_MASK) +#define STC_SYSCLK_DIV_MASK (0x1ff << STC_SYSCLK_DIV_OFFSET) +#define STC_SYSCLK_DIV(x) ((((x) - 1) << STC_SYSCLK_DIV_OFFSET) & STC_SYSCLK_DIV_MASK) #define STC_TXCLK_SRC_OFFSET 8 #define STC_TXCLK_SRC_MASK (0x7 << STC_TXCLK_SRC_OFFSET) #define STC_TXCLK_SRC_SET(x) ((x << STC_TXCLK_SRC_OFFSET) & STC_TXCLK_SRC_MASK) -- cgit v1.2.3 From f721c956d46685645269933c8a71f2dbccfb7e58 Mon Sep 17 00:00:00 2001 From: Xianzhong Date: Thu, 17 Apr 2014 16:23:19 +0800 Subject: ENGR00308898 [#1135] fixed gc400t gpu hang with 5.0.11 Virtual command buffer is forcibly enabled and causes gpu hang on i.MX6SLX - Android GPU hang - X11 GPU hang when run es2gears - Dfb 2D test case df_dok may cause gpu hang. The safe fix is to disable virtual command buffer temporarily Date: Apr 17, 2014 Signed-off-by: Xianzhong Acked-by: Jason Liu (cherry picked from commit f0aaa7521e0e58b4a7c9f104271343ab277fed56) (cherry picked from commit a5730ef091adfc28b8fd3866bf9a771bff09d8ea) --- drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 2 +- drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c index 61ea344c12df..365fe5b28ff6 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -328,7 +328,7 @@ gckKERNEL_Construct( /* Initialize virtual command buffer. */ /* TODO: Remove platform limitation after porting. */ #if (defined(LINUX) || defined(__QNXNTO__)) - kernel->virtualCommandBuffer = gcvTRUE; + kernel->virtualCommandBuffer = gcvFALSE; #else kernel->virtualCommandBuffer = gcvFALSE; #endif diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h index 58150483bf7c..37141eac8a1a 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h @@ -105,7 +105,7 @@ #define gcdNOWARN 0 #endif -#define gcdUSE_NON_PAGED_MEMORY_CACHE 0 +#define gcdUSE_NON_PAGED_MEMORY_CACHE 10 /******************************************************************************\ ********************************** Structures ********************************** -- cgit v1.2.3 From 02364c15d630f8d045a4120a4a864c1ca8bc0cb3 Mon Sep 17 00:00:00 2001 From: Loren Huang Date: Mon, 21 Apr 2014 11:04:36 +0800 Subject: ENGR00292154-13 [#1141]Fix Kernel panic when contiguous memory used up -When allocation failed, the node will be null. node->Virtual.type access will cause kernel panic when forceContiguous is enabled. Date: Apr 21,2014 Signed-off-by: Loren Huang Acked-by: Shawn Guo (cherry picked from commit 9b5b98b69201135fef0500907ecb3320b128ef0f) --- drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c index 365fe5b28ff6..59b35bbaface 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -815,8 +815,8 @@ _AllocateMemory_Retry: if(node) { bytes = node->Virtual.bytes; + node->Virtual.type = Type; } - node->Virtual.type = Type; /* Success. */ break; @@ -842,8 +842,8 @@ _AllocateMemory_Retry: if(node) { bytes = node->Virtual.bytes; + node->Virtual.type = Type; } - node->Virtual.type = Type; /* Memory allocated. */ if(node && forceContiguous == gcvTRUE) -- cgit v1.2.3 From 29485c192fab4fde2793c04e28f324c26a497bd3 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Mon, 21 Apr 2014 18:25:14 +0800 Subject: ENGR00309566 ASoC: fsl: fix maxburst is not accurate The src_maxburst and dst_maxburst means the watermark level for p2p, no need to be scaled. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 6dd2d4a9bbff..10f19ee95482 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -120,9 +120,9 @@ static int asrc_p2p_request_channel(struct snd_pcm_substream *substream) */ slave_config.direction = DMA_DEV_TO_DEV; slave_config.src_addr_width = buswidth; - slave_config.src_maxburst = dma_params_be->maxburst * 2; + slave_config.src_maxburst = dma_params_be->maxburst; slave_config.dst_addr_width = buswidth; - slave_config.dst_maxburst = dma_params_be->maxburst * 2; + slave_config.dst_maxburst = dma_params_be->maxburst; slave_config.dma_request0 = be_filter_data->dma_request0; if (playback) { -- cgit v1.2.3 From eecd1867719d8280e9e3373884395e737fa7b9ad Mon Sep 17 00:00:00 2001 From: Zhenyong Chen Date: Fri, 18 Apr 2014 12:10:56 +0800 Subject: ENGR00309261 Wrong version number in gpu 5.0.11 gcvVERSION_STRING is not consistent with gcvVERSION_BUILD. Vivante will provide a more flexible way in future release. Date: Apr 18, 2014 Signed-off-by: Zhenyong Chen Acked-by: Jason Liu (cherry picked from commit e3a5ec334a239599f7ea2ab98ec5fc8c576b614f) --- drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h index 57e3e4c362e3..93c11ef35b3e 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h +++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h @@ -31,7 +31,7 @@ #define gcvVERSION_BUILD 17486 -#define gcvVERSION_STRING "5.0.11.14786" +#define gcvVERSION_STRING "5.0.11.17486" #define gcvVERSION_DATE __DATE__ -- cgit v1.2.3 From 800f0701de97fc92967c729d3f79002dd99a8d3e Mon Sep 17 00:00:00 2001 From: Xianzhong Date: Tue, 22 Apr 2014 02:00:52 +0800 Subject: ENGR00309582 [#1129] fixed context switch issue on GC400T fixed 3D context switch issue, the original comments from Vivante Set command->using2D correctly when gcdCMD_NO_2D_CONTEXT = 1 this patch is to fix Android mess UI issue on GC400T Date: Apr 21, 2014 Signed-off-by: Xianzhong Acked-by: Jason Liu (cherry picked from commit 31ced071862c9e28d10c8680919637b716296786) --- drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c index cf43706cb2ec..3be171b2b959 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c @@ -1520,6 +1520,8 @@ gckCOMMAND_Commit( entryLogical = commandBufferLogical + offset; entryAddress = commandBufferAddress + offset; entryBytes = commandBufferSize - offset; + + Command->currContext = gcvNULL; } else if (Command->currContext != Context) { -- cgit v1.2.3 From 627fd5ad13d247065707010e1e1bbf4949b04d23 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Tue, 22 Apr 2014 09:46:43 +0800 Subject: ENGR00309701 usb: phy: otg-fsm: export symbol of otg_statemachine This patch exports symbol of otg_statemachine for kernel module to use it. Signed-off-by: Li Jun --- drivers/usb/phy/phy-fsm-usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-fsm-usb.c b/drivers/usb/phy/phy-fsm-usb.c index c23c474cb772..f51dc5e9a23b 100644 --- a/drivers/usb/phy/phy-fsm-usb.c +++ b/drivers/usb/phy/phy-fsm-usb.c @@ -1,7 +1,7 @@ /* * OTG Finite State Machine from OTG spec * - * Copyright (C) 2007,2008 Freescale Semiconductor, Inc. + * Copyright (C) 2007-2014 Freescale Semiconductor, Inc. * * Author: Li Yang * Jerry Huang @@ -363,3 +363,4 @@ int otg_statemachine(struct otg_fsm *fsm) VDBG("quit statemachine, changed = %d\n", state_changed); return state_changed; } +EXPORT_SYMBOL_GPL(otg_statemachine); -- cgit v1.2.3 From b9207d422d82d039de2803c3541381eaf1838929 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Fri, 18 Apr 2014 18:01:05 +0800 Subject: ENGR00309468-1 ASoC: fsl_spdif: Add coreclk control for DMA access Even if we assign regmap to manage the coreclk control, we still need to open the clock if we are going to run the driver because DMA access would not be detected by regmap. So this patch adds clock control for coreclk. Signed-off-by: Nicolin Chen (cherry picked from commit 7e9a6bb3eb4df21f96a6f3efd1f3a334a910b2ac) --- sound/soc/fsl/fsl_spdif.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 99480fe77f4f..4f42bb7ea6a4 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -1,7 +1,7 @@ /* * Freescale S/PDIF ALSA SoC Digital Audio Interface (DAI) driver * - * Copyright (C) 2013 Freescale Semiconductor, Inc. + * Copyright (C) 2013-2014 Freescale Semiconductor, Inc. * * Based on stmp3xxx_spdif_dai.c * Vladimir Barinov @@ -82,6 +82,7 @@ struct fsl_spdif_priv { u8 rxclk_src; struct clk *txclk[SPDIF_TXRATE_MAX]; struct clk *rxclk; + struct clk *coreclk; struct clk *sysclk; struct clk *dmaclk; struct snd_dmaengine_dai_dma_data dma_params_tx; @@ -426,6 +427,7 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream, int ret; pm_runtime_get_sync(cpu_dai->dev); + clk_prepare_enable(spdif_priv->coreclk); clk_prepare_enable(spdif_priv->dmaclk); /* Reset module and interrupts only for first initialization */ @@ -494,6 +496,7 @@ static void fsl_spdif_shutdown(struct snd_pcm_substream *substream, } clk_disable_unprepare(spdif_priv->dmaclk); + clk_disable_unprepare(spdif_priv->coreclk); pm_runtime_put_sync(cpu_dai->dev); } @@ -1162,6 +1165,13 @@ static int fsl_spdif_probe(struct platform_device *pdev) return PTR_ERR(spdif_priv->sysclk); } + /* Get core clock for data register access via DMA */ + spdif_priv->coreclk = devm_clk_get(&pdev->dev, "core"); + if (IS_ERR(spdif_priv->coreclk)) { + dev_err(&pdev->dev, "no core clock in devicetree\n"); + return PTR_ERR(spdif_priv->coreclk); + } + /* Get dma clock for dma script operation */ spdif_priv->dmaclk = devm_clk_get(&pdev->dev, "dma"); if (IS_ERR(spdif_priv->dmaclk)) { -- cgit v1.2.3 From 2d18a34b29ffd2804d6b90751c198ed484621e9f Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Fri, 18 Apr 2014 18:11:16 +0800 Subject: ENGR00309468-2 ASoC: fsl_spdif: Add sysclk_df divsor support for sysclk usage The sysclk, which could be connected to IPG clock, is one of the eight clocks on the inner clock mux of SPDIF. Previously we forbade the usage of this clock due to imperfect clock selecting function. This patch adds the sysclk_df divisor so as to complete sysclk function. [ In order to potect those clocks from other modules and the situation when SPDIF root clock is shared with other module (ASRC on imx6sx for example) that demands us to fix the clock and not to change its rate, starting from now on, we no longer use clk_round() and clk_set_rate(). ] Signed-off-by: Nicolin Chen (cherry picked from commit 3092f062768d7c4312c54c7ec2c5f9acfbbf7e69) --- sound/soc/fsl/fsl_spdif.c | 89 +++++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 4f42bb7ea6a4..c1baba2ca029 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -78,6 +78,7 @@ struct fsl_spdif_priv { struct regmap *regmap; bool dpll_locked; u8 txclk_div[SPDIF_TXRATE_MAX]; + u8 sysclk_df[SPDIF_TXRATE_MAX]; u8 txclk_src[SPDIF_TXRATE_MAX]; u8 rxclk_src; struct clk *txclk[SPDIF_TXRATE_MAX]; @@ -354,8 +355,7 @@ static int spdif_set_sample_rate(struct snd_pcm_substream *substream, struct platform_device *pdev = spdif_priv->pdev; unsigned long csfs = 0; u32 stc, mask, rate; - u8 clk, div; - int ret; + u8 clk, div, df; switch (sample_rate) { case 32000: @@ -387,19 +387,10 @@ static int spdif_set_sample_rate(struct snd_pcm_substream *substream, return -EINVAL; } - /* - * The S/PDIF block needs a clock of 64 * fs * div. The S/PDIF block - * will divide by (div). So request 64 * fs * (div+1) which will - * get rounded. - */ - ret = clk_set_rate(spdif_priv->txclk[rate], 64 * sample_rate * (div + 1)); - if (ret) { - dev_err(&pdev->dev, "failed to set tx clock rate\n"); - return ret; - } + df = spdif_priv->sysclk_df[rate]; dev_dbg(&pdev->dev, "expected clock rate = %d\n", - (64 * sample_rate * div)); + (64 * sample_rate * div * df)); dev_dbg(&pdev->dev, "actual clock rate = %ld\n", clk_get_rate(spdif_priv->txclk[rate])); @@ -411,6 +402,13 @@ static int spdif_set_sample_rate(struct snd_pcm_substream *substream, mask = STC_TXCLK_ALL_EN_MASK | STC_TXCLK_SRC_MASK | STC_TXCLK_DIV_MASK; regmap_update_bits(regmap, REG_SPDIF_STC, mask, stc); + /* The min of df should be 2 if valid */ + if (df >= 2) { + regmap_update_bits(regmap, REG_SPDIF_STC, + STC_SYSCLK_DIV_MASK, STC_SYSCLK_DIV(df)); + dev_dbg(&pdev->dev, "use df %d clk %d\n", df, clk); + } + dev_dbg(&pdev->dev, "set sample rate to %d\n", sample_rate); return 0; @@ -1013,40 +1011,51 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, enum spdif_txrate index) { const u32 rate[] = { 32000, 44100, 48000 }; - u64 rate_ideal, rate_actual, sub; + bool is_sysclk = clk == spdif_priv->sysclk; + u64 rate_actual, sub; + u32 df_min, df_max, df; u32 div, arate; - for (div = 1; div <= 128; div++) { - rate_ideal = rate[index] * (div + 1) * 64; - rate_actual = clk_round_rate(clk, rate_ideal); + /* The sysclk has an extra divisor [2, 512] */ + df_min = is_sysclk ? 2 : 1; + df_max = is_sysclk ? 512 : 1; - arate = rate_actual / 64; - arate /= div; + for (df = df_min; df <= df_max; df++) { + for (div = 1; div <= 128; div++) { + rate_actual = clk_get_rate(clk); - if (arate == rate[index]) { - /* We are lucky */ - savesub = 0; - spdif_priv->txclk_div[index] = div; - break; - } else if (arate / rate[index] == 1) { - /* A little bigger than expect */ - sub = (arate - rate[index]) * 100000; - do_div(sub, rate[index]); - if (sub < savesub) { + arate = rate_actual / 64; + arate /= df * div; + + if (arate == rate[index]) { + /* We are lucky */ + savesub = 0; + spdif_priv->txclk_div[index] = div; + spdif_priv->sysclk_df[index] = df; + goto out; + } else if (arate / rate[index] == 1) { + /* A little bigger than expect */ + sub = (arate - rate[index]) * 100000; + do_div(sub, rate[index]); + if (sub >= savesub) + continue; savesub = sub; spdif_priv->txclk_div[index] = div; - } - } else if (rate[index] / arate == 1) { - /* A little smaller than expect */ - sub = (rate[index] - arate) * 100000; - do_div(sub, rate[index]); - if (sub < savesub) { + spdif_priv->sysclk_df[index] = df; + } else if (rate[index] / arate == 1) { + /* A little smaller than expect */ + sub = (rate[index] - arate) * 100000; + do_div(sub, rate[index]); + if (sub >= savesub) + continue; savesub = sub; spdif_priv->txclk_div[index] = div; + spdif_priv->sysclk_df[index] = df; } } } +out: return savesub; } @@ -1071,13 +1080,6 @@ static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, if (!clk_get_rate(clk)) continue; - /* TODO: We here ignore sysclk source due to imperfect clock - * selecting mechanism: sysclk is a bit different which we can - * not change its clock rate but use another inner divider to - * derive a proper clock rate. */ - if (i == SPDIF_CLK_SRC_SYSCLK) - continue; - ret = fsl_spdif_txclk_caldiv(spdif_priv, clk, savesub, index); if (savesub == ret) continue; @@ -1095,6 +1097,9 @@ static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, spdif_priv->txclk_src[index], rate[index]); dev_dbg(&pdev->dev, "use divisor %d for %dHz sample rate\n", spdif_priv->txclk_div[index], rate[index]); + if (spdif_priv->txclk[index] == spdif_priv->sysclk) + dev_dbg(&pdev->dev, "use sysclk_df %d for %dHz sample rate\n", + spdif_priv->sysclk_df[index], rate[index]); return 0; } -- cgit v1.2.3 From 5d891c7b305dd2d39b0005aecf2c80b242fadaf0 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Mon, 21 Apr 2014 11:40:22 +0800 Subject: ENGR00309468-3 ASoC: fsl_spdif: Print selected rate for debug It'd better to tell people what's the current rate from the clock selecting function against the required sample rate. Signed-off-by: Nicolin Chen (cherry picked from commit 468755326e5ab405e1567480d4c09c3387ce028a) --- sound/soc/fsl/fsl_spdif.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index c1baba2ca029..b47c436e03a9 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -1067,6 +1067,7 @@ static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, struct device *dev = &pdev->dev; u64 savesub = 100000, ret; struct clk *clk; + long rate_final; char tmp[16]; int i; @@ -1100,6 +1101,10 @@ static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, if (spdif_priv->txclk[index] == spdif_priv->sysclk) dev_dbg(&pdev->dev, "use sysclk_df %d for %dHz sample rate\n", spdif_priv->sysclk_df[index], rate[index]); + rate_final = clk_get_rate(spdif_priv->txclk[index]); + rate_final /= 64 * spdif_priv->txclk_div[index] * spdif_priv->sysclk_df[index]; + dev_dbg(&pdev->dev, "The best rate for %dHz sample rate is %ldHz\n", + rate[index], rate_final); return 0; } -- cgit v1.2.3 From 63a5ec1b474c5d7e2276a50a3e30791c7b64ba16 Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Tue, 22 Apr 2014 12:07:07 +0800 Subject: ENGR00309727 net:fec: fix mdio timeout issue The issue can be reproduced after overninght test, reproduced step: nfs mount rootfs, don't do any other ethernet test cases. If the issue generates, there has log: fec 2188000.ethernet eth0: MDIO read timeout The origin interrupt handler may ignore to process mdio interrupt in current irq handler until the next irq action. If the next irq comes in time that is less than the mdio wait time, the next irq handler wake up a single thread waiting on this completion, MDIO read function can get the single before time expired. Otherwise, MDIO read generate timeout issue. The patch just to fix the issue. Signed-off-by: Fugang Duan --- drivers/net/ethernet/freescale/fec_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index b13675cf8975..cd28f81b9e9b 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1251,7 +1251,7 @@ fec_enet_interrupt(int irq, void *dev_id) complete(&fep->mdio_done); fep->work_mdio = 0; } - } while (fec_enet_collect_events(fep)); + } while (1); return ret; } -- cgit v1.2.3 From 137a6478919be81c59a12f29567a1f8a0aa00c0b Mon Sep 17 00:00:00 2001 From: Richard Zhu Date: Tue, 22 Apr 2014 14:49:48 +0800 Subject: ENGR00309798 arm: create standalone dts for a9 when m4 is running Create standalone dts for a9 when m4 is running, since there are some conflictions in the following modules * i2c3 * flexcan1&2 * uart2 Signed-off-by: Richard Zhu --- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/imx6sx-sdb-m4.dts | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 arch/arm/boot/dts/imx6sx-sdb-m4.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index fe08961b9084..db4f00c55929 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -148,6 +148,7 @@ dtb-$(CONFIG_ARCH_MXC) += \ imx6sx-sdb-lcdif1.dtb \ imx6sx-sdb-sai.dtb \ imx6sx-sdb-emmc.dtb \ + imx6sx-sdb-m4.dtb \ vf610-twr.dtb dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \ imx23-olinuxino.dtb \ diff --git a/arch/arm/boot/dts/imx6sx-sdb-m4.dts b/arch/arm/boot/dts/imx6sx-sdb-m4.dts new file mode 100644 index 000000000000..2d706853438c --- /dev/null +++ b/arch/arm/boot/dts/imx6sx-sdb-m4.dts @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2014 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include "imx6sx-sdb.dts" + +/* + * The flollowing modules are conflicting with M4, disable them when m4 + * is running. + */ +&flexcan1 { + status = "disabled"; +}; + +&flexcan2 { + status = "disabled"; +}; + +&i2c3 { + status = "disabled"; +}; + +&uart2 { + status = "disabled"; +}; -- cgit v1.2.3 From a728754b84361dfdb3f2ccda252cf47366b5e0c7 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Wed, 23 Apr 2014 08:54:33 +0800 Subject: ENGR00309918 ARM: imx6sx: enable usb charger for sdb board Enable usb charger for imx6sx-sdb board Signed-off-by: Peter Chen --- arch/arm/boot/dts/imx6sx-sdb.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts b/arch/arm/boot/dts/imx6sx-sdb.dts index 10e95064ab62..216538218161 100644 --- a/arch/arm/boot/dts/imx6sx-sdb.dts +++ b/arch/arm/boot/dts/imx6sx-sdb.dts @@ -472,6 +472,7 @@ vbus-supply = <®_usb_otg1_vbus>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usbotg1_1>; + imx6-usb-charger-detection; status = "okay"; }; -- cgit v1.2.3 From 8093ee3558fdefba5257cc6f1da9217e3a7ca814 Mon Sep 17 00:00:00 2001 From: Luwei Zhou Date: Tue, 22 Apr 2014 17:10:35 +0800 Subject: ENGR00309828 ARM: imx6sx: Add imx6sx-17x17-arm2-mlb.dtb in Makefile Add imx6sx-17x17-arm2-mlb.dtb in devicetree makefile list Signed-off-by: Luwei Zhou (cherry picked from commit 0ac36559f00dace422fbc766de3e06cf2a343fdf) --- arch/arm/boot/dts/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index db4f00c55929..a02ff774c6da 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -140,6 +140,7 @@ dtb-$(CONFIG_ARCH_MXC) += \ imx6sx-17x17-arm2-sai.dtb \ imx6sx-17x17-arm2-ssi.dtb \ imx6sx-17x17-arm2-spdif.dtb \ + imx6sx-17x17-arm2-mlb.dtb \ imx6sx-19x19-arm2.dtb \ imx6sx-19x19-arm2-csi.dtb \ imx6sx-19x19-arm2-lcdif1.dtb \ -- cgit v1.2.3 From 78c6fe6ed7a7b6ebdc4ff4ce74c32ff54cff9e23 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Wed, 23 Apr 2014 11:58:24 +0800 Subject: ENGR00309934 ARM: imx_v7_defconfig: Select CONFIG_USB_G_NCM as module Enable g_ncm as module for use g_ncm gadget driver. Signed-off-by: Li Jun --- arch/arm/configs/imx_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/imx_v7_defconfig b/arch/arm/configs/imx_v7_defconfig index d4a2666d9de1..abc9957ae4a9 100644 --- a/arch/arm/configs/imx_v7_defconfig +++ b/arch/arm/configs/imx_v7_defconfig @@ -257,6 +257,7 @@ CONFIG_USB_MXS_PHY=y CONFIG_USB_GADGET=y CONFIG_USB_ZERO=m CONFIG_USB_ETH=m +CONFIG_USB_G_NCM=m CONFIG_USB_MASS_STORAGE=m CONFIG_USB_G_SERIAL=m CONFIG_MMC=y -- cgit v1.2.3 From 85e7c5fd7332f962a66b0a7084f696d678dbecf5 Mon Sep 17 00:00:00 2001 From: Fugang Duan Date: Wed, 23 Apr 2014 15:12:41 +0800 Subject: ENGR00310027 net:fec: return the suitable value in irq handler The current return value is not right beacause there may have irq interrupt that is processed. So correct the return value. Signed-off-by: Fugang Duan --- drivers/net/ethernet/freescale/fec_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index cd28f81b9e9b..3447f7c2248d 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1224,7 +1224,7 @@ fec_enet_interrupt(int irq, void *dev_id) do { if (unlikely(!fec_enet_collect_events(fep))) - return IRQ_NONE; + return ret; if (fep->work_ts && fep->bufdesc_ex) { ret = IRQ_HANDLED; -- cgit v1.2.3 From 40b6be52e36f13cc6340970607b5ee90990ee8ec Mon Sep 17 00:00:00 2001 From: Xianzhong Date: Wed, 23 Apr 2014 18:21:33 +0800 Subject: ENGR00309915 [#1087] enhanced video memory mutex this patch can fix NULL pointer issue in GPU kernel driver with the following log [<7f240438>] (gckEVENT_AddList+0x0/0x810 [galcore]) from [<7f239ebc>] (gckCOMMAND_Commit+0xf28/0x118c [galcore]) [<7f238f94>] (gckCOMMAND_Commit+0x0/0x118c [galcore]) from [<7f2362dc>] (gckKERNEL_Dispatch+0x120c/0x24e4 [galcore]) [<7f2350d0>] (gckKERNEL_Dispatch+0x0/0x24e4 [galcore]) from [<7f222280>] (drv_ioctl+0x390/0x540 [galcore]) [<7f221ef0>] (drv_ioctl+0x0/0x540 [galcore]) from [<800facd0>] (vfs_ioctl+0x30/0x44) The false code is at 0x217bc where the 0-pointer happens (r3 = 0) gcuVIDMEM_NODE_PTR node = (gcuVIDMEM_NODE_PTR)(gcmUINT64_TO_PTR(Record->info.u.FreeVideoMemory.node)); 217b8: e5953028 ldr r3, [r5, #40] ; 0x28 if (node->VidMem.memory->object.type == gcvOBJ_VIDMEM) 217bc: e5932000 ldr r2, [r3] 217c0: e5922000 ldr r2, [r2] 217c4: e152000a cmp r2, sl { gcmkVERIFY_OK(gckKERNEL_RemoveProcessDB(Event->kernel, Date: Apr 23, 2014 Signed-off-by: Xianzhong Acked-by: Jason Liu (cherry picked from commit 13859c2276997dbfd1b45aff1ff598e2ee1d4f74) --- drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 5 ++ drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h | 7 +- .../gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c | 12 --- .../hal/kernel/gc_hal_kernel_video_memory.c | 88 ++++++++-------------- 4 files changed, 36 insertions(+), 76 deletions(-) diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c index 59b35bbaface..0fc52e79a3df 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -240,6 +240,8 @@ gckKERNEL_Construct( kernel->dvfs = gcvNULL; #endif + kernel->vidmemMutex = gcvNULL; + /* Initialize the gckKERNEL object. */ kernel->object.type = gcvOBJ_KERNEL; kernel->os = Os; @@ -386,6 +388,8 @@ gckKERNEL_Construct( gcmkONERROR( gckOS_CreateMutex(Os, (gctPOINTER)&kernel->virtualBufferLock)); + /* Construct a video memory mutex. */ + gcmkONERROR(gckOS_CreateMutex(Os, &kernel->vidmemMutex)); /* Return pointer to the gckKERNEL object. */ *Kernel = kernel; @@ -612,6 +616,7 @@ gckKERNEL_Destroy( gcmkVERIFY_OK(gckOS_DestroySyncTimeline(Kernel->os, Kernel->timeline)); #endif + gcmkVERIFY_OK(gckOS_DeleteMutex(Kernel->os, Kernel->vidmemMutex)); /* Mark the gckKERNEL object as unknown. */ Kernel->object.type = gcvOBJ_UNKNOWN; diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h index e2e93dfcc991..18ed7ffbd4f8 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h @@ -547,6 +547,7 @@ struct _gckKERNEL /* Level of dump information after stuck. */ gctUINT stuckDump; + gctPOINTER vidmemMutex; }; struct _FrequencyHistory @@ -896,9 +897,6 @@ typedef union _gcuVIDMEM_NODE /* Actual physical address */ gctUINT32 addresses[gcdMAX_GPU_COUNT]; - /* Mutex. */ - gctPOINTER mutex; - /* Locked counter. */ gctINT32 lockeds[gcdMAX_GPU_COUNT]; @@ -938,9 +936,6 @@ struct _gckVIDMEM /* Allocation threshold. */ gctSIZE_T threshold; - - /* The heap mutex. */ - gctPOINTER mutex; }; typedef struct _gcsVIDMEM_NODE * gckVIDMEM_NODE; diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c index a54929742962..68471b9cb632 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c @@ -1133,14 +1133,8 @@ _AllocateLinear( node->Virtual.lockKernels[i] = gcvNULL; } - node->Virtual.mutex = gcvNULL; - node->Virtual.processID = 0; - /* Create the mutex. */ - gcmkERR_BREAK( - gckOS_CreateMutex(Command->os, &node->Virtual.mutex)); - node->Virtual.bytes = ((Size + Alignment -1)/ Alignment)*Alignment;; gcmkERR_BREAK(gckOS_AllocateNonPagedMemory( @@ -1166,12 +1160,6 @@ _AllocateLinear( /* Roll back. */ if (node != gcvNULL) { - if (node->Virtual.mutex != gcvNULL) - { - /* Destroy the mutex. */ - gcmkCHECK_STATUS(gckOS_DeleteMutex(Command->os, node->Virtual.mutex)); - } - /* Free the structure. */ gcmkCHECK_STATUS(gcmkOS_SAFE_FREE(Command->os, node)); } diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c index 5b1619a97953..7e81b3063e57 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c @@ -253,14 +253,8 @@ gckVIDMEM_ConstructVirtual( node->Virtual.lockKernels[i] = gcvNULL; } - node->Virtual.mutex = gcvNULL; - gcmkONERROR(gckOS_GetProcessID(&node->Virtual.processID)); - /* Create the mutex. */ - gcmkONERROR( - gckOS_CreateMutex(os, &node->Virtual.mutex)); - #if LINUX_CMA_FSL if(node->Virtual.contiguous && (!node->Virtual.cacheable)) { @@ -306,12 +300,6 @@ OnError: /* Roll back. */ if (node != gcvNULL) { - if (node->Virtual.mutex != gcvNULL) - { - /* Destroy the mutex. */ - gcmkVERIFY_OK(gckOS_DeleteMutex(os, node->Virtual.mutex)); - } - /* Free the structure. */ gcmkVERIFY_OK(gcmkOS_SAFE_FREE(os, node)); } @@ -352,9 +340,6 @@ gckVIDMEM_DestroyVirtual( os = Node->Virtual.kernel->os; gcmkVERIFY_OBJECT(os, gcvOBJ_OS); - /* Delete the mutex. */ - gcmkVERIFY_OK(gckOS_DeleteMutex(os, Node->Virtual.mutex)); - /* Delete the gcuVIDMEM_NODE union. */ gcmkVERIFY_OK(gcmkOS_SAFE_FREE(os, Node)); @@ -438,7 +423,6 @@ gckVIDMEM_Construct( memory->bytes = heapBytes; memory->freeBytes = heapBytes; memory->threshold = Threshold; - memory->mutex = gcvNULL; BaseAddress = 0; @@ -561,9 +545,6 @@ gckVIDMEM_Construct( "[GALCORE] TILE_STATUS: bank %d", memory->mapping[gcvSURF_TILE_STATUS]); - /* Allocate the mutex. */ - gcmkONERROR(gckOS_CreateMutex(Os, &memory->mutex)); - /* Return pointer to the gckVIDMEM object. */ *Memory = memory; @@ -575,12 +556,6 @@ OnError: /* Roll back. */ if (memory != gcvNULL) { - if (memory->mutex != gcvNULL) - { - /* Delete the mutex. */ - gcmkVERIFY_OK(gckOS_DeleteMutex(Os, memory->mutex)); - } - for (i = 0; i < banks; ++i) { /* Free the heap. */ @@ -647,9 +622,6 @@ gckVIDMEM_Destroy( } } - /* Free the mutex. */ - gcmkVERIFY_OK(gckOS_DeleteMutex(Memory->os, Memory->mutex)); - /* Mark the object as unknown. */ Memory->object.type = gcvOBJ_UNKNOWN; @@ -914,7 +886,7 @@ gckVIDMEM_AllocateLinear( gcmkVERIFY_ARGUMENT(Type < gcvSURF_NUM_TYPES); /* Acquire the mutex. */ - gcmkONERROR(gckOS_AcquireMutex(Memory->os, Memory->mutex, gcvINFINITE)); + gcmkONERROR(gckOS_AcquireMutex(Memory->os, Kernel->vidmemMutex, gcvINFINITE)); acquired = gcvTRUE; @@ -1030,7 +1002,7 @@ gckVIDMEM_AllocateLinear( #endif /* Release the mutex. */ - gcmkVERIFY_OK(gckOS_ReleaseMutex(Memory->os, Memory->mutex)); + gcmkVERIFY_OK(gckOS_ReleaseMutex(Memory->os, Kernel->vidmemMutex)); /* Return the pointer to the node. */ *Node = node; @@ -1047,7 +1019,7 @@ OnError: if (acquired) { /* Release the mutex. */ - gcmkVERIFY_OK(gckOS_ReleaseMutex(Memory->os, Memory->mutex)); + gcmkVERIFY_OK(gckOS_ReleaseMutex(Memory->os, Kernel->vidmemMutex)); } /* Return the status. */ @@ -1087,6 +1059,11 @@ gckVIDMEM_Free( gcmkHEADER_ARG("Node=0x%x", Node); + /* Acquire the mutex. */ + gcmkONERROR( + gckOS_AcquireMutex(Kernel->os, Kernel->vidmemMutex, gcvINFINITE)); + mutexAcquired = gcvTRUE; + /* Verify the arguments. */ if ((Node == gcvNULL) || (Node->VidMem.memory == gcvNULL) @@ -1103,12 +1080,6 @@ gckVIDMEM_Free( /* Extract pointer to gckVIDMEM object owning the node. */ memory = Node->VidMem.memory; - /* Acquire the mutex. */ - gcmkONERROR( - gckOS_AcquireMutex(memory->os, memory->mutex, gcvINFINITE)); - - mutexAcquired = gcvTRUE; - #ifdef __QNXNTO__ /* Unmap the video memory. */ if (Node->VidMem.logical != gcvNULL) @@ -1193,7 +1164,7 @@ gckVIDMEM_Free( } /* Release the mutex. */ - gcmkVERIFY_OK(gckOS_ReleaseMutex(memory->os, memory->mutex)); + gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, Kernel->vidmemMutex)); gcmkTRACE_ZONE(gcvLEVEL_INFO, gcvZONE_VIDMEM, "Node 0x%x is freed.", @@ -1247,16 +1218,19 @@ gckVIDMEM_Free( /* Destroy the gcuVIDMEM_NODE union. */ gcmkVERIFY_OK(gckVIDMEM_DestroyVirtual(Node)); + gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, Kernel->vidmemMutex)); + /* Success. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: + if (mutexAcquired) { /* Release the mutex. */ gcmkVERIFY_OK(gckOS_ReleaseMutex( - memory->os, memory->mutex + Kernel->os,Kernel->vidmemMutex )); } @@ -1492,6 +1466,10 @@ gckVIDMEM_Lock( /* Verify the arguments. */ gcmkVERIFY_ARGUMENT(Address != gcvNULL); + /* Grab the mutex. */ + gcmkONERROR(gckOS_AcquireMutex(Kernel->os, Kernel->vidmemMutex, gcvINFINITE)); + acquired = gcvTRUE; + if ((Node == gcvNULL) || (Node->VidMem.memory == gcvNULL) ) @@ -1553,10 +1531,6 @@ gckVIDMEM_Lock( os = Node->Virtual.kernel->os; gcmkVERIFY_OBJECT(os, gcvOBJ_OS); - /* Grab the mutex. */ - gcmkONERROR(gckOS_AcquireMutex(os, Node->Virtual.mutex, gcvINFINITE)); - acquired = gcvTRUE; - #if gcdPAGED_MEMORY_CACHEABLE /* Force video memory cacheable. */ Cacheable = gcvTRUE; @@ -1655,10 +1629,11 @@ gckVIDMEM_Lock( *Address = Node->Virtual.addresses[Kernel->core]; #endif - /* Release the mutex. */ - gcmkVERIFY_OK(gckOS_ReleaseMutex(os, Node->Virtual.mutex)); } + /* Release the mutex. */ + gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, Kernel->vidmemMutex)); + /* Success. */ gcmkFOOTER_ARG("*Address=%08x", *Address); return gcvSTATUS_OK; @@ -1704,7 +1679,7 @@ OnError: if (acquired) { /* Release the mutex. */ - gcmkVERIFY_OK(gckOS_ReleaseMutex(os, Node->Virtual.mutex)); + gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, Kernel->vidmemMutex)); } /* Return the status. */ @@ -1755,6 +1730,10 @@ gckVIDMEM_Unlock( gcmkHEADER_ARG("Node=0x%x Type=%d *Asynchroneous=%d", Node, Type, gcmOPT_VALUE(Asynchroneous)); + /* Grab the mutex. */ + gcmkONERROR(gckOS_AcquireMutex(Kernel->os, Kernel->vidmemMutex, gcvINFINITE)); + acquired = gcvTRUE; + /* Verify the arguments. */ if ((Node == gcvNULL) || (Node->VidMem.memory == gcvNULL) @@ -1800,12 +1779,6 @@ gckVIDMEM_Unlock( os = Kernel->os; gcmkVERIFY_OBJECT(os, gcvOBJ_OS); - /* Grab the mutex. */ - gcmkONERROR( - gckOS_AcquireMutex(os, Node->Virtual.mutex, gcvINFINITE)); - - acquired = gcvTRUE; - if (Asynchroneous == gcvNULL) { #if !gcdPROCESS_ADDRESS_SPACE @@ -1868,13 +1841,12 @@ gckVIDMEM_Unlock( /* Schedule the surface to be unlocked. */ *Asynchroneous = gcvTRUE; } - - /* Release the mutex. */ - gcmkVERIFY_OK(gckOS_ReleaseMutex(os, Node->Virtual.mutex)); - - acquired = gcvFALSE; } + /* Release the mutex. */ + gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, Kernel->vidmemMutex)); + acquired = gcvFALSE; + /* Success. */ gcmkFOOTER_ARG("*Asynchroneous=%d", gcmOPT_VALUE(Asynchroneous)); return gcvSTATUS_OK; @@ -1883,7 +1855,7 @@ OnError: if (acquired) { /* Release the mutex. */ - gcmkVERIFY_OK(gckOS_ReleaseMutex(os, Node->Virtual.mutex)); + gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, Kernel->vidmemMutex)); } /* Return the status. */ -- cgit v1.2.3 From c01fcf9c5d5aab969487b4960c0b40a2273b14c9 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sat, 19 Apr 2014 13:01:30 +0800 Subject: ARM: imx: define struct clk_gate2 on our own The imx clk-gate2 driver implements an i.MX specific gate clock, which has two bits controlling the gate states. While this is a completely separate gate driver from the common clk-gate one, it reuses the common clk_gate structure. Such reusing makes the extending of clk_gate2 clumsy. Let's define struct clk_gate2 on our own to make the driver independent of the common clk-gate one, and ease the clk_gate2 extending at a later time. Signed-off-by: Shawn Guo Signed-off-by: Nicolin Chen (cherry picked from commit b0293bafbb378183279eb74442506194db7b2c89) --- arch/arm/mach-imx/clk-gate2.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c index dcdc1a1d8a1b..a7857a9dd866 100644 --- a/arch/arm/mach-imx/clk-gate2.c +++ b/arch/arm/mach-imx/clk-gate2.c @@ -28,11 +28,19 @@ * parent - fixed parent. No clk_set_parent support */ -#define to_clk_gate(_hw) container_of(_hw, struct clk_gate, hw) +struct clk_gate2 { + struct clk_hw hw; + void __iomem *reg; + u8 bit_idx; + u8 flags; + spinlock_t *lock; +}; + +#define to_clk_gate2(_hw) container_of(_hw, struct clk_gate2, hw) static int clk_gate2_enable(struct clk_hw *hw) { - struct clk_gate *gate = to_clk_gate(hw); + struct clk_gate2 *gate = to_clk_gate2(hw); u32 reg; unsigned long flags = 0; @@ -51,7 +59,7 @@ static int clk_gate2_enable(struct clk_hw *hw) static void clk_gate2_disable(struct clk_hw *hw) { - struct clk_gate *gate = to_clk_gate(hw); + struct clk_gate2 *gate = to_clk_gate2(hw); u32 reg; unsigned long flags = 0; @@ -69,7 +77,7 @@ static void clk_gate2_disable(struct clk_hw *hw) static int clk_gate2_is_enabled(struct clk_hw *hw) { u32 reg; - struct clk_gate *gate = to_clk_gate(hw); + struct clk_gate2 *gate = to_clk_gate2(hw); reg = readl(gate->reg); @@ -90,15 +98,15 @@ struct clk *clk_register_gate2(struct device *dev, const char *name, void __iomem *reg, u8 bit_idx, u8 clk_gate2_flags, spinlock_t *lock) { - struct clk_gate *gate; + struct clk_gate2 *gate; struct clk *clk; struct clk_init_data init; - gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL); + gate = kzalloc(sizeof(struct clk_gate2), GFP_KERNEL); if (!gate) return ERR_PTR(-ENOMEM); - /* struct clk_gate assignments */ + /* struct clk_gate2 assignments */ gate->reg = reg; gate->bit_idx = bit_idx; gate->flags = clk_gate2_flags; -- cgit v1.2.3 From b3caae4778599bbbf77e188082d2c3e2da33688f Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sat, 19 Apr 2014 13:01:31 +0800 Subject: ARM: imx: lock is always valid for clk_gate2 The imx specific clk_gate2 always has a valid lock with the clock. So the validation on gate->lock is not really needed. Remove it. Signed-off-by: Shawn Guo Signed-off-by: Nicolin Chen (cherry picked from commit 430468ff84e8d8a8d53e3ca974721edd85042d47) --- arch/arm/mach-imx/clk-gate2.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c index a7857a9dd866..96bbc7082d3a 100644 --- a/arch/arm/mach-imx/clk-gate2.c +++ b/arch/arm/mach-imx/clk-gate2.c @@ -44,15 +44,13 @@ static int clk_gate2_enable(struct clk_hw *hw) u32 reg; unsigned long flags = 0; - if (gate->lock) - spin_lock_irqsave(gate->lock, flags); + spin_lock_irqsave(gate->lock, flags); reg = readl(gate->reg); reg |= 3 << gate->bit_idx; writel(reg, gate->reg); - if (gate->lock) - spin_unlock_irqrestore(gate->lock, flags); + spin_unlock_irqrestore(gate->lock, flags); return 0; } @@ -63,15 +61,13 @@ static void clk_gate2_disable(struct clk_hw *hw) u32 reg; unsigned long flags = 0; - if (gate->lock) - spin_lock_irqsave(gate->lock, flags); + spin_lock_irqsave(gate->lock, flags); reg = readl(gate->reg); reg &= ~(3 << gate->bit_idx); writel(reg, gate->reg); - if (gate->lock) - spin_unlock_irqrestore(gate->lock, flags); + spin_unlock_irqrestore(gate->lock, flags); } static int clk_gate2_is_enabled(struct clk_hw *hw) -- cgit v1.2.3 From 16d56735a615c9cbfeb319f88c8bddece261da69 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sat, 19 Apr 2014 13:01:32 +0800 Subject: ARM: imx: add shared gate clock support It's quite common on i.MX that one gate bit controls the gating of multiple clocks, i.e. this is a shared gate. The patch adds the function imx_clk_gate2_shared() for such case. The clocks controlled by the same gate bits should call this function with a pointer to a single share count variable, so that the gate bits will only be operated on the first enabling and the last disabling of these shared gate clocks. Thanks to Gerhard Sittig for this idea. Signed-off-by: Shawn Guo Signed-off-by: Nicolin Chen (cherry picked from commit 9c830d95d0e6d7522a31cd14f9641c37700d4e85) --- arch/arm/mach-imx/clk-gate2.c | 13 ++++++++++++- arch/arm/mach-imx/clk.h | 13 +++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c index 96bbc7082d3a..52d872e7d326 100644 --- a/arch/arm/mach-imx/clk-gate2.c +++ b/arch/arm/mach-imx/clk-gate2.c @@ -34,6 +34,7 @@ struct clk_gate2 { u8 bit_idx; u8 flags; spinlock_t *lock; + unsigned int *share_count; }; #define to_clk_gate2(_hw) container_of(_hw, struct clk_gate2, hw) @@ -46,10 +47,14 @@ static int clk_gate2_enable(struct clk_hw *hw) spin_lock_irqsave(gate->lock, flags); + if (gate->share_count && (*gate->share_count)++ > 0) + goto out; + reg = readl(gate->reg); reg |= 3 << gate->bit_idx; writel(reg, gate->reg); +out: spin_unlock_irqrestore(gate->lock, flags); return 0; @@ -63,10 +68,14 @@ static void clk_gate2_disable(struct clk_hw *hw) spin_lock_irqsave(gate->lock, flags); + if (gate->share_count && --(*gate->share_count) > 0) + goto out; + reg = readl(gate->reg); reg &= ~(3 << gate->bit_idx); writel(reg, gate->reg); +out: spin_unlock_irqrestore(gate->lock, flags); } @@ -92,7 +101,8 @@ static struct clk_ops clk_gate2_ops = { struct clk *clk_register_gate2(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, - u8 clk_gate2_flags, spinlock_t *lock) + u8 clk_gate2_flags, spinlock_t *lock, + unsigned int *share_count) { struct clk_gate2 *gate; struct clk *clk; @@ -107,6 +117,7 @@ struct clk *clk_register_gate2(struct device *dev, const char *name, gate->bit_idx = bit_idx; gate->flags = clk_gate2_flags; gate->lock = lock; + gate->share_count = share_count; init.name = name; init.ops = &clk_gate2_ops; diff --git a/arch/arm/mach-imx/clk.h b/arch/arm/mach-imx/clk.h index e9f235bef175..319a9660e4c2 100644 --- a/arch/arm/mach-imx/clk.h +++ b/arch/arm/mach-imx/clk.h @@ -30,7 +30,8 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name, struct clk *clk_register_gate2(struct device *dev, const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, - u8 clk_gate_flags, spinlock_t *lock); + u8 clk_gate_flags, spinlock_t *lock, + unsigned int *share_count); struct clk * imx_obtain_fixed_clock( const char *name, unsigned long rate); @@ -39,7 +40,15 @@ static inline struct clk *imx_clk_gate2(const char *name, const char *parent, void __iomem *reg, u8 shift) { return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, - shift, 0, &imx_ccm_lock); + shift, 0, &imx_ccm_lock, NULL); +} + +static inline struct clk *imx_clk_gate2_shared(const char *name, + const char *parent, void __iomem *reg, u8 shift, + unsigned int *share_count) +{ + return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg, + shift, 0, &imx_ccm_lock, share_count); } struct clk *imx_clk_pfd(const char *name, const char *parent_name, -- cgit v1.2.3 From 670c44be3abdb5174059b51b62b90ff9ea021c0e Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Tue, 22 Apr 2014 15:10:32 +0800 Subject: ENGR00309977-1 ARM: imx6sx: Separate SPDIF and Audio clocks Shawn's patch -- ARM: imx: shared gate support for i.MX clk_gate2 clocko has fixed the problem of clock conflicts due to sharing a same gate. So from now on, we can no longer need to take care the shared gate clock for each audio clock route. Thus this patch separates them by using the new clock registering helper function. And meanwhile, we set a proper rate for each route so as to support each module. For S/PDIF, we use 98304000Hz so that the current driver would perfectly get 32000Hz and 48000Hz sample rate playback support, even though we can only get 43885Hz for 44100Hz sample rate in this way -- If user want to playback 44100Hz group sample rates, they need to change the parent rate. Acked-by: Wang Shengjiu Signed-off-by: Nicolin Chen (cherry picked from commit b50eb55b1eb35e8e568ab777dc794370f20464eb) --- arch/arm/mach-imx/clk-imx6sx.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-imx/clk-imx6sx.c b/arch/arm/mach-imx/clk-imx6sx.c index 6a5a8b543c23..e8b9a973b502 100644 --- a/arch/arm/mach-imx/clk-imx6sx.c +++ b/arch/arm/mach-imx/clk-imx6sx.c @@ -115,6 +115,9 @@ static struct clk_div_table video_div_table[] = { { } }; +static u32 share_count_asrc; +static u32 share_count_audio; + static void __init imx6sx_clocks_init(struct device_node *ccm_node) { struct device_node *np; @@ -319,9 +322,8 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) clks[IMX6SX_CLK_AIPS_TZ1] = imx_clk_gate2("aips_tz1", "ahb", base + 0x68, 0); clks[IMX6SX_CLK_AIPS_TZ2] = imx_clk_gate2("aips_tz2", "ahb", base + 0x68, 2); clks[IMX6SX_CLK_APBH_DMA] = imx_clk_gate2("apbh_dma", "usdhc3", base + 0x68, 4); - clks[IMX6SX_CLK_ASRC_GATE] = imx_clk_gate2("asrc_gate", "ahb", base + 0x68, 6); - clks[IMX6SX_CLK_ASRC_MEM] = imx_clk_fixed_factor("asrc_mem", "asrc_gate", 1, 1); - clks[IMX6SX_CLK_ASRC_IPG] = imx_clk_fixed_factor("asrc_ipg", "asrc_gate", 1, 1); + clks[IMX6SX_CLK_ASRC_MEM] = imx_clk_gate2_shared("asrc_mem", "ahb", base + 0x68, 6, &share_count_asrc); + clks[IMX6SX_CLK_ASRC_IPG] = imx_clk_gate2_shared("asrc_ipg", "ahb", base + 0x68, 6, &share_count_asrc); clks[IMX6SX_CLK_CAAM_MEM] = imx_clk_gate2("caam_mem", "ahb", base + 0x68, 8); clks[IMX6SX_CLK_CAAM_ACLK] = imx_clk_gate2("caam_aclk", "ahb", base + 0x68, 10); clks[IMX6SX_CLK_CAAM_IPG] = imx_clk_gate2("caam_ipg", "ipg", base + 0x68, 12); @@ -394,9 +396,8 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) clks[IMX6SX_CLK_ROM] = imx_clk_gate2("rom", "ahb", base + 0x7c, 0); clks[IMX6SX_CLK_SDMA] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6); clks[IMX6SX_CLK_SPBA] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12); - clks[IMX6SX_CLK_AUDIO_GATE] = imx_clk_gate2("audio_gate", "audio_podf", base + 0x7c, 14); - clks[IMX6SX_CLK_AUDIO] = imx_clk_fixed_factor("audio", "audio_gate", 1, 1); - clks[IMX6SX_CLK_SPDIF] = imx_clk_fixed_factor("spdif", "audio_gate", 1, 1); + clks[IMX6SX_CLK_AUDIO] = imx_clk_gate2_shared("audio", "audio_podf", base + 0x7c, 14, &share_count_audio); + clks[IMX6SX_CLK_SPDIF] = imx_clk_gate2_shared("spdif", "spdif_podf", base + 0x7c, 14, &share_count_audio); clks[IMX6SX_CLK_SSI1_IPG] = imx_clk_gate2("ssi1_ipg", "ipg", base + 0x7c, 18); clks[IMX6SX_CLK_SSI2_IPG] = imx_clk_gate2("ssi2_ipg", "ipg", base + 0x7c, 20); clks[IMX6SX_CLK_SSI3_IPG] = imx_clk_gate2("ssi3_ipg", "ipg", base + 0x7c, 22); @@ -479,20 +480,11 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) /* Audio clocks */ clk_set_rate(clks[IMX6SX_CLK_PLL4_AUDIO_DIV], 393216000); - /* - * IMPORTANT: - * SPDIF and AUDIO clocks are sharing the same gate on i.MX6 Solo X - * while their rates and gates are being handled by separate drivers. - * To keep them safe, we here merge them into one clock and use one - * exact rate so there'd not be any conflict during usages of them. - * - * But this results a limitation that if using these two simultaneous, - * make sure to keep them identical as what the code does over here. - */ - clk_set_parent(clks[IMX6SX_CLK_SPDIF_SEL], clks[IMX6SX_CLK_PLL3_USB_OTG]); + clk_set_parent(clks[IMX6SX_CLK_SPDIF_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]); + clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000); + clk_set_parent(clks[IMX6SX_CLK_AUDIO_SEL], clks[IMX6SX_CLK_PLL3_USB_OTG]); - clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 48000000); - clk_set_rate(clks[IMX6SX_CLK_AUDIO_PODF], 48000000); + clk_set_rate(clks[IMX6SX_CLK_AUDIO_PODF], 24000000); clk_set_parent(clks[IMX6SX_CLK_SSI1_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]); clk_set_parent(clks[IMX6SX_CLK_SSI2_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]); -- cgit v1.2.3 From f802466e492c478b433dd84dd0c16b8cf11e987a Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Wed, 23 Apr 2014 12:42:45 +0800 Subject: ENGR00309977-2 ARM: imx6q/sl: Set SPDIF clock to 22736841Hz Since we no longer use clk_set_rate() in spdif driver, the rate we provide to it on imx6q/sl platforms is no more contented for its supporting sample rates. By setting the clock to 22736841Hz, we can get the sample rates: 48008Hz for 48000Hz 32005Hz for 32000Hz 43859Hz for 44100Hz The results for 48KHz and 32KHz has changed comparing to the previous release, but the one for 44100Hz has a bit lose even though it should be the best we can get based on the current clock rate. If user want to playback a perfect 44100Hz, they need to change the parent clock rate. Acked-by: Wang Shengjiu Signed-off-by: Nicolin Chen (cherry picked from commit f12e2ea9c6c5557adb3bbe26c51021978f2c8d99) --- arch/arm/mach-imx/clk-imx6q.c | 1 + arch/arm/mach-imx/clk-imx6sl.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 6efe6f2316f5..77d425c4a3a5 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -691,6 +691,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) clk_set_parent(clk[ssi3_sel], clk[pll4_audio_div]); clk_set_parent(clk[esai_sel], clk[pll4_audio_div]); clk_set_parent(clk[spdif_sel], clk[pll3_pfd3_454m]); + clk_set_rate(clk[spdif_podf], 227368421); clk_set_parent(clk[spdif1_sel], clk[pll3_usb_otg]); clk_set_rate(clk[spdif1_sel], 7500000); diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c index 95f8b0b8d029..c9eb48a09159 100644 --- a/arch/arm/mach-imx/clk-imx6sl.c +++ b/arch/arm/mach-imx/clk-imx6sl.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Freescale Semiconductor, Inc. + * Copyright (C) 2013-2014 Freescale Semiconductor, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -458,6 +458,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node) /* Audio clocks */ clk_set_parent(clks[IMX6SL_CLK_SPDIF0_SEL], clks[IMX6SL_CLK_PLL3_PFD3]); + clk_set_rate(clks[IMX6SL_CLK_SPDIF0_PODF], 227368421); /* set extern_audio to be sourced from PLL4/audio PLL */ clk_set_parent(clks[IMX6SL_CLK_EXTERN_AUDIO_SEL], clks[IMX6SL_CLK_PLL4_AUDIO_DIV]); -- cgit v1.2.3 From 5f1f2d8a3db3ea7215b717a08cb80385be97f7d3 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Wed, 23 Apr 2014 14:10:31 +0800 Subject: ENGR00309977-3 ARM: imx6sx: Drop useless IMX6SX_CLK_AUDIO_GATE Since we've fixed the clock's shared-gate issue, we no longer need this gate clock. Thus drop it. Acked-by: Wang Shengjiu Signed-off-by: Nicolin Chen (cherry picked from commit c368f9011aebb877aaffc6e4c5d12c7893b552b0) --- include/dt-bindings/clock/imx6sx-clock.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/dt-bindings/clock/imx6sx-clock.h b/include/dt-bindings/clock/imx6sx-clock.h index 4fe0e4686794..0cc658b7e436 100644 --- a/include/dt-bindings/clock/imx6sx-clock.h +++ b/include/dt-bindings/clock/imx6sx-clock.h @@ -249,7 +249,6 @@ #define IMX6SX_CLK_ASRC_MEM 236 #define IMX6SX_CLK_SAI1_IPG 237 #define IMX6SX_CLK_SAI2_IPG 238 -#define IMX6SX_CLK_AUDIO_GATE 239 -#define IMX6SX_CLK_CLK_END 240 +#define IMX6SX_CLK_CLK_END 239 #endif /* __DT_BINDINGS_CLOCK_IMX6SX_H */ -- cgit v1.2.3 From 5c17876222eac2c7c79030d74d813fee97a6bc76 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Mon, 21 Apr 2014 14:12:49 +0800 Subject: ENGR00301281 media: mxc vout: set input resolution back after PP check/process In VDOA PP mode, the input resolution would be changed to be VDOA's output for PP to use as its input resolution to go on to do resizing or color space conversion. The input resolution will be different from the original one when VDOA input cropping is enabled. And, this finally causes a wrong input resolution being used if the users do rotation by calling the S_CTRL ioctrl in runtime. In order to fix this issue, this patch sets the original input resolution back after PP task check and process. The issue can be reproduced by the following command line(enable VDOA mode in the gst plugin configuration file first): gplay AVC_MP30_854x356_23.976_679_AACLC_44.1_96_2_TRON_LEGACY.flv (Enter 't 90' to change to rotate 90 degrees in runtime.) In this case, VDOA input cropping(854x356 -> 848x352) is enabled because VDOA input resolution should align to macro block size. Signed-off-by: Liu Ying (cherry picked from commit 4c732ad69265d8e441e6c15a2e87f5aeef234624) --- drivers/media/platform/mxc/output/mxc_vout.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mxc/output/mxc_vout.c b/drivers/media/platform/mxc/output/mxc_vout.c index bd7d1f0446f3..6ebecf38e790 100644 --- a/drivers/media/platform/mxc/output/mxc_vout.c +++ b/drivers/media/platform/mxc/output/mxc_vout.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2011-2014 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -577,7 +577,7 @@ static void disp_work_func(struct work_struct *work) unsigned long flags = 0; struct ipu_pos ipos; int ret = 0; - u32 in_fmt = 0; + u32 in_fmt = 0, in_width = 0, in_height = 0; u32 vdi_cnt = 0; u32 vdi_frame; u32 index = 0; @@ -689,7 +689,11 @@ vdi_frame_rate_double: } vout->task.input.paddr = vout->vdoa_task.output.paddr; in_fmt = vout->task.input.format; + in_width = vout->task.input.width; + in_height = vout->task.input.height; vout->task.input.format = vout->vdoa_task.output.format; + vout->task.input.width = vout->vdoa_task.output.width; + vout->task.input.height = vout->vdoa_task.output.height; if (vout->task.input.deinterlace.enable) { tiled_interlaced = 1; vout->task.input.deinterlace.enable = 0; @@ -698,8 +702,11 @@ vdi_frame_rate_double: "tiled queue task\n"); } ret = ipu_queue_task(&vout->task); - if ((!vout->tiled_bypass_pp) && tiled_fmt) + if ((!vout->tiled_bypass_pp) && tiled_fmt) { vout->task.input.format = in_fmt; + vout->task.input.width = in_width; + vout->task.input.height = in_height; + } if (tiled_interlaced) vout->task.input.deinterlace.enable = 1; if (ret < 0) { @@ -1101,6 +1108,7 @@ static inline int vdoaipu_try_task(struct mxc_vout_output *vout) { int ret; int is_1080p_stream; + int in_width, in_height; size_t size; struct ipu_task *ipu_task = &vout->task; struct ipu_crop *icrop = &ipu_task->input.crop; @@ -1146,6 +1154,8 @@ static inline int vdoaipu_try_task(struct mxc_vout_output *vout) if (is_1080p_stream) ipu_task->input.crop.h = VALID_HEIGHT_1080P; in_fmt = ipu_task->input.format; + in_width = ipu_task->input.width; + in_height = ipu_task->input.height; ipu_task->input.format = vdoa_task->output.format; ipu_task->input.height = vdoa_task->output.height; ipu_task->input.width = vdoa_task->output.width; @@ -1155,6 +1165,8 @@ static inline int vdoaipu_try_task(struct mxc_vout_output *vout) if (deinterlace) ipu_task->input.deinterlace.enable = 1; ipu_task->input.format = in_fmt; + ipu_task->input.width = in_width; + ipu_task->input.height = in_height; return ret; } -- cgit v1.2.3 From c78c4d7c0c515e98fe81bf0f5e3a183cf52baeea Mon Sep 17 00:00:00 2001 From: Anson Huang Date: Thu, 24 Apr 2014 18:30:37 +0800 Subject: ENGR00310290 ARM: imx: enable necessary clocks for i.mx6sx On i.MX6SX, when CA9 and CM4 are working together, CA9 can NOT disable those shared modules' clock, so keep those clocks CM4 needs always enabled. Signed-off-by: Anson Huang --- arch/arm/mach-imx/clk-imx6sx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/clk-imx6sx.c b/arch/arm/mach-imx/clk-imx6sx.c index e8b9a973b502..6c8a7506abf3 100644 --- a/arch/arm/mach-imx/clk-imx6sx.c +++ b/arch/arm/mach-imx/clk-imx6sx.c @@ -90,7 +90,11 @@ static int const clks_init_on[] __initconst = { IMX6SX_CLK_WAKEUP, IMX6SX_CLK_MMDC_P0_FAST, IMX6SX_CLK_MMDC_P0_IPG, IMX6SX_CLK_ROM, IMX6SX_CLK_ARM, IMX6SX_CLK_IPG, IMX6SX_CLK_OCRAM, IMX6SX_CLK_PER2_MAIN, IMX6SX_CLK_PERCLK, IMX6SX_CLK_M4, - IMX6SX_CLK_QSPI1, IMX6SX_CLK_QSPI2, + IMX6SX_CLK_QSPI1, IMX6SX_CLK_QSPI2, IMX6SX_CLK_UART_IPG, + IMX6SX_CLK_UART_SERIAL, IMX6SX_CLK_I2C3, IMX6SX_CLK_ECSPI5, + IMX6SX_CLK_CAN1_IPG, IMX6SX_CLK_CAN1_SERIAL, IMX6SX_CLK_CAN2_IPG, + IMX6SX_CLK_CAN2_SERIAL, IMX6SX_CLK_CANFD, IMX6SX_CLK_EPIT1, + IMX6SX_CLK_EPIT2, }; static struct clk_div_table clk_enet_ref_table[] = { -- cgit v1.2.3