From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752365AbdJSJCJ (ORCPT ); Thu, 19 Oct 2017 05:02:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:57667 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdJSJCE (ORCPT ); Thu, 19 Oct 2017 05:02:04 -0400 Date: Thu, 19 Oct 2017 11:02:02 +0200 Message-ID: From: Takashi Iwai To: Vinod Koul Cc: Greg Kroah-Hartman , ALSA , Charles Keepax , Sudheer Papothi , plai@codeaurora.org, LKML , Pierre , patches.audio@intel.com, Mark , srinivas.kandagatla@linaro.org, Shreyas NC , Sanyog Kale , Sagar Dharia , alan@linux.intel.com Subject: Re: [alsa-devel] [PATCH 04/14] soundwire: Add MIPI DisCo property helpers In-Reply-To: <1508382211-3154-5-git-send-email-vinod.koul@intel.com> References: <1508382211-3154-1-git-send-email-vinod.koul@intel.com> <1508382211-3154-5-git-send-email-vinod.koul@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Oct 2017 05:03:20 +0200, Vinod Koul wrote: > > diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c > index a14d1de80afa..baad4ad3be44 100644 > --- a/drivers/soundwire/bus_type.c > +++ b/drivers/soundwire/bus_type.c > @@ -139,12 +139,28 @@ static int sdw_drv_probe(struct device *dev) > return ret; > } > > + slave->ops = drv->ops; > + > ret = drv->probe(slave, id); > if (ret) { > dev_err(dev, "Probe of %s failed: %d\n", drv->name, ret); > return ret; > } > > + /* device is probed so let's read the properties now */ > + if (slave->ops && slave->ops->read_prop) > + slave->ops->read_prop(slave); > + > + /* > + * Check for valid clk_stop_timeout, use DisCo worst case value of > + * 300ms > + */ > + if (slave->prop.clk_stop_timeout == 0) > + slave->prop.clk_stop_timeout = 300; > + > + slave->bus->clk_stop_timeout = max_t(u32, slave->bus->clk_stop_timeout, > + slave->prop.clk_stop_timeout); Isn't it racy? Also what happens after removing a driver? The clk_stop_timeout is kept high? > + > +int sdw_slave_read_dpn(struct sdw_slave *slave, > + struct sdw_dpn_prop *dpn, int count, int ports, char *type) Missing comment for a public API function. thanks, Takashi