From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1314C43219 for ; Sat, 27 Apr 2019 05:13:16 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76B87208C2 for ; Sat, 27 Apr 2019 05:13:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76B87208C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44rfFk54YMzDqT4 for ; Sat, 27 Apr 2019 15:13:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=julietk@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44rP516H0RzDqXC for ; Sat, 27 Apr 2019 05:19:49 +1000 (AEST) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3QJFVMY130627 for ; Fri, 26 Apr 2019 15:19:45 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0b-001b2d01.pphosted.com with ESMTP id 2s45588bj9-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Apr 2019 15:19:45 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 26 Apr 2019 20:19:44 +0100 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 26 Apr 2019 20:19:42 +0100 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3QJJfk38913254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Apr 2019 19:19:41 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DA7956A05A; Fri, 26 Apr 2019 19:19:40 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C26256A057; Fri, 26 Apr 2019 19:19:40 +0000 (GMT) Received: from ltcalpine2-lp21.aus.stglabs.ibm.com (unknown [9.40.195.230]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 26 Apr 2019 19:19:40 +0000 (GMT) Received: by ltcalpine2-lp21.aus.stglabs.ibm.com (Postfix, from userid 0) id D2C8A16111B; Fri, 26 Apr 2019 15:19:39 -0400 (EDT) Date: Fri, 26 Apr 2019 15:19:39 -0400 From: Juliet Kim To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH]powerpc/mobility: Serialize PRRN and LPM in device tree update User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19042619-0016-0000-0000-000009A77640 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011000; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01194774; UDB=6.00626437; IPR=6.00975609; MB=3.00026612; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-26 19:19:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19042619-0017-0000-0000-000042F8A2C1 Message-Id: <5cc359cb.vtkUQVWEs1xLqLLf%julietk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-26_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904260130 X-Mailman-Approved-At: Sat, 27 Apr 2019 15:04:36 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nathanl@linux.ibm.com, mmc@linux.ibm.com, mwb@linux.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Fix extending start/stop topology update scope during LPM Commit 65b9fdadfc4d ("powerpc/pseries/mobility: Extend start/stop topology update scope") made the change to the duration that topology updates are suppressed during LPM to allow the complete device tree update which leaves the property update notifier unregistered until device tree update completes. This prevents topology update during LPM. Instead, use mutex_lock, which serializes LPM and PRRN operation in pseries_devicetree_update. Signed-off-by: Juliet Kim arch/powerpc/platforms/pseries/mobility.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index 88925f8ca8a0..3a79ded056fd 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -42,6 +42,8 @@ struct update_props_workarea { #define MIGRATION_SCOPE (1) #define PRRN_SCOPE -2 +static DEFINE_MUTEX(dt_affinity_mutex); + static int mobility_rtas_call(int token, char *buf, s32 scope) { int rc; @@ -270,13 +272,19 @@ int pseries_devicetree_update(s32 scope) int update_nodes_token; int rc; + mutex_lock(&dt_affinity_mutex); + update_nodes_token = rtas_token("ibm,update-nodes"); - if (update_nodes_token == RTAS_UNKNOWN_SERVICE) + if (update_nodes_token == RTAS_UNKNOWN_SERVICE) { + mutex_unlock(&dt_affinity_mutex); return -EINVAL; + } rtas_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL); - if (!rtas_buf) + if (!rtas_buf) { + mutex_unlock(&dt_affinity_mutex); return -ENOMEM; + } do { rc = mobility_rtas_call(update_nodes_token, rtas_buf, scope); @@ -316,6 +324,7 @@ int pseries_devicetree_update(s32 scope) } while (rc == 1); kfree(rtas_buf); + mutex_unlock(&dt_affinity_mutex); return rc; } @@ -371,10 +380,10 @@ static ssize_t migration_store(struct class *class, if (rc) return rc; - post_mobility_fixup(); - start_topology_update(); + post_mobility_fixup(); + return count; } -- 2.12.3