Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp12036254ybi; Fri, 26 Jul 2019 03:45:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDCU0R/9i5ITzQEOluA5FZVWUG3Ez02TLoTdKzD5W5VO9Be22+JOzTPIQ7/Psouwbeoo0w X-Received: by 2002:a17:90a:3086:: with SMTP id h6mr99435136pjb.14.1564137940236; Fri, 26 Jul 2019 03:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564137940; cv=none; d=google.com; s=arc-20160816; b=Z1yPjAvh/h78O4bNebj0tYzdHsT2DKCURrAa+b4+rSdKnHDgobvwZQcHmsyIuCWuXt wd5+AYJAHy1qowNflH3kINZ9OVjZ7d4HohQZbj7FexjCQ1kxrstHIQbN8p2Ow/UNWOBb myZp741y06GVLTODH4p0drqE9Nldc6eqC/DCAgjSqv3OMY5U9z0gExIy1Z9SKzVedi5H soK+oLSvtENmWnHD56xqVyCC8Bq15zyoWdZw6ZsKnlFYY0uuEkHVmeOwQ1WF33BXANhp RJkl3g87ECZCuNkGPufXGGzYmlOVtg2rURZx2RUrjxvk6Q2WM1H/LLBiy+Lx3CtdA7yO iwHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=BxpokcBvlAXiZAoliSW5KophW6xhELWBCMHtMw4HerY=; b=VJ7rnYBajoFTPcwhEDB93+CpwX8YFJcuUiKAXzFn7DHi3VbqqTjkqedPpR5Dkk1d1U Fr9G/jfulTFZb+I9FMapNWiCubeQyxzsj/MUweoPe0xbRW/jI+W9Zb/JiGEA9Tbv9Uke I8GjHtEQdQHJwyrf3q6retl7s5oftp0e+F9Q33ug4mFk1v+7FMMS1Wh79Rsm7YeC0Ip/ aYYhJ1mQ+9QROmLfie1mFm515f5ROsIzApGMJpKw3pS+6fNDWIGoBt6hN+AW5zlt/Jeq Cxb1N6S+osvSie2e30MfmsMJHGY/+8OzKAmILxOu2LrkaJhk8wrn9PmhCT/5gtwtlObA 01SA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id br15si19042652pjb.43.2019.07.26.03.45.25; Fri, 26 Jul 2019 03:45:40 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726668AbfGZKmq (ORCPT + 99 others); Fri, 26 Jul 2019 06:42:46 -0400 Received: from mga04.intel.com ([192.55.52.120]:31386 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbfGZKmq (ORCPT ); Fri, 26 Jul 2019 06:42:46 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2019 03:42:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,310,1559545200"; d="scan'208";a="175558526" Received: from crojewsk-mobl1.ger.corp.intel.com (HELO [10.251.89.116]) ([10.251.89.116]) by orsmga006.jf.intel.com with ESMTP; 26 Jul 2019 03:42:40 -0700 Subject: Re: [RFC PATCH 32/40] soundwire: intel: add helper for initialization To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-33-pierre-louis.bossart@linux.intel.com> From: Cezary Rojewski Message-ID: Date: Fri, 26 Jul 2019 12:42:38 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190725234032.21152-33-pierre-louis.bossart@linux.intel.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 On 2019-07-26 01:40, Pierre-Louis Bossart wrote: > Move code to helper for reuse in power management routines > > Signed-off-by: Pierre-Louis Bossart > --- > drivers/soundwire/intel.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c > index c40ab443e723..215dc81cdf73 100644 > --- a/drivers/soundwire/intel.c > +++ b/drivers/soundwire/intel.c > @@ -984,6 +984,15 @@ static struct sdw_master_ops sdw_intel_ops = { > .post_bank_switch = intel_post_bank_switch, > }; > > +static int intel_init(struct sdw_intel *sdw) > +{ > + /* Initialize shim and controller */ > + intel_link_power_up(sdw); > + intel_shim_init(sdw); > + > + return sdw_cdns_init(&sdw->cdns); > +} Why don't we check polling status for _link_power_up? I've already met slow starting devices in the past. If polling fails and -EAGAIN is returned, flow of initialization should react appropriately e.g. poll till MAX_TIMEOUT of some sort -or- collapse.