linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Sanjay R Mehta <Sanju.Mehta@amd.com>,
	bhelgaas@google.com, lukas@wunner.de,
	andriy.shevchenko@linux.intel.com, stuart.w.hayes@gmail.com,
	mr.nuke.me@gmail.com
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Sanjay R Mehta <sanju.mehta@amd.com>
Subject: [kbuild] Re: [PATCH] PCI: pciehp: Add check for DL_ACTIVE bit in pciehp_check_link_status()
Date: Wed, 7 Oct 2020 12:30:11 +0300	[thread overview]
Message-ID: <20201007093011.GM18329@kadam> (raw)
In-Reply-To: <1602008668-43646-1-git-send-email-Sanju.Mehta@amd.com>

[-- Attachment #1: Type: text/plain, Size: 3759 bytes --]

Hi Sanjay,

url:    https://github.com/0day-ci/linux/commits/Sanjay-R-Mehta/PCI-pciehp-Add-check-for-DL_ACTIVE-bit-in-pciehp_check_link_status/20201007-022638 
base:    549738f15da0e5a00275977623be199fbbf7df50
config: x86_64-randconfig-m001-20201005 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/pci/hotplug/pciehp_hpc.c:313 pciehp_check_link_status() warn: maybe use && instead of &

vim +313 drivers/pci/hotplug/pciehp_hpc.c

82a9e79ef132cbf Kenji Kaneshige   2009-09-15  290  int pciehp_check_link_status(struct controller *ctrl)
^1da177e4c3f415 Linus Torvalds    2005-04-16  291  {
cd84d34074f5659 Bjorn Helgaas     2013-05-09  292  	struct pci_dev *pdev = ctrl_dev(ctrl);
1a84b99ccbb954c Bjorn Helgaas     2013-12-14  293  	bool found;
^1da177e4c3f415 Linus Torvalds    2005-04-16  294  	u16 lnk_status;
^1da177e4c3f415 Linus Torvalds    2005-04-16  295  
f0157160b359b1d Keith Busch       2018-09-20  296  	if (!pcie_wait_for_link(pdev, true))
f0157160b359b1d Keith Busch       2018-09-20  297  		return -1;
f18e9625e02bb3e Kenji Kaneshige   2008-10-22  298  
f496648b99f8f7f Alexandru Gagniuc 2019-10-25  299  	if (ctrl->inband_presence_disabled)
f496648b99f8f7f Alexandru Gagniuc 2019-10-25  300  		pcie_wait_for_presence(pdev);
f496648b99f8f7f Alexandru Gagniuc 2019-10-25  301  
2f5d8e4ff947ad6 Yinghai Lu        2012-01-27  302  	found = pci_bus_check_dev(ctrl->pcie->port->subordinate,
2f5d8e4ff947ad6 Yinghai Lu        2012-01-27  303  					PCI_DEVFN(0, 0));
0027cb3e1947d0f Kenji Kaneshige   2011-11-10  304  
6c35a1ac3da63a7 Lukas Wunner      2018-07-19  305  	/* ignore link or presence changes up to this point */
6c35a1ac3da63a7 Lukas Wunner      2018-07-19  306  	if (found)
6c35a1ac3da63a7 Lukas Wunner      2018-07-19  307  		atomic_and(~(PCI_EXP_SLTSTA_DLLSC | PCI_EXP_SLTSTA_PDC),
6c35a1ac3da63a7 Lukas Wunner      2018-07-19  308  			   &ctrl->pending_events);
6c35a1ac3da63a7 Lukas Wunner      2018-07-19  309  
1a84b99ccbb954c Bjorn Helgaas     2013-12-14  310  	pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status);
7f2feec140f1f1e Taku Izumi        2008-09-05  311  	ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status);
818dc520d6f8472 Sanjay R Mehta    2020-10-06  312  	if (((lnk_status & PCI_EXP_LNKSTA_LT) &
                                                                                              ^
This won't ever be true.  PCI_EXP_LNKSTA_LT is 0x0800.  It needs to be
&&.

818dc520d6f8472 Sanjay R Mehta    2020-10-06 @313  	     !(lnk_status & PCI_EXP_DPC_CAP_DL_ACTIVE)) ||
322162a71bd9fc4 Kenji Kaneshige   2008-12-19  314  	    !(lnk_status & PCI_EXP_LNKSTA_NLW)) {
3784e0c6b02d4fa Bjorn Helgaas     2015-06-15  315  		ctrl_err(ctrl, "link training error: status %#06x\n",
3784e0c6b02d4fa Bjorn Helgaas     2015-06-15  316  			 lnk_status);
1a84b99ccbb954c Bjorn Helgaas     2013-12-14  317  		return -1;
^1da177e4c3f415 Linus Torvalds    2005-04-16  318  	}
^1da177e4c3f415 Linus Torvalds    2005-04-16  319  
fdbd3ce9efb3a04 Yinghai Lu        2011-11-07  320  	pcie_update_link_speed(ctrl->pcie->port->subordinate, lnk_status);
fdbd3ce9efb3a04 Yinghai Lu        2011-11-07  321  
1a84b99ccbb954c Bjorn Helgaas     2013-12-14  322  	if (!found)
1a84b99ccbb954c Bjorn Helgaas     2013-12-14  323  		return -1;
2f5d8e4ff947ad6 Yinghai Lu        2012-01-27  324  
1a84b99ccbb954c Bjorn Helgaas     2013-12-14  325  	return 0;
^1da177e4c3f415 Linus Torvalds    2005-04-16  326  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org 

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37370 bytes --]

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

      parent reply	other threads:[~2020-10-07  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 18:24 [PATCH] PCI: pciehp: Add check for DL_ACTIVE bit in pciehp_check_link_status() Sanjay R Mehta
2020-10-06 19:38 ` Lukas Wunner
2020-10-08  7:13   ` Sanjay R Mehta
2020-10-08 11:29     ` Andy Shevchenko
2020-10-09 10:34     ` Lukas Wunner
2020-10-07  9:30 ` 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=20201007093011.GM18329@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=Sanju.Mehta@amd.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lukas@wunner.de \
    --cc=mr.nuke.me@gmail.com \
    --cc=stuart.w.hayes@gmail.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;
as well as URLs for NNTP newsgroup(s).