Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1602647rdb; Wed, 24 Jan 2024 23:56:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVIuVihQb+ncT50HH2TSpqJQCYZF4DLr9MBaDcKIW9OEwbChhACkH0uiN9703sVA/G0ExJ X-Received: by 2002:a17:902:c3c5:b0:1d7:83e4:a30 with SMTP id j5-20020a170902c3c500b001d783e40a30mr609794plj.14.1706169397113; Wed, 24 Jan 2024 23:56:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706169397; cv=pass; d=google.com; s=arc-20160816; b=uHxv3HMSTTlunVNlR9l3N/USglJMCvbMUxMUs242b2pfz5BVsmItdMBf1KHlZ9DKu9 X261rKSofeI/AB2/1MkwT/nVk70dQSSIdXWVYAYwO+jy6GJqaemZJz4g6HPpLZl8p/Z0 Am89Eh/lITy3BRuSiYuX2iaWXs052cecMb2LePPvKC18qhS05vGuD2buz2JSvA2QygAA k41sKYQoa5qtkRz9bGnd7ux9pgabsnMiZ7zeFQmyb8It4cBgYv5/B4wKhhdzmxsAN7fR etJvwqc0sH8jjW35vvXj2ryu+U53CHkCLGPMAhNfxkLi7meVsINfUCodlsTs1UUnJZUN F7tg== 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=ULZWJuGhnF2ea/LfwNYqAmDKmEW5+K3JBKr5JNF7TY4=; fh=8obW4vdhdrU7+yMfC0j4YWeUtttLawy54ZEx++dwukc=; b=QMXtJuxI9WEC3BWHhacsmyaWS/r4RCjwFjgOGfrzC+vlZSA3ljS6DEzaDeDiRoT6z6 mfF242JetBqaFzXz9jCVJGQP9chR/Us/T+IXho1RrTiJMXLWzGfGtwCGF5Jar7iBz+CW e5S2tfsanKrG5JNlOKSxlXBqGb1qZkEyDuW6H2MIiLGOm14imcbsOVD8KuQXYU47JqhY W/1Ws4rGjU43YG05J+1CIoEA7d5yel8DsuoEg/ccucfL+iwWjmntssuXNlNFotnGpKZG HM24aqwtlhpxWUFEf0y2nxy+YA+M8aSjgGtAv8j/Uur6nc6kL+fskyZwtQo7MzCezsv5 Wcmg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=thOYhABM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38113-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38113-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x15-20020a170902820f00b001d726c0bd3bsi9867966pln.315.2024.01.24.23.56.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 23:56:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38113-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=thOYhABM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38113-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38113-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 841F528A7D3 for ; Thu, 25 Jan 2024 07:56:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84D70171C9; Thu, 25 Jan 2024 07:56:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="thOYhABM" 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 A8C6F13AC4; Thu, 25 Jan 2024 07:56:10 +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=1706169370; cv=none; b=DHiRmaVSXxbA3ywH7G0tTlD7ir46o/LDUkYDKwgz3Z9lY9sVX1CPG6NNUayAseAYmvN+8rfLcJoKTbR4XJqasAk4k+c/QpKUiEg3bszouR9uyEBPJZuQFwBA6nvcQZrR6o37d0QjFESdD53sxK0xI/vrUiO/Ey8UhvVwqosFEqE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706169370; c=relaxed/simple; bh=oGEnZLNs2ln1J2d3RRX097XSFJtdFzD/XrDgWH8hjdQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uvkUL8J/zJwUToOSP8Ra9SPG0UVgR6SUKZNlDg3POb8ogopRG9mRf3CPQvifTO01zldOv0jppfWCyyQI4bh4E0MRf9T9IPNawtcsnDNbHUqbSllqKzHXHOAQ7Yx9cOW4hPMpzEJv4SyuH2ZivsA1MGt3eX515LTmloBX8MnoLdg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=thOYhABM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38ABEC433F1; Thu, 25 Jan 2024 07:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706169370; bh=oGEnZLNs2ln1J2d3RRX097XSFJtdFzD/XrDgWH8hjdQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=thOYhABMOeY+9IP7f2oUSgkMLUYNSAl+xPZqTZtkEiMlDnqabS/2mNNZKNzSpr3i4 akQpx8sDx2/gkp2Fayhc0KNISBf0voNvqAy71rpYfxTYzekkPyL9yb3uyUn5e4/HwR V4LNNzDK+FxSXaejQIc5CSJTM4T9Q+Vwg/J+MpuQsKP+AOh86SE5FPAU4dtbxdsG6b bjwzxqOT/jvKofSgqp0OEHr4qMU2UAPz1HkSQPKJVtZQ/fehZfGQXoDC1YESZ4c/+p k1qOJ61RXzTMegtvSNNl3QtJ28zPkxe7kscJmBOmXfztNlVIDW1RInYCa7nk2JCbqj us+TfKVlu9ekQ== Date: Thu, 25 Jan 2024 08:56:01 +0100 From: Niklas Cassel To: Dan Carpenter Cc: 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 v4 2/2] PCI: dwc: Cleanup in dw_pcie_ep_raise_msi_irq() Message-ID: References: <888c23ff-1ee4-4795-8c24-7631c6c37da6@moroto.mountain> <64ef42f0-5618-40fd-b715-0d412121045c@moroto.mountain> 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: <64ef42f0-5618-40fd-b715-0d412121045c@moroto.mountain> On Wed, Jan 24, 2024 at 06:03:51PM +0300, Dan Carpenter wrote: > I recently changed the alignment code in dw_pcie_ep_raise_msix_irq(). > The code in dw_pcie_ep_raise_msi_irq() is similar so update it to match > as well, just for consistency. (No effect on runtime, just a cleanup). > > Signed-off-by: Dan Carpenter > --- > v4: style improvements > v3: use ALIGN_DOWN() > v2: new patch > > drivers/pci/controller/dwc/pcie-designware-ep.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c > index 51679c6702cf..d2de41f02a77 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-ep.c > +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c > @@ -482,9 +482,10 @@ int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no, > reg = ep_func->msi_cap + PCI_MSI_DATA_32; > msg_data = dw_pcie_ep_readw_dbi(ep, func_no, reg); > } > - aligned_offset = msg_addr_lower & (epc->mem->window.page_size - 1); > - msg_addr = ((u64)msg_addr_upper) << 32 | > - (msg_addr_lower & ~aligned_offset); > + msg_addr = ((u64)msg_addr_upper) << 32 | msg_addr_lower; > + > + aligned_offset = msg_addr & (epc->mem->window.page_size - 1); > + 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 > Reviewed-by: Niklas Cassel (Feel free to keep my R-b tags even if you send out a new version with the #include requested by Ilpo.)