Patch "mfd: altera-sysmgr: Fix physical address storing more" has been added to the 5.11-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

    mfd: altera-sysmgr: Fix physical address storing more

to the 5.11-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:
     mfd-altera-sysmgr-fix-physical-address-storing-more.patch
and it can be found in the queue-5.11 subdirectory.

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



commit 8fa5a539a2f83447616335c9b15f56bab33aa042
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Thu Dec 3 23:52:48 2020 +0100

    mfd: altera-sysmgr: Fix physical address storing more
    
    [ Upstream commit b0b5b16b78cea1b2b990a69ab8e07a42ccf7a2ed ]
    
    A recent fix improved the way the resource gets passed to
    the low-level accessors, but left one warning that appears
    in configurations with a resource_size_t that is wider than
    a pointer:
    
    In file included from drivers/mfd/altera-sysmgr.c:19:
    drivers/mfd/altera-sysmgr.c: In function 'sysmgr_probe':
    drivers/mfd/altera-sysmgr.c:148:40: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      148 |   regmap = devm_regmap_init(dev, NULL, (void *)res->start,
          |                                        ^
    include/linux/regmap.h:646:6: note: in definition of macro '__regmap_lockdep_wrapper'
      646 |   fn(__VA_ARGS__, &_key,     \
          |      ^~~~~~~~~~~
    drivers/mfd/altera-sysmgr.c:148:12: note: in expansion of macro 'devm_regmap_init'
      148 |   regmap = devm_regmap_init(dev, NULL, (void *)res->start,
          |            ^~~~~~~~~~~~~~~~
    
    I had tried a different approach that would store the address
    in the private data as a phys_addr_t, but the easiest solution
    now seems to be to add a double cast to shut up the warning.
    
    As the address is passed to an inline assembly, it is guaranteed
    to not be wider than a register anyway.
    
    Fixes: d9ca7801b6e5 ("mfd: altera-sysmgr: Fix physical address storing hacks")
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mfd/altera-sysmgr.c b/drivers/mfd/altera-sysmgr.c
index 193a96c8b1eab..20cb294c75122 100644
--- a/drivers/mfd/altera-sysmgr.c
+++ b/drivers/mfd/altera-sysmgr.c
@@ -145,7 +145,8 @@ static int sysmgr_probe(struct platform_device *pdev)
 		sysmgr_config.reg_write = s10_protected_reg_write;
 
 		/* Need physical address for SMCC call */
-		regmap = devm_regmap_init(dev, NULL, (void *)res->start,
+		regmap = devm_regmap_init(dev, NULL,
+					  (void *)(uintptr_t)res->start,
 					  &sysmgr_config);
 	} else {
 		base = devm_ioremap(dev, res->start, resource_size(res));



[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