From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net 1/4] qed: Wait for ready indication before rereading the shmem Date: Sun, 19 Aug 2018 11:10:53 -0700 (PDT) Message-ID: <20180819.111053.432633844805546559.davem@davemloft.net> References: <1534701487-25778-1-git-send-email-Tomer.Tayar@cavium.com> <1534701487-25778-2-git-send-email-Tomer.Tayar@cavium.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, Ariel.Elior@cavium.com To: Tomer.Tayar@cavium.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:33660 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbeHSVXN (ORCPT ); Sun, 19 Aug 2018 17:23:13 -0400 In-Reply-To: <1534701487-25778-2-git-send-email-Tomer.Tayar@cavium.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Tomer Tayar Date: Sun, 19 Aug 2018 20:58:04 +0300 > + while (!p_info->mfw_mb_length && cnt--) { > + msleep(msec); > + p_info->mfw_mb_length = > + (u16)qed_rd(p_hwfn, p_ptt, > + p_info->mfw_mb_addr + > + offsetof(struct public_mfw_mb, sup_msgs)); > + } > + > + if (!cnt) { Because you use postdecrement on 'cnt', the loop will timeout with 'cnt' equal to '-1' not zero. You need to fix this.