Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp78678rdb; Mon, 22 Jan 2024 12:31:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHW1jDdQU+SesYvEVpbFezd4lCsqoOPiSE06wniQPF8jSaeLr3vwdzwT6B3QugS1Q2rgM/2 X-Received: by 2002:a17:90a:be10:b0:290:855f:950b with SMTP id a16-20020a17090abe1000b00290855f950bmr3742979pjs.13.1705955507674; Mon, 22 Jan 2024 12:31:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705955507; cv=pass; d=google.com; s=arc-20160816; b=I2mcxh9GUPqvmwPpAV1WMf3z6ecq6qW1RqzVGLthDFE9zfbazzAQcFDvOYpluJlmK/ 655Uw9RkMCoBcC24/6eorgI67KHGyqxUnjP2d17Q0AKVU5AJd4Nq8K81zAeYMul/Z5F7 WLgQ4MqO0hvsEKHSpzVjnE8XhgtQ3XsU/qcdNhZ3QUkViGTfcL63Dm2VxL+oJJ4eGs8m bvpyEguV5tHz8NXPh05ZkisoUP6tbf+dAQ5xUn69j6d8zONqzQHzQqOnvASJZpUplqxt zt9dYWXg53xyeC0ungzZyXmzv1Md3iGJznHKIKNoZfbAp3lPb0B8Bu8WL0LCeNx5ARxA efkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=e71jhF+JauQ+6TZTpvGaql3y7BsTmUFD9rTpMAYih40=; fh=oIdHDxTa4cUHteVnfd+edSLY3cKj/fvbZd8tH32asIA=; b=yUBSohCRn6SKfIGYAmmIcRkbV8pwapJR/cqkXJCZcqQTvJ1KRuBP3Y1HiMNpRLznFq juH/CJEBZBr6WsntcCWQ9jn63fmyTmhf62jWVXiWJ6eaEDnAJVTyqwXU6IHGjllbp2r5 gcfWMcI3xpdshnROpw/5SVuig3crnHfHEOg4pbWw92R2QfJgDqAVJ9iLcsCvLM7EiDeA MNuS5PPNtzOd9OYAT4HnyLr5oGMfiCYSnxlXhK29Rrb4e1+Zdc9IlOEUovMjLQMmuVil VKfBji5Js5YIPL22I03umMKuU37FpbgfUggwec4l6TjiOIyI/2YpXphGxTFFl4K7qHnV vRZg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VEmMchw9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-34115-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34115-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 o3-20020a63e343000000b005ced5c08ff1si8450962pgj.113.2024.01.22.12.31.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 12:31:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34115-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=VEmMchw9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-34115-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34115-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 C363A290ED5 for ; Mon, 22 Jan 2024 20:30:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23A534779D; Mon, 22 Jan 2024 20:29:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VEmMchw9" 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 48B5847A74; Mon, 22 Jan 2024 20:29:52 +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=1705955392; cv=none; b=ZCe+t+StRvAyuONsNytGa9/H8Jmr+2fMI0m4J7+VLbK9dlj7WalVaciHTJ+FEzkNPPybRnvGHU90W6/2CU3x8FtmdQ0sysDsA1QnaCH9+YVDKV0Gyas1DNXPFLnaTQ1neLWf+jog3vF0Lx1+lBkqa2bhN0GgFuXNBzdEE+SJ/eQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705955392; c=relaxed/simple; bh=Y3EXBEoU3EZ5ZxGkaPVnRGmzkLJq9ZuinS9YeAT7Mic=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cDpIvJR1h1U98uvvM00bQsOSW3reB+FE9RERk3/LFwhDE+Mxm+TV1uZL4fyCwReZPJFpVu8QacQH/NjS+3ix7DZcfESeFvCzyD8ItmUVzJdMSxcA5ds+cNGtGeOJ1099YKGxtV2/ZjwzF/BRVcrMJ9HwKzTKKtyral5RJi2aCxY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VEmMchw9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3A95C433C7; Mon, 22 Jan 2024 20:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705955392; bh=Y3EXBEoU3EZ5ZxGkaPVnRGmzkLJq9ZuinS9YeAT7Mic=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VEmMchw9gV9k72seBZMorakDsZ/Zb6H26fE9aXHqJ2xFoX1Fq3gBFToRBhCniqT4/ EiWahqeUVyo5s6YuQ/Dnt7ivt+PxDNQgtYb5KXheBtaq5Dd/+N1Jgd+GLdKRYsSAvd za3iKKjrSSCnhiFuJvz5dTp9/VqqN/MK+ik0q6wMl2iZLOkipVqPwl5in9GHzKwC0M e0TPOhexIydLbLMcctK9q8CyvNf91IWylUWTLOIs33YR9qj9rIF3G3PZDCAFy7EaOF PYuTFiaSgY0PZrBR31Cz3kd4zfjIzo7kKwXUdtJLFDxmbGv7TMQ61CxU2GX4TVzeDt o22UIQpqoD0Nw== Date: Mon, 22 Jan 2024 21:29:44 +0100 From: Niklas Cassel To: Dan Carpenter Cc: Niklas Cassel , Jingoo Han , Gustavo Pimentel , Manivannan Sadhasivam , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v3 1/2] PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq() Message-ID: References: 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=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Jan 22, 2024 at 06:19:52PM +0300, Dan Carpenter wrote: > 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") > Signed-off-by: Dan Carpenter > --- > v2: fix typo in commit message > v3: Use ALIGN_DOWN() instead of ANDing with ~aligned_offset (this is a > style improvement). > > drivers/pci/controller/dwc/pcie-designware-ep.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c > index 5befed2dc02b..51679c6702cf 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-ep.c > +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c > @@ -551,7 +551,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) > -- > 2.43.0 > Oh.. I just got emails that the patch that this fixes has been backported, so perhaps we should add: Cc: stable@vger.kernel.org as well...? Kind regards, Niklas