Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp220355lqt; Thu, 6 Jun 2024 01:15:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqAyzFE3DQt8xKPzgbkzRAlmzlZBSb1VW9LKfM/V50IMDcMeYWDOB8CSVsWD7HxxfE3oyglEVXuj2sTxE51Xgt5zW9e718BOvA6AJ1MA== X-Google-Smtp-Source: AGHT+IFGvV6nhp4rI2pMf9BooVrtn1LiCTrzBE5xmelVhlTLY/ybxNE9boKvdqYGKLqWt0ZisOYU X-Received: by 2002:a05:6a20:2588:b0:1b1:d402:a93d with SMTP id adf61e73a8af0-1b2b6f948d2mr5581966637.19.1717661739421; Thu, 06 Jun 2024 01:15:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717661739; cv=pass; d=google.com; s=arc-20160816; b=XMGLPm7ezJkR61Zg+Qw/M5psF5Fe/9VXq0+zCqk4WMIb8ZIYL8NW/oKFT6KAiS+b4M 9U94SxGakXp5ZSXUGtCe3oQBM3iJ9wFxl0EOUIiSmfUyKbDIWi6ya/oabazgA3T3egpm j4MQl0TfUme/QPcCfgfJ7iEap/aIyjUr7cYUzTX/Gk4tHVVUNTpaxy+TvK12620s7+AF q1aCZZc5luVr8R1J2nn+4wbQ34u5apFzH8Cx3YQp23TzbbMu9z5Lc/2vWixfB8xhT/p2 QxKOmA2EXVs6bOlIMhu/ry73IQsaZ7ARG3z3wV7qM1SotGXHQhDQq4BCxJPRR4YMlzwL 8RBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=2DGnNvf3KWKHUjD4JxTptYTdQaOnZmVliuD5nphPVGw=; fh=H4JO4DPqAe/pa0ytw7bRzzJ8Nlob1XnYqf6KbB5/uQw=; b=OPM0NOJxUqpKI22vu7Go3LkgBRSmTKG3L4yzbBe7I+MFQHmkKWoIeh4sDs7seX91u4 OHnG5yKI3OLvSqt+eKNDswkvoAO0ieGS0WocbT2WKyBb3DnjuhAY9skbcKEOxuGvfz1w mRRn1ZOw2rrDO9gbV5705IkS81hWE42KD52TJdrQ2N/urbQa25SMUakRxQzUVJaPbUmj AUOoi6gL70udlLDXlm3pJCMP5SSFyakd1j3sI5fe2eIUeH3tJWqVP/owPleP6k14MVCb dgC+WcMHyYFD+c4ugB1IfNeoRLlyiR1AJ2R4e61KPpo7XhVQ38TiHM0AuopEvnz/R5FT sBCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q70jBlpJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203810-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd4c7365si723000b3a.211.2024.06.06.01.15.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 01:15:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203810-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q70jBlpJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203810-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 06E642830AA for ; Thu, 6 Jun 2024 08:15:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB98213A27D; Thu, 6 Jun 2024 08:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="q70jBlpJ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F19765C96; Thu, 6 Jun 2024 08:15:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717661734; cv=none; b=mBZBdHOyEP/v4JlUYBZciD2Pcc/v7bKw4LYgFVmsxX7i/BdrPF1hYWeaJIfPQN3+OfVsC4ADCdkYxcFlIG04o8LkMbje1nsMRHGKQMt35uotXhXu1C2LqS2Q7BAfQSG8DA02o2+PwErofajwqR17qVYbPhbRfu3p9v93QiawH20= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717661734; c=relaxed/simple; bh=qqQC4N4qM8SKjgtTHvaS/WXpl4ugfRenh7/dnBWZlIk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=BqSS4zcnaz1HQzI4zwdAuyCjyFwxRWJvuxIb0K6Tw27mkxwCBT9Xz6c/7xKdD8wHiERzP0ojWN/Kc/OGWIUvBusPq5caN4o7mG8Ip2lSZGAbem1Tyuj5SNY6cL/3W/I9npQKiwlkIVzgcdcJnCgMvpZFCdJpqZgjgdXY2Bv528A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q70jBlpJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 73914C4AF0C; Thu, 6 Jun 2024 08:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717661733; bh=qqQC4N4qM8SKjgtTHvaS/WXpl4ugfRenh7/dnBWZlIk=; h=From:Date:Subject:To:Cc:Reply-To:From; b=q70jBlpJMTgvIkjQdk1GFBLrKer1dglrqH9+8vDT9bfhTmSc3ggNXgD5doySKpYJ3 tEwWRyrpb24i0uMClBJeig7DiI6EP5J2lm1oDE6HegJl+ICCPmSs+hMICjy7kep6Xs ZWvcyjdKCfuafPAnw8Z3TNZQ1LDejA2PW3XROyMHJgvWuzvsQkZEOUPZwMmzM+pX8f iC3d4fiX0kToJ0OMcjbJTQqzglTkbZuRIhTxEbxLwB6SWWui/XHfy3ErnlJb7nKhDC rri1YMWdZNABHZJB/N27NbYwRcfn93nzGmq573TmqUmocdY1hGUk3a2V7BPozIeTsD Q75ZGkCD6gtoA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 591EAC25B75; Thu, 6 Jun 2024 08:15:33 +0000 (UTC) From: Nikita Shubin via B4 Relay Date: Thu, 06 Jun 2024 11:15:19 +0300 Subject: [PATCH] ntb: intel: Fix using link status DB's Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240606-ntb_intel_db_fix-v1-1-ba9033aea289@yadro.com> X-B4-Tracking: v=1; b=H4sIABZwYWYC/x2MWwqAIBAAryL7nWAWUl0lQnystRAWKhFEd0/6n IGZBzImwgwTeyDhRZmOWKFtGLjNxBU5+cogheyFEorHYjXFgrv2Vge6ueiUHMdgrOsHqNmZsOp /OS/v+wE9gs7NYgAAAA== To: Dave Jiang , Jon Mason , Allen Hubbe Cc: Nikita Shubin , ntb@lists.linux.dev, linux-kernel@vger.kernel.org, linux@yadro.com, Nikita Shubin X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717661730; l=1211; i=n.shubin@yadro.com; s=20230718; h=from:subject:message-id; bh=m6Ej8L6+xmXOl3RZbV82ktzzdYahkk4scP8S6bypgnI=; b=+HlydAPVVu4+ZMywh4SWhA+S6XYV8sVahCZZ6LzcQ8yNPDKz7VT9FpR+U826CFRkkiBi9zeM3ILx tuiY46THD8IhJfZQ3NGDixQ4ib+QBUIj5WD61znSyHouI32j9RiA X-Developer-Key: i=n.shubin@yadro.com; a=ed25519; pk=vqf5YIUJ7BJv3EJFaNNxWZgGuMgDH6rwufTLflwU9ac= X-Endpoint-Received: by B4 Relay for n.shubin@yadro.com/20230718 with auth_id=161 X-Original-From: Nikita Shubin Reply-To: n.shubin@yadro.com From: Nikita Shubin Make sure we are not using DB's which were remapped for link status. Fixes: f6e51c354b60 ("ntb: intel: split out the gen3 code") Signed-off-by: Nikita Shubin --- Hello Dave, sending a patch as planned. Thank you for looking into this! Link: https://lore.kernel.org/all/686c55cc658564e8f37147e0d6d5ab62bb8372af.camel@maquefel.me/ --- drivers/ntb/hw/intel/ntb_hw_gen3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/ntb/hw/intel/ntb_hw_gen3.c b/drivers/ntb/hw/intel/ntb_hw_gen3.c index ffcfc3e02c35..a5aa96a31f4a 100644 --- a/drivers/ntb/hw/intel/ntb_hw_gen3.c +++ b/drivers/ntb/hw/intel/ntb_hw_gen3.c @@ -215,6 +215,9 @@ static int gen3_init_ntb(struct intel_ntb_dev *ndev) } ndev->db_valid_mask = BIT_ULL(ndev->db_count) - 1; + /* Make sure we are not using DB's used for link status */ + if (ndev->hwerr_flags & NTB_HWERR_MSIX_VECTOR32_BAD) + ndev->db_valid_mask &= ~ndev->db_link_mask; ndev->reg->db_iowrite(ndev->db_valid_mask, ndev->self_mmio + --- base-commit: 2df0193e62cf887f373995fb8a91068562784adc change-id: 20240606-ntb_intel_db_fix-036299fabc48 Best regards, -- Nikita Shubin