Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp127440ybi; Fri, 26 Jul 2019 07:11:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1O+nN+2tmhBTuEhwd+SY0ziMS47Yc2kAfEGnnvAHAG1PalAzP0JCPDTEjlcmuA1g1L4J3 X-Received: by 2002:a17:902:5a2:: with SMTP id f31mr94897688plf.72.1564150277771; Fri, 26 Jul 2019 07:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564150277; cv=none; d=google.com; s=arc-20160816; b=iv5EW7Jj+ere7quVccHJUgUSaHjNsfaUXOYgYkyJsQ0vPy9N3HUbKYiRk+vVq0Zv31 ie4m6CcieqCIXCrJ6ikMoV2TuLptRUTyyPe49C4K1HfU+dyRE39FHhTsPpZGMCEQiGl/ rsj2mUoiLNKKlP6lZJN9yshBdNW/ytGXqRLJtUwzqWgnUPXf9TvNFIBB5PDOdnC+Kh5o Lkt1XdDvOq0XqSvMofpBafHf29euP1+73wK7yVTQhgUi8r8KJf4wDgfLi+Zu2eaw5qwH lSC/fX8c1TB2IJuYAR5/GJQXhjWCvhr6eXl4pbgMxJ4sKtgrQvrOdnzn37YV1piqn5Qj k0kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6WC8jkGxUI7sghnD6VHp6LF27X9GAm/Z4sosb2pqZpg=; b=HN2TMUvkyfScE8aeTo5PHU2/6/2QNCbw+dewvqKfaQgq03ywQzl0A7HWutZEUHciEl Qc8UcmdAnQtZcxJaJd4eLoVlfqT1/IxpAZ0+05pgurS7YT3GWWL961plBvl8KHprdRqx dcrjaHF7/c3xJPvhnxFs/87kkknbwrvxVx9xS6z7K81+WJzujq8YHGzJ2yRsqTdTKeiD eQTU5C8JMs6xVj7PDUzvEwbdKG5czJNKgqgj/Z9AdUFg384j/2bpZuQ6JZK8HbJ1vBOC MUnYYG9cxLbHbfZnBeqsn5clrxMC1FNWoxOsMJhJ+FzVVNR23t3jFHC1x9Wk5jqrPzrQ m9hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sWp6qOTp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p44si19849216pjp.0.2019.07.26.07.11.01; Fri, 26 Jul 2019 07:11:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sWp6qOTp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727716AbfGZOHw (ORCPT + 99 others); Fri, 26 Jul 2019 10:07:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:44476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbfGZOHw (ORCPT ); Fri, 26 Jul 2019 10:07:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 179AD218D3; Fri, 26 Jul 2019 14:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564150071; bh=2uuUK1ifiyV3Y744hTmQ7HeB0GK4yG8UQLMkmVM9zpc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sWp6qOTpA7EA0QuyZ00iA2kjV0qwj8DZ1fRMijoF4NxjWPJQOQ5BvSC+bVJX2sNaC +b57ip08/KFMI9dpgoX6yZbKyTvu7SYTD8ZFUQ7KIXvSWr5Cu05w5ab6mfFlzd9DqU mrCVTz10XLKAOk4dt7H9S8fHUzIwpAj68zoRAQXo= Date: Fri, 26 Jul 2019 16:07:49 +0200 From: Greg KH To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Sanyog Kale Subject: Re: [RFC PATCH 37/40] soundwire: cadence_master: add hw_reset capability in debugfs Message-ID: <20190726140749.GC8767@kroah.com> References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-38-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190725234032.21152-38-pierre-louis.bossart@linux.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 25, 2019 at 06:40:29PM -0500, Pierre-Louis Bossart wrote: > This is to kick devices into reset and see what software does > > Signed-off-by: Pierre-Louis Bossart > --- > drivers/soundwire/cadence_master.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c > index fa7230b0f200..53278aa2436f 100644 > --- a/drivers/soundwire/cadence_master.c > +++ b/drivers/soundwire/cadence_master.c > @@ -331,6 +331,25 @@ static const struct file_operations cdns_reg_fops = { > .llseek = default_llseek, > }; > > +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. > + > + return ret; > +} > + > +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? thanks, greg k-h