From patchwork Tue Jul 23 03:31:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 18532 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AB29E27781 for ; Tue, 23 Jul 2013 03:31:53 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf1313888yhz.3 for ; Mon, 22 Jul 2013 20:31:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-transfer-encoding; bh=xbjKtRXMeLQ9xyS4arjf83usP7OjuVdUvBKnwj0nKhE=; b=XLMJ7rV26gPc8kGS20K9oiN4ZNz5oREFA6svrHZMAiXup3XuPNQAj7jaGFg5WHYWf6 ROt5rezkfnd43HqirraJ4CjG9FGTMbAOy65oTqJEOHS+AdUxorTluQeBoxVkhUIIOFFK wXtuFG4JXS6VcIS/ttykGB3YsS/6FBoMnuJWs/BhVhARdxEGDo2Kbgu1/apF+hnV08jm tnYd0JpzFD0Dp5n1RNInOy4tUh/XWz//6tHJ9MYe7h9+OxQfTNfHQLOAOY56DtgYSO8C 5k5grEKUCw+50AUrqI4dxpwLAVQGpG4sAG/ywMtY1tERglgyDJSeQtHcHe8oxWrOS+UG qiMw== X-Received: by 10.236.32.229 with SMTP id o65mr17790290yha.19.1374550313189; Mon, 22 Jul 2013 20:31:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.14.71 with SMTP id n7ls3061191qec.2.gmail; Mon, 22 Jul 2013 20:31:53 -0700 (PDT) X-Received: by 10.58.80.38 with SMTP id o6mr10399104vex.69.1374550312959; Mon, 22 Jul 2013 20:31:52 -0700 (PDT) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id bk8si7816151vec.132.2013.07.22.20.31.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 20:31:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.52; Received: by mail-vb0-f52.google.com with SMTP id f12so5086890vbg.25 for ; Mon, 22 Jul 2013 20:31:52 -0700 (PDT) X-Received: by 10.220.67.10 with SMTP id p10mr10081742vci.85.1374550312875; Mon, 22 Jul 2013 20:31:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp84152veb; Mon, 22 Jul 2013 20:31:52 -0700 (PDT) X-Received: by 10.224.20.72 with SMTP id e8mr36924424qab.104.1374550306690; Mon, 22 Jul 2013 20:31:46 -0700 (PDT) Received: from relais.videotron.ca (relais.videotron.ca. [24.201.245.36]) by mx.google.com with ESMTP id i7si5237393qcu.54.2013.07.22.20.31.46 for ; Mon, 22 Jul 2013 20:31:46 -0700 (PDT) Received-SPF: neutral (google.com: 24.201.245.36 is neither permitted nor denied by best guess record for domain of nicolas.pitre@linaro.org) client-ip=24.201.245.36; Received: from yoda.home ([70.83.209.44]) by VL-VM-MR004.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0MQD007GKDSVI140@VL-VM-MR004.ip.videotron.ca>; Mon, 22 Jul 2013 23:31:44 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 2A04C2DA0540; Mon, 22 Jul 2013 23:31:44 -0400 (EDT) From: Nicolas Pitre To: linux-arm-kernel@lists.infradead.org Cc: dave.martin@linaro.org, lorenzo.pieralisi@arm.com, patches@linaro.org Subject: [PATCH 11/13] ARM: bL_switcher: veto CPU hotplug requests when the switcher is active Date: Mon, 22 Jul 2013 23:31:27 -0400 Message-id: <1374550289-25305-12-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-reply-to: <1374550289-25305-1-git-send-email-nicolas.pitre@linaro.org> References: <1374550289-25305-1-git-send-email-nicolas.pitre@linaro.org> X-Gm-Message-State: ALoCoQlzCByr+V4gVoU6hrMWNarpKqJw+B6ZXxmy1tOwpso5bBYz2ZChfaFODnkGVu5kpykM2qrp X-Original-Sender: nicolas.pitre@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-transfer-encoding: 7BIT Trying to support both the switcher and CPU hotplug at the same time is quickly becoming very complex due to ambiguous semantics. So let's simply veto any hotplug requests when the switcher is active for now. This restriction might be loosened eventually. Signed-off-by: Nicolas Pitre --- arch/arm/common/bL_switcher.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c index 704c4b4ef3..2fe3911601 100644 --- a/arch/arm/common/bL_switcher.c +++ b/arch/arm/common/bL_switcher.c @@ -528,6 +528,25 @@ static int __init bL_switcher_sysfs_init(void) #endif /* CONFIG_SYSFS */ +/* + * Veto any CPU hotplug operation while the switcher is active. + * We're just not ready to deal with that given the trickery involved. + */ +static int bL_switcher_hotplug_callback(struct notifier_block *nfb, + unsigned long action, void *hcpu) +{ + switch (action) { + case CPU_UP_PREPARE: + case CPU_DOWN_PREPARE: + if (bL_switcher_active) + return NOTIFY_BAD; + } + return NOTIFY_DONE; +} + +static struct notifier_block bL_switcher_hotplug_notifier = + { &bL_switcher_hotplug_callback, NULL, 0 }; + static bool no_bL_switcher; core_param(no_bL_switcher, no_bL_switcher, bool, 0644); @@ -540,6 +559,8 @@ static int __init bL_switcher_init(void) return -EINVAL; } + register_cpu_notifier(&bL_switcher_hotplug_notifier); + if (!no_bL_switcher) { ret = bL_switcher_enable(); if (ret)