Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754051AbbGIUWe (ORCPT ); Thu, 9 Jul 2015 16:22:34 -0400 Received: from mail-bn1bon0142.outbound.protection.outlook.com ([157.56.111.142]:39327 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753931AbbGIUWM (ORCPT ); Thu, 9 Jul 2015 16:22:12 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Roy Pledge To: , CC: , Subject: [PATCH 09/11] soc/bman: Add HOTPLUG_CPU support to the BMan driver Date: Thu, 9 Jul 2015 16:22:00 -0400 Message-ID: <1436473322-21247-10-git-send-email-Roy.Pledge@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1436473322-21247-1-git-send-email-Roy.Pledge@freescale.com> References: <1436473322-21247-1-git-send-email-Roy.Pledge@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC013;1:sVmHMZVWnUYe4D8b1g2A0Vx4dXeiVU9EnFpAAQJt47D8Qn64m/fk35IQ84iSoNkw5DrdYDovjVmWx3AOJQwmKFi9JuMEOg5KC8lxmifMB9wArlhM3433O5GDQdP8ysWUsbfzTuDo6d+dtcT9hK4k2Ii4PJVIVOAJi6F9EcuoUcLN/mQHrHjuOXkB636NObWCFWcr8W8E1yqvOTwVu76YYgjNl2kt3b8U7ILcncEizveOQco6NVHumdIJwhy/sjn9MykK9AbKpVCF6fMV14nobyuvpf+x/PbjSDUM6xZ24Xyy4KCK9SQKXKNaKEk3rCnWm5CXsnyrU4uweqUNGhpI81QudIHZbly6LepP3xGErCgSj90iuXmSm4TvSP+8I7cBVtsHwn6WuSYmPRJIgngXaGws3M3rn8bcxGpNaF8QPj5tCfCGpNSv6U6i5AYlkBVB X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(36756003)(92566002)(50466002)(77096005)(50226001)(46102003)(5003940100001)(2950100001)(19580405001)(189998001)(106466001)(19580395003)(50986999)(62966003)(77156002)(76176999)(48376002)(47776003)(104016003)(229853001)(6806004)(85426001)(5001920100001)(86362001)(5001770100001)(87936001)(5001960100002)(105606002)(4001450100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1481;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1481;2:rPwfRN/SCS+qFyIWeUyW0dUjI53cnEMI/yt3RNirgiKQdqnnb/wwWZ1mYafF1JGU;3:esSL6z3fCMHwBIoOu3lmXGuFA+hnghrQ2cKx5wSEYXagPO8X8Q2H20iqhMaYB1g6j2i22Eq0+qUAaIMWpGXCMxrbRGN6F7eW2T1UExj39OIQ/fPgO/W8TZ2ZyFfzpwNaf9uT0RdDKar0kGthRhL19EbchsBNtLAkE3h4WkRUJxnO/AmYCYmPTkF0yBPMZ3El16SCRUZUo9de4a8CYyOmsqsNqphpJt6nJcL3A9zK+lU=;25:HcZ7wxHcwAlfAo7MzjraOW7Lnbu+yG4OGYVq6AL41v6cfvJaRDg/nisMdTM/uJtHedR1Ixfn1MWkoUC7LIylMOWDcles3CR1wJckvgh1QCZ+6aH1qq1CFl8S/dyNkkp5jXVIZ1YJeuDweQtnawpuTS4KNztjYDXllzcNjoSPzjeh0F2x9nR/xltfmjJiATYz9PHMJMMBdYaBx+jdBz9midDU1vZS9c71IvVN0Fr5qENY0yMlbRLNIFi9KD9XJsfvu9x9p6tDbn7zkV/F3E/LYg==;20:OIHNkadDgYHXD71nayyCwW/GIuot6L1iTYpagRnzg99/vK27xX077QwhSenyVUHpN0Wf/5YdE9gfLsySwpjDbF5Aawv/BSWxBxfWUQjycO1z8dVGtgk35ezMQzo7riGZr5KDZ+jmAV1Pdn4vLDJrI6RtV96pj9a2keyVBZeUV9nqYoHKcpp8AuiHCDwWvs7cfwqi2w30XYNQ3P1hQSLtKb1f3SHSkmUq1wywAUB0e5mmzCt98S8o5nbhDChWRtOHdSYTda+531/uG2zcjChy4NM6hx6jUVBjsAFeCbLySAj16XoNwnd56Qx+DNKqsE3Wx83E7ohDwcimKioXVYg9OgKhRaiiGHKti8ptDbFVPEk= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1481; BY1PR03MB1481: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BY1PR03MB1481;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1481; X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1481;4:9QENLm1s6IYUY8xQ/yzW8Bf/vQg0xT6Uo6XRRqwXEmI+I0jTWMgWwx6KgeGDbnFkiaX+myPXtenbIOUYsoskzfaa67n6rHfX5zHdXDprj1m9HEwl4kd8Kg4QzXkFHVrw+9eDqJunqIYwLhp7BG9vu7oPMpYmNWPN0O3IktS2o7xgEjP6cO3rMfA5fTXA2KYquFwMlS6WB4EWgkCtlwjmSc4qRlRP3NOJaCj+2Jr/c+19p82ctxdYX0TYhO6CXcy+3ADMzvXAreawHJZYnXI4hTjeAxMSU+21qD/ut+riivQ= X-Forefront-PRVS: 0632519F33 X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1481;23:QzavBm2t6V7Q78L5QN+64QQgZ0JsQlWjnCo7g/r7/yCclEdSk+52PFp6QulYpxYlEpUPY6Dj3+3oScQnLjaapnqY6BoWAtv9pokxb7sTAIvdJmPhY8sB0ZZ8hUsu8b8gEaIfo8G21qD+RKFrsBb+aq3lyraXaaPLBuPethhuO3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JOG0VjCeelpx1VkCSAskaQQbEU=;20:+CRwMB337p1TAEcOHYX4AMre5x1WqxW8qiPn4c37n+iUTGhRXBt/mt5on9OITcoTFs2HmPKdehlU1sFugWuCNg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 20:22:08.5871 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1481 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2651 Lines: 93 From: Hai-Ying Wang Add support for CPU hotplug for the DPAA 1.0 Buffer Manager driver Signed-off-by: Hai-Ying Wang Signed-off-by: Emil Medve Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/bman_portal.c | 40 +++++++++++++++++++++++++++++++++++ drivers/soc/fsl/qbman/dpaa_sys.h | 3 +++ 2 files changed, 43 insertions(+) diff --git a/drivers/soc/fsl/qbman/bman_portal.c b/drivers/soc/fsl/qbman/bman_portal.c index 62d8f64..f33d671 100644 --- a/drivers/soc/fsl/qbman/bman_portal.c +++ b/drivers/soc/fsl/qbman/bman_portal.c @@ -129,6 +129,42 @@ static void __cold bman_offline_cpu(unsigned int cpu) } } +#ifdef CONFIG_HOTPLUG_CPU +static void __cold bman_online_cpu(unsigned int cpu) +{ + struct bman_portal *p = (struct bman_portal *)affine_bportals[cpu]; + const struct bm_portal_config *pcfg; + + if (p) { + pcfg = bman_get_bm_portal_config(p); + if (pcfg) + irq_set_affinity(pcfg->public_cfg.irq, cpumask_of(cpu)); + } +} + +static int __cold bman_hotplug_cpu_callback(struct notifier_block *nfb, + unsigned long action, void *hcpu) +{ + unsigned int cpu = (unsigned long)hcpu; + + switch (action) { + case CPU_ONLINE: + case CPU_ONLINE_FROZEN: + bman_online_cpu(cpu); + break; + case CPU_DOWN_PREPARE: + case CPU_DOWN_PREPARE_FROZEN: + bman_offline_cpu(cpu); + } + + return NOTIFY_OK; +} + +static struct notifier_block bman_hotplug_cpu_notifier = { + .notifier_call = bman_hotplug_cpu_callback, +}; +#endif /* CONFIG_HOTPLUG_CPU */ + static int __cold bman_portal_probe(struct platform_device *of_dev) { struct device *dev = &of_dev->dev; @@ -342,6 +378,10 @@ static int __init bman_portal_driver_register(struct platform_driver *drv) for_each_cpu(cpu, &offline_cpus) bman_offline_cpu(cpu); +#ifdef CONFIG_HOTPLUG_CPU + register_hotcpu_notifier(&bman_hotplug_cpu_notifier); +#endif + bman_seed_bpid_range(0, bman_pool_max); return 0; diff --git a/drivers/soc/fsl/qbman/dpaa_sys.h b/drivers/soc/fsl/qbman/dpaa_sys.h index 3758f96..930a4d3 100644 --- a/drivers/soc/fsl/qbman/dpaa_sys.h +++ b/drivers/soc/fsl/qbman/dpaa_sys.h @@ -43,6 +43,9 @@ #include #include #include +#ifdef CONFIG_HOTPLUG_CPU +#include +#endif #include -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/