public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, Haotien Hsu <haotienh@nvidia.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	"Wayne Chang" <waynec@nvidia.com>,
	"Sing-Han Chen" <singhanc@nvidia.com>,
	"Sanket Goswami" <Sanket.Goswami@amd.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Haotien Hsu" <haotienh@nvidia.com>
Subject: Re: [PATCH] ucsi_ccg: Refine the UCSI Interrupt handling
Date: Thu, 29 Dec 2022 11:46:56 +0300	[thread overview]
Message-ID: <202212271237.LWXg8oOw-lkp@intel.com> (raw)
In-Reply-To: <20221221083812.3363045-1-haotienh@nvidia.com>

Hi Haotien,

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Haotien-Hsu/ucsi_ccg-Refine-the-UCSI-Interrupt-handling/20221221-163923
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link:    https://lore.kernel.org/r/20221221083812.3363045-1-haotienh%40nvidia.com
patch subject: [PATCH] ucsi_ccg: Refine the UCSI Interrupt handling
config: x86_64-randconfig-m001-20221226
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>

smatch warnings:
drivers/usb/typec/ucsi/ucsi_ccg.c:708 ccg_irq_handler() error: uninitialized symbol 'cci'.

vim +/cci +708 drivers/usb/typec/ucsi/ucsi_ccg.c

247c554a14aa16 Ajay Gupta      2018-10-26  675  static irqreturn_t ccg_irq_handler(int irq, void *data)
247c554a14aa16 Ajay Gupta      2018-10-26  676  {
e32fd989ac1c45 Heikki Krogerus 2019-11-04  677  	u16 reg = CCGX_RAB_UCSI_DATA_BLOCK(UCSI_CCI);
247c554a14aa16 Ajay Gupta      2018-10-26  678  	struct ucsi_ccg *uc = data;
e32fd989ac1c45 Heikki Krogerus 2019-11-04  679  	u8 intr_reg;
e32fd989ac1c45 Heikki Krogerus 2019-11-04  680  	u32 cci;
e32fd989ac1c45 Heikki Krogerus 2019-11-04  681  	int ret;
e32fd989ac1c45 Heikki Krogerus 2019-11-04  682  
e32fd989ac1c45 Heikki Krogerus 2019-11-04  683  	ret = ccg_read(uc, CCGX_RAB_INTR_REG, &intr_reg, sizeof(intr_reg));
e32fd989ac1c45 Heikki Krogerus 2019-11-04  684  	if (ret)
e32fd989ac1c45 Heikki Krogerus 2019-11-04  685  		return ret;
e32fd989ac1c45 Heikki Krogerus 2019-11-04  686  
e65232d7f1fccd Sing-Han Chen   2022-12-21  687  	if (!intr_reg)
e65232d7f1fccd Sing-Han Chen   2022-12-21  688  		return IRQ_HANDLED;
e65232d7f1fccd Sing-Han Chen   2022-12-21  689  	else if (!(intr_reg & UCSI_READ_INT))
e65232d7f1fccd Sing-Han Chen   2022-12-21  690  		goto err_clear_irq;

cci is uninitialized on this goto.

e65232d7f1fccd Sing-Han Chen   2022-12-21  691  
e32fd989ac1c45 Heikki Krogerus 2019-11-04  692  	ret = ccg_read(uc, reg, (void *)&cci, sizeof(cci));
e32fd989ac1c45 Heikki Krogerus 2019-11-04  693  	if (ret)
e32fd989ac1c45 Heikki Krogerus 2019-11-04  694  		goto err_clear_irq;
e32fd989ac1c45 Heikki Krogerus 2019-11-04  695  
e32fd989ac1c45 Heikki Krogerus 2019-11-04  696  	if (UCSI_CCI_CONNECTOR(cci))
e32fd989ac1c45 Heikki Krogerus 2019-11-04  697  		ucsi_connector_change(uc->ucsi, UCSI_CCI_CONNECTOR(cci));
247c554a14aa16 Ajay Gupta      2018-10-26  698  
e65232d7f1fccd Sing-Han Chen   2022-12-21  699  	/* As per CCGx UCSI interface guide, copy CCI and MESSAGE_IN
e65232d7f1fccd Sing-Han Chen   2022-12-21  700  	 * to the OpRegion before clear the UCSI interrupt
e65232d7f1fccd Sing-Han Chen   2022-12-21  701  	 */
e65232d7f1fccd Sing-Han Chen   2022-12-21  702  	ccg_op_region_update(uc, cci);
e32fd989ac1c45 Heikki Krogerus 2019-11-04  703  
e32fd989ac1c45 Heikki Krogerus 2019-11-04  704  err_clear_irq:
e32fd989ac1c45 Heikki Krogerus 2019-11-04  705  	ccg_write(uc, CCGX_RAB_INTR_REG, &intr_reg, sizeof(intr_reg));
247c554a14aa16 Ajay Gupta      2018-10-26  706  
e65232d7f1fccd Sing-Han Chen   2022-12-21  707  	if (!ret && test_bit(DEV_CMD_PENDING, &uc->flags) &&
e65232d7f1fccd Sing-Han Chen   2022-12-21 @708  	    cci & (UCSI_CCI_ACK_COMPLETE | UCSI_CCI_COMMAND_COMPLETE))
e65232d7f1fccd Sing-Han Chen   2022-12-21  709  		complete(&uc->complete);
e65232d7f1fccd Sing-Han Chen   2022-12-21  710  
247c554a14aa16 Ajay Gupta      2018-10-26  711  	return IRQ_HANDLED;
247c554a14aa16 Ajay Gupta      2018-10-26  712  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


      reply	other threads:[~2022-12-29  8:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  8:38 [PATCH] ucsi_ccg: Refine the UCSI Interrupt handling Haotien Hsu
2022-12-29  8:46 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202212271237.LWXg8oOw-lkp@intel.com \
    --to=error27@gmail.com \
    --cc=Sanket.Goswami@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haotienh@nvidia.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=singhanc@nvidia.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=waynec@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox