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 CCEC94B5D9 for ; Mon, 19 Feb 2024 18:41:09 +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=1708368069; cv=none; b=NJmdBU1+SygwHYQUJW8Qywd6p4YP+Tpj6bKWdrLBtmgfwFpMvt0jEMWmWh+gWkLD9XzM6YD9DRPVQ+PB27W68+i317pEhtrIQcM9LimzCgjgdwyFxvZ6xs8/ypyEiIfXVzQquFU/oK7hQK3JOR/mXHslWzxFhBEmBhH874koeDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708368069; c=relaxed/simple; bh=5gHIpv1mHO4FhHZ+ISmD6k8/o4tgatWL7eDt8/5II0s=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=X4ayrYzDG2XdrH05L6nS4V9O12UYf3hKJgOqXGBFFdWgtpFvD4z57uTUnYCjAhvIYvBvXLw383PPkJ8k0o3dchS3B+gIvz1YRfdZjnobdDzTkXBnS7m22v12j9iMY7XuujrR+bI6/Uc1Oi3PqzUBoiHl8UZpvh8OLnwz6gsS3qY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Nf5jrOjz; 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="Nf5jrOjz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46DA3C433C7; Mon, 19 Feb 2024 18:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708368069; bh=5gHIpv1mHO4FhHZ+ISmD6k8/o4tgatWL7eDt8/5II0s=; h=Subject:To:Cc:From:Date:From; b=Nf5jrOjz1jfNguyFnH7LtQJtRnzFsE3V7BFC8phm2+M5Hr12qDf4tlHbHq6sIAFr8 2HnKfMLdvmfz9cWwk0ObT4BE9HMxAkj6M2dHJmZPz9O6WApeGLz9cZzyUVsEMRivHu dog0KZEGlDdajUa6hxrwhfTtXUakOgoW6qCXO3MU= Subject: FAILED: patch "[PATCH] PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq()" failed to apply to 6.6-stable tree To: dan.carpenter@linaro.org,bhelgaas@google.com,cassel@kernel.org,ilpo.jarvinen@linux.intel.com,manivannan.sadhasivam@linaro.org,stable@vger.kernel.org Cc: From: Date: Mon, 19 Feb 2024 19:40:45 +0100 Message-ID: <2024021945-droplet-overbid-1f08@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x b5d1b4b46f856da1473c7ba9a5cdfcb55c9b2478 # git commit -s git send-email --to '' --in-reply-to '2024021945-droplet-overbid-1f08@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: b5d1b4b46f85 ("PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq()") 2217fffcd63f ("PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support") 92af77ca26f7 ("PCI: dwc: Use FIELD_GET/PREP()") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From b5d1b4b46f856da1473c7ba9a5cdfcb55c9b2478 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 26 Jan 2024 11:40:37 +0300 Subject: [PATCH] PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "msg_addr" variable is u64. However, the "aligned_offset" is an unsigned int. This means that when the code does: msg_addr &= ~aligned_offset; it will unintentionally zero out the high 32 bits. Use ALIGN_DOWN() to do the alignment instead. Fixes: 2217fffcd63f ("PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support") Link: https://lore.kernel.org/r/af59c7ad-ab93-40f7-ad4a-7ac0b14d37f5@moroto.mountain Signed-off-by: Dan Carpenter Signed-off-by: Bjorn Helgaas Reviewed-by: Niklas Cassel Reviewed-by: Ilpo Järvinen Reviewed-by: Manivannan Sadhasivam Cc: diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 5befed2dc02b..d6b66597101e 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -6,6 +6,7 @@ * Author: Kishon Vijay Abraham I */ +#include #include #include #include @@ -551,7 +552,7 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no, } aligned_offset = msg_addr & (epc->mem->window.page_size - 1); - msg_addr &= ~aligned_offset; + msg_addr = ALIGN_DOWN(msg_addr, epc->mem->window.page_size); ret = dw_pcie_ep_map_addr(epc, func_no, 0, ep->msi_mem_phys, msg_addr, epc->mem->window.page_size); if (ret)