Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2720499pxb; Tue, 12 Oct 2021 12:04:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiGKOWiynUhswq5UPA8bgmK7m260P5dxSv2lo1mHNZYM3RdiyCmY8BQ1KlLrCB8Ry0OHge X-Received: by 2002:a17:902:da83:b0:13f:704:d731 with SMTP id j3-20020a170902da8300b0013f0704d731mr30653825plx.77.1634065492733; Tue, 12 Oct 2021 12:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634065492; cv=none; d=google.com; s=arc-20160816; b=Tu8cAjaVEbGLVx0zBPq9Bly18ayaMO/wvJKzv8PrTmLASjAE5WPbtSiYW2IKSaQ/jY booAqLDq9Qw/O6ZVKU/VuKDFc7LBN1KvUszjzWjKjc7vc5sF7Iih2t49LfJuNrYm+M/3 EB5d6rc0DI/LfwTld9LOhaSOvVHFE/CwD63uGZXOv75lhK6PPdj2AnxX/RJvQJYNsyIT FKfy8ud+r3ko/hYjGZxOwJAKsXTJIVGORo5KRrLKd6iU4ZrXAOsUvLt3kqK/j8g5OxS1 Ytvdj7wmOJ2LhStK9NlG/7Sj2wQ7wvUzqpIqkrs0vxn+C1ox3x/YVe2LtikkWt9lwdam k6Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KPK3CZ1zOzdsBLcM+K13rH6mWEGG9SFXIFi7T85GUjM=; b=0fiA4fnOk1tqJqOIywt6+1bdTkeDScNHlxmnlRky83ojhD90JLUHsxyfK2MeMZU6WC s/eu0BdrRUGu527gLE0pRQF9mSBUUcxzsCib1dxpNOsTb+3X4t7F74GE5+naaRDy5wmN YgX29whakvjUGdtS+Zuru03vtJXC5I/ZYdIxsRHC5/MxWolSWwtL/er1AW7WOKlVKgPu PEoiN1AM2TcTd7+7VVNMep8URYpraMEfUOJwCXPN12yZO2a7HU3gvODUukQZXgwJSPcc Et1+bG4snRBWCVmOmJPhGwhio5YDqFznw75/x5JPVLc54sCY+kjlN/7eU5S3e6f+jDNr BIsg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si16695191pfu.123.2021.10.12.12.04.37; Tue, 12 Oct 2021 12:04:52 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233849AbhJLTFg (ORCPT + 99 others); Tue, 12 Oct 2021 15:05:36 -0400 Received: from gloria.sntech.de ([185.11.138.130]:38644 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234204AbhJLTFX (ORCPT ); Tue, 12 Oct 2021 15:05:23 -0400 Received: from ip5f5a6e92.dynamic.kabel-deutschland.de ([95.90.110.146] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maMdv-0007d3-Gg; Tue, 12 Oct 2021 20:36:51 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Palmer Dabbelt , Palmer Dabbelt , Paul Walmsley , Albert Ou , Daniel Lezcano , Ulf Hansson , "Rafael J . Wysocki" , Pavel Machek , Rob Herring , linux-riscv@lists.infradead.org Cc: Sandeep Tripathy , Atish Patra , Alistair Francis , Liush , Anup Patel , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Anup Patel , Anup Patel Subject: Re: [PATCH v9 4/8] RISC-V: Add SBI HSM suspend related defines Date: Tue, 12 Oct 2021 20:36:50 +0200 Message-ID: <5247988.8z7lCFx90T@diego> In-Reply-To: <20211012095857.1314214-5-anup.patel@wdc.com> References: <20211012095857.1314214-1-anup.patel@wdc.com> <20211012095857.1314214-5-anup.patel@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anup, Am Dienstag, 12. Oktober 2021, 11:58:53 CEST schrieb Anup Patel: > We add defines related to SBI HSM suspend call and also > update HSM states naming as-per latest SBI specification. > > Signed-off-by: Anup Patel Looks like this patch depends on your SRST patch. ("RISC-V: Use SBI SRST extension when available"). Looking at the history this seems to have been last posted in june 2021 with the conversation stalling around july. I guess as this was so long ago, that patch might've dropped out of peoples inboxes and a resend might be in order? Heiko > --- > arch/riscv/include/asm/sbi.h | 27 ++++++++++++++++++++++----- > arch/riscv/kernel/cpu_ops_sbi.c | 2 +- > 2 files changed, 23 insertions(+), 6 deletions(-) > > diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h > index 289621da4a2a..ab9782f8da52 100644 > --- a/arch/riscv/include/asm/sbi.h > +++ b/arch/riscv/include/asm/sbi.h > @@ -62,15 +62,32 @@ enum sbi_ext_hsm_fid { > SBI_EXT_HSM_HART_START = 0, > SBI_EXT_HSM_HART_STOP, > SBI_EXT_HSM_HART_STATUS, > + SBI_EXT_HSM_HART_SUSPEND, > }; > > -enum sbi_hsm_hart_status { > - SBI_HSM_HART_STATUS_STARTED = 0, > - SBI_HSM_HART_STATUS_STOPPED, > - SBI_HSM_HART_STATUS_START_PENDING, > - SBI_HSM_HART_STATUS_STOP_PENDING, > +enum sbi_hsm_hart_state { > + SBI_HSM_STATE_STARTED = 0, > + SBI_HSM_STATE_STOPPED, > + SBI_HSM_STATE_START_PENDING, > + SBI_HSM_STATE_STOP_PENDING, > + SBI_HSM_STATE_SUSPENDED, > + SBI_HSM_STATE_SUSPEND_PENDING, > + SBI_HSM_STATE_RESUME_PENDING, > }; > > +#define SBI_HSM_SUSP_BASE_MASK 0x7fffffff > +#define SBI_HSM_SUSP_NON_RET_BIT 0x80000000 > +#define SBI_HSM_SUSP_PLAT_BASE 0x10000000 > + > +#define SBI_HSM_SUSPEND_RET_DEFAULT 0x00000000 > +#define SBI_HSM_SUSPEND_RET_PLATFORM SBI_HSM_SUSP_PLAT_BASE > +#define SBI_HSM_SUSPEND_RET_LAST SBI_HSM_SUSP_BASE_MASK > +#define SBI_HSM_SUSPEND_NON_RET_DEFAULT SBI_HSM_SUSP_NON_RET_BIT > +#define SBI_HSM_SUSPEND_NON_RET_PLATFORM (SBI_HSM_SUSP_NON_RET_BIT | \ > + SBI_HSM_SUSP_PLAT_BASE) > +#define SBI_HSM_SUSPEND_NON_RET_LAST (SBI_HSM_SUSP_NON_RET_BIT | \ > + SBI_HSM_SUSP_BASE_MASK) > + > enum sbi_ext_srst_fid { > SBI_EXT_SRST_RESET = 0, > }; > diff --git a/arch/riscv/kernel/cpu_ops_sbi.c b/arch/riscv/kernel/cpu_ops_sbi.c > index 685fae72b7f5..5fd90f03a3e9 100644 > --- a/arch/riscv/kernel/cpu_ops_sbi.c > +++ b/arch/riscv/kernel/cpu_ops_sbi.c > @@ -97,7 +97,7 @@ static int sbi_cpu_is_stopped(unsigned int cpuid) > > rc = sbi_hsm_hart_get_status(hartid); > > - if (rc == SBI_HSM_HART_STATUS_STOPPED) > + if (rc == SBI_HSM_STATE_STOPPED) > return 0; > return rc; > } >