/* * Copyright (C) 2009 * Guennadi Liakhovetski, DENX Software Engineering, * * Description: * Helper routines for i.MX3x SoCs from Freescale, needed by the fsl_usb2_udc.c * driver to function correctly on these systems. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include #include #include #include #include #include #include "fsl_usb2_udc.h" static struct clk *mxc_ahb_clk; static struct clk *mxc_per_clk; static struct clk *mxc_ipg_clk; /* workaround ENGcm09152 for i.MX35 */ #define MX35_USBPHYCTRL_OFFSET 0x600 #define USBPHYCTRL_OTGBASE_OFFSET 0x8 #define USBPHYCTRL_EVDO (1 << 23) int fsl_udc_clk_init(struct platform_device *pdev) { struct fsl_usb2_platform_data *pdata; unsigned long freq; int ret; pdata = dev_get_platdata(&pdev->dev); mxc_ipg_clk = devm_clk_get(&pdev->dev, "ipg"); if (IS_ERR(mxc_ipg_clk)) { dev_err(&pdev->dev, "clk_get(\"ipg\") failed\n"); return PTR_ERR(mxc_ipg_clk); } mxc_ahb_clk = devm_clk_get(&pdev->dev, "ahb"); if (IS_ERR(mxc_ahb_clk)) { dev_err(&pdev->dev, "clk_get(\"ahb\") failed\n"); return PTR_ERR(mxc_ahb_clk); } mxc_per_clk = devm_clk_get(&pdev->dev, "per"); if (IS_ERR(mxc_per_clk)) { dev_err(&pdev->dev, "clk_get(\"per\") failed\n"); return PTR_ERR(mxc_per_clk); } clk_prepare_enable(mxc_ipg_clk); clk_prepare_enable(mxc_ahb_clk); clk_prepare_enable(mxc_per_clk); /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */ if (!strcmp(pdev->id_entry->name, "imx-udc-mx27")) { freq = clk_get_rate(mxc_per_clk); if (pdata->phy_mode != FSL_USB2_PHY_ULPI && (freq < 59999000 || freq > 60001000)) { dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq); ret = -EINVAL; goto eclkrate; } } return 0; eclkrate: clk_disable_unprepare(mxc_ipg_clk); clk_disable_unprepare(mxc_ahb_clk); clk_disable_unprepare(mxc_per_clk); mxc_per_clk = NULL; return ret; } int fsl_udc_clk_finalize(struct platform_device *pdev) { struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); int ret = 0; /* workaround ENGcm09152 for i.MX35 */ if (pdata->workaround & FLS_USB2_WORKAROUND_ENGCM09152) { unsigned int v; struct resource *res = platform_get_resource (pdev, IORESOURCE_MEM, 0); void __iomem *phy_regs = ioremap(res->start + MX35_USBPHYCTRL_OFFSET, 512); if (!phy_regs) { dev_err(&pdev->dev, "ioremap for phy address fails\n"); ret = -EINVAL; goto ioremap_err; } v = readl(phy_regs + USBPHYCTRL_OTGBASE_OFFSET); writel(v | USBPHYCTRL_EVDO, phy_regs + USBPHYCTRL_OTGBASE_OFFSET); iounmap(phy_regs); } ioremap_err: /* ULPI transceivers don't need usbpll */ if (pdata->phy_mode == FSL_USB2_PHY_ULPI) { clk_disable_unprepare(mxc_per_clk); mxc_per_clk = NULL; } return ret; } void fsl_udc_clk_release(void) { if (mxc_per_clk) clk_disable_unprepare(mxc_per_clk); clk_disable_unprepare(mxc_ahb_clk); clk_disable_unprepare(mxc_ipg_clk); } /net-next.git/commit/net/wireless?h=nds-private-remove&id=0b3589be9b98994ce3d5aeca52445d1f5627c4ba'>wireless/lib80211_crypt_tkip.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2017-01-26 23:15:08 +0100
committerIngo Molnar <mingo@kernel.org>2017-01-30 11:41:26 +0100
commit0b3589be9b98994ce3d5aeca52445d1f5627c4ba (patch)
tree85d0d9b3ac902af2c938b19a566884caf8d00323 /net/wireless/lib80211_crypt_tkip.c
parenta76a82a3e38c8d3fb6499e3dfaeb0949241ab588 (diff)
perf/core: Fix PERF_RECORD_MMAP2 prot/flags for anonymous memory
Andres reported that MMAP2 records for anonymous memory always have their protection field 0. Turns out, someone daft put the prot/flags generation code in the file branch, leaving them unset for anonymous memory. Reported-by: Andres Freund <andres@anarazel.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Don Zickus <dzickus@redhat.com Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@gmail.com> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: acme@kernel.org Cc: anton@ozlabs.org Cc: namhyung@kernel.org Cc: stable@vger.kernel.org # v3.16+ Fixes: f972eb63b100 ("perf: Pass protection and flags bits through mmap2 interface") Link: http://lkml.kernel.org/r/20170126221508.GF6536@twins.programming.kicks-ass.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/wireless/lib80211_crypt_tkip.c')