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=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 461DBC43331 for ; Fri, 27 Mar 2020 12:42:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16DA72082D for ; Fri, 27 Mar 2020 12:42:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pDJP439A" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727444AbgC0MmZ (ORCPT ); Fri, 27 Mar 2020 08:42:25 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33009 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727125AbgC0MmZ (ORCPT ); Fri, 27 Mar 2020 08:42:25 -0400 Received: by mail-pg1-f194.google.com with SMTP id d17so4534819pgo.0 for ; Fri, 27 Mar 2020 05:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:to:cc:subject:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=6/5YCNjZbhs7fDAqKSxswEEQ3GsJtkzaU0ERi/T9jdI=; b=pDJP439AKcqJEmIiiQaq6fA0FRPNI2TGoJyKDH2QWJoa10+GA1NXAGjCnejn0D8NKh E/2YJr5BO60dyTwRyIbQTraOWM/wHXcJQhfixsk8JHm0KHcWzWiL/+UxySN4AzlXhUyW 5zyn2PgxvZV7jIH6E1I/tKWG45EvUpSg1LTh4KsH1/rt+A1L6Q9065rSnNeB2kcgyRi6 /DuP99iQwPGPQi9Ne7v2Rt0ElZv6VHuD8LVRdEEOAqJZcf7cNFkYzPvIbBQFJGWflEIH 3F8b103aJzx5Av32T33KBPtkGJSKySEJXNbx7BGsjoA0/VlCXshGENDUwJ7NdvGLnUB4 ON0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:to:cc:subject:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=6/5YCNjZbhs7fDAqKSxswEEQ3GsJtkzaU0ERi/T9jdI=; b=TU1G+vM1QrYvIqET3d4OBCPUJaXrgGBqj9elVt569twtu5JApOIwfx2t7vDsTN0Yn2 XIrPWu1ypClBbXsmwEdtH1dx3LiamQpyfW+fJH/gz0fDk+D8+MeYpbbGFt4TZ/kWjTov +nBLwnzBP8ABcVWYteWPFa0yvpbpfIlSdu9ZznoSlgULkU4F9BGjQtSpW0tlxI8aCS4Z x+QlnNjtLFRiAd58Kzqe4diDGqHlvmKxUqHpg/A9gdgCVB5/L6V91S7PsoTkh5YvJ/15 DasfB97solDw04v8oH9LI1HLbGWvsNVCvXcCFWDXFRtOaOOoO1peP6BzxzfGzazdrYKr EbuQ== X-Gm-Message-State: ANhLgQ39DqhiLyWZ+ZeRgOOgjSxB9PLw6XSCtdDtcGlU+sQcZAeT/Fx3 4M5T8yRg+m3tL1mprswJK96OpgkGO50= X-Google-Smtp-Source: ADFU+vsV/F21FOaRvO15PNaCzRYH1GWTS74YJq40ErXbKs5RHRa3UictBwXBL6FXeFNsxEgqLuK1ZA== X-Received: by 2002:a65:6910:: with SMTP id s16mr14604573pgq.426.1585312941765; Fri, 27 Mar 2020 05:42:21 -0700 (PDT) Received: from SARKAR ([106.51.108.92]) by smtp.gmail.com with ESMTPSA id e14sm4025423pfn.196.2020.03.27.05.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2020 05:42:21 -0700 (PDT) Message-ID: <5e7df4ad.1c69fb81.25b38.eec8@mx.google.com> X-Google-Original-Message-ID: <20200327124217.GA13042@rohitsarkar5398@gmail.com> Date: Fri, 27 Mar 2020 18:12:17 +0530 From: Rohit Sarkar To: Jean-Baptiste Maneyrol Cc: Andy Shevchenko , Jonathan Cameron , linux-iio Subject: Re: [PATCH] iio: imu: inv_mpu6050: add debugfs register r/w interface References: <5e730c2f.1c69fb81.9eda3.5c70@mx.google.com> <20200321183154.128d8920@archlinux> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Fri, Mar 27, 2020 at 10:56:33AM +0000, Jean-Baptiste Maneyrol wrote: > Hello, > > this is quite useful for me for debugging and testing. So I am in favor. > > Just one comment, I think it is safer here to lock the mutex to ensure this doesn't happen in the middle of an interrupt or anything else. Sure > I am waiting for V2. Will send it asap, was waiting for your ack. > Thanks for the patch, > JB > > > > From: Andy Shevchenko > > Sent: Saturday, March 21, 2020 20:53 > > To: Jonathan Cameron > > Cc: Jean-Baptiste Maneyrol ; Rohit Sarkar ; linux-iio > > Subject: Re: [PATCH] iio: imu: inv_mpu6050: add debugfs register r/w interface > >   > > >  CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe. > > > > On Sat, Mar 21, 2020 at 8:31 PM Jonathan Cameron > > wrote: > > > On Thu, 19 Mar 2020 11:08:44 +0000 > > > Jean-Baptiste Maneyrol wrote: > > > > > > iio debugfs register interface is quite handy because we can read a single register and write a value. > > > > > > > > regmap debugfs is only a dump of all registers, as far as I know (may have missed something). > > > > > > So this is something Mark has discussed before around regmap > > > and more generally IIRC.  The issue is that a write > > > interface does make it somewhat easy to do really nasty things > > > in some drivers that use regmap (to the extent of setting boards > > > on fire etc).  For IIO we are much safer - the worst you can do > > > is break the IIO driver. > > > > Sometimes IIO driver provides a sensor data about platform facilities, > > such as temperature of the die / chip or battery voltage threshold. > > > > > I've never been that fussed myself about the debugfs interfaces > > > as it's easy to hack them in when needed for actual debugging, but > > > have taken the view that if someone has enough of a usecase to > > > want to add them to a particular driver, then it's up to them. > > > > Good to know your p.o.v.! > > > > -- > > With Best Regards, > > Andy Shevchenko >