Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2383187rdd; Fri, 12 Jan 2024 07:53:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IE64y0wo1MrOqkaSkKAAQhnb2trUMZSifxS5cfK7rr2hBnixgUgAKFBWGD1PNkxclN8UEW3 X-Received: by 2002:a17:90b:3653:b0:28d:bca7:d9d4 with SMTP id nh19-20020a17090b365300b0028dbca7d9d4mr1373524pjb.12.1705074820879; Fri, 12 Jan 2024 07:53:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705074820; cv=none; d=google.com; s=arc-20160816; b=FHgSdlVnK51cANqzz/E4UAjK8QeXYwZW/1hjB9euZgKft1/TU48BpPfm2PBl+MJnFK hwGCAsP/rFuqUhX/X4UAiYij3Mh188b5u7yl/4tskUiHybBRHWttjPkfIrZ+MNQkLEFP OeGQLDekEfXNIP6YkmewImaeBM8wc9JrmMgvMRN7SRWjG4v2IFASGup++CAt2uhhHhwD xIiAtiJM2wnwFO4cO/Df5WbmokltvpgJqMJjubtdtWnMdZcfqNbWX8WXzVjksnv2nfHd L79Co7syRrtLc+FDuFuQveiWWZllf2OG3FYUKLlksdYl0e+uKu94Jy2nFOZX3bLQgV6m T3bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=YCUv4QD3m4qLNZG02uewh/6SZ5moAHjrquOh0sYfrIk=; fh=ouc8/aei/ITjaeMf9JGWByS+4MtbwCXEjSNFgZjbX5E=; b=B2zTgzQht/lTI9KlNl8Cg2c/SL6kyWdZvQOf17mhGuYqAZu/iuGrpmGnk68u5T10KB yFAoYvAmSfW9uxK0aEiriAMlytki3mBZ/GvFChOwVO3yWsL443BLYrAbjWMmwnBFNMEw QG+wxkShCQHtzebpnu3jtJT/RqMgPu+6vWiWt7xS138mhqnB5RLLyGyQQJSep4yOKzqT rnRifdLU3w6hJQicClHNTpAlzMxLJJPFwiaLh8TTtPkehU1dCzdKcJVDncB2Lf535df2 ItSQISbmfchS/0YEEwK9ZKYvAFDI/BMYR4jEvtdoAQz/3UQbSiYTfpclwM3+w2+E2us0 rv7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="4N8l/0GP"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-24830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x8-20020a17090a46c800b0028def898db5si2937372pjg.133.2024.01.12.07.53.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 07:53:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24830-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=@linutronix.de header.s=2020 header.b="4N8l/0GP"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-24830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 8F38428302F for ; Fri, 12 Jan 2024 15:53:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92A546EB75; Fri, 12 Jan 2024 15:53:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4N8l/0GP"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4CITCkRg" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 8FD4C6E2C7; Fri, 12 Jan 2024 15:53:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1705074808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YCUv4QD3m4qLNZG02uewh/6SZ5moAHjrquOh0sYfrIk=; b=4N8l/0GPCLeFqCcRf8EEXw/ERWD4S3cJmBEsgCCDnnixeNbE49Fz+CjUCWnanmNB80C6lS gvLpUBdj0TcPvjjVLYhmlMCUUkf/17Pio2Ug73x9ndFMcXt31L3Y2DNsJ3xlfTgmNbedvP 37TW9pCz5S9fe0vQ5NXSXR0RAlKal72sMb7r2bvR2DigLu5fkyDjHsH2z+hy+KeTb931kV 9J7/ItVk14cEN9Ad1b+6Zay4eQ1zcBQNT5QZlv3FpkKJhiANjHDuR6gnf3SoX0i8zsp4xa CxVu8XdZ1oYDJx+RGXGm/JXedqaENb3lNRZVKIQ9TRB7YjaxoSMw4cI6d1yPuA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1705074808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YCUv4QD3m4qLNZG02uewh/6SZ5moAHjrquOh0sYfrIk=; b=4CITCkRgGXuMgHHvP4EOiVQ0hY0q/EDh+yJQjmMOBUe7pOj2fY+M76/yy2h1mT6ZGIzNN5 wXaD7VFyRM+RAsBA== To: Vidya Sagar , bhelgaas@google.com, rdunlap@infradead.org, ilpo.jarvinen@linux.intel.com, jiang.liu@linux.intel.com 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, vidyas@nvidia.com, sagar.tv@gmail.com Subject: Re: [PATCH V3] PCI/MSI: Fix MSI hwirq truncation In-Reply-To: <20240111052814.713016-1-vidyas@nvidia.com> References: <20240108120522.1368240-1-vidyas@nvidia.com> <20240111052814.713016-1-vidyas@nvidia.com> Date: Fri, 12 Jan 2024 16:53:26 +0100 Message-ID: <87bk9qim4p.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Thu, Jan 11 2024 at 10:58, 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 return > type of pci_domain_nr() which is 'int'. 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 'irq_hw_number_t' before left shifting > it to calculate hwirq number. This still does not explain that this fixes it only on 64-bit platforms and why we don't care for 32-bit systems.