Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp439869rdb; Mon, 15 Jan 2024 02:11:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGY1jqVOLxWvFX6SQkUO563yXx1lwnazJnEkcbtlsGIE3llcGwX3aXKVHQ9/tqdv5TcC8Mz X-Received: by 2002:a17:906:b782:b0:a28:c7fe:5458 with SMTP id dt2-20020a170906b78200b00a28c7fe5458mr2252850ejb.94.1705313482121; Mon, 15 Jan 2024 02:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705313482; cv=none; d=google.com; s=arc-20160816; b=ITJmjLVQP8RTR1S02fZkRVeXmRrFz3koRvJARPHCouKuo8Jk5CWTdzPqY1dgM2Xsbl nWi1BvWMVoBoogPkQYM0gBLdGPqTaBTL2Kli0LbVbbBv1kX5XYgiOlV7fxRyMaHyw+aI Up4ruDtMVOyNoPVnHiJN/lAxgcLNf2XD74Y/d/nSUrKlHbwuHRrGye67PNhh9C2KPrXS Nn6DLn/a+3u36IaUXlHgmMKpxeUT+3x4yGyFqM1FgK/LUp5kChHnIzN50QPiyJrssuTD lir4IWHt374rdWyPQLeGQITxCQvWMgDKK1fBrlTk7S9gLTgVBkNenzPRAhzVu1Z3J9oR d43g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=+D1l7MDJ7PqRKV1gRx82cPii/0bkhIwCmY25QP/RxaE=; fh=FKC/h5VVoA65vzO0ouUOa33iBRZCVTrZz9+QoLDKUqs=; b=M5ZTDzFg3SqsnYGmyVj7LY2Te7EJThXtSeM6ktMjTlbs3JvEC89i7xN4WBss7rgqov XN+ebdKH7FUf+affsd3tEpH14KQiZA3Nz0u7pA33vGqYpmT/Mo6TN16qPG7kQIpziMzK 5FAzQj72aOjr8OhMqEVxls25sfl7jv3Hwap/0m1vqDZnyA7c15p5hNJa8/uZQI8FuVgI FHQ2D0/fiePvqmKXOw57F9C3z9R3NpSCw72Wgya9t3VAQ7PDEZZkev5Priw4spZ4L7u0 Njdz1xcaN6IBgpLAGTWJ3f8a8p79vD93J1RsDYBkpKMUUBpOavvgMgJqCH1KkgeCZfCm EXbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="Bx4lfp/d"; spf=pass (google.com: domain of linux-kernel+bounces-25860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25860-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n16-20020a170906089000b00a28f023581csi3725870eje.630.2024.01.15.02.11.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 02:11:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="Bx4lfp/d"; spf=pass (google.com: domain of linux-kernel+bounces-25860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25860-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C8DE31F21E0F for ; Mon, 15 Jan 2024 10:11:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77B0AF9F5; Mon, 15 Jan 2024 10:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="Bx4lfp/d" Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 033B7F9C2 for ; Mon, 15 Jan 2024 10:11:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-598b8dd877dso1682293eaf.3 for ; Mon, 15 Jan 2024 02:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1705313466; x=1705918266; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+D1l7MDJ7PqRKV1gRx82cPii/0bkhIwCmY25QP/RxaE=; b=Bx4lfp/dAV5DrKNyckkBvP2tsq5kqUN1tWbObT5zPvJkTRXIvCeqc2fV0F4eRiOraY Zll2cLGqgDOkFxRLIWQ7yJ9k+aERXZM024/GpxAnCTT4hxQlSOl2lD6YhOySyw3Kj6Tf 7vFoNvWYa4tPIIwjxPOIKtI9bgQ5PjatxQZnhgtdU6slJJZJg8+DWT5R886xaRaMxAD7 1LsOr527caCLPKlIO+3YiwBHt5vajTBHQre6sAXY7FZIPafMcX+sA57O2RQmFzL/CI+j wx37gTwSyqByN5HdThaKzowq7oXLHhuLh5WrRLnHEm59zBQzna7y2tNmgx/RfrH69NoZ 8T/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705313466; x=1705918266; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+D1l7MDJ7PqRKV1gRx82cPii/0bkhIwCmY25QP/RxaE=; b=R+zIzNN0281BIDdNYCatNq/7gzvj74sn2Ier6YIpjU52Hz6m9vaXt6xdJDj3qgWG9H HikHrQctdRZKSqKrP7mWaVyuF0kowSQBFRbXZ2SxxGvF/wkm6qmZAp8mGQSx2QoO3APl spV8bsmhC4+YKD5vqNw5ULyTccN04Yqv9yeW4g6rmmJ2p9CdX+hEj+ZzN/16gv7997rD DpIpuYsYeR9f2MEvxXpXfxkYVPWBpfYXe/Zh2dyjvie+/wTRpfa1ZkqZXvqBahHKBpKc HTK97Z2DYCDdXOkz02jCDw7G5UEbFgHuS8iflRhq61AJSEv3YxyUheyUVw25tid+tYtH 4fQA== X-Gm-Message-State: AOJu0Yx99omM+BeCdwEgbwn25GxmvkqLNAie+4+WqDV7QO2Z2Io0LBlW Y7XxeS9bFGWH/CeWalcfLuX8htkTC4o6pw== X-Received: by 2002:a05:6359:6b81:b0:170:64cd:8aac with SMTP id ta1-20020a0563596b8100b0017064cd8aacmr3471927rwb.62.1705313465983; Mon, 15 Jan 2024 02:11:05 -0800 (PST) Received: from localhost.localdomain ([106.51.188.200]) by smtp.gmail.com with ESMTPSA id u5-20020aa78385000000b006d9b8572e77sm7348256pfm.120.2024.01.15.02.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 02:11:05 -0800 (PST) From: Sunil V L To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Cc: "Rafael J . Wysocki" , Len Brown , Anup Patel , Daniel Lezcano , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Andrew Jones , Atish Kumar Patra , Pavel Machek , Sunil V L Subject: [PATCH v2 -next 0/3] RISC-V: ACPI: Add LPI support Date: Mon, 15 Jan 2024 15:40:53 +0530 Message-Id: <20240115101056.429471-1-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series adds support for Low Power Idle (LPI) on ACPI based platforms. LPI is described in the ACPI spec [1]. RISC-V FFH spec required to enable this is available at [2]. [1] - https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html#lpi-low-power-idle-states [2] - https://github.com/riscv-non-isa/riscv-acpi-ffh/releases/download/v/riscv-ffh.pdf Changes since v1: 1) Reordered the commits such that the patch which enables ACPI_PROCESSOR is the last one in the series. 2) Used GENMASK and other changes to address Drew's comments. 3) Moved common functions required by both DT and ACPI based cpuidle drivers from the DT driver to common arch/riscv/suspend.c. 4) ACPI cpuidle driver is added under drivers/acpi/riscv 5) Rebased to latest for-next branch of linux-riscv. Sunil V L (3): cpuidle: RISC-V: Move few functions to arch/riscv ACPI: RISC-V: Add LPI driver ACPI: Enable ACPI_PROCESSOR for RISC-V arch/riscv/include/asm/suspend.h | 3 ++ arch/riscv/kernel/suspend.c | 47 +++++++++++++++++ drivers/acpi/Kconfig | 2 +- drivers/acpi/riscv/Makefile | 3 +- drivers/acpi/riscv/cpuidle.c | 81 +++++++++++++++++++++++++++++ drivers/cpuidle/cpuidle-riscv-sbi.c | 41 +-------------- 6 files changed, 135 insertions(+), 42 deletions(-) create mode 100644 drivers/acpi/riscv/cpuidle.c -- 2.34.1