Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp42880pxb; Fri, 29 Oct 2021 05:32:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNw3VisAoE57Ryie/aayhm5nnbjBWUemQ4oHfHVFKqFXgrYDkKjipDrPgJmLL5JC17KI2I X-Received: by 2002:a05:6a00:140c:b0:447:96be:2ade with SMTP id l12-20020a056a00140c00b0044796be2ademr10376667pfu.26.1635510726778; Fri, 29 Oct 2021 05:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635510726; cv=none; d=google.com; s=arc-20160816; b=mxn2vpypODER/BhSKHZ5g0b/5p+m7NuRRA1c5nL7ot0XG9UOT5MBg2EpdZjp/zQmCw CDCarpGZ4YhYb/5zNCNja0bYyOjpaeQG4ALNSu7yqnUL8rSY8TPBzl6xNTRHj8/7uSaF h0QQZS2CQOifVoUF7/IA0dueNBcwOpsMAU6xXqsNlvhuPbe4BE7CQ16PxZRrcLyqM9po zugtVb/E5c9Hx0e3jHynfvct3M9G5HZEgWlwmAPr3wZS5lhmFEJ/BYa9qFdx2QVR6iX8 55dwAhtzdy10B0txJ0uC+3/+turJCT+7gW7Uj1wqPbV+OLMSk+RhktKkWbFBZmadlFBg 053A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=GgyHSASqDWoZ4OZKb08A4effzTOgaRIpV6COx4WnTEU=; b=zG7x5Md0tz/Nw4eGmg2esV38H5uiLUfO24VIXbVUlNkDRioIWImRpti0rkkUyaUpWI FjkT/h4W0dnMrIdWZfgM05za5ZGv6Z/xwHKLmT/PiQpJ0Wkf0qP4AlW+h5NWFUn8W4aO O7OhMYxbqwO9viQJSHzPaLbleRUT9pZ2lf53l8YmpwmXKmcT/mv9CLXqxP91Iv7WdYL/ QGHTtZCoyd/y8NTMdARU9P8oNyap+hUURNSE9PsYmbA3ihS4SP7QojMbRkOhEHqukxPQ c6sGZwYVFLs4P/uMLX7s8RpX0UCUF/2xZ9hIO+MCYlF897Ap97zc5cgLwflaxd14YrOk WvTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si5224970pji.71.2021.10.29.05.31.38; Fri, 29 Oct 2021 05:32:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230134AbhJ2Mdv (ORCPT + 99 others); Fri, 29 Oct 2021 08:33:51 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:56388 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230273AbhJ2Mdt (ORCPT ); Fri, 29 Oct 2021 08:33:49 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.92 #5 (Debian)) id 1mgR2Q-0001j9-GE; Fri, 29 Oct 2021 20:31:14 +0800 Received: from herbert by gondobar with local (Exim 4.92) (envelope-from ) id 1mgR2B-0001EN-RN; Fri, 29 Oct 2021 20:30:59 +0800 Date: Fri, 29 Oct 2021 20:30:59 +0800 From: Herbert Xu To: Meng Li Cc: horia.geanta@nxp.com, pankaj.gupta@nxp.com, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] driver: crypto: caam: instead this_cpu_ptr with raw_cpu_ptr Message-ID: <20211029123059.GA4648@gondor.apana.org.au> References: <20211019063719.18251-1-Meng.Li@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211019063719.18251-1-Meng.Li@windriver.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Oct 19, 2021 at 02:37:19PM +0800, Meng Li wrote: > 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 "), it doesn't matter whether preemption is > disable or not. So, only instead this_cpu_ptr with raw_cpu_ptr to > avoid above call trace. Please put the reason why raw is safe into a comment in the code. Readers shouldn't need to run git whatschanged to figure out why this is safe. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt