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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B5FFC433F5 for ; Wed, 20 Oct 2021 01:37:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 000FE60EFF for ; Wed, 20 Oct 2021 01:37:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 000FE60EFF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NHy6C3tk5W45/j+2MyGEcMsku4VDSLCykZlPtWdEAe0=; b=LETWNSy4foYQJy uPmEAG1ZFsKfomQLkfg7B4r+YQbVA7UnGYRarrQ+uBnNyCTkMWsN3Hv90IvNerKtO11ZO0hD5vc8y kVyOdDNJdKTXh4PXrbosS6/Jl9WD/OCPc0AvKOpXr16w5NhP89E307Cii9P1ypSJj0Y/jZhCihze/ hOmTJI2uY0WYi79tPnXVLdkpNsZalwSzt2/T6zIM58jtEgZAc32VGYSgjN1sOiUNXW26Gsqh78s1C Za32EtS1SA45vKfJdgt/Kz5wZtfOh5bqbAR0I5Da8CeavjNB0dEKBaoJxZ5bJ/2ptuVg/+fbVwBmd YylzoyoCUZz7TBwdX3YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1md0Vp-0037hT-1X; Wed, 20 Oct 2021 01:35:25 +0000 Received: from mail-qt1-f170.google.com ([209.85.160.170]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1md0Vl-0037gr-9Q for linux-arm-kernel@lists.infradead.org; Wed, 20 Oct 2021 01:35:22 +0000 Received: by mail-qt1-f170.google.com with SMTP id v17so1728553qtp.1 for ; Tue, 19 Oct 2021 18:35:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RUYSv1Ml+e5O/S44qXhwpad8q6ZJhXnlabD5d8PHlfE=; b=BVfs2zE+7wOKUjGaNY+fCrxfjr+VNh8LLtYuZz5OkhL15FsPZQQPdp7WpBCrwxAO3N a7GS0UgkNiNx22vpOTBYMBy+km4XV97k4Cc3BGcgTab3GOe2f/Gi4wIyVy7PcXKPHCI4 3u2/ayd3ZN10n4onrdJ57gAqKfmTYVRgxnLJiHUemyC+iPWWOXUWd6J6q5FJVD7/6Nio zTHIa9aYFxDjq3eQ+d4z6BFS80rjpoUBtAKHe9nlWnJ2lOl3YoJF9R/HqhgotjtR/HlH X2nM/FAUg81Hp66aWJan8deMkTeJ2wmF9qqQA2/25HsD0STRhgdngN2sL57ldhyGIGxp asEQ== X-Gm-Message-State: AOAM5326MIW5/WPZwOU7RtV2xrmuUelgEr0fNkakc84+fFg+EBq47WDz HUB5UJmOU/bXFDOTCbWLhWUjRxroxwU= X-Google-Smtp-Source: ABdhPJxllwZKY1DAgVLe1rwWmk7hD+X4gP1qc7QVcJ/g9+9Tbx4m9NwLO+nxYLBxu9ZKlCAum/l5Cw== X-Received: by 2002:ac8:7c53:: with SMTP id o19mr3878362qtv.228.1634693719231; Tue, 19 Oct 2021 18:35:19 -0700 (PDT) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com. [209.85.222.172]) by smtp.gmail.com with ESMTPSA id e15sm312965qtp.94.2021.10.19.18.35.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Oct 2021 18:35:18 -0700 (PDT) Received: by mail-qk1-f172.google.com with SMTP id x123so1794546qke.7 for ; Tue, 19 Oct 2021 18:35:18 -0700 (PDT) X-Received: by 2002:a37:c12:: with SMTP id 18mr3064225qkm.12.1634693718152; Tue, 19 Oct 2021 18:35:18 -0700 (PDT) MIME-Version: 1.0 References: <20211019023241.17466-1-Meng.Li@windriver.com> In-Reply-To: <20211019023241.17466-1-Meng.Li@windriver.com> From: Li Yang Date: Tue, 19 Oct 2021 20:35:06 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] soc: fsl: dpio: instead smp_processor_id with raw_smp_processor_id To: Meng.Li@windriver.com Cc: Roy Pledge , Ioana Ciocoi Radulescu , Horia Geanta , linuxppc-dev , lkml , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211019_183521_354622_F680CDFC X-CRM114-Status: GOOD ( 23.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 18, 2021 at 9:46 PM wrote: > > From: Meng Li > > When enable debug kernel configs,there will be calltrace as below: > > BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 > caller is debug_smp_processor_id+0x20/0x30 > CPU: 6 PID: 1 Comm: swapper/0 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_io_query_fq_count+0xdc/0x154 > dpaa2_eth_stop+0x144/0x314 > __dev_close_many+0xdc/0x160 > __dev_change_flags+0xe8/0x220 > dev_change_flags+0x30/0x70 > ic_close_devs+0x50/0x78 > ip_auto_config+0xed0/0xf10 > do_one_initcall+0xac/0x460 > kernel_init_freeable+0x30c/0x378 > kernel_init+0x20/0x128 > ret_from_fork+0x10/0x38 > > Based on comment in the context, it doesn't matter whether > preemption is disable or not. So, instead smp_processor_id() s/instead/replace/g > with raw_smp_processor_id() to avoid above call trace. > > v2: > Remove the preempt_disable/enable() protection, instead smp_processor_id > with raw_smp_processor_id. The revision history information should go after the "---" below. > > Fixes: c89105c9b390 ("staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl") > Cc: stable@vger.kernel.org > Signed-off-by: Meng Li I helped to fix the issues I mentioned. Applied for fix. Thanks. > --- > drivers/soc/fsl/dpio/dpio-service.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c > index 19f47ea9dab0..3050a534d42c 100644 > --- a/drivers/soc/fsl/dpio/dpio-service.c > +++ b/drivers/soc/fsl/dpio/dpio-service.c > @@ -59,7 +59,7 @@ static inline struct dpaa2_io *service_select_by_cpu(struct dpaa2_io *d, > * potentially being migrated away. > */ > if (cpu < 0) > - cpu = smp_processor_id(); > + cpu = raw_smp_processor_id(); > > /* If a specific cpu was requested, pick it up immediately */ > return dpio_by_cpu[cpu]; > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel