Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1174822rdb; Wed, 24 Jan 2024 07:06:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHGGLJBmVhd2QEYW7BBCMsAAXNVktJ+pItex7N/Cu4yuP9vttdkvW98NcsAH85NUzXzh+fg X-Received: by 2002:a17:902:ba84:b0:1d7:49e3:4664 with SMTP id k4-20020a170902ba8400b001d749e34664mr913450pls.100.1706108817358; Wed, 24 Jan 2024 07:06:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706108817; cv=pass; d=google.com; s=arc-20160816; b=FAKcWi3OY9dpgwQQvyHukO1ILoHP26YOAAxQVqS1dnhhbpkTXnDmAdHDs8qoAc/DwE RlpRftBWlHw2YZAeRky0XYKnGyEGxoy23k14FuWW2GJFks7pM0RbCDkuSgHrWJ9oNufe BwPhqWaFG68+kUVkKvpTorERlmTz/+Grp1YfnxrqAF5Lj6s7fE8YDNp3ug91ovguDbUl h3K5FJBeIvDd8m92ZoGyyV7w9Fv7xTesNa58qIIJFMbs2bC/Yz0cBuW4qVgrXQpKbXPD dKJbrRYjLOlfJU3WvPZzg2V+plycZJ6Lo1et0Z3TaKTJvrydl4zqCSpFeNY1ATu62deM O72Q== 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:message-id:subject:cc:to:from :date:dkim-signature; bh=VlaR5UjpyG5Q22l5wBG4NSdMskPDkfH7d0hZ/q3K1b0=; fh=eXzY3uCod0uoUhoSFH26hwNyKgz3imtHgoKrWTV58bE=; b=rCnwFxcqyTnMSELCQgIzT8tEu4295O3xOkFVRNipK8D6b25YanHKlCdJPwwkwGy6bz v/G37oJsz3tQKvsKKdXorkMFp2NZEOgA6kOT5yx7RNfbB8PlMTYG8Mnm9iLkFkvRhvVT ZrkxBW89KkT1Eymh1iyC2l7c81Go56r8UYSa5cUXk1HQpRSxPJkyuG+B6b6fGcIIitGm ggNotZy6sXculfJfcVi5beG1Guq17SL+UzPB2KtabHZKwbXdR9L0lao/VK75afq8cqB0 enuMuvTBTyOkTUt657h9W0qH58RsI3OTA9D5hjO26TkgxpE2WBmg4hS/OqUhZYZweWKW q+og== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Pf6e+/lA"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-37218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37218-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 z16-20020a170903019000b001d3e4207386si11834522plg.317.2024.01.24.07.06.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 07:06:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37218-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=@linaro.org header.s=google header.b="Pf6e+/lA"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-37218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37218-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 BFBA029AFEC for ; Wed, 24 Jan 2024 15:04:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA3EB54654; Wed, 24 Jan 2024 15:03:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Pf6e+/lA" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 690AB18624 for ; Wed, 24 Jan 2024 15:03:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706108637; cv=none; b=u3oU0H5TSge5fNM7Ks6rj9+WDq0JYIEW9ovgyhIIq9s0tj70Ir4+GyYBulWLlbqCNkEl4BDGtIi+AfShVTtHp0RrZBoo1GvmQNC3EtWjlypD1MuTsJQrA2ugjEMauHJ4K2bSbbcJ3x2mj37M1EtDJdiw3qKq9d2HycvowPhO19s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706108637; c=relaxed/simple; bh=T/pn351JESsRmM/aRPuZIGT3H4X/z2umZFJ27SQOtmM=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=QfKiFeRFC4ju4eeSmcQYC4UFHDJ4nAocg9233BGa3Ch+sgU7pi2QjCqU+vHqQQuUkcJ1hMut45ATON9ia3m/gY4I2fdJgZBT3QmbbpEGq772rP95w4VxYgQTQXoHL68YZrH1ej+I2Ut7+6QfaLmNPqJNL6PFNBpsVjZop2JiBhU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Pf6e+/lA; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40e9101b5f9so61465455e9.3 for ; Wed, 24 Jan 2024 07:03:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706108635; x=1706713435; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VlaR5UjpyG5Q22l5wBG4NSdMskPDkfH7d0hZ/q3K1b0=; b=Pf6e+/lAMoKPiAFz/fjTwAzAEOBeXmpzGuwQwb/M7m67wgWiZx+bn0IYip4CLyxFsP m6ZyFPZiQKxbOWFi+1ECBCzUgFyyMZmFNt8GYm/ftZbNeoDRZMqel2fpxy/9llpmkBRS lvVxM4T6Qp3IhSIy94H21WOF5Sosc2I+2kg99C5RcOlgRFAP1DpFxR0IbhfNrRhnt61o 3796hbD779jgNbpGLo9lASUT5TNGySAxEwuM2HD/fZK+Yo2xJzacXn/YHdk7b7KiZddz XwJLUAvYiml6DpuhPxpBZMAEj1uvz+CJJSPV0jdudh+NGdKPGYcBCdfKvQmpoBWHAQpD hcKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706108635; x=1706713435; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VlaR5UjpyG5Q22l5wBG4NSdMskPDkfH7d0hZ/q3K1b0=; b=fLf/6FNtV7lAweQovM9zaeVM7OgD8chIuXGgEFkHwTyCteTjervw6WiELfdlKvhxor KnV4WYuQi7nSXbU5A2vnyRDLsHuAxD8hlfXvnDSlXIPh5wLzaOtjQ3r/MJtpXx1lqUFg Riyx21F7FQ32+ztCG/WySd5vxbSrrKdNiLJ1GsgpVbpkCsE8JEMe8T52wszXMhuKB1Wi IJ0vlwdhblvyec7mK2/vQfjW4jatZBIT+/iYV86jsmSD8tkP3W0Ppv91mdkc8tN3JDxS f24KR4VGmf1SotDDlC7V/BDp3vXD4tbGBhJxIMnGVNbNlcNzUEQrhoB+EWgSQZ/HBCGr 9NuQ== X-Gm-Message-State: AOJu0YzRyFcPcjabQ4Yoob5c4EVHPtkILAw1L/fMELzAESVEUObMz8u4 ZIZgEDMmFy9ZjIcyT69D3LinYZSVBrk15WcMteHS6s+m6cCQhxCEaEkMfnJ3vBA= X-Received: by 2002:a05:600c:1d04:b0:40e:c337:fbe6 with SMTP id l4-20020a05600c1d0400b0040ec337fbe6mr1131335wms.106.1706108634709; Wed, 24 Jan 2024 07:03:54 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id f7-20020adff8c7000000b0033921c383b2sm13626449wrq.67.2024.01.24.07.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 07:03:54 -0800 (PST) Date: Wed, 24 Jan 2024 18:03:51 +0300 From: Dan Carpenter To: Jingoo Han Cc: 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: [PATCH v4 2/2] PCI: dwc: Cleanup in dw_pcie_ep_raise_msi_irq() Message-ID: <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: <888c23ff-1ee4-4795-8c24-7631c6c37da6@moroto.mountain> X-Mailer: git-send-email haha only kidding 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