Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2114911lqb; Mon, 27 May 2024 08:17:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVitBDzPrXmUKAReMZ1xT5lF9EZhjRPoLaYhoByr068kV3qGqOupKgnL/nKgI6yAWdeP6XgHD7qQMaW+TkeW0I70/AmqtKm8he9qFKiRw== X-Google-Smtp-Source: AGHT+IEmHgUq9ellBqoXAR7JLJBSmRR+U/emeHoGQMIvmPbHcj4lTXmI07f+fKmMREpZpO7dpy59 X-Received: by 2002:ac2:46e9:0:b0:520:5261:9cd0 with SMTP id 2adb3069b0e04-52966ca7a45mr5322412e87.57.1716823063900; Mon, 27 May 2024 08:17:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716823063; cv=pass; d=google.com; s=arc-20160816; b=KcnlKVYJveI6MrX/NOoCeGQpONxlIPmC1GSdCgcZsGlMHCOzrj1JadCHCelJORf3Z2 F4y3adxLRg+3RmQjMeaIijelv/cVyF4V5BJzQMhSTRLzfk6erjsYiJLBstlPhKrMfTt9 SP+r+sUaKQ2BYd3JQoRP3EEz9CDwMLjQ1iQtUORcUlzcvdNtxqxM6OJsjCQ5DIVFCws/ Tks68bIFAMCvsCM2lvBxCu/usXWmkrp0SlA95lllmLaqzU43RNhtzYIgwvZxvZnKI7/n I1HN+n9gAEQWGZDK+3dJ7sSXW5AUtR50G++mggtHe27lYHFvAZEWacfXUAnfaYUjxpwC lkaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bHasxKpgjhxqUmqJ+xEeZn7y3EOnIZVDwC4JTGZWi6E=; fh=Ziao0p0RcFIk1m8NLPwqjsu6vYLfPaffF9PtwEMeyjc=; b=ai0wRM2AbdxAVDSOchn4lRt0KEN5a/w+olQ6sjbVCoN9kSWTQV0y4D8Xcx4zX8Tq4X 8BLBt5B0KNdut5fUhpagWgmhYWAqyAhL2RqUDdVfrtrLLTqjZ8rFIfsdtese+z56IJ2Y ghqMnYolcP+d9l6+qODusADCCIKsSaHh0dwnJ3BNG2kNWkVJzuawdY225R13JkkuJeLt 18ZOnp03OmMWvlowd5lb/8dPftVcSCI8s4KHDWUNvEOLH4M+25DCRxXrTn8xQ8XYxz0p Anx7X5tZBtTjHRwlSNOdFSUfx4brxQXluk5GTnMrXY/rscq/xzGJ/2HGDkczxcwXvC13 ZYow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@habana.ai header.s=default header.b="cURU/Aju"; arc=pass (i=1 spf=pass spfdomain=habana.ai dkim=pass dkdomain=habana.ai dmarc=pass fromdomain=habana.ai); spf=pass (google.com: domain of linux-kernel+bounces-191031-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191031-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=habana.ai Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-578524b4307si4028648a12.532.2024.05.27.08.17.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 08:17:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191031-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@habana.ai header.s=default header.b="cURU/Aju"; arc=pass (i=1 spf=pass spfdomain=habana.ai dkim=pass dkdomain=habana.ai dmarc=pass fromdomain=habana.ai); spf=pass (google.com: domain of linux-kernel+bounces-191031-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191031-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=habana.ai Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 96F3D1F271BB for ; Mon, 27 May 2024 15:17:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59F3116C85D; Mon, 27 May 2024 15:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=habana.ai header.i=@habana.ai header.b="cURU/Aju" Received: from mail02.habana.ai (habanamailrelay02.habana.ai [62.90.112.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC8EC15F3F7 for ; Mon, 27 May 2024 15:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.90.112.121 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716822161; cv=none; b=spk5NDEZdIamU+bWLDw2takrHZETsx+HdMHEPXTOLBknthJZxfDw0MUUEStfYEQnosya52usFM3OkkkU7eJOBWBH6ZiiXXPm7Fki8H6DW1eskG00wPpGRfSh1SW+Gkez/ZLqT+eqPhzKr0QTlheQsfKwvSFl77ow8qPuW/WUbSs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716822161; c=relaxed/simple; bh=mO1wTBrjD0PxLOyQ4AqovbqlEFzmz5ozW7rB391zFZg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lYJT0Qb21ljlbc+0WN2vfaBs/vp6jB/xiuBrgU4s/EEujf7161Jm6VPfI0715/SbS82q7LXZygzvVK8fMaiZYQ4a+yQWZsb5LbemvpcZ5G1cMfQk5mF+ywSmnFb66boq5Mj7dHjcpY8hI+rXETVjrb3Ly8mSRUZJhZDe4/A+usQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=habana.ai; spf=pass smtp.mailfrom=habana.ai; dkim=pass (2048-bit key) header.d=habana.ai header.i=@habana.ai header.b=cURU/Aju; arc=none smtp.client-ip=62.90.112.121 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=habana.ai Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=habana.ai Received: internal info suppressed DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=habana.ai; s=default; t=1716822151; bh=mO1wTBrjD0PxLOyQ4AqovbqlEFzmz5ozW7rB391zFZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cURU/AjuxgUwR+8nWz1e4LtyXs/e1DBcpK1wFmxlXep0ObfgsF5ZvgtPS+d1JnRxA IDCRW/4Q3AqLNCwF8+pE/UIHPPfOy17xNm2u4UmbHubR8HHKn/mLwi24TOgL9ARuY3 SgAxj0YCbgtYPDjAPpVD0+tRVCv5Mwlr//PIZFxz92HZhXJ/E9QzANce44CgngQVa6 n3GgTwg7LvtvysfhUUHW4uv3O/Ke6DreKA38CmDl//SOQWDafxsMm7tE8Dk+I9kQwK a95TKV6v7BESJqVpzvIKI0wBbPga4hVmshbGBnMIQd/H+b+2L1NRqxgzYdbNlfLXb+ SV8Zm+6KAnVaw== Received: from obitton-vm-u22.habana-labs.com (localhost [127.0.0.1]) by obitton-vm-u22.habana-labs.com (8.15.2/8.15.2/Debian-22ubuntu3) with ESMTP id 44RF2PiZ1954007; Mon, 27 May 2024 18:02:26 +0300 From: Ofir Bitton To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Tal Cohen Subject: [PATCH 8/8] accel/habanalabs: disable EQ interrupt after disabling pci Date: Mon, 27 May 2024 18:02:24 +0300 Message-Id: <20240527150224.1953969-8-obitton@habana.ai> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527150224.1953969-1-obitton@habana.ai> References: <20240527150224.1953969-1-obitton@habana.ai> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Tal Cohen When sending disable pci msg towards firmware, there is a possibility that an EQ packet is already pending, disabling EQ interrupt will prevent this from happening. The interrupt will be re-enabled after reset. Signed-off-by: Tal Cohen Reviewed-by: Ofir Bitton --- drivers/accel/habanalabs/common/device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index 5ca7014def00..78e65c6b76a7 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -1502,10 +1502,11 @@ static void send_disable_pci_access(struct hl_device *hdev, u32 flags) if (hl_fw_send_pci_access_msg(hdev, CPUCP_PACKET_DISABLE_PCI_ACCESS, 0x0)) return; - /* verify that last EQs are handled before disabled is set */ + /* disable_irq also generates sync irq, this verifies that last EQs are handled + * before disabled is set. The IRQ will be enabled again in request_irq call. + */ if (hdev->cpu_queues_enable) - synchronize_irq(pci_irq_vector(hdev->pdev, - hdev->asic_prop.eq_interrupt_id)); + disable_irq(pci_irq_vector(hdev->pdev, hdev->asic_prop.eq_interrupt_id)); } } -- 2.34.1