Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4565316pxv; Tue, 20 Jul 2021 06:46:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVNtdT3ER7+RKanSYaL7YtP7lQXMusqimvO2La4fitL0kzVMyQgRx2WvfALEF90zHgnVTc X-Received: by 2002:a17:907:397:: with SMTP id ss23mr32081382ejb.470.1626788760891; Tue, 20 Jul 2021 06:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626788760; cv=none; d=google.com; s=arc-20160816; b=hZrtZdN/0mjfbatTA0LflmFQxNsjXkGFw3W1d7LQRNhAeYQy36z57O1Rcz2ZE5c+8S cwqkK29CP2w7qkgMb2vRQO3zrbWpbsC2sGRvPhPoLIP7BHFXktbD0SudZMffgtADluYk tN8dJPzrlmfNGdYUlHFjOkO661MgJLBcSEzeYBsxSDEUF3aHc4YxwYwO6ZN0G2Vu9BIN O+W1jkoUwRCNEpOMYAIuXvxRlbeURd3hQUjWS3gpJc8/0qgtmW4mkbWuDGMGbd0pE2pz 3hNPe046icy4CJvke9UorO5yr36IbsvB2UMKb7gjz7L0fDNlVaew6Ba6RKFyfuChf3L3 +tGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=/ExEKAtmJyL9TxMg3hiVVVc9mI+9aEA5bvTAYfZp8Do=; b=LwVqOMf0onYmenbK5zHB2HM7kbcjFUbe1Snyun5SgyRRF2jN/WcIVuAxeMZNGnSZzM ClILO2WWWtHoKJ5xdoSRADTDb/KhSTqQ7IxOaYjj5zyDVsXEoD2uIoyzdclaNjhT+Xch tyyG6dTKqyFeUGi4o+OzCpWrQxg8s9GSW7icFAqq+JvUi2WbBWr3HTMQpRWL9+y/lyyW B9zqN6FdqdcZQeGKhH0KmzhAsH1EAdJ9GpkrmsUfrH3lTlC3e8PLfTdy3vgbQvge/0yi W1A+LsZ1OQuug9WckHqgQ20ZybwfDQKdV4PxeIOwVmyzfePBYNiiFPYxbTtNlJbz841I fZ9w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si17563874ejn.748.2021.07.20.06.45.37; Tue, 20 Jul 2021 06:46:00 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238684AbhGTM6z (ORCPT + 99 others); Tue, 20 Jul 2021 08:58:55 -0400 Received: from foss.arm.com ([217.140.110.172]:58802 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238682AbhGTM6N (ORCPT ); Tue, 20 Jul 2021 08:58:13 -0400 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210720112635.38565-1-wangxiongfeng2@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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