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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 EC6CFC433DF for ; Thu, 18 Jun 2020 02:17:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE4CF20885 for ; Thu, 18 Jun 2020 02:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592446652; bh=7M6z7fs61XZxQuQan2QJTeDa90sui9RkFFPu1DKBAzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QJFanjpOCImlzcrrFL9bUEEMYmqZsaUagRqBQgmaPEFQu9dLeicRePSM7BkJdp9Av Y8QK/zwlbd0eDVEp5K9cjg+qXNwDFZv6uqLqepKTVhCGK4jogY5oD2Kr0zW8P6TX63 pKpNcpqExnyDfC/c1cDtWRHtKWaqH5uF8xp9t/Pc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729607AbgFRBT4 (ORCPT ); Wed, 17 Jun 2020 21:19:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:51774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730203AbgFRBTv (ORCPT ); Wed, 17 Jun 2020 21:19:51 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 47534221F3; Thu, 18 Jun 2020 01:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592443186; bh=7M6z7fs61XZxQuQan2QJTeDa90sui9RkFFPu1DKBAzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m/ZK264UmK+/dBsWKwD7vUwdd8lY3xg8mpBUlRsvM1WzDjrWx66wO6V8F5a1wBlKs 63JwyYv9ifXQ8i5hFPqUBIex+fFnOGgZE051J6D2+9V8JUvviKq0hZL8gvmAalgnIu Ms8sXEZwQOAw6mHbZdoVhhEHcZMnuaKBvvvnMTl0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Oded Gabbay , Omer Shpigelman , Sasha Levin Subject: [PATCH AUTOSEL 5.4 148/266] habanalabs: increase timeout during reset Date: Wed, 17 Jun 2020 21:14:33 -0400 Message-Id: <20200618011631.604574-148-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618011631.604574-1-sashal@kernel.org> References: <20200618011631.604574-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Oded Gabbay [ Upstream commit 7a65ee046b2238e053f6ebb610e1a082cfc49490 ] When doing training, the DL framework (e.g. tensorflow) performs hundreds of thousands of memory allocations and mappings. In case the driver needs to perform hard-reset during training, the driver kills the application and unmaps all those memory allocations. Unfortunately, because of that large amount of mappings, the driver isn't able to do that in the current timeout (5 seconds). Therefore, increase the timeout significantly to 30 seconds to avoid situation where the driver resets the device with active mappings, which sometime can cause a kernel bug. BTW, it doesn't mean we will spend all the 30 seconds because the reset thread checks every one second if the unmap operation is done. Reviewed-by: Omer Shpigelman Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin --- drivers/misc/habanalabs/habanalabs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/habanalabs/habanalabs.h b/drivers/misc/habanalabs/habanalabs.h index 75862be53c60..30addffd76f5 100644 --- a/drivers/misc/habanalabs/habanalabs.h +++ b/drivers/misc/habanalabs/habanalabs.h @@ -23,7 +23,7 @@ #define HL_MMAP_CB_MASK (0x8000000000000000ull >> PAGE_SHIFT) -#define HL_PENDING_RESET_PER_SEC 5 +#define HL_PENDING_RESET_PER_SEC 30 #define HL_DEVICE_TIMEOUT_USEC 1000000 /* 1 s */ -- 2.25.1