Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3729234pxb; Mon, 24 Jan 2022 16:31:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLz9T3rLwf+6V4RZgdgXqCDlVo/LsD1A4Aa8XfL2tzVy7ZLCeZG+zls+AXnVgCxwtJfiMT X-Received: by 2002:a17:902:7603:b0:149:1ce6:c28c with SMTP id k3-20020a170902760300b001491ce6c28cmr16771080pll.164.1643070713289; Mon, 24 Jan 2022 16:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070713; cv=none; d=google.com; s=arc-20160816; b=wGxVouKEjDW3vIIYnRxEImEclRUI9b/SEtlvLHM8IT8YFdk7aSzma45J7DMpUtueMZ FVRSHPYc/rzZvcn5Tm4trH5ZyMFWixZrxFPmtvB+96dVqk8z3E+KicjjjQd4I7QNa6KZ zvIpYEF0AYO8ktqhKZHD2pB5HEEAn5XOkXs/3jSkwSg7UlbFsqmmCIE0GurTUg9Wu5nS Qs9bwusgkme+hRDQv5V7wW7vFe4NrZfiLkDqxBqmGS6monKO9kPll/qn3KO7Oz6Y+om4 3XxIgERJ3dJRHKDJ6g3boSCCf/AhYPT0n7osZLJe76BwqwVlArcYSHFgJ13tHPVEIYNz HC5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hP33WxiESKCl6UiFvuF5SarWIIeZtSawMVFIR5ztFYg=; b=yF0zrlvLajHPOgIWCm0KvxKDceBpUYMooUl0soi5Dj9NJaY5evy1NhULT/wASPcRUs PlrcH2tRwHgo11sQbgKCO/H/QkIqnRThF1Vo9axjGmPhCN/XDc5Pg6+Q937C1VLAcQ5+ YPZfV9jc16nCom1xGeLNi93/nL1d4lUWssIRW+joagCM4bezd6Kn10oUYe/rI0FKq3YU fIAA8QLr+dUeZfPZ/PUijfCjbHoHcC+D3OKEpt/0GdVJSkKynAlcSH9got+CiC3k+Reo mjmV+6eIBuD+6+V2kKVjpFfBL3sOaxj+sJ9C8XhdqZl91H20zsvfCm4Fk7EtOhp70664 Yi2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="i9qnq/lD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x10si2990864plg.314.2022.01.24.16.31.41; Mon, 24 Jan 2022 16:31:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="i9qnq/lD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3409850AbiAYA1g (ORCPT + 99 others); Mon, 24 Jan 2022 19:27:36 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:48184 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1389762AbiAXVgg (ORCPT ); Mon, 24 Jan 2022 16:36:36 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B9AF0B8121C; Mon, 24 Jan 2022 21:36:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC4D0C340E4; Mon, 24 Jan 2022 21:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060193; bh=llqmotql0dU1BNpAsfO0Bt9goMpDGsF/FGV07efugkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i9qnq/lDhbb59LbB5CmK6zDdxBbqt7rFN3ifeTA35257P33Cs6RpA8voh8gg7WoSv abaGI6EY5gZxOCmV8qobdSmy7SEY8OKNuozcM76veOqGo1pMK5MZC+kra2HaszvlLi LQ0sWk6wH40nC/HC5xa8YarfwttrNErDZ6I0lNew= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Meng Li , =?UTF-8?q?Horia=20Geant=C4=83?= , Herbert Xu Subject: [PATCH 5.16 0838/1039] crypto: caam - replace this_cpu_ptr with raw_cpu_ptr Date: Mon, 24 Jan 2022 19:43:47 +0100 Message-Id: <20220124184153.461557090@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Meng Li commit efd21e10fc3bf4c6da122470a5ae89ec4ed8d180 upstream. When enable the kernel debug config, there is below calltrace detected: BUG: using smp_processor_id() in preemptible [00000000] code: cryptomgr_test/339 caller is debug_smp_processor_id+0x20/0x30 CPU: 9 PID: 339 Comm: cryptomgr_test Not tainted 5.10.63-yocto-standard #1 Hardware name: NXP Layerscape LX2160ARDB (DT) Call trace: dump_backtrace+0x0/0x1a0 show_stack+0x24/0x30 dump_stack+0xf0/0x13c check_preemption_disabled+0x100/0x110 debug_smp_processor_id+0x20/0x30 dpaa2_caam_enqueue+0x10c/0x25c ...... cryptomgr_test+0x38/0x60 kthread+0x158/0x164 ret_from_fork+0x10/0x38 According to the comment in commit ac5d15b4519f("crypto: caam/qi2 - use affine DPIOs "), because preemption is no longer disabled while trying to enqueue an FQID, it might be possible to run the enqueue on a different CPU(due to migration, when in process context), however this wouldn't be a functionality issue. But there will be above calltrace when enable kernel debug config. So, replace this_cpu_ptr with raw_cpu_ptr to avoid above call trace. Fixes: ac5d15b4519f ("crypto: caam/qi2 - use affine DPIOs") Cc: stable@vger.kernel.org Signed-off-by: Meng Li Reviewed-by: Horia Geantă Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/caam/caamalg_qi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/caam/caamalg_qi2.c +++ b/drivers/crypto/caam/caamalg_qi2.c @@ -5470,7 +5470,7 @@ int dpaa2_caam_enqueue(struct device *de dpaa2_fd_set_len(&fd, dpaa2_fl_get_len(&req->fd_flt[1])); dpaa2_fd_set_flc(&fd, req->flc_dma); - ppriv = this_cpu_ptr(priv->ppriv); + ppriv = raw_cpu_ptr(priv->ppriv); for (i = 0; i < (priv->dpseci_attr.num_tx_queues << 1); i++) { err = dpaa2_io_service_enqueue_fq(ppriv->dpio, ppriv->req_fqid, &fd);