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=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 A7249C07E95 for ; Tue, 20 Jul 2021 13:40:46 +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 5C6EA606A5 for ; Tue, 20 Jul 2021 13:40:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C6EA606A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qktDEqtBahGNhvj2alNNlmzSsA4jRcfn71dEDbpcXyA=; b=knKZs1SYHplGEl Cg6PCXjFxF+ve83VDGdwftu5MltDyKtGvHc9lV12X13OWmiZvV5nFywi7bPZNsJ3Zcok8oSOS6c0X HDdO943IQ13v4lilkpoKTRrajkpyrUFVLb6NBtu64BL9DG8fSV/ZPU/zwT08EyliBtD2VtqyXruoL YPuqtvr5KF3spq3cYU3X0fxG+5nzCpmbrgfsURo7t3qaKQuvdmLf54vUb7sRlUcjLd7mC/GZFPVgh vprNgYG7dHj51VMn1CERf70ictm4A9nnzsVHM4fo48dLURsmeO6l+xWGlaQjOhH/r5x2n9qEQ8vw2 rpj8hiD9Vp6/EkzP16mQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5pxe-00Cxnp-P2; Tue, 20 Jul 2021 13:39:02 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5pxa-00Cxmp-Pr for linux-arm-kernel@lists.infradead.org; Tue, 20 Jul 2021 13:39:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DA6E81FB; Tue, 20 Jul 2021 06:38:51 -0700 (PDT) Received: from bogus (unknown [10.57.79.213]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F06353F694; Tue, 20 Jul 2021 06:38:49 -0700 (PDT) Date: Tue, 20 Jul 2021 14:37:51 +0100 From: Sudeep Holla To: Xiongfeng Wang Cc: catalin.marinas@arm.com, will@kernel.org, rjw@rjwysocki.net, viresh.kumar@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, guohanjun@huawei.com, Sudeep Holla Subject: Re: [PATCH] ACPI / PPTT: get PPTT table in the first beginning Message-ID: <20210720133751.u6k6bdm7qco3gn65@bogus> References: <20210720112635.38565-1-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210720112635.38565-1-wangxiongfeng2@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210720_063858_949537_02C20492 X-CRM114-Status: GOOD ( 14.90 ) 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 Tue, Jul 20, 2021 at 07:26:35PM +0800, Xiongfeng Wang wrote: > When I added might_sleep() in down_timeout(), I got the following Sorry it is not clear if you are able to reproduce this issue without any other modifications in the mainline kernel ? > Calltrace: > > [ 8.775671] BUG: sleeping function called from invalid context at kernel/locking/semaphore.c:160 > [ 8.777070] in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 14, name: cpuhp/0 >From this I guess you are adding sleep after raw_spin_lock_irqsave in down_timeout(kernel/locking/semaphore.c). > > It is because generic_exec_single() will disable local irq before > calling _init_cache_level(). _init_cache_level() use acpi_get_table() to > get the PPTT table, but this function could schedule out. > > To fix this issue, we use a static pointer to record the mapped PPTT > table in the first beginning. Later, we use that pointer to reference > the PPTT table in acpi_find_last_cache_level(). We also modify other > functions in pptt.c to use the pointer to reference PPTT table. > I don't follow this change at all. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel