Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: Jeffrey Hugo <quic_jhugo@quicinc.com>, <quic_carlv@quicinc.com>,
	<manivannan.sadhasivam@linaro.org>, <quic_yabdulra@quicinc.com>,
	<quic_mattleun@quicinc.com>, <quic_thanson@quicinc.com>
Cc: <ogabbay@kernel.org>, <jacek.lawrynowicz@linux.intel.com>,
	<linux-arm-msm@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>, <mhi@lists.linux.dev>
Subject: Re: [PATCH 3/7] accel/qaic: Allocate an exact number of MSIs
Date: Fri, 13 Dec 2024 15:43:20 -0800	[thread overview]
Message-ID: <6c866fe1-8d25-aceb-8f5b-0f2d40abcf6d@amd.com> (raw)
In-Reply-To: <20241213213340.2551697-4-quic_jhugo@quicinc.com>


On 12/13/24 13:33, Jeffrey Hugo wrote:
> From: Youssef Samir <quic_yabdulra@quicinc.com>
>
> Devices use 1 MSI vector for the MHI controller and as many vectors as
> the DMA bridge channels on the device. During the probing of the
> device, the driver allocates 32 MSI vectors, which is usually more
> than what is needed for AIC100 devices, which is wasting resources.
>
> Allocate only the needed number of MSI vectors per device.
>
> Signed-off-by: Youssef Samir <quic_yabdulra@quicinc.com>
> Reviewed-by: Troy Hanson <quic_thanson@quicinc.com>
> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
> ---
>   drivers/accel/qaic/qaic_drv.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/accel/qaic/qaic_drv.c b/drivers/accel/qaic/qaic_drv.c
> index 81819b9ef8d4..6e9bed17b3f1 100644
> --- a/drivers/accel/qaic/qaic_drv.c
> +++ b/drivers/accel/qaic/qaic_drv.c
> @@ -465,12 +465,13 @@ static int init_pci(struct qaic_device *qdev, struct pci_dev *pdev)
>   
>   static int init_msi(struct qaic_device *qdev, struct pci_dev *pdev)
>   {
> +	int irq_count = qdev->num_dbc + 1;
>   	int mhi_irq;
>   	int ret;
>   	int i;
>   
>   	/* Managed release since we use pcim_enable_device */
> -	ret = pci_alloc_irq_vectors(pdev, 32, 32, PCI_IRQ_MSI);
> +	ret = pci_alloc_irq_vectors(pdev, irq_count, irq_count, PCI_IRQ_MSI);
>   	if (ret == -ENOSPC) {
>   		ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
>   		if (ret < 0)
> @@ -485,7 +486,8 @@ static int init_msi(struct qaic_device *qdev, struct pci_dev *pdev)
>   		 * interrupted, it shouldn't race with itself.
>   		 */
>   		qdev->single_msi = true;
> -		pci_info(pdev, "Allocating 32 MSIs failed, operating in 1 MSI mode. Performance may be impacted.\n");
> +		pci_info(pdev, "Allocating %d MSIs failed, operating in 1 MSI mode. Performance may be impacted.\n",
> +			 irq_count);
>   	} else if (ret < 0) {
>   		return ret;
>   	}
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>

  reply	other threads:[~2024-12-13 23:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 21:33 [PATCH 0/7] accel/qaic: Initial AIC200 support Jeffrey Hugo
2024-12-13 21:33 ` [PATCH 1/7] bus: mhi: host: Refactor BHI/BHIe based firmware loading Jeffrey Hugo
2025-01-07 11:06   ` Jacek Lawrynowicz
2025-01-08  5:24   ` Manivannan Sadhasivam
2025-01-17 16:21     ` Jeffrey Hugo
2024-12-13 21:33 ` [PATCH 2/7] bus: mhi: host: Add a policy to enable image transfer via BHIe in PBL Jeffrey Hugo
2025-01-07 11:12   ` Jacek Lawrynowicz
2025-01-08  5:42   ` Manivannan Sadhasivam
2025-01-17 16:45     ` Jeffrey Hugo
2024-12-13 21:33 ` [PATCH 3/7] accel/qaic: Allocate an exact number of MSIs Jeffrey Hugo
2024-12-13 23:43   ` Lizhi Hou [this message]
2024-12-13 21:33 ` [PATCH 4/7] accel/qaic: Add support for MSI-X Jeffrey Hugo
2024-12-13 23:49   ` Lizhi Hou
2024-12-13 21:33 ` [PATCH 5/7] accel/qaic: Mask out SR-IOV PCI resources Jeffrey Hugo
2024-12-14  0:20   ` Lizhi Hou
2024-12-13 21:33 ` [PATCH 6/7] accel/qaic: Add config structs for supported cards Jeffrey Hugo
2024-12-14  0:35   ` Lizhi Hou
2024-12-20 17:15     ` Jeffrey Hugo
2024-12-20 18:08       ` Lizhi Hou
2024-12-13 21:33 ` [PATCH 7/7] accel/qaic: Add AIC200 support Jeffrey Hugo
2024-12-14  0:49   ` Lizhi Hou
2024-12-20 17:26     ` Jeffrey Hugo
2024-12-20 17:33       ` Lizhi Hou
2024-12-20 17:50         ` Jeffrey Hugo
2024-12-20 18:07           ` Lizhi Hou
2024-12-28  0:19   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c866fe1-8d25-aceb-8f5b-0f2d40abcf6d@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jacek.lawrynowicz@linux.intel.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mhi@lists.linux.dev \
    --cc=ogabbay@kernel.org \
    --cc=quic_carlv@quicinc.com \
    --cc=quic_jhugo@quicinc.com \
    --cc=quic_mattleun@quicinc.com \
    --cc=quic_thanson@quicinc.com \
    --cc=quic_yabdulra@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox