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=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 89A84C433DF for ; Thu, 18 Jun 2020 01:12:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5BAF020EDD for ; Thu, 18 Jun 2020 01:12:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592442765; bh=jCVTeln9hYqBwZrVBsTL/59b9zWrZJ+FeA82jf6YncU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LOQCWEUsXZmAZcd+kclzeDZGZR97IxCNrHmhcRzRbQo/y3dYjRsjRQ112gxjFeAqt ZSNiDfQUClHMWqxiH/eMJn0oux9fEB1bIG8+OJZEiJoGi9lXTop3nImR3jCtbYqRxo Bcr/ND5DOVk6sAw6QI1IHXG9H2hyscx8LOa3VVaI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728975AbgFRBMo (ORCPT ); Wed, 17 Jun 2020 21:12:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:41500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728974AbgFRBMn (ORCPT ); Wed, 17 Jun 2020 21:12:43 -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 E5EB12193E; Thu, 18 Jun 2020 01:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592442763; bh=jCVTeln9hYqBwZrVBsTL/59b9zWrZJ+FeA82jf6YncU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dn2RXfDMyuUFmLAT7EIVX0YgZ81acSCjBFyRs8FGlSE5+UXy/0b1QmluBP9AHuTEt /bLCxeBy1fNpMXbcjwqQGcwmVQgww+xaXHj4znvGfU30iHZTp9HUqcjoWyR6q7/A0A NejvHrkc8hpHuUraL2JgUvgdmXxWSAgZkvYpUieg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Oded Gabbay , Omer Shpigelman , Sasha Levin Subject: [PATCH AUTOSEL 5.7 213/388] habanalabs: increase timeout during reset Date: Wed, 17 Jun 2020 21:05:10 -0400 Message-Id: <20200618010805.600873-213-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618010805.600873-1-sashal@kernel.org> References: <20200618010805.600873-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 31ebcf9458fe..a6dd8e6ca594 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