Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5EA81C433F5 for ; Thu, 24 Mar 2022 10:04:45 +0000 (UTC) Received: from localhost ([::1]:44462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXKKi-0002xt-3a for qemu-devel@archiver.kernel.org; Thu, 24 Mar 2022 06:04:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXKH5-0001d7-G3 for qemu-devel@nongnu.org; Thu, 24 Mar 2022 06:00:59 -0400 Received: from exmail.andestech.com ([60.248.187.195]:29901 helo=Atcsqr.andestech.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXKGy-0003sN-5s for qemu-devel@nongnu.org; Thu, 24 Mar 2022 06:00:58 -0400 Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 22OA0chc053247; Thu, 24 Mar 2022 18:00:38 +0800 (+08) (envelope-from dylan@andestech.com) Received: from atcsi01 (10.0.15.167) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Thu, 24 Mar 2022 18:00:34 +0800 Date: Thu, 24 Mar 2022 18:00:34 +0800 From: Dylan Jhong To: Peter Maydell Subject: Re: [PATCH] hw/char/serial: Support serial_mm_init() with wakeup event. Message-ID: References: <20220323091637.5609-1-dylan@andestech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.1 (2022-02-19) X-Originating-IP: [10.0.15.167] X-DNSRBL: X-MAIL: Atcsqr.andestech.com 22OA0chc053247 Received-SPF: pass client-ip=60.248.187.195; envelope-from=dylan@andestech.com; helo=Atcsqr.andestech.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "pbonzini@redhat.com" , "qemu-devel@nongnu.org" , "mst@redhat.com" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, Mar 23, 2022 at 05:37:10PM +0800, Peter Maydell wrote: > On Wed, 23 Mar 2022 at 09:20, Dylan Jhong wrote: > > > > Although the "wakeup" parameter is declared in SerialState, > > but there is no function actually setting it up. > > Support "wakeup" as parameter in serial_mm_init(). > > This patch seems to provide a new argument which every > caller passes the same value for, unless I missed one > somewhere. What's the reason for this change? > > thanks > -- PMM Hi PMM, First of all, thank you for your review. The purpose of this variable is to allow users to specify their own wakeup reason id. At present, there are only 4 wakeup reasons provided by QEMU[*1]. Take uart as an example, which are classified as QEMU_WAKEUP_REASON_OTHER, so there is no way to distinguish the source of the wakeup reason when designing a custom power manager device. Indeed, as you can see, currently there is no device that supports the use of "wakeup_reason". But it will be used on the board we are going to upstream later. The goal of this patch is to make the "wakeup" feature support more complete. [*1] include/sysemu/runstate.h:42 typedef enum WakeupReason { /* Always keep QEMU_WAKEUP_REASON_NONE = 0 */ QEMU_WAKEUP_REASON_NONE = 0, QEMU_WAKEUP_REASON_RTC, QEMU_WAKEUP_REASON_PMTIMER, QEMU_WAKEUP_REASON_OTHER, } WakeupReason; Thanks, Dylan