Re: [PATCH v2 3/3] reset: npcm: add NPCM reset controller driver

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

 



Hi Tomer,

I love your patch! Perhaps something to improve:

[auto build test WARNING on pza/reset/next]
[also build test WARNING on v5.4-rc5 next-20191029]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Tomer-Maimon/reset-npcm-add-NPCM-reset-driver-support/20191030-101136
base:   https://git.pengutronix.de/git/pza/linux reset/next
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers//reset/reset-npcm.c: In function 'npcm_rc_probe':
>> drivers//reset/reset-npcm.c:147:2: warning: 'gcr_regmap' may be used uninitialized in this function [-Wmaybe-uninitialized]
     regmap_read(gcr_regmap, NPCM_MDLR_OFFSET, &mdlr);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers//reset/reset-npcm.c:131:17: note: 'gcr_regmap' was declared here
     struct regmap *gcr_regmap;
                    ^~~~~~~~~~

vim +/gcr_regmap +147 drivers//reset/reset-npcm.c

   122	
   123	/*
   124	 *  The following procedure should be observed in USB PHY, USB device and
   125	 *  USB host initialization at BMC boot
   126	 */
   127	static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc)
   128	{
   129		struct device_node *np = pdev->dev.of_node;
   130		u32 mdlr, iprst1, iprst2, iprst3;
   131		struct regmap *gcr_regmap;
   132		u32 ipsrst1_bits = 0;
   133		u32 ipsrst2_bits = NPCM_IPSRST2_USB_HOST;
   134		u32 ipsrst3_bits = 0;
   135	
   136		if (of_device_is_compatible(np, "nuvoton,npcm750-reset")) {
   137			gcr_regmap = syscon_regmap_lookup_by_compatible("nuvoton,npcm750-gcr");
   138			if (IS_ERR(gcr_regmap)) {
   139				dev_err(&pdev->dev, "Failed to find nuvoton,npcm750-gcr\n");
   140				return PTR_ERR(gcr_regmap);
   141			}
   142		}
   143		if (!gcr_regmap)
   144			return -ENXIO;
   145	
   146		/* checking which USB device is enabled */
 > 147		regmap_read(gcr_regmap, NPCM_MDLR_OFFSET, &mdlr);
   148		if (!(mdlr & NPCM_MDLR_USBD0))
   149			ipsrst3_bits |= NPCM_IPSRST3_USBD0;
   150		if (!(mdlr & NPCM_MDLR_USBD1))
   151			ipsrst1_bits |= NPCM_IPSRST1_USBD1;
   152		if (!(mdlr & NPCM_MDLR_USBD2_4))
   153			ipsrst1_bits |= (NPCM_IPSRST1_USBD2 |
   154					 NPCM_IPSRST1_USBD3 |
   155					 NPCM_IPSRST1_USBD4);
   156		if (!(mdlr & NPCM_MDLR_USBD0)) {
   157			ipsrst1_bits |= (NPCM_IPSRST1_USBD5 |
   158					 NPCM_IPSRST1_USBD6);
   159			ipsrst3_bits |= (NPCM_IPSRST3_USBD7 |
   160					 NPCM_IPSRST3_USBD8 |
   161					 NPCM_IPSRST3_USBD9);
   162		}
   163	
   164		/* assert reset USB PHY and USB devices */
   165		iprst1 = readl(rc->base + NPCM_IPSRST1);
   166		iprst2 = readl(rc->base + NPCM_IPSRST2);
   167		iprst3 = readl(rc->base + NPCM_IPSRST3);
   168	
   169		iprst1 |= ipsrst1_bits;
   170		iprst2 |= ipsrst2_bits;
   171		iprst3 |= (ipsrst3_bits | NPCM_IPSRST3_USBPHY1 |
   172			   NPCM_IPSRST3_USBPHY2);
   173	
   174		writel(iprst1, rc->base + NPCM_IPSRST1);
   175		writel(iprst2, rc->base + NPCM_IPSRST2);
   176		writel(iprst3, rc->base + NPCM_IPSRST3);
   177	
   178		/* clear USB PHY RS bit */
   179		regmap_update_bits(gcr_regmap, NPCM_USB1PHYCTL_OFFSET,
   180				   NPCM_USBXPHYCTL_RS, 0);
   181		regmap_update_bits(gcr_regmap, NPCM_USB2PHYCTL_OFFSET,
   182				   NPCM_USBXPHYCTL_RS, 0);
   183	
   184		/* deassert reset USB PHY */
   185		iprst3 &= ~(NPCM_IPSRST3_USBPHY1 | NPCM_IPSRST3_USBPHY2);
   186		writel(iprst3, rc->base + NPCM_IPSRST3);
   187	
   188		udelay(50);
   189	
   190		/* set USB PHY RS bit */
   191		regmap_update_bits(gcr_regmap, NPCM_USB1PHYCTL_OFFSET,
   192				   NPCM_USBXPHYCTL_RS, NPCM_USBXPHYCTL_RS);
   193		regmap_update_bits(gcr_regmap, NPCM_USB2PHYCTL_OFFSET,
   194				   NPCM_USBXPHYCTL_RS, NPCM_USBXPHYCTL_RS);
   195	
   196		/* deassert reset USB devices*/
   197		iprst1 &= ~ipsrst1_bits;
   198		iprst2 &= ~ipsrst2_bits;
   199		iprst3 &= ~ipsrst3_bits;
   200	
   201		writel(iprst1, rc->base + NPCM_IPSRST1);
   202		writel(iprst2, rc->base + NPCM_IPSRST2);
   203		writel(iprst3, rc->base + NPCM_IPSRST3);
   204	
   205		return 0;
   206	}
   207	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux