Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11569738rwb; Fri, 25 Nov 2022 18:01:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf7qey0atBO4beSFjyG5o0MhAbMCf1KFBVE+K/bmqw/ClCUFrQha9FJ2ElG3FjzMc8mnJVDT X-Received: by 2002:a17:906:8455:b0:7aa:97c7:2c04 with SMTP id e21-20020a170906845500b007aa97c72c04mr21197365ejy.191.1669428082965; Fri, 25 Nov 2022 18:01:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669428082; cv=none; d=google.com; s=arc-20160816; b=SZhCbvf73RgOGKhpa+pXj7VVn7DfhD8c8HXIki1PfLXrHy9El5e2PDNX2PbrBWBFKD CsX+9vML8U/3oOzQyTsnX2C5jMJxHF+SIIX5zRoaShemWQF+83/24hK/GLsrYlwBVWkt Izzaw9D5TUJ+ApP3TipHG32W+h5eoZDO5xi0arpAhHLrQ3sCLz+Bm1BPLLtK4ZLDdY/V 4f1xjOu3kRAbSROmhgCCBbzsrVBKsR5a4Ta6SyOxsxvfg6vvdgMVuzFxSvxXePguYgzg 2aIGKNPllW0SfYHqVbh6bc4Uro8/UGi6SiwELAOBpl9yF2Wqr/uICqlXAvbxWVrQHiCP J+ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=zSVu8IzWQnukYfrlr5/HsImCuo05xjm0CcfHLq4urLI=; b=P+CGH5jmjKE8mEb5NYwOI6i5jnZlKlNMDBcAaarXrJ6LJ9VMmHdnhCib8Pry9f50Jn BB+RRUzhaGGylWk8pYVkYp4k0mrd/2CfqwYmPEiWJ2zPcEe0YAqHOUrdN3FXN7kVlIIE tP12ZuWYqS8+Xfly5fcId7b34d3FT7hLlyK7/+6x5CRInaqHTvBpYXJ/5uD2gbNanw9f 3Gm1PI7+jY4Qb/MlH0i9ztUXwzKk5GtVH+TNM8wHSVhOMbZ6B4peUUWxkVmnGhzIq8vw guZGdBf9h0olJ/f37jFExiV8Asl0CTtWitMvZVq3SWdxwkypjOPsmQ5z+zd/QxiLHCPh NTsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RZC2Lxjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s17-20020a056402521100b00463d1e2639fsi6045521edd.363.2022.11.25.18.01.02; Fri, 25 Nov 2022 18:01:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RZC2Lxjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbiKZBqq (ORCPT + 86 others); Fri, 25 Nov 2022 20:46:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbiKZBqo (ORCPT ); Fri, 25 Nov 2022 20:46:44 -0500 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B3CD450AC; Fri, 25 Nov 2022 17:46:43 -0800 (PST) Received: by mail-ot1-x32b.google.com with SMTP id a13-20020a9d6e8d000000b00668d65fc44fso3648140otr.9; Fri, 25 Nov 2022 17:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=zSVu8IzWQnukYfrlr5/HsImCuo05xjm0CcfHLq4urLI=; b=RZC2Lxjfq7QI2Nc/9un0NKkTteBkrHjVjqKdAqOInw7u9Gsi7ro4i9TNGDxKyzNGMV ojewZguGFeqvzygkN0UCUKMRraJRWpd9fAoxV+HXoflyp9vm3oJKA0uN+VRRvCjIZiAh jpcGiTBLzmEDNs7+tZiPsDdDPiPZlqX1mHm5XhAkGfzacdy3NpvRcOLBs8I243x1FCMl TCunXaWytSvSFSxcQXDGv0djUBaHwPv1u58xLrGPON18haElE1epFLyTbs+o+A5WsPh1 h1o07+OaJwQ24MxrkVCsH6CsRA4Gtceplk7/o0HCdGwp8bFTEG+P+WTqthsC30m+lMou 29Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zSVu8IzWQnukYfrlr5/HsImCuo05xjm0CcfHLq4urLI=; b=Wvn9ccLmHA+ceiH9s/7JbajxZMhewsQKYaDmfrXEyRs2qFVlczaYb4gJXv44Ura3+R jHLWMrN1uit1yxamHvnwNcNinIfogs5s2yq6E0DR2KpxrshJIskjJK+bYcksuN1IwFtL A/fvPOoWj3htlKHqoz9vfCMSb5a8cxCn87+mwn4rbX66mdLGLw8tPksGR2R3FLU+L+tY kEeGBq1UuorSHKUWy7fOIKAMesDZjMJowYkkbHJZCKbeWr09vFOmjEZ/xz8oyPkB61qz JTDGD2VzzqvKp/faCrQhbWlPUBC5MMx7tD4lQ053pt9DBOvWqn5pFCGUHxIuZ7wBoc1J bUWw== X-Gm-Message-State: ANoB5pnzLupHI7/yViWKpfwrGj2kHJnVZtnRB7LPxoappLtJZ6TnF29Q z6DV2p/iQ1r4zYZMiI2HgXsiRTCRHyU= X-Received: by 2002:a05:6830:1e96:b0:66b:48e3:655a with SMTP id n22-20020a0568301e9600b0066b48e3655amr10595917otr.20.1669427202585; Fri, 25 Nov 2022 17:46:42 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id g31-20020a056830309f00b0066cf6a14d1asm2344284ots.23.2022.11.25.17.46.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Nov 2022 17:46:41 -0800 (PST) Sender: Guenter Roeck Message-ID: <7c38ad68-49cb-0f8a-18a4-fa78f0429bdd@roeck-us.net> Date: Fri, 25 Nov 2022 17:46:40 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] watchdog: Report firmware_version in sysfs Content-Language: en-US To: =?UTF-8?Q?Thomas_Wei=c3=9fschuh?= Cc: Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221125222315.4925-1-linux@weissschuh.net> From: Guenter Roeck In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/25/22 17:00, Thomas Weißschuh wrote: > On 2022-11-25 16:37-0800, Guenter Roeck wrote: >> On 11/25/22 14:23, Thomas Weißschuh wrote: >>> This synchronizes the information reported by ioctl and sysfs. >>> The mismatch is confusing because "wdctl" from util-linux uses the ioctl >>> when used with root privileges and sysfs without. >>> >>> Signed-off-by: Thomas Weißschuh >>> >>> --- >>> >>> Userspace implementation: >>> >>> https://github.com/util-linux/util-linux/pull/1927 >>> --- >>> drivers/watchdog/watchdog_dev.c | 10 ++++++++++ >>> 1 file changed, 10 insertions(+) >>> >>> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c >>> index 55574ed42504..88c76e27873c 100644 >>> --- a/drivers/watchdog/watchdog_dev.c >>> +++ b/drivers/watchdog/watchdog_dev.c >>> @@ -555,6 +555,15 @@ static ssize_t identity_show(struct device *dev, struct device_attribute *attr, >>> } >>> static DEVICE_ATTR_RO(identity); >>> +static ssize_t firmware_version_show(struct device *dev, struct device_attribute *attr, >>> + char *buf) >>> +{ >>> + struct watchdog_device *wdd = dev_get_drvdata(dev); >>> + >>> + return sysfs_emit(buf, "%d\n", wdd->info->firmware_version); >>> +} >>> +static DEVICE_ATTR_RO(firmware_version); >>> + >>> static ssize_t state_show(struct device *dev, struct device_attribute *attr, >>> char *buf) >>> { >>> @@ -618,6 +627,7 @@ static umode_t wdt_is_visible(struct kobject *kobj, struct attribute *attr, >>> static struct attribute *wdt_attrs[] = { >>> &dev_attr_state.attr, >>> &dev_attr_identity.attr, >>> + &dev_attr_firmware_version.attr, >>> &dev_attr_timeout.attr, >>> &dev_attr_min_timeout.attr, >>> &dev_attr_max_timeout.attr, >>> >>> base-commit: 0b1dcc2cf55ae6523c6fbd0d741b3ac28c9f4536 >> >> I think this conflicts with drivers/watchdog/ziirave_wdt.c which generates its own >> firmnware_version attribute. > > Indeed, thanks for the catch. > > We probably can't change the attribute from ziirave_wdt, which is a bit > unfortunate as "firmware_version" would nicely match the name from > "struct watchdog_info". > > How about "fw_version"? > I don't have a better idea. Go for it. Guenter > That would match the naming of sysfs attributes from a bunch of other > subsystems. > > And obviously an addition to Documentation/ABI/testing/sysfs-class-watchdog is > also missing from the patch. > I'll add it in v2. > > Thomas