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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 7DAF3C7618B for ; Fri, 26 Jul 2019 10:42:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F96622BEF for ; Fri, 26 Jul 2019 10:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbfGZKmq (ORCPT ); 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.