Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1589933imm; Thu, 18 Oct 2018 00:24:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV61hew7TF7NYhuPUwq6O+WnMQ9sfMzbjYivnGNh6AViUUppc5BPGDjiRnjt6Huw+t1sy/8hh X-Received: by 2002:a17:902:44:: with SMTP id 62-v6mr29175152pla.181.1539847441965; Thu, 18 Oct 2018 00:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539847441; cv=none; d=google.com; s=arc-20160816; b=NEJp5mq25KJ0vhPlZizWycrYE5V7yfJKXV0q4XTyZrrTc9hPmYHugyRT2iIER9Xmyt RS1HnqL+OGpLCT1odfP7L/fM00vxDJC4cC2A5jU7t62Fg0aAf1TVjUauw8ll+1zIELYu qyim+OmsjbbEhPKXRMptVwj9ctktOwPB1WrJjjM9HxjqVhJTnTHB2MCi33iCkHUn5t3h RyqN4kUYUMtsTL8UQNP+RPDmFI0/9UxqyNIPfPA3N1XgucBz43wbw7Uq0Pc/i42sa9Pg vYDIIXoeylIIfQtVM6bvT2WNk5G9rMfguOaW0m+3CJuGd7PXfzxhyZyYTz/4FPrQlZLG 4rXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hW70wPM5B1kwnKSHRgQ7+ugmG/Kth6DHltt08mOUgrk=; b=RQFXL8WrCH66+/44Supt+DRIexfscgjKqhVcPmRH50Zg8MWjFps8gFhmC1x6Sx4nba VGKJvGkzcyzE8JisdE/6JPCIyLRrlKQYn1yEQfpAL83Lf94gu7KdeXjZf9M13YQ7y7LI 9HvpiNieEKolBr63GWkfLc15ftkmlu2CCK36B8Wo84DRox1MyKgZVaqk/b9f5rPchF/R 9INL+qaCpQ3myFbS2bqWJPxKiSKefNluBlFEBozEiJMgMSiRLZuMHCUE+Htl41nVKr7b nkpVCYP6NDsL7R+KO14Y5/kcKL9eKfC1TWGNs9o/hvnAyEqB0VlTxMrxkvxovHxRSDgR hfhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U7a9sL6F; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj3-v6si19470246plb.12.2018.10.18.00.23.46; Thu, 18 Oct 2018 00:24:01 -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=@gmail.com header.s=20161025 header.b=U7a9sL6F; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727486AbeJRPVv (ORCPT + 99 others); Thu, 18 Oct 2018 11:21:51 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:44221 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727365AbeJRPVv (ORCPT ); Thu, 18 Oct 2018 11:21:51 -0400 Received: by mail-qt1-f196.google.com with SMTP id x24-v6so1559064qtx.11; Thu, 18 Oct 2018 00:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hW70wPM5B1kwnKSHRgQ7+ugmG/Kth6DHltt08mOUgrk=; b=U7a9sL6F1De6iqcemhWxikuybdlr+gsnPAOSjrnsAS9qqnUiLfSR7ZdNzfaqpkKu2j HCkQ/6ofazu7QYyVaKLsrV1LEibi1bn94rEEFGZ25KIvg3WMLRgBRur/vWdkunEni7l1 6+rGw+wjjlzP/ig4CBKjVekfyeJOsrCPIp6RHF7GzAhqGZMY224RYRfDzXEWQCZUO4N3 6U4k1FI9zggjsM1gaz1JrZfHlINq2JvKSxisMWOdjvxvzbP0aDXWcbncty4Szd9HPNJ6 DDsLIDqBWQ1PuEj3Vy/BMikfVAFMSt8pJBGBlhMwZKvbs0WvPpH5NbragQ606QFvXmkz yNsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hW70wPM5B1kwnKSHRgQ7+ugmG/Kth6DHltt08mOUgrk=; b=ZPdXgzCauF/ItJdzkj+VJQfSqbPU5jV+L+IWAElFqsVVpr2ahicIX4RXjkHfcnI80B ULQGYhUd43BJvCzSM5j4F9e34wYOkjJvcWaSebFiEk8cWlQYJl3N8vjR5h0/Yot1Q9jg 1fqhWpYdt5sZpYzhuInijlx2WOYTdetw9+0o4H3nVUxwgBwEkwvJX7LU0oWCgMtxHWh7 lu8LyyvjQfVZJMrKtevAux+6oJ7ifxe5sw2Ywf7s3F255kK0LYpmbYRgSNNG+q62RXi0 d0IpIA3cyF7Fs4tZvLAHWUzZlyck36lq5/bHHrsUck3nvietreKs9bmvQEbaipnL7a5I 9psA== X-Gm-Message-State: ABuFfojN3Y6N1Z4A51Ud/guEgTpbTUug4MCB7GIXzlZ3USPgPG/Du6Pw cqx216TAAYriq7N7cBbsY11IAeNKq/dDbrBxsKI= X-Received: by 2002:aed:2de3:: with SMTP id i90-v6mr9194791qtd.229.1539847332291; Thu, 18 Oct 2018 00:22:12 -0700 (PDT) MIME-Version: 1.0 References: <1539755947-27014-1-git-send-email-suganath-prabu.subramani@broadcom.com> <1539755947-27014-2-git-send-email-suganath-prabu.subramani@broadcom.com> In-Reply-To: From: Andy Shevchenko Date: Thu, 18 Oct 2018 10:22:00 +0300 Message-ID: Subject: Re: [v5 1/4] mpt3sas: Separate out mpt3sas_wait_for_ioc_to_operational To: Suganath Prabu Subramani Cc: Bjorn Helgaas , Lukas Wunner , linux-scsi , linux-pci@vger.kernel.org, Linux Kernel Mailing List , Benjamin Herrenschmidt , ruscur@russell.cc, sbobroff@linux.ibm.com, Oliver , Sathya Prakash , Sreekanth Reddy Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 18, 2018 at 10:10 AM Suganath Prabu Subramani wrote: > On Wed, Oct 17, 2018 at 1:49 PM Andy Shevchenko wrote: >> On Wed, Oct 17, 2018 at 11:17 AM Andy Shevchenko >> wrote: >> > I understand this is part of existing code, but can you consider to >> > modify it to something like >> > >> > do { >> > ioc_state = mpt3sas_base_get_iocstate(ioc, 1); >> > if (ioc_state == MPI2_IOC_STATE_OPERATIONAL) >> > break; >> >> Forgot ssleep(1); here. >> >> > ioc_info(ioc, "%s: waiting for operational state(count=%d)\n", >> > __func__, ++wait_state_count); >> > while (timeout--); Just noticed this should be --timeout. >> > if (!timeout) { >> > ioc_err(ioc, "%s: failed due to ioc not operational\n", __func__); >> > return -EFAULT; >> > } >> > Less lines, more understandable in my view. > > Yes, We 'll take this change and resend. -- With Best Regards, Andy Shevchenko