From mboxrd@z Thu Jan 1 00:00:00 1970 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 8908C222D73; Thu, 12 Dec 2024 17:41:54 +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=1734025314; cv=none; b=ivSmIeh4V5n6qGrUq3pPLmO1rOfWIHid4JxGEUTtIoV/LBz//sOOplIltwLAlLqzpJ5a2Md+emDpenZzKmElxcLwdshvWmHpQgly3wvDhJdyLspQvauqfjAq6jiAhTer/nLbJmkMBTrlmmkJyV8jShAkLnzFmF9xpqrwkeuUu70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734025314; c=relaxed/simple; bh=UFEiyvnFP4tLwMCfC/rSwx9itOas1DMsiNSax8oXdgE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LeqIJBbIQMKEvnUoJxh+QCPmyXKz502mlB3k1kE0x62XHm3Q7GYyn5o3Wa4e400L1u8AgAv+M7xxcZki6Hw/5ilXmKQbTKtPYfaNX6nuuifKE0fEQYNUQEC3lNOaL7+LnEjQJoQB9p+S8zenrfm56QEwJ5ULysELm4VcANd9Yq4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yDMcMAP9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yDMcMAP9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B58CC4CECE; Thu, 12 Dec 2024 17:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734025314; bh=UFEiyvnFP4tLwMCfC/rSwx9itOas1DMsiNSax8oXdgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yDMcMAP9lRgorE+MBEr0tjLI635piuCvmY2o67cvdSdhpWsUk0ogMFIeHkuP6cjl7 obprs5KdVtyYTy+3JubkuHIpwpj6OWp/sy/d2WVPLQwNsaCZo8UAKIFsl5y/B51AxE KZtw1A5EAaW+9DOw8C5Z9JK6IdcWEWzOKxFKFTJ0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Salam Noureddine , Kalesh AP , Somnath Kotur , Pavan Chebbi , Michal Kubiak , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 128/321] tg3: Set coherent DMA mask bits to 31 for BCM57766 chipsets Date: Thu, 12 Dec 2024 16:00:46 +0100 Message-ID: <20241212144235.031549501@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144229.291682835@linuxfoundation.org> References: <20241212144229.291682835@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pavan Chebbi [ Upstream commit 614f4d166eeeb9bd709b0ad29552f691c0f45776 ] The hardware on Broadcom 1G chipsets have a known limitation where they cannot handle DMA addresses that cross over 4GB. When such an address is encountered, the hardware sets the address overflow error bit in the DMA status register and triggers a reset. However, BCM57766 hardware is setting the overflow bit and triggering a reset in some cases when there is no actual underlying address overflow. The hardware team analyzed the issue and concluded that it is happening when the status block update has an address with higher (b16 to b31) bits as 0xffff following a previous update that had lowest bits as 0xffff. To work around this bug in the BCM57766 hardware, set the coherent dma mask from the current 64b to 31b. This will ensure that upper bits of the status block DMA address are always at most 0x7fff, thus avoiding the improper overflow check described above. This work around is intended for only status block and ring memories and has no effect on TX and RX buffers as they do not require coherent memory. Fixes: 72f2afb8a685 ("[TG3]: Add DMA address workaround") Reported-by: Salam Noureddine Reviewed-by: Kalesh AP Reviewed-by: Somnath Kotur Signed-off-by: Pavan Chebbi Reviewed-by: Michal Kubiak Link: https://patch.msgid.link/20241119055741.147144-1-pavan.chebbi@broadcom.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/tg3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 4847441cf161d..b060e1fe3bab4 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -17815,6 +17815,9 @@ static int tg3_init_one(struct pci_dev *pdev, } else persist_dma_mask = dma_mask = DMA_BIT_MASK(64); + if (tg3_asic_rev(tp) == ASIC_REV_57766) + persist_dma_mask = DMA_BIT_MASK(31); + /* Configure DMA attributes. */ if (dma_mask > DMA_BIT_MASK(32)) { err = pci_set_dma_mask(pdev, dma_mask); -- 2.43.0