Patch "platform/x86: intel/pmc: Fix ioremap() of bad address" has been added to the 6.12-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

    platform/x86: intel/pmc: Fix ioremap() of bad address

to the 6.12-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:
     platform-x86-intel-pmc-fix-ioremap-of-bad-address.patch
and it can be found in the queue-6.12 subdirectory.

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



commit 840c4439f887dd46cccb7f44b737354a9225d5cc
Author: David E. Box <david.e.box@xxxxxxxxxxxxxxx>
Date:   Mon Jan 6 09:46:52 2025 -0800

    platform/x86: intel/pmc: Fix ioremap() of bad address
    
    [ Upstream commit 1d7461d0c8330689117286169106af6531a747ed ]
    
    In pmc_core_ssram_get_pmc(), the physical addresses for hidden SSRAM
    devices are retrieved from the MMIO region of the primary SSRAM device.
    If additional devices are not present, the address returned is zero.
    Currently, the code does not check for this condition, resulting in
    ioremap() incorrectly attempting to map address 0.
    
    Add a check for a zero address and return 0 if no additional devices
    are found, as it is not an error for the device to be absent.
    
    Fixes: a01486dc4bb1 ("platform/x86/intel/pmc: Cleanup SSRAM discovery")
    Signed-off-by: David E. Box <david.e.box@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20250106174653.1497128-1-david.e.box@xxxxxxxxxxxxxxx
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/platform/x86/intel/pmc/core_ssram.c b/drivers/platform/x86/intel/pmc/core_ssram.c
index 8504154b649f..927f58dc73e3 100644
--- a/drivers/platform/x86/intel/pmc/core_ssram.c
+++ b/drivers/platform/x86/intel/pmc/core_ssram.c
@@ -269,8 +269,12 @@ pmc_core_ssram_get_pmc(struct pmc_dev *pmcdev, int pmc_idx, u32 offset)
 		/*
 		 * The secondary PMC BARS (which are behind hidden PCI devices)
 		 * are read from fixed offsets in MMIO of the primary PMC BAR.
+		 * If a device is not present, the value will be 0.
 		 */
 		ssram_base = get_base(tmp_ssram, offset);
+		if (!ssram_base)
+			return 0;
+
 		ssram = ioremap(ssram_base, SSRAM_HDR_SIZE);
 		if (!ssram)
 			return -ENOMEM;




[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