Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751730AbdINT73 (ORCPT ); Thu, 14 Sep 2017 15:59:29 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:45950 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbdINT70 (ORCPT ); Thu, 14 Sep 2017 15:59:26 -0400 X-Google-Smtp-Source: AOwi7QCw1QxsKWtiL/aGC/NdEZ2sMqv2wyrhMkfIwF1g+KyXAwvFjzCpH4qFYwPWuVCoEcWr2rxj8+PfucHaeDTanJw= MIME-Version: 1.0 In-Reply-To: <87h8wdb8bj.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> References: <20170828191748.19492-1-vivien.didelot@savoirfairelinux.com> <20170828191748.19492-2-vivien.didelot@savoirfairelinux.com> <20170907193434.GA11006@kroah.com> <87h8wdb8bj.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> From: Maxim Uvarov Date: Thu, 14 Sep 2017 22:59:24 +0300 Message-ID: Subject: Re: [PATCH net-next v2 01/10] net: dsa: add debugfs interface To: Vivien Didelot Cc: Greg KH , netdev , linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli , Andrew Lunn , Egil Hjelmeland , John Crispin , Woojung Huh , Sean Wang , Nikita Yushchenko , Chris Healy Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1901 Lines: 49 debugfs here is very very useful to read registers directly and compare what use space tools see. Cool feature to get regs by port and use standard tools to diff and print them. Even might be better to allow drivers to decode register names and bits values. Once that is done driver mainaince will be much easy. I.e. you need only match regs with spec from one side and regs with user space tools from other side. Of course it's needed only for debuging, not for production. But even for production regs dump on something wrong might tell a lot. Maxim. 2017-09-08 16:58 GMT+03:00 Vivien Didelot : > Hi Greg, > > Greg KH writes: > >> I agree you shouldn't be using debugfs for this, but in the future, if >> you do write debugfs code, please take the following review into >> account: > > Humm sorry I may not have given enough details. This was really meant > for debug and dev only, because DSA makes it hard to query directly the > hardware (some switch ports are not exposed to userspace as well.) > > This is not meant to be used for anything real at all, or even be > compiled-in in a production kernel. That's why I found it appropriate. > > So I am still wondering why it doesn't fit here, can you tell me why? > >> You should _never_ care about the return value of a debugfs call, and >> you should not need to ever propagate the error upward. The api was >> written to not need this. >> >> Just call the function, and return, that's it. If you need to save the >> return value (i.e. it's a dentry), you also don't care, just save it and >> pass it to some other debugfs call, and all will still be fine. Your >> code should never do anything different if a debugfs call succeeds or >> fails. > > Thank for your interesting review! I'll cleanup my out-of-tree patches. > > > Vivien -- Best regards, Maxim Uvarov