Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752640AbbHLUSu (ORCPT ); Wed, 12 Aug 2015 16:18:50 -0400 Received: from mail-bl2on0115.outbound.protection.outlook.com ([65.55.169.115]:39448 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751955AbbHLUPI (ORCPT ); Wed, 12 Aug 2015 16:15:08 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Roy Pledge To: , CC: , Subject: [v2 09/11] soc/bman: Add HOTPLUG_CPU support to the BMan driver Date: Wed, 12 Aug 2015 16:14:55 -0400 Message-ID: <1439410497-19039-10-git-send-email-Roy.Pledge@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1439410497-19039-1-git-send-email-Roy.Pledge@freescale.com> References: <1439410497-19039-1-git-send-email-Roy.Pledge@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD014;1:UK8pyFfDoEkPhgucNuB6ei0D5MLE7aL21zAgSsMn2XREU/LXkPb/UwMDPD2brRIPVlbSikqnA04bSiTjjjSOpbxvZXERLL0CV4dNzkQa2eQs65hJBRpcitg3rtFzkVva1IjaSnTn9ikyE/YsWaAPIK0QzRm9LlepP+e/68JOHtfPSySLm4yB1WhesOqB6wfYJaLv2y3hT7wMHSRCf8gzdbDBzY3arUV8Ypzqgm78Y9uAmvRQlbMhBASORi2VussjfnrKv2ksxmKKHIwQLNIgLp1L/tWEmlaWWdNWZIq/vHwaRazBxF6RieQCxsxS0nobKfNwXEsXY3FwwGdq9SSiDhMNFwMXn0gFH4QNN8h/4/WMT2GUCWt3TcMhfqFG5/SYOha6Nqbh7QA7w/6+QhkH9g== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(3050300001)(339900001)(199003)(189002)(2950100001)(4001450100002)(50466002)(48376002)(105606002)(19580405001)(77156002)(62966003)(6806004)(19580395003)(106466001)(86362001)(229853001)(43066003)(47776003)(50226001)(64706001)(85426001)(77096005)(68736005)(76176999)(104016003)(46102003)(87936001)(53806999)(50986999)(81156007)(5001860100001)(69596002)(189998001)(97736004)(5001830100001)(5003940100001)(5001960100002)(5001770100001)(36756003)(4001540100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB1476;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB1476;2:LEw/AMsJ4qrx4OLENXNSAWVQQs+0oiHMMoTr0EoW244zACsbYNXNqbl6vyBGlbvANQWhYrTSG2q9bdTv2e0CRxQ/tB4PryE1QJHuLb+c9vEwt8Rc6cFkU29iQlRCaGgPeYoZH3is2RS2pyW17AhkQZS9X+8IRx7HS+56Fg8Bt5M=;3:a+GfIXZNkVAVpVEAv2jezN2ofPcqU2tut3V0XeI0NqC4NKZ1sMrw+rvHbw2TYBbeabvNQlI3Z8vIycgLc/+4TqmKhwkePaPBc5bi4XgZcVgrBDHOgMYq7KOHzTOVx15Y13IZyN/kaYTsSaVpn/TiPOJtu9O8u5ilHc2QkzlVJDRH+wLG2El+Wgqa8NelHXCV7FDfDdTqaxs04WzLZkOt14VGmpOSitHuOnDaYqNmw2g=;25:MzrYdNFCjHfqhICwu2ZJjBt0BXPk6IJFzam6uY4S8phQmKPnxqkU5rzoTMkC1N7+YVDoNQ5drEuU+Rx0CCNenv5XVBoPA78oRcJg+k9cqPQtk6ZhhBH0RqIxIzoddrxj/SXE1js9WIGOJRxM+bvcJkRA6vz83w9SL0ShRQOzpfCnPfJpsZrl4vlC4UDeIDQ9DhYtvQcDe+Z9pRYriU1YBvtF0+LZSkxZYw3YUSB3enbPj+svPY6LJTXD2HW6ce4GYjQggzBwj41Bv/1Zooujzw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1476; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB1476;20:Oa/Dr4Y93hXpqwm5qXMka3vzrlHuCPb26QeuKtSHv7SpqeIa9JIPWG7+YGTjGb63Oay08B04wjPZYzJzDJ+pGFI1r9mYf2R9iItEhorCybgAFWwpdsLNoSL8FtP3wALMf4xAj0MxLgpzfjL8wAnNiXR3eBEeq/5WaZdS+Ep7gxoI+lD9y2aMYyiG6rODBnHBjZDTDrOPGPnF50if2ZITgB5XW8oSJb3h4xZbiSF4l1/09VdXD5hI1Foz08gpyXZTVNxEl3j/aCgbHILVdV5T4hljEJi+oXkXMLmXV4caCiUG5ScEId1LDxMIK569vwbceKQxg2G8BFnNoz6rWm0fVMv0gy2maLQqwZEMlHB6pSQ=;4:Pr5B8U3ARvrbZLGfW5TmUYr14apppCxrupqc8/YD4aub+AdNS7CEtOsUualwuWG7tmtMwn0B2J/OMeeEC5uQG+xg7nZ+o3lntdtLjyvPwwvUzF5q1refVxC5ysVbSr1b2qMytGbYP+0bOdtVEC7jvdAKg7zYE2cXwDNi27FnWgnDurJ8714stJf5eXBuyAxAk6pcvPz32jxl1jLFnDwRZWo399cCBGxR+UA1Ksul+q2Pa3+CMJ0mW4BcIQuGObtTcM+CCCUI9nRqvk9RGcFXm8PM0G1cOj4hSwHHE3pTdjA= 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:BLUPR03MB1476;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1476; X-Forefront-PRVS: 0666E15D35 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR03MB1476;23:J05tFfvGmdDjz8huCtQWp56sK+yQstGsrzX+J1Y36?= =?us-ascii?Q?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ZufXAvMok?= =?us-ascii?Q?uEhmFM1XVpXHSmuXzaEGEITPaBsP/t++Ct5inU4vHo3IYIOGtLBCX4XfT6f7?= =?us-ascii?Q?9klUOHvXwfIeV+03S2TnHq1Er4yfUYsVmmY36vXiolo5PjMPDpp14zDCkSfe?= =?us-ascii?Q?AVfbst3GxPI3j2gb/GUUgRVKmo34oIs8rMBG2/dUc3OSerS7RQ+5xkodBwEu?= =?us-ascii?Q?RDbiz3bg8ZYZrABYAYaSxCHN4tW/8kKITbOGLSY9cKO+pz2SfUYAg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB1476;5:jDB2jJ9QHjXTreaD6St3hcEGUR41H2m0iIeRDMgf0KBxvRGt8LKBvAUiMzIp55Nrewbyum+F9q3oz4hNQYhKYCRLSloLfZSP95x97qu489TGS+sZqQrBm8qy6KCwtxDji/ydgZwIWeUZBivNVBBk1w==;24:BfToZ+CWToGyXORhZkPaZEHSJaieZHsptYORwe+7vhbFcfW5ltckMcEomrq6XPRJdF7Q/b8G7Qx+EJ+00384egIdPmYrpOSIBz22+OdVo1Q=;20:1bPeutL7n6rlPBmKBGuS1egO51i3hYjl8/IRSZeWy1bOpna6zXxObfeOf/Nh10kLGARrarw057tTvupl+9lSKw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2015 20:15:05.7938 (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.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1476 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 0dd341c..d1da092 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/