From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre-Louis Bossart Subject: Re: [alsa-devel] [RFC PATCH 37/40] soundwire: cadence_master: add hw_reset capability in debugfs Date: Fri, 26 Jul 2019 10:01:54 -0500 Message-ID: <81637203-4a8d-5d6b-26c8-524b8868b015@linux.intel.com> References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-38-pierre-louis.bossart@linux.intel.com> <20190726140749.GC8767@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190726140749.GC8767@kroah.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: alsa-devel@alsa-project.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.