CC: [email protected]
BCC: [email protected]
CC: Linux Memory Management List <[email protected]>
TO: Yong Wu <[email protected]>
CC: Joerg Roedel <[email protected]>
CC: AngeloGioacchino Del Regno <[email protected]>
CC: Matthias Brugger <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   38a288f5941ef03752887ad86f2d85442358c99a
commit: d2e9a1102cfc22c08450875faa667a60f0b1b1f6 [8521/9759] iommu/mediatek: 
Contain MM IOMMU flow with the MM TYPE
:::::: branch date: 10 hours ago
:::::: commit date: 2 days ago
config: openrisc-randconfig-m031-20220506 
(https://download.01.org/0day-ci/archive/20220507/[email protected]/config)
compiler: or1k-linux-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/iommu/mtk_iommu.c:878 mtk_iommu_mm_dts_parse() error: uninitialized 
symbol 'larbnode'.

Old smatch warnings:
drivers/iommu/mtk_iommu.c:583 mtk_iommu_iova_to_phys() warn: impossible 
condition '(pa >= 5368709120) => (0-u32max >= 5368709120)'

vim +/larbnode +878 drivers/iommu/mtk_iommu.c

0df4fabe208d95 Yong Wu 2016-02-23  833  
d2e9a1102cfc22 Yong Wu 2022-05-03  834  static int 
mtk_iommu_mm_dts_parse(struct device *dev, struct component_match **match,
d2e9a1102cfc22 Yong Wu 2022-05-03  835                                    
struct mtk_iommu_data *data)
0df4fabe208d95 Yong Wu 2016-02-23  836  {
baf94e6ebff962 Yong Wu 2021-01-11  837          struct device_node *larbnode, 
*smicomm_node;
baf94e6ebff962 Yong Wu 2021-01-11  838          struct platform_device 
*plarbdev;
baf94e6ebff962 Yong Wu 2021-01-11  839          struct device_link *link;
d2e9a1102cfc22 Yong Wu 2022-05-03  840          int i, larb_nr, ret;
d2e9a1102cfc22 Yong Wu 2022-05-03  841  
d2e9a1102cfc22 Yong Wu 2022-05-03  842          larb_nr = 
of_count_phandle_with_args(dev->of_node, "mediatek,larbs", NULL);
d2e9a1102cfc22 Yong Wu 2022-05-03  843          if (larb_nr < 0)
d2e9a1102cfc22 Yong Wu 2022-05-03  844                  return larb_nr;
d2e9a1102cfc22 Yong Wu 2022-05-03  845  
d2e9a1102cfc22 Yong Wu 2022-05-03  846          for (i = 0; i < larb_nr; i++) {
d2e9a1102cfc22 Yong Wu 2022-05-03  847                  u32 id;
d2e9a1102cfc22 Yong Wu 2022-05-03  848  
d2e9a1102cfc22 Yong Wu 2022-05-03  849                  larbnode = 
of_parse_phandle(dev->of_node, "mediatek,larbs", i);
d2e9a1102cfc22 Yong Wu 2022-05-03  850                  if (!larbnode)
d2e9a1102cfc22 Yong Wu 2022-05-03  851                          return -EINVAL;
d2e9a1102cfc22 Yong Wu 2022-05-03  852  
d2e9a1102cfc22 Yong Wu 2022-05-03  853                  if 
(!of_device_is_available(larbnode)) {
d2e9a1102cfc22 Yong Wu 2022-05-03  854                          
of_node_put(larbnode);
d2e9a1102cfc22 Yong Wu 2022-05-03  855                          continue;
d2e9a1102cfc22 Yong Wu 2022-05-03  856                  }
d2e9a1102cfc22 Yong Wu 2022-05-03  857  
d2e9a1102cfc22 Yong Wu 2022-05-03  858                  ret = 
of_property_read_u32(larbnode, "mediatek,larb-id", &id);
d2e9a1102cfc22 Yong Wu 2022-05-03  859                  if (ret)/* The id is 
consecutive if there is no this property */
d2e9a1102cfc22 Yong Wu 2022-05-03  860                          id = i;
d2e9a1102cfc22 Yong Wu 2022-05-03  861  
d2e9a1102cfc22 Yong Wu 2022-05-03  862                  plarbdev = 
of_find_device_by_node(larbnode);
d2e9a1102cfc22 Yong Wu 2022-05-03  863                  if (!plarbdev) {
d2e9a1102cfc22 Yong Wu 2022-05-03  864                          
of_node_put(larbnode);
d2e9a1102cfc22 Yong Wu 2022-05-03  865                          return -ENODEV;
d2e9a1102cfc22 Yong Wu 2022-05-03  866                  }
d2e9a1102cfc22 Yong Wu 2022-05-03  867                  if 
(!plarbdev->dev.driver) {
d2e9a1102cfc22 Yong Wu 2022-05-03  868                          
of_node_put(larbnode);
d2e9a1102cfc22 Yong Wu 2022-05-03  869                          return 
-EPROBE_DEFER;
d2e9a1102cfc22 Yong Wu 2022-05-03  870                  }
d2e9a1102cfc22 Yong Wu 2022-05-03  871                  data->larb_imu[id].dev 
= &plarbdev->dev;
d2e9a1102cfc22 Yong Wu 2022-05-03  872  
d2e9a1102cfc22 Yong Wu 2022-05-03  873                  
component_match_add_release(dev, match, component_release_of,
d2e9a1102cfc22 Yong Wu 2022-05-03  874                                          
    component_compare_of, larbnode);
d2e9a1102cfc22 Yong Wu 2022-05-03  875          }
d2e9a1102cfc22 Yong Wu 2022-05-03  876  
d2e9a1102cfc22 Yong Wu 2022-05-03  877          /* Get smi-common dev from the 
last larb. */
d2e9a1102cfc22 Yong Wu 2022-05-03 @878          smicomm_node = 
of_parse_phandle(larbnode, "mediatek,smi", 0);
d2e9a1102cfc22 Yong Wu 2022-05-03  879          if (!smicomm_node)
d2e9a1102cfc22 Yong Wu 2022-05-03  880                  return -EINVAL;
d2e9a1102cfc22 Yong Wu 2022-05-03  881  
d2e9a1102cfc22 Yong Wu 2022-05-03  882          plarbdev = 
of_find_device_by_node(smicomm_node);
d2e9a1102cfc22 Yong Wu 2022-05-03  883          of_node_put(smicomm_node);
d2e9a1102cfc22 Yong Wu 2022-05-03  884          data->smicomm_dev = 
&plarbdev->dev;
d2e9a1102cfc22 Yong Wu 2022-05-03  885  
d2e9a1102cfc22 Yong Wu 2022-05-03  886          link = 
device_link_add(data->smicomm_dev, dev,
d2e9a1102cfc22 Yong Wu 2022-05-03  887                                 
DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME);
d2e9a1102cfc22 Yong Wu 2022-05-03  888          if (!link) {
d2e9a1102cfc22 Yong Wu 2022-05-03  889                  dev_err(dev, "Unable to 
link %s.\n", dev_name(data->smicomm_dev));
d2e9a1102cfc22 Yong Wu 2022-05-03  890                  return -EINVAL;
d2e9a1102cfc22 Yong Wu 2022-05-03  891          }
d2e9a1102cfc22 Yong Wu 2022-05-03  892          return 0;
d2e9a1102cfc22 Yong Wu 2022-05-03  893  }
d2e9a1102cfc22 Yong Wu 2022-05-03  894  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to