Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp263354rdb; Fri, 5 Jan 2024 09:02:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IEulKleTUWAs4Z+W0OckIDt+DkSaSQEZ3RJrIldUr3tLfMKURPUH8Hkf/ro8bkZi4/qxhH5 X-Received: by 2002:a05:6122:5a3:b0:4b6:ce08:cc76 with SMTP id w3-20020a05612205a300b004b6ce08cc76mr1986421vko.9.1704474152752; Fri, 05 Jan 2024 09:02:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704474152; cv=none; d=google.com; s=arc-20160816; b=TB5aFboPZbf3cPF7vrur/25J55S2EbJrOSUFL09cxl6Ma/8ReyvTV7QPKeOfqli4YR auzsUriPpk52l0kC6XbQwdAOhdT2AEeneuI2ZDONXxYOhFhOtO8jLwg5HLD3uqjr3CIM PC0Ow36DpScwbSDbFBa7+yU6omEMDf5nm34RPgN6Hs0J3hdMeNVrPg8Mi3JCZZUjmr8R lcMGJLd21Q0yHCUgkHdRzsanYbWey7CqXVPhU+/lWSsa+KtHtJk2WUEnUP0eGVmm+oHP Y7oUDbQIawHIgJTeu5YWmt/eEv0+TzPK+B9N4faeQ8IJ4NFybkncOpi8+B33bzy0sEpd UmWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=a6tojIsMYWumNIQ/Fv6bUVbhwvsBlhRaDpJVAsxk/HE=; fh=V4Q44AeEFf+Cu4qDeCUfFTW2YnuJk/O9DEeIt8XMCU8=; b=oHF6oDKeW1GDEu87hBq2JuxpZxkwMS5kJxyJ1C7EE88Tt44chYcxPiEjB1A79fFrNd j9QtP3SKyu9L6yR7Xn3CZEXT8QEzlz1bAfEpxXc7mNuEtjMgjvOUkr3rRLhFtZyujCPT zQUNkGMA83/Aq26qj7smSyNb6oK3EiptW8g82nEs5vcq7N+2CrKN+2WT84PlvQSPV9CZ aw0sGd3N9Gt4YBmXfc5PIudRvtYQhP8gGCILNzwU+CtIgLE4f1vHqWr7Em1SJ2O/eLUE p+oVor4KbWZ4XLcB73+y3dNl1zt1Fsze0WWgWlkxsHWGSPfdkZCMh2tmHItek0SLPpwT ci+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MuSUGs8U; spf=pass (google.com: domain of linux-kernel+bounces-18092-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18092-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a63-20020a1fe342000000b004b2ca955fe6si292592vkh.5.2024.01.05.09.02.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 09:02:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18092-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MuSUGs8U; spf=pass (google.com: domain of linux-kernel+bounces-18092-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18092-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 39C051C23345 for ; Fri, 5 Jan 2024 17:02:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE1EA31A9D; Fri, 5 Jan 2024 17:02:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MuSUGs8U" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) (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 4113B328C9; Fri, 5 Jan 2024 17:02:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704474128; x=1736010128; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=FcTzdhBtTOYIP8EuD7whPDY+E/POUXTBvU923+ovZKY=; b=MuSUGs8UcT5BIUxZJJoBPfF4/PPbyBuYFp4lX/oFhmm/uDdFQvtg87Mc JuTUxjVIgKgDb9Hqv5a+lU4A/rq1SmbFcDsRdpr4LAVNnrl1sbqpjABvd jAu6QxqBFB330UK/rIvgMeCqq4UXDrcO6DZeCfQD7+zWp4CjSkXyAC3Hp RDaZ2UhHpXyvG9K0zxFMH/38l0k8OtU9FDWOr7lkWLYiQ+KIwVqWaC7CQ WcDyvxy7AbUHnvPEbfPMdZfEM3taFBwxSiHp8TN+ux73CXYkCA6FDKHJO vMObvjDNbMLZLsxZg0bwm4JL3HlMBJ5iu12xTf9l7OyVtg+4ZNe0fy9jp A==; X-IronPort-AV: E=McAfee;i="6600,9927,10944"; a="483715041" X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208";a="483715041" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 09:02:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10944"; a="1112132781" X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208";a="1112132781" Received: from liujusti-mobl3.amr.corp.intel.com (HELO [10.212.183.234]) ([10.212.183.234]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 09:02:05 -0800 Message-ID: Date: Fri, 5 Jan 2024 09:02:06 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V1] PCI/MSI: Fix MSI hwirq truncation Content-Language: en-US To: Vidya Sagar , bhelgaas@google.com, rdunlap@infradead.org, ilpo.jarvinen@linux.intel.com, tglx@linutronix.de Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, treding@nvidia.com, jonathanh@nvidia.com, sdonthineni@nvidia.com, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com References: <20240105134339.3091497-1-vidyas@nvidia.com> From: Kuppuswamy Sathyanarayanan In-Reply-To: <20240105134339.3091497-1-vidyas@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/5/2024 5:43 AM, Vidya Sagar wrote: > While calculating the hwirq number for an MSI interrupt, the higher > bits (i.e. from bit-5 onwards a.k.a domain_nr >= 32) of the PCI domain > number gets truncated because of the shifted value casting to u32. This > for example is resulting in same hwirq number for devices 0019:00:00.0 > and 0039:00:00.0. > > So, cast the PCI domain number to u64 before left shifting it to > calculate hwirq number. This seems like a bug fix. Why not add Fixes: tag? Is this issue detected in a platform test? Maybe including the relevant details about it will help reproduce the issue. > > Signed-off-by: Vidya Sagar > --- > drivers/pci/msi/irqdomain.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c > index c8be056c248d..cfd84a899c82 100644 > --- a/drivers/pci/msi/irqdomain.c > +++ b/drivers/pci/msi/irqdomain.c > @@ -61,7 +61,7 @@ static irq_hw_number_t pci_msi_domain_calc_hwirq(struct msi_desc *desc) > > return (irq_hw_number_t)desc->msi_index | > pci_dev_id(dev) << 11 | > - (pci_domain_nr(dev->bus) & 0xFFFFFFFF) << 27; > + ((irq_hw_number_t)(pci_domain_nr(dev->bus) & 0xFFFFFFFF)) << 27; > } > > static void pci_msi_domain_set_desc(msi_alloc_info_t *arg, -- Sathyanarayanan Kuppuswamy Linux Kernel Developer