Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530AbbHLUR2 (ORCPT ); Wed, 12 Aug 2015 16:17:28 -0400 Received: from mail-bl2on0117.outbound.protection.outlook.com ([65.55.169.117]:10602 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752000AbbHLUPJ (ORCPT ); Wed, 12 Aug 2015 16:15:09 -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 10/11] soc/qman: Add HOTPLUG_CPU support to the QMan driver Date: Wed, 12 Aug 2015 16:14:56 -0400 Message-ID: <1439410497-19039-11-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;BL2FFO11FD048;1:tJyFbRzuYhpJ1WVdTu74wPKoC/SbR0Vvqp4N8p/WHxkatGd6BEturiJaR7YmAoWIoXWTfXTA14FmB2vEt3mWgseIg0ujGNEsCQtHuguL20FUyCXPM3+CodJ3JRnfsEjhWvA5yjaS6U4RV2kquyNYHNb8g95dXUzrust36Mg9vwF5MpL5p1nDgsfHVTrh22kJTscnANBnmkNQuKqBtObLLlv7VVVU1O9PohkvUl3i8IEXIubjvbRdWPuXWDyI6nTwaMYmQLFYyjW+nM5+LYIPSSTuQsM++EjmI8M2mObtcUj81b61qI3Rdj5hvmzXiSz1xCtIg9iUNWWymvuRuYx2r/yjw2NjopVFTF+SP0E9AU81p5o6z0A9ZhoPlqt9lHnjkDQjrKA30fwy4EwOrIhzNQ== 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)(86362001)(76176999)(229853001)(87936001)(5003940100001)(50466002)(53806999)(4001450100002)(48376002)(50986999)(68736005)(189998001)(77096005)(19580395003)(19580405001)(6806004)(5001960100002)(104016003)(36756003)(97736004)(2950100001)(5001830100001)(81156007)(46102003)(5001860100001)(4001540100001)(5001770100001)(47776003)(77156002)(85426001)(105606002)(64706001)(106466001)(43066003)(69596002)(50226001)(62966003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR03MB1485;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;CY1PR03MB1485;2:8y/lpoUZl+txQdjVW6pCmiYU6M8gBI6Y+DE1oGtM1RXF9R+Pry/3+m7LpK/2yQqheLvAJwVs/IpObi0PlmD/NCvYjiJMVYFcIomDyPoTC9V40f3hj2eA3/dnu/M0V+uZO6PeChU7OKDDrVE6NeqmtU3OFYkq/ahXq7MJDpz7EJY=;3:r+AeCn9tctbjYxY8uNlCxbLI/jQ47k7tnYOGGriBG4GSdpqGLZmc+wqiEkirSWVJ5mEDjVy0ILx4cIlwvhG7X+H2pbqadSGuuU3Lf7JZCc8quvGYCiETk5vY3TCDQfWtfgCWbYT5TcyjUvk5CxGg95SuhRDdzr1bN2iSyPi3TaBpMAaw8M3eagQpGoa2fYcxDAYyTARSewZM1LAru+erPFTEZqh/hgzTd5xj1kC0ePY=;25:LyIKpLx5syIxyr15O/aBSLwX/IFf7a+8AL3w88wJIvvwDSAMPbzaCHsU8RBMzdnyMy/OT0u5jWt4Qdd1dKVG7WRS4xIrxA3dUWYfPNtdy3Gf+zcxfOvy+aH79cZv7svk6mqTJtRCAmr44ImWVy+J2rPtIzcPTu20yy0kxNNytRq8W865ox0yq+kz5thgrA8BoVa70ry1PukGCiLK1g0Ocjx4gsExyldiMLekyNgs3CosU8Xuq00UwpCPqhRq4nY93tjUW5uegh/12nIZSblROA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1485; X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB1485;20:kExLL4sMyIbAzwh03lnS5V3ppVeCFLmECpUcuA7qyVY14Kzr+FfZkAe58iEHLs+QfNDhLvmhRj6fqWfHGFVMb+RAdYb+0g5P7CMPpEIVP7S/aj+0ICqktFX+RlxjEZT2ApD1fUoe1wu4mhWr2vJ7SZ3WflsfQVTjQURWzqv+lRWixkLU7HOjdPf4GgekdC2nIE5vP6GgVRP5nv3h4NFjTRdAMzzBbmW5o12OaFXdo01nHRVNU2JJVg8sJoQnNtyRnuNKqwqpA5QAM9a52gsWm61lzAU6+a3Wp16H3GS+5IGALg2uI6HkKu1/Nc8omus6aT+wbUK7iw9TbMDjLl3xtQTkOJtbH4fT0k85swz0Ylw=;4:f9cgooycUYjbbhkQ7sAJfBZNP8rt6pKl17rBR8dTD51QRPjO0qokkzs62H1O2e7bpLf3JSBfsxoJ5dlVEulHkLDNM3eB1830rUd/ZfCsnghDWi1wiJ+vciXFnEULred7XBvfVv4P5XdBeM5cmg2FpXXbm7L99/jEffOhYvhG7QZK6Sn6CH4FrXqxAVGQbT6aSZ60kUC3suZQjZkIcBrtWY3iR0IwclZ+Sbw+Ih35KSE6Th0kvAvg+WjXWIZKksxLNuokmfdSrAr1oiH8F0/cP8xCOsxdW+5bU21SYLYFn3M= 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:CY1PR03MB1485;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1485; X-Forefront-PRVS: 0666E15D35 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR03MB1485;23:djfLYl95xPnCxIPbj7PUfEbpp8AsKqA7kr72de5Wn?= =?us-ascii?Q?qK9DBgz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aMgW6eCR?= =?us-ascii?Q?IURAlfFpnpG9T7ChYQ2W5WvTSFFkKfvCe8ZQ17SEkmxC2KikDa712T3uCHOA?= =?us-ascii?Q?U1XBv5okJYt/WTEMBjnK0YTVNsHgjD147KtmxcvRirBlz71Nnp4QHCADdQlu?= =?us-ascii?Q?u6oAd3sMUYvbi+ZdjTkb7i01yWfSG3kqUcUaUN0NcdLzaHykUFaIQFafwIV5?= =?us-ascii?Q?kFGcaXP8Qrr6mQ0bP2vBBX96/Od0ahXVIeQtR8JzctaqdLQUxisvg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB1485;5:6TMXe+gRujin+E6BbPssBoQrBt6znpRX06tMd3E8tD+DekM5yVBvm2aZEh6pqnDBYhKATQD7oNGiqHRD4Q++JQ2s5yySQwkCiXekgXOomHBd0u+AQG6my00sfLCQBJgGBlrg07MKljAbH7rubz5WVQ==;24:vVDU4LkA2tWlmT6mqiHUOc5LO4OBjcwrEjeSfPCH5mdkWOY/K3v3e2J6hvWAmg/nRRDfz9WSg3G9YiKwG1ah02lodCg8jV8r6ZQdCg2z2zw=;20:0EmGtkXUnfTPck15PCNANxXFw2mQdl93OcncFn/LgzqQtqqb2MogwU97POdv2XtLZFe42qYFBaKhLkobYTcNCA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2015 20:15:06.4009 (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: CY1PR03MB1485 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2194 Lines: 81 From: Hai-Ying Wang Add support for CPU hotplug for the DPAA 1.0 Queue Manager driver. Signed-off-by: Hai-Ying Wang Signed-off-by: Emil Medve Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/qman_portal.c | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c index ad9e3ba..85acba2 100644 --- a/drivers/soc/fsl/qbman/qman_portal.c +++ b/drivers/soc/fsl/qbman/qman_portal.c @@ -474,6 +474,46 @@ static void qman_offline_cpu(unsigned int cpu) } } +#ifdef CONFIG_HOTPLUG_CPU +static void qman_online_cpu(unsigned int cpu) +{ + struct qman_portal *p; + const struct qm_portal_config *pcfg; + + p = (struct qman_portal *)affine_portals[cpu]; + if (p) { + pcfg = qman_get_qm_portal_config(p); + if (pcfg) { + irq_set_affinity(pcfg->public_cfg.irq, cpumask_of(cpu)); + qman_portal_update_sdest(pcfg, cpu); + } + } +} + +static int qman_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: + qman_online_cpu(cpu); + break; + case CPU_DOWN_PREPARE: + case CPU_DOWN_PREPARE_FROZEN: + qman_offline_cpu(cpu); + default: + break; + } + return NOTIFY_OK; +} + +static struct notifier_block qman_hotplug_cpu_notifier = { + .notifier_call = qman_hotplug_cpu_callback, +}; +#endif /* CONFIG_HOTPLUG_CPU */ + __init int qman_init(void) { struct cpumask slave_cpus; @@ -597,6 +637,9 @@ __init int qman_init(void) cpumask_andnot(&offline_cpus, cpu_possible_mask, cpu_online_mask); for_each_cpu(cpu, &offline_cpus) qman_offline_cpu(cpu); +#ifdef CONFIG_HOTPLUG_CPU + register_hotcpu_notifier(&qman_hotplug_cpu_notifier); +#endif return 0; } -- 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/