i.MX SoC update for 6.3:
- Call ida_simple_remove() to free up ID allocated by ida_simple_get() for MMDC driver. - Add i.MX6ULZ compatible string to match table. -----BEGIN PGP SIGNATURE----- iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmPXGWgUHHNoYXduZ3Vv QGtlcm5lbC5vcmcACgkQUFdYWoewfM4FwQf/fM5s0A1RanOP1vwznuZw3SiJu2MO F3vjBdifg80I+ZrokOEHFwCDG4KsDw7dSA1B5Uqdt+mQ3sXJDQwQfJMJvtR7496T MiLLQemfNpiP+aSSVPNKF3Lwsqc/mi9JEHJxsvh6Lvq59MoerYRK840LqKHy7km2 ZmxHGigympHQQPD0CEQY+Etpf8xDr9zAfMmieh9R0R7XW82nTFmi+WHBzn/Q67ZH ZtoFPjoCaW5vdWJSp22mFnXnBJwZhQ5wEgcoQUpflNdVX/63NqJRDPnuLFfy68kG WWTcLF9gFHHKVPzSlp7F5YESQ46BBhEimKf68f0R4ND5JoM2miRMMxgG2w== =yvfs -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmPYzhQACgkQmmx57+YA GNlk2g/9GFuINZBaxOixrHZlT2kJWNxr2nheR0TIAI3iTmQQ/42nxk/gyUmOU5Js rcSk4/aJfKKEfjNXjRYzX7EL4UbxQYhLYUFAgnGpcbVuvjxcU1s7I+ZvCeCrTcHY 5rzFa1bqJl3TpNSyj8MKggaW62Ivsst5NfOelwdq4kQDUqKBjwWZlQmarDOxTK7S aPHoyBJnaR7vAspIbNyjoYEzG0XjQb1566oHaQjykkaRzh2HsELR8sJb6A0yZqfB xKZap5PycAI9VuGiKY79mSKbMp0zunamfWmVf7qVy8nfhNdbAv8XTeQLtTOnq1KI vQTeFDxTF8PXhaZWY4e3JzU1oC6b9uHp8Xch2Jg37GMm70yOGilH6V28U8mVEZzn 6Mz6OLuIZFHS7ewlTP5r6drMluIQA/Mq1jiMs0A/Mt68K4EBN4nIImEycfNFRmIA ARn1ty2mnDlQLSfB44QE5TjNb6+Gou+awRVVY/VtwhPJB65i7TYVdEBLBEhiJ6Lg ptgKWDIgDcK1OnYbzACD4r4ZDUovCpudp8cEn7BHGmjflsPIQ8rkXE8zE8XWDNFW MpEnWODwWHmTttdAJ3gK0zv+tU2+JOH3FApISaq/OXhLnCrQEOBAGQuB1TCyvncC 3s4ZPjsMX9sYTX5sa1X5U7qeS3dVUBhHGB+tdKsJGzSbUhDIChE= =b4Oy -----END PGP SIGNATURE----- Merge tag 'imx-soc-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/soc i.MX SoC update for 6.3: - Call ida_simple_remove() to free up ID allocated by ida_simple_get() for MMDC driver. - Add i.MX6ULZ compatible string to match table. * tag 'imx-soc-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx: mach-imx6ul: add imx6ulz support ARM: imx: Call ida_simple_remove() for ida_simple_get Link: https://lore.kernel.org/r/20230130023947.11780-2-shawnguo@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
ae3147bb30
@ -63,6 +63,7 @@ static void __init imx6ul_init_late(void)
|
||||
static const char * const imx6ul_dt_compat[] __initconst = {
|
||||
"fsl,imx6ul",
|
||||
"fsl,imx6ull",
|
||||
"fsl,imx6ulz",
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
@ -99,6 +99,7 @@ struct mmdc_pmu {
|
||||
cpumask_t cpu;
|
||||
struct hrtimer hrtimer;
|
||||
unsigned int active_events;
|
||||
int id;
|
||||
struct device *dev;
|
||||
struct perf_event *mmdc_events[MMDC_NUM_COUNTERS];
|
||||
struct hlist_node node;
|
||||
@ -433,8 +434,6 @@ static enum hrtimer_restart mmdc_pmu_timer_handler(struct hrtimer *hrtimer)
|
||||
static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc,
|
||||
void __iomem *mmdc_base, struct device *dev)
|
||||
{
|
||||
int mmdc_num;
|
||||
|
||||
*pmu_mmdc = (struct mmdc_pmu) {
|
||||
.pmu = (struct pmu) {
|
||||
.task_ctx_nr = perf_invalid_context,
|
||||
@ -452,15 +451,16 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc,
|
||||
.active_events = 0,
|
||||
};
|
||||
|
||||
mmdc_num = ida_simple_get(&mmdc_ida, 0, 0, GFP_KERNEL);
|
||||
pmu_mmdc->id = ida_simple_get(&mmdc_ida, 0, 0, GFP_KERNEL);
|
||||
|
||||
return mmdc_num;
|
||||
return pmu_mmdc->id;
|
||||
}
|
||||
|
||||
static int imx_mmdc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev);
|
||||
|
||||
ida_simple_remove(&mmdc_ida, pmu_mmdc->id);
|
||||
cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
|
||||
perf_pmu_unregister(&pmu_mmdc->pmu);
|
||||
iounmap(pmu_mmdc->mmdc_base);
|
||||
@ -474,7 +474,6 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
|
||||
{
|
||||
struct mmdc_pmu *pmu_mmdc;
|
||||
char *name;
|
||||
int mmdc_num;
|
||||
int ret;
|
||||
const struct of_device_id *of_id =
|
||||
of_match_device(imx_mmdc_dt_ids, &pdev->dev);
|
||||
@ -497,14 +496,14 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
|
||||
cpuhp_mmdc_state = ret;
|
||||
}
|
||||
|
||||
mmdc_num = mmdc_pmu_init(pmu_mmdc, mmdc_base, &pdev->dev);
|
||||
pmu_mmdc->mmdc_ipg_clk = mmdc_ipg_clk;
|
||||
if (mmdc_num == 0)
|
||||
name = "mmdc";
|
||||
else
|
||||
name = devm_kasprintf(&pdev->dev,
|
||||
GFP_KERNEL, "mmdc%d", mmdc_num);
|
||||
ret = mmdc_pmu_init(pmu_mmdc, mmdc_base, &pdev->dev);
|
||||
if (ret < 0)
|
||||
goto pmu_free;
|
||||
|
||||
name = devm_kasprintf(&pdev->dev,
|
||||
GFP_KERNEL, "mmdc%d", ret);
|
||||
|
||||
pmu_mmdc->mmdc_ipg_clk = mmdc_ipg_clk;
|
||||
pmu_mmdc->devtype_data = (struct fsl_mmdc_devtype_data *)of_id->data;
|
||||
|
||||
hrtimer_init(&pmu_mmdc->hrtimer, CLOCK_MONOTONIC,
|
||||
@ -525,6 +524,7 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
|
||||
|
||||
pmu_register_err:
|
||||
pr_warn("MMDC Perf PMU failed (%d), disabled\n", ret);
|
||||
ida_simple_remove(&mmdc_ida, pmu_mmdc->id);
|
||||
cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
|
||||
hrtimer_cancel(&pmu_mmdc->hrtimer);
|
||||
pmu_free:
|
||||
|
Loading…
x
Reference in New Issue
Block a user