Patch "PCI: tegra194: Fix tegra_pcie_ep_raise_msi_irq() ill-defined shift" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    PCI: tegra194: Fix tegra_pcie_ep_raise_msi_irq() ill-defined shift

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pci-tegra194-fix-tegra_pcie_ep_raise_msi_irq-ill-def.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9bf66f3e7bfe0e9661d0c3faa10d54190d662df9
Author: Jon Hunter <jonathanh@xxxxxxxxxx>
Date:   Fri Jun 18 17:02:19 2021 +0100

    PCI: tegra194: Fix tegra_pcie_ep_raise_msi_irq() ill-defined shift
    
    [ Upstream commit f67092eff2bd40650aad54a1a1910160f41d864a ]
    
    tegra_pcie_ep_raise_msi_irq() shifted a signed 32-bit value left by 31
    bits.  The behavior of this is implementation-defined.
    
    Replace the shift by BIT(), which is well-defined.
    
    Found by cppcheck:
    
      $ cppcheck --enable=all drivers/pci/controller/dwc/pcie-tegra194.c
      Checking drivers/pci/controller/dwc/pcie-tegra194.c ...
    
      drivers/pci/controller/dwc/pcie-tegra194.c:1829:23: portability: Shifting signed 32-bit value by 31 bits is implementation-defined behaviour. See condition at line 1826.  [shiftTooManyBitsSigned]
    
      appl_writel(pcie, (1 << irq), APPL_MSI_CTRL_1);
                         ^
    
    [bhelgaas: commit log]
    Link: https://lore.kernel.org/r/20210618160219.303092-1-jonathanh@xxxxxxxxxx
    Fixes: c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")
    Signed-off-by: Jon Hunter <jonathanh@xxxxxxxxxx>
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
    Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index fa6b12cfc043..3ec7b29d5dc7 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1826,7 +1826,7 @@ static int tegra_pcie_ep_raise_msi_irq(struct tegra_pcie_dw *pcie, u16 irq)
 	if (unlikely(irq > 31))
 		return -EINVAL;
 
-	appl_writel(pcie, (1 << irq), APPL_MSI_CTRL_1);
+	appl_writel(pcie, BIT(irq), APPL_MSI_CTRL_1);
 
 	return 0;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux