From patchwork Mon Jan 15 10:10:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 19026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1609863dyc; Mon, 15 Jan 2024 02:11:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYdD3Jmb0Q+utLcRpmN16dpBOzxe0ooHjabh6D/eftw+LWoJKyzIeuLKlhBSLIbF4V2pJp X-Received: by 2002:a05:6a20:c52a:b0:19a:1c9a:3fb4 with SMTP id gm42-20020a056a20c52a00b0019a1c9a3fb4mr4542467pzb.107.1705313493318; Mon, 15 Jan 2024 02:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705313493; cv=none; d=google.com; s=arc-20160816; b=mMA7cQJkcFjEyZqSCL1NhHrowOPrHHilPYZmCFhG/qD7wiHcN8kTjuSzVNUXEw7DOF fSRgWYFDIm9+XSnyNq2b4xnpbJ57H5SzN5bftoE1OzMIVX6DLuA23acJMI9aeCCBFyGT 3tUOi90tEMioXUsnw9LNEK/oggKlABu7se/cIVHL2WOrC7By6Ewdqv6zOAWl4fna16M6 /8brjTd6kPkNf/+pmilISvDN/b/vFZnOFKnHNGIkPoa4YrQiXwmSbBSh9VBDnF0xbiXc fsO5JOZA8EQoDwEExJhvVxuLEfuFHimXwao+gcTtgZ3ljzF5ouHe+5c3T1/9NQFGyAP3 daIg== 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25860-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h8-20020a17090a470800b0028bf2811d79si8256096pjg.100.2024.01.15.02.11.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 02:11:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25860-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25860-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0F47D281032 for ; Mon, 15 Jan 2024 10:11:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55DA118E01; Mon, 15 Jan 2024 10:11:14 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788150801307894966 X-GMAIL-MSGID: 1788150801307894966 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