[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86r0tvxftu.wl-maz@kernel.org>
Date: Sat, 11 Mar 2023 19:12:29 +0000
From: Marc Zyngier <maz@...nel.org>
To: Sven Peter <sven@...npeter.dev>
Cc: Alyssa Rosenzweig <alyssa@...enzweig.io>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
asahi@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI: apple: Initialize pcie->nvecs before using it
On Sat, 11 Mar 2023 13:34:53 +0000,
Sven Peter <sven@...npeter.dev> wrote:
>
> apple_pcie_setup_port computes ilog2(pcie->nvecs) to setup the number of
> MSIs available for each port. It is however called before apple_msi_init
> which actually initializes pcie->nvecs.
> Luckily, pcie->nvecs is part of kzalloc-ed structure and thus
> initialized as zero. ilog2(0) happens to be 0xffffffff which then just
> configures more MSIs in hardware than we actually have. This doesn't
> break anything because we never hand out those vectors.
> Let's swap the order of the two calls so that we use the correctly
> initialized value.
>
> Fixes: 476c41ed4597 ("PCI: apple: Implement MSI support")
> Signed-off-by: Sven Peter <sven@...npeter.dev>
Huh, how embarrassing... :-/
Reviewed-by: Marc Zyngier <maz@...nel.org>
M.
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists