/* * Copyright (C) ST-Ericsson SA 2012 * * Author: Ola Lilja (ola.o.lilja@stericsson.com) * for ST-Ericsson. * * License terms: * * 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 #include #include #include #include #include #include #include "ux500_pcm.h" #include "ux500_msp_dai.h" #include "mop500_ab8500.h" /* Define the whole MOP500 soundcard, linking platform to the codec-drivers */ static struct snd_soc_dai_link mop500_dai_links[] = { { .name = "ab8500_0", .stream_name = "ab8500_0", .cpu_dai_name = "ux500-msp-i2s.1", .codec_dai_name = "ab8500-codec-dai.0", .platform_name = "ux500-msp-i2s.1", .codec_name = "ab8500-codec.0", .init = mop500_ab8500_machine_init, .ops = mop500_ab8500_ops, }, { .name = "ab8500_1", .stream_name = "ab8500_1", .cpu_dai_name = "ux500-msp-i2s.3", .codec_dai_name = "ab8500-codec-dai.1", .platform_name = "ux500-msp-i2s.3", .codec_name = "ab8500-codec.0", .init = NULL, .ops = mop500_ab8500_ops, }, }; static struct snd_soc_card mop500_card = { .name = "MOP500-card", .owner = THIS_MODULE, .probe = NULL, .dai_link = mop500_dai_links, .num_links = ARRAY_SIZE(mop500_dai_links), }; static void mop500_of_node_put(void) { int i; for (i = 0; i < 2; i++) { of_node_put(mop500_dai_links[i].cpu_of_node); of_node_put(mop500_dai_links[i].codec_of_node); } } static int mop500_of_probe(struct platform_device *pdev, struct device_node *np) { struct device_node *codec_np, *msp_np[2]; int i; msp_np[0] = of_parse_phandle(np, "stericsson,cpu-dai", 0); msp_np[1] = of_parse_phandle(np, "stericsson,cpu-dai", 1); codec_np = of_parse_phandle(np, "stericsson,audio-codec", 0); if (!(msp_np[0] && msp_np[1] && codec_np)) { dev_err(&pdev->dev, "Phandle missing or invalid\n"); mop500_of_node_put(); return -EINVAL; } for (i = 0; i < 2; i++) { mop500_dai_links[i].cpu_of_node = msp_np[i]; mop500_dai_links[i].cpu_dai_name = NULL; mop500_dai_links[i].platform_of_node = msp_np[i]; mop500_dai_links[i].platform_name = NULL; mop500_dai_links[i].codec_of_node = codec_np; mop500_dai_links[i].codec_name = NULL; } snd_soc_of_parse_card_name(&mop500_card, "stericsson,card-name"); return 0; } static int mop500_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; int ret; dev_dbg(&pdev->dev, "%s: Enter.\n", __func__); mop500_card.dev = &pdev->dev; if (np) { ret = mop500_of_probe(pdev, np); if (ret) return ret; } dev_dbg(&pdev->dev, "%s: Card %s: Set platform drvdata.\n", __func__, mop500_card.name); platform_set_drvdata(pdev, &mop500_card); snd_soc_card_set_drvdata(&mop500_card, NULL); dev_dbg(&pdev->dev, "%s: Card %s: num_links = %d\n", __func__, mop500_card.name, mop500_card.num_links); dev_dbg(&pdev->dev, "%s: Card %s: DAI-link 0: name = %s\n", __func__, mop500_card.name, mop500_card.dai_link[0].name); dev_dbg(&pdev->dev, "%s: Card %s: DAI-link 0: stream_name = %s\n", __func__, mop500_card.name, mop500_card.dai_link[0].stream_name); ret = snd_soc_register_card(&mop500_card); if (ret) dev_err(&pdev->dev, "Error: snd_soc_register_card failed (%d)!\n", ret); return ret; } static int mop500_remove(struct platform_device *pdev) { struct snd_soc_card *mop500_card = platform_get_drvdata(pdev); pr_debug("%s: Enter.\n", __func__); snd_soc_unregister_card(mop500_card); mop500_ab8500_remove(mop500_card); mop500_of_node_put(); return 0; } static const struct of_device_id snd_soc_mop500_match[] = { { .compatible = "stericsson,snd-soc-mop500", }, {}, }; MODULE_DEVICE_TABLE(of, snd_soc_mop500_match); static struct platform_driver snd_soc_mop500_driver = { .driver = { .name = "snd-soc-mop500", .of_match_table = snd_soc_mop500_match, }, .probe = mop500_probe, .remove = mop500_remove, }; module_platform_driver(snd_soc_mop500_driver); hange='this.form.submit();'>mode:
authorThomas Gleixner <tglx@linutronix.de>2017-01-31 23:58:38 +0100
committerIngo Molnar <mingo@kernel.org>2017-02-01 08:37:27 +0100
commitdd86e373e09fb16b83e8adf5c48c421a4ca76468 (patch)
tree55703c2ea8584e303e342090614e0aab3509ab21 /fs/xfs/libxfs/xfs_bmap.c
parent0b3589be9b98994ce3d5aeca52445d1f5627c4ba (diff)
perf/x86/intel/rapl: Make package handling more robust
The package management code in RAPL relies on package mapping being available before a CPU is started. This changed with: 9d85eb9119f4 ("x86/smpboot: Make logical package management more robust") because the ACPI/BIOS information turned out to be unreliable, but that left RAPL in broken state. This was not noticed because on a regular boot all CPUs are online before RAPL is initialized. A possible fix would be to reintroduce the mess which allocates a package data structure in CPU prepare and when it turns out to already exist in starting throw it away later in the CPU online callback. But that's a horrible hack and not required at all because RAPL becomes functional for perf only in the CPU online callback. That's correct because user space is not yet informed about the CPU being onlined, so nothing caan rely on RAPL being available on that particular CPU. Move the allocation to the CPU online callback and simplify the hotplug handling. At this point the package mapping is established and correct. This also adds a missing check for available package data in the event_init() function. Reported-by: Yasuaki Ishimatsu <yasu.isimatu@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sebastian Siewior <bigeasy@linutronix.de> Cc: Stephane Eranian <eranian@google.com> Cc: Vince Weaver <vincent.weaver@maine.edu> Fixes: 9d85eb9119f4 ("x86/smpboot: Make logical package management more robust") Link: http://lkml.kernel.org/r/20170131230141.212593966@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')