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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75960C7EE23 for ; Mon, 12 Jun 2023 07:43:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234868AbjFLHnu (ORCPT ); Mon, 12 Jun 2023 03:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235286AbjFLHnp (ORCPT ); Mon, 12 Jun 2023 03:43:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF942173A for ; Mon, 12 Jun 2023 00:43:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D041F61198 for ; Mon, 12 Jun 2023 07:07:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3D08C4339B; Mon, 12 Jun 2023 07:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686553650; bh=hDOdrUVsiFKT4C+s+l6wl40gbyWzeXDJnT7poMSSApc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pG8z54y08n9iVZNcZ7V+mCsrufgHH09ypz7nSPYzAo8ovyjZfeLEdh/X6BuantDiC SUphMaaceRomBO3sV1z2oBeFVwf9iNmpuSYM/ouWj/GOiEZxubaQN1tDTOsZQ0hxKf +aeYbZArhWH4Jxo98DeBSAs+jD/bVILdbrGGt3BMckdwfL7Ydn7LUmNMNyBjNQHmYW alEXJIvkRUMJWjNfBfryK017Z1yv4EpQQRmdGIINZz3VYxrw9/B+JpbAoW/FC2Yvbm cnLs+qp+5yMtPt26byLqRq8PddMengduCW5ps/sxAgKHlVkV/cnuG+VdJCGeyr5RBd iPG4pgCrHuN7w== Date: Mon, 12 Jun 2023 10:07:26 +0300 From: Leon Romanovsky To: Selvin Xavier Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, kashyap.desai@broadcom.com Subject: Re: [PATCH v2 for-next 10/17] RDMA/bnxt_re: handle command completions after driver detect a timedout Message-ID: <20230612070726.GP12152@unreal> References: <1686308514-11996-1-git-send-email-selvin.xavier@broadcom.com> <1686308514-11996-11-git-send-email-selvin.xavier@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1686308514-11996-11-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Fri, Jun 09, 2023 at 04:01:47AM -0700, Selvin Xavier wrote: > From: Kashyap Desai > > If calling context detect command timeout, associated memory stored on > stack will not be valid. If firmware complete the same command later, > this causes incorrect memory access by driver. > > Added is_waiter_alive to handle delayed completion by firmware. > is_waiter_alive is set and reset under command queue lock. > > Signed-off-by: Kashyap Desai > Signed-off-by: Selvin Xavier > --- > drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 59 +++++++++++++++++------------- > drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 1 + > 2 files changed, 34 insertions(+), 26 deletions(-) <...> > /* Non zero means command completed */ This comment is not valid anymore. > - ret = wait_event_timeout(cmdq->waitq, > - !test_bit(cbit, cmdq->cmdq_bitmap), > - msecs_to_jiffies(10000)); > + wait_event_timeout(cmdq->waitq, > + !test_bit(cbit, cmdq->cmdq_bitmap), > + msecs_to_jiffies(10000)); Thanks