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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 5C070C7618B for ; Fri, 26 Jul 2019 15:01:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 385A7229F3 for ; Fri, 26 Jul 2019 15:01:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387668AbfGZPB4 (ORCPT ); Fri, 26 Jul 2019 11:01:56 -0400 Received: from mga17.intel.com ([192.55.52.151]:30486 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387569AbfGZPB4 (ORCPT ); Fri, 26 Jul 2019 11:01:56 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2019 08:01:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,311,1559545200"; d="scan'208";a="322059365" Received: from msmall-mobl.amr.corp.intel.com (HELO [10.251.154.62]) ([10.251.154.62]) by orsmga004.jf.intel.com with ESMTP; 26 Jul 2019 08:01:54 -0700 Subject: Re: [alsa-devel] [RFC PATCH 37/40] soundwire: cadence_master: add hw_reset capability in debugfs To: Greg KH Cc: alsa-devel@alsa-project.org, tiwai@suse.de, linux-kernel@vger.kernel.org, vkoul@kernel.org, broonie@kernel.org, srinivas.kandagatla@linaro.org, jank@cadence.com, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-38-pierre-louis.bossart@linux.intel.com> <20190726140749.GC8767@kroah.com> From: Pierre-Louis Bossart Message-ID: <81637203-4a8d-5d6b-26c8-524b8868b015@linux.intel.com> Date: Fri, 26 Jul 2019 10:01:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190726140749.GC8767@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for the review Greg. >> +static int cdns_hw_reset(void *data, u64 value) >> +{ >> + struct sdw_cdns *cdns = data; >> + int ret; >> + >> + if (value != 1) >> + return 0; >> + >> + dev_info(cdns->dev, "starting link hw_reset\n"); >> + >> + ret = sdw_cdns_exit_reset(cdns); >> + >> + dev_info(cdns->dev, "link hw_reset done\n"); > > Do not be noisy for when things always go right. This looks like > debuggging code, please remove. yes, missed this in the cleanup, will remove. >> +DEFINE_DEBUGFS_ATTRIBUTE(cdns_hw_reset_fops, NULL, cdns_hw_reset, "%llu\n"); >> + >> /** >> * sdw_cdns_debugfs_init() - Cadence debugfs init >> * @cdns: Cadence instance >> @@ -339,6 +358,9 @@ static const struct file_operations cdns_reg_fops = { >> void sdw_cdns_debugfs_init(struct sdw_cdns *cdns, struct dentry *root) >> { >> debugfs_create_file("cdns-registers", 0400, root, cdns, &cdns_reg_fops); >> + >> + debugfs_create_file_unsafe("cdns-hw-reset", 0200, root, cdns, >> + &cdns_hw_reset_fops); > > Why unsafe? Dunno. I followed the documentation and my take-away, along with a number of examples, was to use _unsafe. I really have no idea if this is correct or not, I can remove this qualifier if that's not needed.