Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754032AbbGIUhT (ORCPT ); Thu, 9 Jul 2015 16:37:19 -0400 Received: from mail-bl2on0107.outbound.protection.outlook.com ([65.55.169.107]:53998 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753977AbbGIUhD (ORCPT ); Thu, 9 Jul 2015 16:37:03 -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 10/11] soc/qman: Add HOTPLUG_CPU support to the QMan driver Date: Thu, 9 Jul 2015 16:22:01 -0400 Message-ID: <1436473322-21247-11-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;BY2FFO11FD023;1:1Wg56m4KRhyuehJ6ZuDaofNJrnOdOGCDxXcpmrJoEjsS0yETXWsszVwOQ7rZmEATXJZreA6nqEI2zCZ68XQNyICdVEJFFr9Dvn2uoo72NUnIIYgqEYjn3xDM8qoLwV7yRcY6HgIcElBo7gQVWUpqP4wV9OXWcY8BGIqD2k2gLbF/nFUOuBaUK0l8CVNWmb0TfZxnjme8r1VK04Mzve46Fll/GyKBhx62I66KZeYwErb6QNQMlHJ8Q26zQMTx5J9QM2VuaaQ1x0I4Zx4BTyqvzgnW+aUSwVWq8xspAAYgTnhC1cLAWzypj/74X3vikMaw+23VJTEbjdZNFdkxg2noYLN9hG240A8AmEuA/UUcL5uNCujXohJ0ERcmkSBKfSHBXPVJkmI2hUUXhmRcIiSy51Jlw/Q5syQ/7nMDYRCflGFCRSQS3Ej6OHzjJgRqjAce X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(979002)(6009001)(2980300002)(339900001)(199003)(189002)(104016003)(50986999)(19580405001)(106466001)(105606002)(229853001)(19580395003)(85426001)(87936001)(86362001)(76176999)(575784001)(48376002)(50466002)(47776003)(92566002)(62966003)(77156002)(36756003)(2950100001)(5003940100001)(77096005)(46102003)(189998001)(5001920100001)(6806004)(5001960100002)(50226001)(5001770100001)(4001450100001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1482;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:ovrnspm;A:1;MX:1;PTR:InfoDomainNonexistent;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1482;2:PCq8QX4fMS6weh478lVa3OZkUOkfHOB987rAMptE4xuTWcSg+BuTUWtfbl4pDH29;3:dokbDGa0URbjM5m+oXb9F4nECTJ9gmdWZBZPvE0lWT6SBI/b5GTvJTAc8JR4mf61786LWPGCWUoN1WGHfhjspmtI8QcU6toNS18CcwvUjNltQOmR0HHfszHBRBgp41gibFhOA5Tu7lcyxwMbhUmJ2MM/IvkO5Lh+iRO37WJftU8rmsLESNst3dizi5Eo2QRxP++bHjHjIn2dduFE3lyotvkZiAQiaAucecc3YjJieHU=;25:qs74zyRt4jy+wv37vFWyyMA6CSqIjR+McrYg5fteuWILjmxtNSeIuXOGy/ScGi0RIuyy8H0sCPK6ekGMn8WCKMzc8lqQu3LhQTYkVWKOqKiuNZGRpv8ysHnIE2GPp/0uQaEUBgEXyqLJ3qV64bo2alPd5GykPjlgSQlGQwyjfZKDlL+KdNlUPk3IBI94wEXdE7oW2hdgcCpmveJT6cYC+gy95tILRHPzbumeZe3J30QgYxTfFjzJw9XNzcOcP48zNsdjWH8AWD0iDFOymtRHEg==;20:eqM/tuKEZqQ8J4SzHGQDLrt7nk+VZh3ag8YhTNJuWKByCYjowk5Lm+xfbtnRpNYsI6OxyY/AKCBrcQejmPEla2IfGwUhRKy5kW5FO3OeE06QeqWjhQWRxudNPaobBC9CV1jjsF4KLuD6aLWFzjbHq10fOKDt+BM07Y13+lFMYckXEY/HQJiBO/6patBVLaPYk+Z4zUYUw5HYTkxkBTZyuBHuHfcSqLk43fRsEvM5AD/Gpr5z7IIerNal9E6poSwgnpQdMTEdO/bZZl2KopXFk3VuJx3/6A9eqJZxHc+Kb4/XkZIa8lQevC5tOpTuSuLPLP5EcYN1HRBzrzYN6dBWG/Z393B7t5YKmDwBDo4gmeM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1482; BY1PR03MB1482: 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:BY1PR03MB1482;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1482; X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1482;4:nrVIB+/l7xPd2M1wut7tJ7V+y239uqwGprFDTxOni9fRWJDi+E/InihF04Tr5demcrSQZQidXp0GOFrwknlqMqV53kciEB8zRLFt/ezB0qjdMLVLPNoegN2bVkEqS6kx6fFyZFoxg26k9ZIc6y6+b6HCvFDrp7zCNEs7R4vyc9NOzXU5qNG58ck4LBkB4tcgPVkYCh7tsHjy4MT/3d0UkxJ7QJNDPEYCYADtZTUueVnaIdHTv1tfjc/R7hqu+GM0dikkwatS8VrVJkoYHlfEaXHdlnsji5Nbl2VM2+y/kPo= X-Forefront-PRVS: 0632519F33 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY1PR03MB1482;23:rsbk002XuH/Afjh53RWetu+y1Io2jyFlGxszzq18r?= =?us-ascii?Q?W5baksMOBqc+PMvaHL2WL4U3Wpgoi+4kUz9XR5IDKkBlhzMY63tHSCR9hkUx?= =?us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ZCcbvEKEQciL7cxi8QoFpw0VzEdi6uo?= =?us-ascii?Q?0Qp4JWwReNDdGQ49bgLN7CvWC3XUNlJ6Io6/UNQsFoUWZXRWHG4/METbQttj?= =?us-ascii?Q?Di0pkMRxPk14/0W/6Vp7+Kuv1JE?= X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1482;5:ZG0BuKr+VUbTQlmez/xckMtO2SvVXehMe7Bhi2y2eXvUVNPTWEtiEgjvtj2vKkBQSO2RGTdOupEdwZpBa1fGuvgJUgZWFAzOUZIEOXwPcoITP4f1qu7W4wwam6qYXqd3YfIDf9nBJB049sMBaGDb1w==;24:esMipCVFeGSrYXa2UPAoDA1A+bzl0hePurn+XaD8AowToqG6qYemC5HjrqbBelpZyOKAjKEr/0RRFp0DVudJ2R9DnoMDaDR9/UaQTopyIUs=;20:68/Y8OZgFmVtZD7Tg1KM3TnEZ3RKY+cSe45paymvJLRZFn19UIRpQ9tpnzcuXEao1XhN5SzX6Da9/vTC+Aimlg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 20:22:08.8447 (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: BY1PR03MB1482 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 9f53f0e..ad740e5 100644 --- a/drivers/soc/fsl/qbman/qman_portal.c +++ b/drivers/soc/fsl/qbman/qman_portal.c @@ -475,6 +475,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; @@ -598,6 +638,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/