Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11503972rwb; Fri, 25 Nov 2022 16:55:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Ts9z/ygGPxCTLkr8NImISqugACM2qssBoQSrr7qFqJAEcvZ0jQA/Z2+X5nq4hGl0CxLXk X-Received: by 2002:a63:eb16:0:b0:477:6fe1:cd6d with SMTP id t22-20020a63eb16000000b004776fe1cd6dmr23462448pgh.334.1669424152308; Fri, 25 Nov 2022 16:55:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669424152; cv=none; d=google.com; s=arc-20160816; b=TGM9g9RswwcyFEiXx80asMeZcL1nP02DReRmxj3+FBRE8URzLhPTaxKQEigAD+Sazo sOXDh0Kjh1P5KE+Kt87yk7VmwwTzSV78kJt7GCfmuoKW8DwfPt3T4Xxzus+behFVMOCu dz5NbqRROsvJhkkZNieoXpHsL7alRsP1YvEqW4KFCNZsyPgT84L5JAMIpHy6nDKwGQdz xFfT7rir8HKTi2dkeUlDQ5YQ6vbIJ9RxSgVvk0c5NM+IYiZ6GhVPLIjckWJGV1Gl2OUO wPdK3MVp4IVMrik2Ta9/BRqxmgQZrfgqCJFHd98oz+wiw0+oMEiCcim+1Jy9+LHxmb0D frEA== 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=iCaceALPA+uyA4RelrcFIgJlb1OAS9i7cU+UvZ4U5QI=; b=USq5yiTx/A54UE3KcXEggzSVM0e5rc/wWJK0QW3pAR7n6XVg/3fOBSFajvcvCt0LjR myAO+WtLDcrH+qrSZWE1wujGKhmvp4B67CGAvOmqG5gmVY6wjtOy68yP6lN0pHARueOF ZXxVKkSbZe5keDb8vIgDsnDxTWSWb5pazNhCgXShA3iIHVrdVkEnEXiHHvxGm4cCHMqe urjN8k2E6r9CaCQ//liysv5M63M9iSYn+Y4Twavez78gvcGgei47l4sjFEQLF31awykJ f7q3Pa/gVsPjDrQgvtE+WQ/Pyv1+Ws/5dNp8i1yARasY9e111AIU2ubxucqX+9CJouCm Fe5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JquloSc6; 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 n16-20020a170902e55000b00186af7a393asi5986969plf.327.2022.11.25.16.55.41; Fri, 25 Nov 2022 16:55:52 -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=JquloSc6; 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 S229868AbiKZAhR (ORCPT + 86 others); Fri, 25 Nov 2022 19:37:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229881AbiKZAhL (ORCPT ); Fri, 25 Nov 2022 19:37:11 -0500 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E235532C0; Fri, 25 Nov 2022 16:37:10 -0800 (PST) Received: by mail-oi1-x231.google.com with SMTP id n186so5962696oih.7; Fri, 25 Nov 2022 16:37:10 -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=iCaceALPA+uyA4RelrcFIgJlb1OAS9i7cU+UvZ4U5QI=; b=JquloSc6fcBDkCLspdkg8gDuh+iY4YIS+sjEkuTNBCsZJ6gtbGcaY6RzZgAibXEA93 aP4bPvblwbVNvSA8t7qikKV0pBTtoIe1v9TPQtxy88gbF/JYFu6B8gMWniwUZWx4bTT+ 0NNNbhtdOlKgISunELmbFpUUWSjyj9pfabZ9v1I+wiPFONV0EoIiQiddkqbbnS+xZK2q vW+luBmeAZchEk1wjDrPViA7Vxc1sQ8nNCcHli+B8CictjAv7A3LNjxgCHLoSrZjcbOJ yc+yKOFWIL8RX3YEBv48Ey+wOue4ahX6VYMOSTc9D9kj2Mmkebq5wmQLeGBNHVew9h32 UuJQ== 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=iCaceALPA+uyA4RelrcFIgJlb1OAS9i7cU+UvZ4U5QI=; b=2ubccQ/O485KgY3pG5LK7Lj3LJfwF7WEc3sKrx82EWb0DGl/P7Ebs6NhYemQgkBpUo 1otB9RuNNHYaJftmAJ4LNilQUl9SaKMj5y9V/ZXc5kBi57q3N4xLzSRAkREHRZVplUU5 26dyKJ6AHHniffbPoFTSdLiXJp4+6mnO7lzscE77yPxe9WjNEksHJHltclMIRrrMPvgS VQzQeiL8KBeqmN8GQWQ8lUw4tvgmsBSG3WspuwKUaQ7ZOu/7Az4/RZpUX1w/hZlIiKXx PUFPCjYFXOL3Cm8BDNSRLpdqReynERGIj9nic+Yzl8x6khAlF5pyHUr6bwToU4exnNlZ s3zQ== X-Gm-Message-State: ANoB5pkGcQIcTBajqh6M8/kPjeOEdT9o+yriDD/auQn6fu49/aR4XuxT BMeTj+neisQ/uvXOBVqgXdQ= X-Received: by 2002:a05:6808:152c:b0:354:da02:c05f with SMTP id u44-20020a056808152c00b00354da02c05fmr10105211oiw.290.1669423029686; Fri, 25 Nov 2022 16:37:09 -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 v71-20020acaac4a000000b0035418324b78sm2042330oie.11.2022.11.25.16.37.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Nov 2022 16:37:09 -0800 (PST) Sender: Guenter Roeck Message-ID: Date: Fri, 25 Nov 2022 16:37:08 -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?= , Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221125222315.4925-1-linux@weissschuh.net> From: Guenter Roeck In-Reply-To: <20221125222315.4925-1-linux@weissschuh.net> 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 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. Guenter