mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Emil Medve <Emilian.Medve@Freescale.com>
To: <devel@driverdev.osuosl.org>, <linuxppc-dev@lists.ozlabs.org>,
	<linux-kernel@vger.kernel.org>
Cc: Hai-Ying Wang <Haiying.Wang@Freescale.com>
Subject: [RFC 10/10] fsl_qman: Add HOTPLUG_CPU support
Date: Wed, 4 Feb 2015 08:48:42 -0600	[thread overview]
Message-ID: <1423061322-16059-11-git-send-email-Emilian.Medve@Freescale.com> (raw)
In-Reply-To: <1423061322-16059-1-git-send-email-Emilian.Medve@Freescale.com>

From: Hai-Ying Wang <Haiying.Wang@freescale.com>

Change-Id: Ica4d1b2b0fd3c3ae5e043663febd9f4cb7c762cf
Signed-off-by: Hai-Ying Wang <Haiying.Wang@freescale.com>
---
 drivers/staging/fsl_qbman/qman_driver.c | 45 +++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/drivers/staging/fsl_qbman/qman_driver.c b/drivers/staging/fsl_qbman/qman_driver.c
index 5ca6221..7cd23bc 100644
--- a/drivers/staging/fsl_qbman/qman_driver.c
+++ b/drivers/staging/fsl_qbman/qman_driver.c
@@ -30,6 +30,9 @@
  */
 
 #include "qman_private.h"
+#ifdef CONFIG_HOTPLUG_CPU
+#include <linux/cpu.h>
+#endif
 
 /* Global variable containing revision id (even on non-control plane systems
  * where CCSR isn't available) */
@@ -381,6 +384,45 @@ 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 __cpuinit 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;
@@ -499,5 +541,8 @@ __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;
 }
-- 
2.2.2

  parent reply	other threads:[~2015-02-04 15:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 14:48 [RFC 00/10] Freescale DPAA B/QMan drivers Emil Medve
2015-02-04 14:48 ` [RFC 01/10] fsl_bman: Add drivers for the Freescale DPAA BMan Emil Medve
2015-02-04 14:48 ` [RFC 02/10] fsl_qman: Add drivers for the Freescale DPAA QMan Emil Medve
2015-02-04 14:48 ` [RFC 03/10] powerpc/mpc85xx: Add platform support for the Freescale DPAA BMan Emil Medve
2015-02-04 14:48 ` [RFC 04/10] powerpc/mpc85xx: Add platform support for the Freescale DPAA QMan Emil Medve
2015-02-04 14:48 ` [RFC 05/10] fsl_bman: Add self-tester Emil Medve
2015-02-04 14:48 ` [RFC 06/10] fsl_qman: " Emil Medve
2015-02-04 14:48 ` [RFC 07/10] fsl_bman: Add debugfs support Emil Medve
2015-02-04 14:48 ` [RFC 08/10] fsl_qman: " Emil Medve
2015-02-04 14:48 ` [RFC 09/10] fsl_bman: Add HOTPLUG_CPU support Emil Medve
2015-02-04 14:48 ` Emil Medve [this message]
2015-02-04 18:40 ` [RFC 00/10] Freescale DPAA B/QMan drivers Greg KH
2015-02-04 22:16   ` Emil Medve
2015-02-05  2:29     ` Greg KH
2015-02-05  8:41 ` Dan Carpenter
2015-02-05 14:55   ` Emil Medve
2015-02-05 15:48 ` Bob Cochran
2015-02-05 15:52   ` Emil Medve

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423061322-16059-11-git-send-email-Emilian.Medve@Freescale.com \
    --to=emilian.medve@freescale.com \
    --cc=Haiying.Wang@Freescale.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®