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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AF71C433EF for ; Fri, 20 May 2022 20:39:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353514AbiETUjC (ORCPT ); Fri, 20 May 2022 16:39:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241610AbiETUi7 (ORCPT ); Fri, 20 May 2022 16:38:59 -0400 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6935F19FF45; Fri, 20 May 2022 13:38:58 -0700 (PDT) Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24KFjYX9028627; Fri, 20 May 2022 20:38:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pps0720; bh=5EP4WWdQHl2GA9A4nkZcKwln/XTzNpHsE6OOEXMtWg4=; b=cdxLViPCAOfi0bOw7sm7GiypYJ9YO1GmWP9ujXzYTeLUOzaqqfHu7cdHR/ubef1LF+Ph 9uxaAGamAQtwMt795mlZYeDqnuvYvu3AAbhUijPmHv1ZxVyWID2bneg2V1goaOxSBXiP z2awl1oqtv0wLR5cBJXMSaSVDKBZ0QtMbJb921GiRObxQiQ7DDfOrhw7/iwjwxDYEL42 y96D2OG0U6ti/83+08Ff/RYhcd9qs2+5S3qr5zOYh90gniR+M4cgHrWYo6xkCkKLqbfv kWM/Usebx8Nr/nVDKCq0Xf5cmRFfhUuBqOEG5tj5Zcz7pmgZAvV/4Ank6m+DRQc6lJUU NA== Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3g6athkpuy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 May 2022 20:38:12 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id 6EFFA81; Fri, 20 May 2022 20:38:11 +0000 (UTC) Received: from dog.eag.rdlabs.hpecorp.net (dog.eag.rdlabs.hpecorp.net [128.162.243.181]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id C04CF37; Fri, 20 May 2022 20:38:09 +0000 (UTC) From: Mike Travis To: Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Steve Wahl , x86@kernel.org Cc: Mike Travis , Dimitri Sivanich , Andy Shevchenko , Darren Hart , "H. Peter Anvin" , Russ Anderson , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH] x86/platform/uv: Dont use smp_processor_id while preemptable Date: Fri, 20 May 2022 15:37:55 -0500 Message-Id: <20220520203755.266337-1-mike.travis@hpe.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: m21svjX_-GCqeTwK_FVQ7dSkUI5r4ybe X-Proofpoint-ORIG-GUID: m21svjX_-GCqeTwK_FVQ7dSkUI5r4ybe X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-20_06,2022-05-20_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 suspectscore=0 adultscore=0 mlxlogscore=915 spamscore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1011 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205200126 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To avoid a "BUG: using smp_processor_id() in preemptible" debug warning message, disable preemption around use of the processor id. Signed-off-by: Mike Travis Reviewed-by: Steve Wahl Reviewed-by: Dimitri Sivanich --- arch/x86/platform/uv/uv_time.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c index 54663f3e00cb..094190814a28 100644 --- a/arch/x86/platform/uv/uv_time.c +++ b/arch/x86/platform/uv/uv_time.c @@ -275,14 +275,17 @@ static int uv_rtc_unset_timer(int cpu, int force) */ static u64 uv_read_rtc(struct clocksource *cs) { - unsigned long offset; + unsigned long offset, time; + unsigned int cpu = get_cpu(); if (uv_get_min_hub_revision_id() == 1) offset = 0; else - offset = (uv_blade_processor_id() * L1_CACHE_BYTES) % PAGE_SIZE; + offset = (uv_cpu_blade_processor_id(cpu) * L1_CACHE_BYTES) % PAGE_SIZE; - return (u64)uv_read_local_mmr(UVH_RTC | offset); + time = (u64)uv_read_local_mmr(UVH_RTC | offset); + put_cpu(); + return time; } /* -- 2.26.2