From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64B92C433F5 for ; Thu, 16 Sep 2021 23:40:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D20D611CA for ; Thu, 16 Sep 2021 23:40:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1D20D611CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To: Date:References:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QWm2XPzYqp9cdsLj6+0FfzVs8MDpnKChJhgUpINPCBM=; b=liGOyGdduBo37L bllqZXKAHRwrGJbVEZQUSSEuOnCJkRmXLMuF3P14ZKqYUUeBxGBpdla6uv/xZnyhfaumj3wYzIkQf 2cEby7IDwIqmDEVbM28kc4WTJSgdSd6vGMHL7OGYkMLCOp1LAevo2VP2a2fGMkw9hK8R7jK4m+83b Zo1tGoDJHwZFBklixeRK1f+W43MascvTboBIIOJHjgJl8BD7ZYbnW2bFFX6Fc2MDijF/slriSIB2V h6WrB70lOwlOTUIHWXqHggwU1+OzLUHDxw35F4DQkzwzmcqZ+GOyM6BXn/swHy+oTbN3uHV96bn73 w8Ffd9LgO07Qgt22h2AQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mR0xD-00Ci32-RV; Thu, 16 Sep 2021 23:38:08 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mR0xA-00Ci2U-4Y for linux-arm-kernel@lists.infradead.org; Thu, 16 Sep 2021 23:38:05 +0000 Received: by mail-pj1-x1034.google.com with SMTP id f3-20020a17090a638300b00199097ddf1aso8748888pjj.0 for ; Thu, 16 Sep 2021 16:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=dsmpAEysummCR+0sKJW94drPPG6N4lgMtRNGAbPoMYM=; b=R3QcpmAxoydu8UEqTsgiQDtldifUVex8DLdhfjcCkkDN4tESQTG+gPUZoh5PkTumk1 tdsNh405J1V5USAYKCG6IA5TShauMTwlqvkXD1Lah/K80tgCzPfH7LYtT781FT/eF7hK roC8CSoyOjdrguPNtwyDlCUsxud4mo4eftpPsB3JVKfzergQmBuCHTW4wTsxEDundsKP 5AGJuq9QONvsF0IOZURgW/gTBWvu3cKCvzYa3wY8HflZj/GHg87H8NAprWyRGjCcHBTJ dP/D+Nypft3eyemyk2jgjwwYybSu1KE6QGaaRSBTbWPpwB3ozTcIC/mQPEvrQ88Fil9P Qccw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=dsmpAEysummCR+0sKJW94drPPG6N4lgMtRNGAbPoMYM=; b=OIIPx9aZ7PRGvksV+B4HdQ5/lH7aIBLPzLcIatxRo0RASxB6Clegz/yME6PfasefLf wMOCP8FRhJ6Vq5uoo4SiCZIfrBEYw0AVvjAw1MtOr+DOEa5AN8M5pLvO0S5V8xWT0wcR kMkOIlvSKcVUz4c+ABKtv5Mctd9R+leRxNfs0BmmfM6Xm/HKJvvEhe/ryZwjaC7/aMWA XKBnDsYOvHrt0oarTbhJGmD7stMkZRmDtoMT1F90Dl3VXMsJA91zJggtSenT9PL8X7bE PswkWdbb3StM2Bk7YvjcIXkr0PzKLblBRFDQkuejKjgsXQVqkwkGUPSJx+dA0bEOE5nn iLYg== X-Gm-Message-State: AOAM533YWDPgSS3gGWjqgk8Ju+uTjbBIbI032kMfNxVVYiwYsHF/zVAf d5X64JvXhxpX46f1YB943lc= X-Google-Smtp-Source: ABdhPJyCDk5ItHOE340GhRmuFVtp+aFArK4dQXh9Ewz/os6s+Gx9QFrxJMIkc5x/fx5wvwRY4yee1A== X-Received: by 2002:a17:902:b694:b0:138:a031:610d with SMTP id c20-20020a170902b69400b00138a031610dmr7127076pls.36.1631835482195; Thu, 16 Sep 2021 16:38:02 -0700 (PDT) Received: from localhost (122x211x248x161.ap122.ftth.ucom.ne.jp. [122.211.248.161]) by smtp.gmail.com with ESMTPSA id h24sm4182036pfn.180.2021.09.16.16.38.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 16:38:01 -0700 (PDT) From: Punit Agrawal To: Ronak Jain Cc: , , , , , , , Subject: Re: [PATCH v2 2/3] firmware: zynqmp: Add sysfs entry for runtime features References: <20210913083955.27146-1-ronak.jain@xilinx.com> <20210913083955.27146-3-ronak.jain@xilinx.com> Date: Fri, 17 Sep 2021 08:37:58 +0900 In-Reply-To: <20210913083955.27146-3-ronak.jain@xilinx.com> (Ronak Jain's message of "Mon, 13 Sep 2021 01:39:54 -0700") Message-ID: <87ee9o6qi1.fsf@stealth> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210916_163804_241031_C19FE5B4 X-CRM114-Status: GOOD ( 30.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ronak, Ronak Jain writes: > Create sysfs entry for runtime feature configuration. The support > is added for an over temperature and external watchdog feature. > > The below listed files are used for runtime features configuration: > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > > In order to configure an over temperature or external watchdog > features, first the user need to select the valid config id and then > the user can configure the value for selected feature config id. > > Signed-off-by: Ronak Jain > --- > Changes in v2: > - Update commit message > --- > .../ABI/stable/sysfs-driver-firmware-zynqmp | 84 +++++++++++++++++++ > 1 file changed, 84 insertions(+) > > diff --git a/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp > index f5724bb5b462..2fde354715a5 100644 > --- a/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp > +++ b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp > @@ -113,3 +113,87 @@ Description: > # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/health_status > > Users: Xilinx > + > +What: /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_* > +Date: Aug 2021 > +KernelVersion: 5.14 > +Contact: "Ronak Jain" > +Description: > + This sysfs interface allows to configure features at runtime. > + The user can enable or disable features running at firmware. > + Also, the user can configure the parameters of the features > + at runtime. The supported features are over temperature and > + external watchdog. Here, the external watchdog is completely > + different than the /dev/watchdog as the external watchdog is > + running on the firmware and it is used to monitor the health > + of firmware not APU(Linux). Also, the external watchdog is > + interfaced outside of the zynqmp soc. > + > + By default the features are disabled in the firmware. The user > + can enable features by querying appropriate config id of the > + features. > + > + The default limit for the over temperature is 90 Degree Celsius. > + The default timer interval for the external watchdog is 570ms. > + > + The supported config ids are for the feature configuration is, > + 1. PM_FEATURE_OVERTEMP_STATUS = 1, the user can enable or > + disable the over temperature feature. > + 2. PM_FEATURE_OVERTEMP_VALUE = 2, the user can configure the > + over temperature limit in Degree Celsius. > + 3. PM_FEATURE_EXTWDT_STATUS = 3, the user can enable or disable > + the external watchdog feature. > + 4. PM_FEATURE_EXTWDT_VALUE = 4, the user can configure the > + external watchdog feature. > + > + Usage: > + > + Enable over temperature feature > + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id > + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + > + Check whether the over temperature feature is enabled or not > + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + The expected result is 1. > + > + Disable over temperature feature > + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id > + # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + > + Check whether the over temperature feature is disabled or not > + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + The expected result is 0. > + > + Configure over temperature limit to 50 Degree Celsius > + # echo 2 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id > + # echo 50 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + > + Check whether the over temperature limit is configured or not > + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + The expected result is 50. Maybe I am missing something but I was wondering why these features are being exposed via custom sysfs nodes - can they be integrated into the respective subsystems? e.g., Over temperature protection would fit in nicely with the thermal sub-system. Did you explore integrating the feature there? > + > + Enable external watchdog feature > + # echo 3 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id > + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + > + Check whether the external watchdog feature is enabled or not > + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + The expected result is 1. > + > + Disable external watchdog feature > + # echo 3 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id > + # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + > + Check whether the external watchdog feature is disabled or not > + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + The expected result is 0. > + > + Configure external watchdog timer interval to 500ms > + # echo 4 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_id > + # echo 500 > /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + > + Check whether the external watchdog timer interval is configured or not > + # cat /sys/devices/platform/firmware\:zynqmp-firmware/feature_config_value > + The expected result is 500. Similarly, this would make sense to go into the watchdog subsystem. Using sub-system interfaces would allow existing tools to just work without having to make zynqmp specific tools or find yet another way to interact with these features. Thanks, Punit _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel