Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp2751453rwl; Sat, 5 Nov 2022 11:07:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4xpaDwU7BoPyKfmODETZlNHoM4AHS5CGIxSzG7hdLiEFBSZeE4errtLNc8u5qOh7M3mHZF X-Received: by 2002:a05:6402:847:b0:45b:d50c:b9aa with SMTP id b7-20020a056402084700b0045bd50cb9aamr41019482edz.289.1667671647056; Sat, 05 Nov 2022 11:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667671647; cv=none; d=google.com; s=arc-20160816; b=0f+ZAnymRknU8hOXzIaTcyTbEHxVxCx5I9z1JuNLfCMKlV+TxqK5mFCZQktCBZcx0q JELfBjbeq3RQKbDt38qtq33olzBrd+qbsztWVk7w+y0tsJTyKakB8G9ghAJXuxZtYo0y 4QcVHmfvregc01SOdIt92HMsUW60bQppAv4rILokYmNP0A/nAlQ1OZV7PnEsVSKBOBSr a6UQkmXB3tt0zOn87HjV3C58A6Ea3uB9rMDEvYVh0vqLHGhvO/L0zXgrfRIWdfo67rVF pNOhXfCp/LcfYE6RX7YdMg+9xmw3J1MXVzqYPc1YRL0PVJjUGF/ye4uBx/oB0KDtmM2R K4bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=vD8FilkUBj9ngEYDZ1KCGWjlrUlUwcbQQEe0iyoadYo=; b=m3Wp9Y85r9nY/yr8/TBxomhIOWvYDWGsCTlyrcGsayjrDIkRFT6V6obuYYHu5jeuWm 7W7/goLqXJOMVBrSeed+H13FRHrfzT7M3rclnXymF3AJgjQdyopWN2rf0ZR7LHzev7aE TQAIdl3gDiI8PityEDTskgPEYy7+YiPeqr+S+JvJU29Z1/gOYTHNWBykTU8+BmC1+IMu 8jM+Ok3NPUFArkopTwgMBWSi4nfHyrIGeFg1x8KRL745FB4lPGQYpZ7JDq2ZCVy0oMmP CPEiQDoi6ZrIIUCPSEo9pA0FFC5KdZ/VL3Vxu5JvMXcar/UHJRV8JLtRKXXrSHHUOtuf DPng== ARC-Authentication-Results: i=1; mx.google.com; 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 hp10-20020a1709073e0a00b0078d85777c4fsi3270814ejc.700.2022.11.05.11.06.50; Sat, 05 Nov 2022 11:07:27 -0700 (PDT) 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; 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 S229718AbiKERVZ (ORCPT + 97 others); Sat, 5 Nov 2022 13:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiKERVY (ORCPT ); Sat, 5 Nov 2022 13:21:24 -0400 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A5F91004E; Sat, 5 Nov 2022 10:21:23 -0700 (PDT) Received: by mail-pj1-f46.google.com with SMTP id m14-20020a17090a3f8e00b00212dab39bcdso10966427pjc.0; Sat, 05 Nov 2022 10:21:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vD8FilkUBj9ngEYDZ1KCGWjlrUlUwcbQQEe0iyoadYo=; b=dDH/kf4Q5iI6ywTjdUFf2qv8iyrdHF97K5VOA3k+jiY4X9KAR3gDzIAQxNfOx/e/Oi 3mExDEmpxPvS60ji4aP0es42Wt6nf16qDWio582WD5YaYx80Q+/U3lYwNhMcx+CmADx1 IIvRJOuWb1At3y7Nz19Rnil8pRO2d14LTXlyjQGVOAij1kv/NncCJgZn0Mytfx+T+CBF 4XHTpNF+bL5Kl4VHZH9ZctlyxqJkTZ3tZaBia+VDtwzozg1cqKLL0B1DUPC0jbnWAjPQ BEYK8qRX/adhY2vXDDXQdB1d5C6TzTSIZvzLeN5spMeN0gp49OwNv2grtDOQnDQaqc0r qXLg== X-Gm-Message-State: ACrzQf1heVfOzh4sIVugL6e9TcK15JnkKtsgkh2PuNpe470SYS80jrz7 cNVQiaW3Hbqh1AaG5D+sWcmRlFPA+6m07sWpb5dm5D6r4mSdaA== X-Received: by 2002:a17:90b:4ac3:b0:213:3918:f276 with SMTP id mh3-20020a17090b4ac300b002133918f276mr57992592pjb.19.1667668882537; Sat, 05 Nov 2022 10:21:22 -0700 (PDT) MIME-Version: 1.0 References: <20221104073659.414147-1-mailhol.vincent@wanadoo.fr> <20221104171604.24052-1-mailhol.vincent@wanadoo.fr> <20221104171604.24052-4-mailhol.vincent@wanadoo.fr> In-Reply-To: From: Vincent MAILHOL Date: Sun, 6 Nov 2022 02:21:11 +0900 Message-ID: Subject: Re: [PATCH v2 3/3] can: etas_es58x: report the firmware version through ethtool To: Greg Kroah-Hartman Cc: linux-can@vger.kernel.org, Marc Kleine-Budde , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Sat. 5 Nov. 2022 at 18:27, Vincent MAILHOL wrote: > On Sat. 5 Nov. 2022 at 17:36, Greg Kroah-Hartman > wrote: > > On Sat, Nov 05, 2022 at 02:16:04AM +0900, Vincent Mailhol wrote: > > > ES58x devices report below information in their usb product info > > > string: > > > > > > * the firmware version > > > * the bootloader version > > > * the hardware revision > > > > > > Report the firmware version through ethtool_drvinfo::fw_version. > > > Because struct ethtool_drvinfo has no fields to report the boatloader > > > version nor the hardware revision, continue to print these in the > > > kernel log (c.f. es58x_get_product_info()). > > > > > > While doing so, bump up copyright year of each modified files. > > > > Why not just stick to the normal USB interface here and not try to tie > > it into ethtool? These values are all availble today in sysfs or in > > libusb, right? > > The simple answer is ignorance. I am more familiar with ethtool than > libusb and I just did not think to explore that second option. > Thanks for the review, comments taken. I will study sysfs and libusb > and will rework that. I double checked following options: * CONFIG_USB_ANNOUNCE_NEW_DEVICES * lsusb -v from usbutils * sysfs None of those will return the firmware version. The only strings I am getting are: the Product name, the Manufacturer and the SerialNumber. I guess you were expecting some default behavior from the device, but unfortunately, this is not the case. On this device, the firmware version is stored at some arbitrary descriptor index (if you ask me: 6). Unless you query that magic number, the information will not pot up. So as far as I can see, this does not duplicate existing mechanisms. With this patch, the firmware version becomes available using: $ ethtool -i canX > > What workflow wants this added to ethtool? > > No workflow. My work is not bound to any company and this driver > maintenance and anything else I am doing on the mailing list at this > time is pure hobby. > > Yours sincerely, > Vincent Mailhol