[rcu:dev.2020.06.17a 35/38] kernel/sched/core.c:2650 try_to_wake_up() error: uninitialized symbol 'cpu'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2020.06.17a
head: d3779e78b9848a707448dbb4a0cb6c4bb651fe9c
commit: 59a5d883f2ccdce1700862b5983cfd3473630aea [35/38] EXP sched: Alleged fix for v5.8 merge-window scheduler issue
config: x86_64-randconfig-m001-20200621 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
kernel/sched/core.c:2650 try_to_wake_up() error: uninitialized symbol 'cpu'.
# https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/com...
git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
git remote update rcu
git checkout 59a5d883f2ccdce1700862b5983cfd3473630aea
vim +/cpu +2650 kernel/sched/core.c
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 2644
b5179ac70de85e kernel/sched/core.c Peter Zijlstra 2016-05-11 2645 ttwu_queue(p, cpu, wake_flags);
aacedf26fb7601 kernel/sched/core.c Peter Zijlstra 2019-06-07 2646 unlock:
013fdb8086acaa kernel/sched.c Peter Zijlstra 2011-04-05 2647 raw_spin_unlock_irqrestore(&p->pi_lock, flags);
aacedf26fb7601 kernel/sched/core.c Peter Zijlstra 2019-06-07 2648 out:
aacedf26fb7601 kernel/sched/core.c Peter Zijlstra 2019-06-07 2649 if (success)
aacedf26fb7601 kernel/sched/core.c Peter Zijlstra 2019-06-07 @2650 ttwu_stat(p, cpu, wake_flags);
^^^
This can be uninitialized on a couple "goto unlock;" paths. Lines
2581 and 2622. The KASan tool will warn about this at run time as well.
I'm not sure why the build bot doesn't include the whole function for
this bug report...
e3d85487fba422 kernel/sched/core.c Peter Zijlstra 2019-07-10 2651 preempt_enable();
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 2652
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 2653 return success;
^1da177e4c3f41 kernel/sched.c Linus Torvalds 2005-04-16 2654 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
drivers/pci/controller/pci-aardvark.c:350:2: error: implicit declaration of function 'gpiod_set_value_cansleep'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8b6ddd10d678bebec32381f71b6b420bafc43ad0
commit: 5169a9851daaa2782a7bd2bb83d5b1bd224b2879 PCI: aardvark: Issue PERST via GPIO
date: 5 weeks ago
config: s390-randconfig-r001-20200621 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project ef455a55bcf2cfea04a99c361b182ad18b7f03f1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390-linux-gnu
git checkout 5169a9851daaa2782a7bd2bb83d5b1bd224b2879
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:19:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
^
In file included from drivers/pci/controller/pci-aardvark.c:14:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:492:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
^
In file included from drivers/pci/controller/pci-aardvark.c:14:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:492:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
^
In file included from drivers/pci/controller/pci-aardvark.c:14:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:492:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^
In file included from drivers/pci/controller/pci-aardvark.c:14:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:492:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
__fswab32(x))
^
In file included from drivers/pci/controller/pci-aardvark.c:14:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:503:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:513:46: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew(cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:523:46: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel(cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:585:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:593:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:601:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:610:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:619:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:628:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/pci/controller/pci-aardvark.c:350:2: error: implicit declaration of function 'gpiod_set_value_cansleep' [-Werror,-Wimplicit-function-declaration]
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
^
drivers/pci/controller/pci-aardvark.c:350:2: note: did you mean 'gpio_set_value_cansleep'?
include/linux/gpio.h:188:20: note: 'gpio_set_value_cansleep' declared here
static inline void gpio_set_value_cansleep(unsigned gpio, int value)
^
>> drivers/pci/controller/pci-aardvark.c:1074:21: error: implicit declaration of function 'devm_gpiod_get_from_of_node' [-Werror,-Wimplicit-function-declaration]
pcie->reset_gpio = devm_gpiod_get_from_of_node(dev, dev->of_node,
^
>> drivers/pci/controller/pci-aardvark.c:1076:14: error: use of undeclared identifier 'GPIOD_OUT_LOW'
GPIOD_OUT_LOW,
^
20 warnings and 3 errors generated.
vim +/gpiod_set_value_cansleep +350 drivers/pci/controller/pci-aardvark.c
335
336 static void advk_pcie_issue_perst(struct advk_pcie *pcie)
337 {
338 u32 reg;
339
340 if (!pcie->reset_gpio)
341 return;
342
343 /* PERST does not work for some cards when link training is enabled */
344 reg = advk_readl(pcie, PCIE_CORE_CTRL0_REG);
345 reg &= ~LINK_TRAINING_EN;
346 advk_writel(pcie, reg, PCIE_CORE_CTRL0_REG);
347
348 /* 10ms delay is needed for some cards */
349 dev_info(&pcie->pdev->dev, "issuing PERST via reset GPIO for 10ms\n");
> 350 gpiod_set_value_cansleep(pcie->reset_gpio, 1);
351 usleep_range(10000, 11000);
352 gpiod_set_value_cansleep(pcie->reset_gpio, 0);
353 }
354
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH] dmaengine: idxd: fix cdev locking for open and release
by Dan Carpenter
Hi Dave,
url: https://github.com/0day-ci/linux/commits/Dave-Jiang/dmaengine-idxd-fix-cd...
base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/slave-dma.git next
config: x86_64-randconfig-m001-20200620 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/dma/idxd/cdev.c:106 idxd_cdev_open() error: uninitialized symbol 'ctx'.
# https://github.com/0day-ci/linux/commit/26b4f2328e66ceefd1ef3be3bea9217d1...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 26b4f2328e66ceefd1ef3be3bea9217d1b7cdda1
vim +/ctx +106 drivers/dma/idxd/cdev.c
42d279f9137ab7 Dave Jiang 2020-01-21 70
42d279f9137ab7 Dave Jiang 2020-01-21 71 static int idxd_cdev_open(struct inode *inode, struct file *filp)
42d279f9137ab7 Dave Jiang 2020-01-21 72 {
42d279f9137ab7 Dave Jiang 2020-01-21 73 struct idxd_user_context *ctx;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42d279f9137ab7 Dave Jiang 2020-01-21 74 struct idxd_device *idxd;
42d279f9137ab7 Dave Jiang 2020-01-21 75 struct idxd_wq *wq;
42d279f9137ab7 Dave Jiang 2020-01-21 76 struct device *dev;
26b4f2328e66ce Nikhil Rao 2020-06-15 77 int rc;
42d279f9137ab7 Dave Jiang 2020-01-21 78
42d279f9137ab7 Dave Jiang 2020-01-21 79 wq = inode_wq(inode);
42d279f9137ab7 Dave Jiang 2020-01-21 80 idxd = wq->idxd;
42d279f9137ab7 Dave Jiang 2020-01-21 81 dev = &idxd->pdev->dev;
42d279f9137ab7 Dave Jiang 2020-01-21 82
988aad2f111c76 Dave Jiang 2020-03-12 83 dev_dbg(dev, "%s called: %d\n", __func__, idxd_wq_refcount(wq));
42d279f9137ab7 Dave Jiang 2020-01-21 84
26b4f2328e66ce Nikhil Rao 2020-06-15 85 mutex_lock(&wq->wq_lock);
26b4f2328e66ce Nikhil Rao 2020-06-15 86
26b4f2328e66ce Nikhil Rao 2020-06-15 87 if (idxd_wq_refcount(wq) > 0 && wq_dedicated(wq)) {
26b4f2328e66ce Nikhil Rao 2020-06-15 88 rc = -EBUSY;
26b4f2328e66ce Nikhil Rao 2020-06-15 89 goto failed;
^^^^^^^^^^^
26b4f2328e66ce Nikhil Rao 2020-06-15 90 }
42d279f9137ab7 Dave Jiang 2020-01-21 91
42d279f9137ab7 Dave Jiang 2020-01-21 92 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It's probably better for performance to move this allocation outside the
lock anyway.
int rc = 0;
...
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
mutex_lock(&wq->wq_lock);
if (idxd_wq_refcount(wq) > 0 && wq_dedicated(wq)) {
rc = -EBUSY;
goto unlock;
}
...
unlock:
mutex_unlock(&wq->wq_lock);
return rc;
26b4f2328e66ce Nikhil Rao 2020-06-15 93 if (!ctx) {
26b4f2328e66ce Nikhil Rao 2020-06-15 94 rc = -ENOMEM;
26b4f2328e66ce Nikhil Rao 2020-06-15 95 goto failed;
26b4f2328e66ce Nikhil Rao 2020-06-15 96 }
42d279f9137ab7 Dave Jiang 2020-01-21 97
42d279f9137ab7 Dave Jiang 2020-01-21 98 ctx->wq = wq;
42d279f9137ab7 Dave Jiang 2020-01-21 99 filp->private_data = ctx;
42d279f9137ab7 Dave Jiang 2020-01-21 100 idxd_wq_get(wq);
26b4f2328e66ce Nikhil Rao 2020-06-15 101 mutex_unlock(&wq->wq_lock);
42d279f9137ab7 Dave Jiang 2020-01-21 102 return 0;
26b4f2328e66ce Nikhil Rao 2020-06-15 103
26b4f2328e66ce Nikhil Rao 2020-06-15 104 failed:
26b4f2328e66ce Nikhil Rao 2020-06-15 105 mutex_unlock(&wq->wq_lock);
26b4f2328e66ce Nikhil Rao 2020-06-15 @106 kfree(ctx);
^^^^^^^^^
Uninitialized.
26b4f2328e66ce Nikhil Rao 2020-06-15 107 return rc;
42d279f9137ab7 Dave Jiang 2020-01-21 108 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [net-next PATCH v2 1/3] net: phy: Allow mdio buses to auto-probe c45 devices
by kernel test robot
Hi Calvin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Calvin-Johnson/ACPI-support-for-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 29a720c1042f469c8fea317cb5e7f496b116e07d
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 1d4c87335d5236ea1f35937e1014980ba961ae34)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/net/phy/mdio_bus.c:745:10: warning: enumeration value 'MDIOBUS_NO_CAP' not handled in switch [-Wswitch]
switch (bus->probe_capabilities) {
^
1 warning generated.
vim +/MDIOBUS_NO_CAP +745 drivers/net/phy/mdio_bus.c
727
728 /**
729 * mdiobus_scan - scan a bus for MDIO devices.
730 * @bus: mii_bus to scan
731 * @addr: address on bus to scan
732 *
733 * This function scans the MDIO bus, looking for devices which can be
734 * identified using a vendor/product ID in registers 2 and 3. Not all
735 * MDIO devices have such registers, but PHY devices typically
736 * do. Hence this function assumes anything found is a PHY, or can be
737 * treated as a PHY. Other MDIO devices, such as switches, will
738 * probably not be found during the scan.
739 */
740 struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
741 {
742 struct phy_device *phydev = ERR_PTR(-ENODEV);
743 int err;
744
> 745 switch (bus->probe_capabilities) {
746 case MDIOBUS_C22:
747 phydev = get_phy_device(bus, addr, false);
748 break;
749 case MDIOBUS_C45:
750 phydev = get_phy_device(bus, addr, true);
751 break;
752 case MDIOBUS_C22_C45:
753 phydev = get_phy_device(bus, addr, false);
754 if (IS_ERR(phydev))
755 phydev = get_phy_device(bus, addr, true);
756 break;
757 }
758
759 if (IS_ERR(phydev))
760 return phydev;
761
762 /*
763 * For DT, see if the auto-probed phy has a correspoding child
764 * in the bus node, and set the of_node pointer in this case.
765 */
766 of_mdiobus_link_mdiodev(bus, &phydev->mdio);
767
768 err = phy_device_register(phydev);
769 if (err) {
770 phy_device_free(phydev);
771 return ERR_PTR(-ENODEV);
772 }
773
774 return phydev;
775 }
776 EXPORT_SYMBOL(mdiobus_scan);
777
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH 2/2] Add Intel LGM soc DMA support.
by Dan Carpenter
Hi Amireddy,
url: https://github.com/0day-ci/linux/commits/Amireddy-Mallikarjuna-reddy/Add-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: i386-randconfig-m021-20200621 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/dma/lgm/lgm-dma.c:1306 ldma_cfg_init() error: uninitialized symbol 'ret'.
# https://github.com/0day-ci/linux/commit/23493bf02c8f7255c8ff22b02f42f0adc...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 23493bf02c8f7255c8ff22b02f42f0adccb8e8ad
vim +/ret +1306 drivers/dma/lgm/lgm-dma.c
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1198 static int ldma_cfg_init(struct ldma_dev *d)
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1199 {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1200 struct fwnode_handle *fwnode = dev_fwnode(d->dev);
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1201 struct fwnode_handle *fw_chans, *fw_chan;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1202 struct fwnode_handle *fw_ports, *fw_port;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1203 struct ldma_chan *c;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1204 struct ldma_port *p;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1205 u32 txendi, rxendi;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1206 u32 prop, val;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1207 int ret, i;
^^^^^^^
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1208
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1209 if (fwnode_property_read_bool(fwnode, "intel,dma-chan-fc"))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1210 d->flags |= DMA_CHAN_FLOW_CTL;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1211
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1212 if (fwnode_property_read_bool(fwnode, "intel,dma-desc-fod"))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1213 d->flags |= DMA_DESC_FTOD;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1214
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1215 if (fwnode_property_read_bool(fwnode, "intel,dma-desc-in-sram"))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1216 d->flags |= DMA_DESC_IN_SRAM;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1217
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1218 if (fwnode_property_read_bool(fwnode, "intel,dma-byte-en"))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1219 d->flags |= DMA_EN_BYTE_EN;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1220
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1221 if (fwnode_property_read_bool(fwnode, "intel,dma-dfetch-ack"))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1222 d->flags |= DMA_VLD_FETCH_ACK;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1223
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1224 if (fwnode_property_read_bool(fwnode, "intel,dma-dburst-wr"))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1225 d->flags |= DMA_DBURST_WR;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1226
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1227 if (fwnode_property_read_bool(fwnode, "intel,dma-drb"))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1228 d->flags |= DMA_DFT_DRB;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1229
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1230 if (fwnode_property_read_u32(fwnode, "intel,dma-polling-cnt",
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1231 &d->pollcnt))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1232 d->pollcnt = DMA_DFT_POLL_CNT;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1233
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1234 if (!fwnode_property_read_u32(fwnode, "intel,dma-orrc", &val)) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1235 if (val > DMA_ORRC_MAX_CNT)
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1236 return -EINVAL;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1237 d->orrc = val;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1238 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1239
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1240 if (d->ver > DMA_VER22) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1241 if (fwnode_property_read_u32(fwnode, "intel,dma-txendi",
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1242 &txendi))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1243 txendi = DMA_DFT_ENDIAN;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1244
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1245 if (fwnode_property_read_u32(fwnode, "intel,dma-rxendi",
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1246 &rxendi))
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1247 rxendi = DMA_DFT_ENDIAN;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1248
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1249 if (!d->port_nrs)
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1250 return -EINVAL;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1251
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1252 for (i = 0; i < d->port_nrs; i++) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1253 p = &d->ports[i];
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1254 p->rxendi = rxendi;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1255 p->txendi = txendi;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1256
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1257 if (!fwnode_property_read_u32(fwnode, "intel,dma-burst",
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1258 &prop)) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1259 p->rxbl = prop;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1260 p->txbl = prop;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1261 } else {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1262 p->rxbl = DMA_DFT_BURST;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1263 p->txbl = DMA_DFT_BURST;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1264 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1265
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1266 p->pkt_drop = DMA_PKT_DROP_DIS;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1267 p->flush_memcpy = 0;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1268 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1269 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1270
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1271 /* Port specific, required for dma0 */
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1272 fw_ports = fwnode_get_named_child_node(fwnode, "dma,ports");
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1273 if (!fw_ports && d->ver == DMA_VER22) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1274 dev_err(d->dev, "Failed to get ports settings\n");
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1275 return -ENODEV;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1276 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1277 if (fw_ports) {
^^^^^^^
"ret" is not initialized if fw_ports is false.
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1278 fwnode_for_each_child_node(fw_ports, fw_port) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1279 ret = dma_parse_port_dt(fw_port, d);
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1280 if (ret) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1281 fwnode_handle_put(fw_port);
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1282 fwnode_handle_put(fw_ports);
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1283 return -EINVAL;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1284 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1285 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1286 fwnode_handle_put(fw_ports);
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1287 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1288
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1289 d->chans = devm_kcalloc(d->dev, d->chan_nrs, sizeof(*c), GFP_KERNEL);
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1290 if (!d->chans)
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1291 return -ENOMEM;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1292
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1293 /* Channel based configuration if available, optional */
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1294 fw_chans = fwnode_get_named_child_node(fwnode, "dma,channels");
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1295 if (fw_chans) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1296 fwnode_for_each_child_node(fw_chans, fw_chan) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1297 if (dma_parse_chan_dt(fw_chan, d)) {
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1298 fwnode_handle_put(fw_chan);
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1299 fwnode_handle_put(fw_chans);
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1300 return -EINVAL;
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1301 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1302 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1303 fwnode_handle_put(fw_chans);
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1304 }
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1305
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 @1306 return ret;
^^^^^^^^^^
It's more readable to return a literal. "return 0;".
23493bf02c8f72 Amireddy Mallikarjuna reddy 2020-06-10 1307 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [RFC PATCH v1 1/2] ufs: introduce callbacks to get command information
by Dan Carpenter
Hi Kiwoong,
url: https://github.com/0day-ci/linux/commits/Kiwoong-Kim/ufs-introduce-callba...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-randconfig-m001-20200620 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/scsi/ufs/ufshcd.c:2548 ufshcd_queuecommand() warn: variable dereferenced before check 'cmd' (see line 2475)
# https://github.com/0day-ci/linux/commit/cff1afd5a0773e6da9106e953721996a5...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout cff1afd5a0773e6da9106e953721996a56a9332c
vim +/cmd +2548 drivers/scsi/ufs/ufshcd.c
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2465 static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2466 {
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2467 struct ufshcd_lrb *lrbp;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2468 struct ufs_hba *hba;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2469 unsigned long flags;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2470 int tag;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2471 int err = 0;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2472
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2473 hba = shost_priv(host);
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2474
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 @2475 tag = cmd->request->tag;
^^^^^^^^^^^^^^^^^
Dereference.
14497328b6a628 Yaniv Gardi 2016-02-01 2476 if (!ufshcd_valid_tag(hba, tag)) {
14497328b6a628 Yaniv Gardi 2016-02-01 2477 dev_err(hba->dev,
14497328b6a628 Yaniv Gardi 2016-02-01 2478 "%s: invalid command tag %d: cmd=0x%p, cmd->request=0x%p",
14497328b6a628 Yaniv Gardi 2016-02-01 2479 __func__, tag, cmd, cmd->request);
14497328b6a628 Yaniv Gardi 2016-02-01 2480 BUG();
14497328b6a628 Yaniv Gardi 2016-02-01 2481 }
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2482
a3cd5ec55f6c72 Subhash Jadavani 2017-02-03 2483 if (!down_read_trylock(&hba->clk_scaling_lock))
a3cd5ec55f6c72 Subhash Jadavani 2017-02-03 2484 return SCSI_MLQUEUE_HOST_BUSY;
a3cd5ec55f6c72 Subhash Jadavani 2017-02-03 2485
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2486 spin_lock_irqsave(hba->host->host_lock, flags);
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2487 switch (hba->ufshcd_state) {
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2488 case UFSHCD_STATE_OPERATIONAL:
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2489 break;
141f81651037ea Zang Leigang 2016-11-16 2490 case UFSHCD_STATE_EH_SCHEDULED:
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2491 case UFSHCD_STATE_RESET:
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2492 err = SCSI_MLQUEUE_HOST_BUSY;
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2493 goto out_unlock;
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2494 case UFSHCD_STATE_ERROR:
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2495 set_host_byte(cmd, DID_ERROR);
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2496 cmd->scsi_done(cmd);
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2497 goto out_unlock;
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2498 default:
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2499 dev_WARN_ONCE(hba->dev, 1, "%s: invalid state %d\n",
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2500 __func__, hba->ufshcd_state);
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2501 set_host_byte(cmd, DID_BAD_TARGET);
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2502 cmd->scsi_done(cmd);
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2503 goto out_unlock;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2504 }
53c12d0ef6fcb7 Yaniv Gardi 2016-02-01 2505
53c12d0ef6fcb7 Yaniv Gardi 2016-02-01 2506 /* if error handling is in progress, don't issue commands */
53c12d0ef6fcb7 Yaniv Gardi 2016-02-01 2507 if (ufshcd_eh_in_progress(hba)) {
53c12d0ef6fcb7 Yaniv Gardi 2016-02-01 2508 set_host_byte(cmd, DID_ERROR);
53c12d0ef6fcb7 Yaniv Gardi 2016-02-01 2509 cmd->scsi_done(cmd);
53c12d0ef6fcb7 Yaniv Gardi 2016-02-01 2510 goto out_unlock;
53c12d0ef6fcb7 Yaniv Gardi 2016-02-01 2511 }
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2512 spin_unlock_irqrestore(hba->host->host_lock, flags);
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2513
7fabb77b3aa016 Gilad Broner 2017-02-03 2514 hba->req_abort_count = 0;
7fabb77b3aa016 Gilad Broner 2017-02-03 2515
1ab27c9cf8b63d Sahitya Tummala 2014-09-25 2516 err = ufshcd_hold(hba, true);
1ab27c9cf8b63d Sahitya Tummala 2014-09-25 2517 if (err) {
1ab27c9cf8b63d Sahitya Tummala 2014-09-25 2518 err = SCSI_MLQUEUE_HOST_BUSY;
1ab27c9cf8b63d Sahitya Tummala 2014-09-25 2519 goto out;
1ab27c9cf8b63d Sahitya Tummala 2014-09-25 2520 }
1ab27c9cf8b63d Sahitya Tummala 2014-09-25 2521 WARN_ON(hba->clk_gating.state != CLKS_ON);
1ab27c9cf8b63d Sahitya Tummala 2014-09-25 2522
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2523 lrbp = &hba->lrb[tag];
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2524
5a0b0cb9bee767 Sujit Reddy Thumma 2013-07-30 2525 WARN_ON(lrbp->cmd);
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2526 lrbp->cmd = cmd;
09a5a24ff36f90 Avri Altman 2018-11-22 2527 lrbp->sense_bufflen = UFS_SENSE_SIZE;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2528 lrbp->sense_buffer = cmd->sense_buffer;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2529 lrbp->task_tag = tag;
0ce147d48a3e33 Subhash Jadavani 2014-09-25 2530 lrbp->lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
b852190e589abe Yaniv Gardi 2015-05-17 2531 lrbp->intr_cmd = !ufshcd_is_intr_aggr_allowed(hba) ? true : false;
e0b299e36004f5 Gilad Broner 2017-02-03 2532 lrbp->req_abort_skip = false;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2533
300bb13f5c7b1d Joao Pinto 2016-05-11 2534 ufshcd_comp_scsi_upiu(hba, lrbp);
300bb13f5c7b1d Joao Pinto 2016-05-11 2535
75b1cc4ad63afa Kiwoong Kim 2016-11-22 2536 err = ufshcd_map_sg(hba, lrbp);
5a0b0cb9bee767 Sujit Reddy Thumma 2013-07-30 2537 if (err) {
5a0b0cb9bee767 Sujit Reddy Thumma 2013-07-30 2538 lrbp->cmd = NULL;
17c7d35f141ef6 Can Guo 2019-12-05 2539 ufshcd_release(hba);
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2540 goto out;
5a0b0cb9bee767 Sujit Reddy Thumma 2013-07-30 2541 }
ad1a1b9cd67a4b Gilad Broner 2016-10-17 2542 /* Make sure descriptors are ready before ringing the doorbell */
ad1a1b9cd67a4b Gilad Broner 2016-10-17 2543 wmb();
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2544
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2545 /* issue command to the controller */
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2546 spin_lock_irqsave(hba->host->host_lock, flags);
5905d4648e7ec2 Bart Van Assche 2020-01-22 2547 ufshcd_vops_setup_xfer_req(hba, tag, true);
cff1afd5a0773e Kiwoong Kim 2020-06-20 @2548 if (cmd)
^^^
If "cmd" is NULL then we would have already crashed.
cff1afd5a0773e Kiwoong Kim 2020-06-20 2549 ufshcd_vops_cmd_log(hba, cmd, 1);
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2550 ufshcd_send_command(hba, tag);
3441da7ddbdedf Sujit Reddy Thumma 2014-05-26 2551 out_unlock:
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2552 spin_unlock_irqrestore(hba->host->host_lock, flags);
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2553 out:
a3cd5ec55f6c72 Subhash Jadavani 2017-02-03 2554 up_read(&hba->clk_scaling_lock);
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2555 return err;
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 2556 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[sashal-linux-stable:queue-4.19 212/440] drivers/pci/quirks.c:5103:2: error: implicit declaration of function 'pci_create_device_link'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.19
head: 7a462d454a5354302318d17cb32da8ec0c8e1a35
commit: 025b25be8630a0280d2c0ff360576bb50b141877 [212/440] PCI: Add NVIDIA GPU multi-function power dependencies
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 025b25be8630a0280d2c0ff360576bb50b141877
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the sashal-linux-stable/queue-4.19 HEAD 7a462d454a5354302318d17cb32da8ec0c8e1a35 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:10,
from drivers/pci/quirks.c:16:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
182 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
include/linux/compiler.h:77:42: note: in definition of macro 'unlikely'
77 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
| ^~~~~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
182 | ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
| ^~
include/linux/compiler.h:77:42: note: in definition of macro 'unlikely'
77 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/dma-mapping.h:329:2: note: in expansion of macro 'BUG_ON'
329 | BUG_ON(pfn_valid(PHYS_PFN(phys_addr)));
| ^~~~~~
include/linux/dma-mapping.h:329:9: note: in expansion of macro 'pfn_valid'
329 | BUG_ON(pfn_valid(PHYS_PFN(phys_addr)));
| ^~~~~~~~~
drivers/pci/quirks.c: In function 'pci_quirk_rciep_acs':
drivers/pci/quirks.c:4556:9: error: implicit declaration of function 'pci_acs_ctrl_enabled'; did you mean 'pci_acs_path_enabled'? [-Werror=implicit-function-declaration]
4556 | return pci_acs_ctrl_enabled(acs_flags,
| ^~~~~~~~~~~~~~~~~~~~
| pci_acs_path_enabled
drivers/pci/quirks.c: In function 'quirk_gpu_usb':
>> drivers/pci/quirks.c:5103:2: error: implicit declaration of function 'pci_create_device_link' [-Werror=implicit-function-declaration]
5103 | pci_create_device_link(usb, 2, 0, PCI_BASE_CLASS_DISPLAY, 16);
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/pci/quirks.c: In function 'quirk_switchtec_ntb_dma_alias':
drivers/pci/quirks.c:5190:32: warning: variable 'mmio_sys_info' set but not used [-Wunused-but-set-variable]
5190 | struct sys_info_regs __iomem *mmio_sys_info;
| ^~~~~~~~~~~~~
In file included from drivers/pci/quirks.c:18:
drivers/pci/quirks.c: At top level:
drivers/pci/quirks.c:5374:25: error: 'PCI_VENDOR_ID_PERICOM' undeclared here (not in a function); did you mean 'PCI_VENDOR_ID_MYRICOM'?
5374 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400e, pci_fixup_no_pme);
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/pci.h:1855:7: note: in definition of macro 'DECLARE_PCI_FIXUP_SECTION'
1855 | = { vendor, device, class, class_shift, hook };
| ^~~~~~
drivers/pci/quirks.c:5374:1: note: in expansion of macro 'DECLARE_PCI_FIXUP_FINAL'
5374 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400e, pci_fixup_no_pme);
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/pci/quirks.c: In function 'quirk_netmos':
drivers/pci/quirks.c:2201:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
2201 | if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
| ^
drivers/pci/quirks.c:2205:2: note: here
2205 | case PCI_DEVICE_ID_NETMOS_9735:
| ^~~~
cc1: some warnings being treated as errors
vim +/pci_create_device_link +5103 drivers/pci/quirks.c
5058
5059 /*
5060 * GPUs with integrated HDA controller for streaming audio to attached displays
5061 * need a device link from the HDA controller (consumer) to the GPU (supplier)
5062 * so that the GPU is powered up whenever the HDA controller is accessed.
5063 * The GPU and HDA controller are functions 0 and 1 of the same PCI device.
5064 * The device link stays in place until shutdown (or removal of the PCI device
5065 * if it's hotplugged). Runtime PM is allowed by default on the HDA controller
5066 * to prevent it from permanently keeping the GPU awake.
5067 */
5068 static void quirk_gpu_hda(struct pci_dev *hda)
5069 {
5070 struct pci_dev *gpu;
5071
5072 if (PCI_FUNC(hda->devfn) != 1)
5073 return;
5074
5075 gpu = pci_get_domain_bus_and_slot(pci_domain_nr(hda->bus),
5076 hda->bus->number,
5077 PCI_DEVFN(PCI_SLOT(hda->devfn), 0));
5078 if (!gpu || (gpu->class >> 16) != PCI_BASE_CLASS_DISPLAY) {
5079 pci_dev_put(gpu);
5080 return;
5081 }
5082
5083 if (!device_link_add(&hda->dev, &gpu->dev,
5084 DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME))
5085 pci_err(hda, "cannot link HDA to GPU %s\n", pci_name(gpu));
5086
5087 pm_runtime_allow(&hda->dev);
5088 pci_dev_put(gpu);
5089 }
5090 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, PCI_ANY_ID,
5091 PCI_CLASS_MULTIMEDIA_HD_AUDIO, 8, quirk_gpu_hda);
5092 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_AMD, PCI_ANY_ID,
5093 PCI_CLASS_MULTIMEDIA_HD_AUDIO, 8, quirk_gpu_hda);
5094 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
5095 PCI_CLASS_MULTIMEDIA_HD_AUDIO, 8, quirk_gpu_hda);
5096
5097 /*
5098 * Create device link for NVIDIA GPU with integrated USB xHCI Host
5099 * controller to VGA.
5100 */
5101 static void quirk_gpu_usb(struct pci_dev *usb)
5102 {
> 5103 pci_create_device_link(usb, 2, 0, PCI_BASE_CLASS_DISPLAY, 16);
5104 }
5105 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
5106 PCI_CLASS_SERIAL_USB, 8, quirk_gpu_usb);
5107
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH v2 15/16] treewide: Remove uninitialized_var() usage
by Dan Carpenter
Hi Kees,
I love your patch! Perhaps something to improve:
[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on linus/master v5.8-rc1 next-20200618]
[cannot apply to wireless-drivers/master rw-ubifs/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Kees-Cook/Remove-uninitialized_v...
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-ne... master
config: x86_64-randconfig-m001-20200619 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/gpu/drm/drm_edid.c:3078 drm_cvt_modes() error: uninitialized symbol 'width'.
# https://github.com/0day-ci/linux/commit/f58ed1805d1492d80a38f58702a37a099...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout f58ed1805d1492d80a38f58702a37a0996973ffc
vim +/width +3078 drivers/gpu/drm/drm_edid.c
139315796778a6 Adam Jackson 2010-08-03 3043 static int drm_cvt_modes(struct drm_connector *connector,
139315796778a6 Adam Jackson 2010-08-03 3044 struct detailed_timing *timing)
139315796778a6 Adam Jackson 2010-08-03 3045 {
139315796778a6 Adam Jackson 2010-08-03 3046 int i, j, modes = 0;
139315796778a6 Adam Jackson 2010-08-03 3047 struct drm_display_mode *newmode;
139315796778a6 Adam Jackson 2010-08-03 3048 struct drm_device *dev = connector->dev;
139315796778a6 Adam Jackson 2010-08-03 3049 struct cvt_timing *cvt;
139315796778a6 Adam Jackson 2010-08-03 3050 const int rates[] = { 60, 85, 75, 60, 50 };
139315796778a6 Adam Jackson 2010-08-03 3051 const u8 empty[3] = { 0, 0, 0 };
a327f6b806103e Adam Jackson 2010-03-29 3052
139315796778a6 Adam Jackson 2010-08-03 3053 for (i = 0; i < 4; i++) {
f58ed1805d1492 Kees Cook 2020-06-19 3054 int width, height;
139315796778a6 Adam Jackson 2010-08-03 3055 cvt = &(timing->data.other_data.data.cvt[i]);
9cf00977da0920 Adam Jackson 2009-12-03 3056
139315796778a6 Adam Jackson 2010-08-03 3057 if (!memcmp(cvt->code, empty, 3))
9cf00977da0920 Adam Jackson 2009-12-03 3058 continue;
9cf00977da0920 Adam Jackson 2009-12-03 3059
139315796778a6 Adam Jackson 2010-08-03 3060 height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2;
139315796778a6 Adam Jackson 2010-08-03 3061 switch (cvt->code[1] & 0x0c) {
139315796778a6 Adam Jackson 2010-08-03 3062 case 0x00:
139315796778a6 Adam Jackson 2010-08-03 3063 width = height * 4 / 3;
139315796778a6 Adam Jackson 2010-08-03 3064 break;
139315796778a6 Adam Jackson 2010-08-03 3065 case 0x04:
139315796778a6 Adam Jackson 2010-08-03 3066 width = height * 16 / 9;
139315796778a6 Adam Jackson 2010-08-03 3067 break;
139315796778a6 Adam Jackson 2010-08-03 3068 case 0x08:
139315796778a6 Adam Jackson 2010-08-03 3069 width = height * 16 / 10;
139315796778a6 Adam Jackson 2010-08-03 3070 break;
139315796778a6 Adam Jackson 2010-08-03 3071 case 0x0c:
139315796778a6 Adam Jackson 2010-08-03 3072 width = height * 15 / 9;
139315796778a6 Adam Jackson 2010-08-03 3073 break;
Default case?
139315796778a6 Adam Jackson 2010-08-03 3074 }
139315796778a6 Adam Jackson 2010-08-03 3075
139315796778a6 Adam Jackson 2010-08-03 3076 for (j = 1; j < 5; j++) {
139315796778a6 Adam Jackson 2010-08-03 3077 if (cvt->code[2] & (1 << j)) {
139315796778a6 Adam Jackson 2010-08-03 @3078 newmode = drm_cvt_mode(dev, width, height,
139315796778a6 Adam Jackson 2010-08-03 3079 rates[j], j == 0,
139315796778a6 Adam Jackson 2010-08-03 3080 false, false);
139315796778a6 Adam Jackson 2010-08-03 3081 if (newmode) {
139315796778a6 Adam Jackson 2010-08-03 3082 drm_mode_probed_add(connector, newmode);
139315796778a6 Adam Jackson 2010-08-03 3083 modes++;
139315796778a6 Adam Jackson 2010-08-03 3084 }
139315796778a6 Adam Jackson 2010-08-03 3085 }
139315796778a6 Adam Jackson 2010-08-03 3086 }
f453ba0460742a Dave Airlie 2008-11-07 3087 }
f453ba0460742a Dave Airlie 2008-11-07 3088
f453ba0460742a Dave Airlie 2008-11-07 3089 return modes;
f453ba0460742a Dave Airlie 2008-11-07 3090 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
arch/mips/sgi-ip27/ip27-hubio.c:30:15: warning: no previous prototype for 'hub_pio_map'
by kernel test robot
Hi Thomas,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 625d3449788f85569096780592549d0340e9c0c7
commit: b78e9d63a3b6307b6b786e6ba189d3978b60ceb5 MIPS: SGI-IP27: use asm/sn/agent.h for including HUB related stuff
date: 6 months ago
config: mips-randconfig-r021-20200622 (attached as .config)
compiler: mips64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout b78e9d63a3b6307b6b786e6ba189d3978b60ceb5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> arch/mips/sgi-ip27/ip27-hubio.c:30:15: warning: no previous prototype for 'hub_pio_map' [-Wmissing-prototypes]
30 | unsigned long hub_pio_map(nasid_t nasid, xwidgetnum_t widget,
| ^~~~~~~~~~~
>> arch/mips/sgi-ip27/ip27-hubio.c:175:6: warning: no previous prototype for 'hub_pio_init' [-Wmissing-prototypes]
175 | void hub_pio_init(nasid_t nasid)
| ^~~~~~~~~~~~
vim +/hub_pio_map +30 arch/mips/sgi-ip27/ip27-hubio.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 20
^1da177e4c3f41 Linus Torvalds 2005-04-16 21 /**
^1da177e4c3f41 Linus Torvalds 2005-04-16 22 * hub_pio_map - establish a HUB PIO mapping
^1da177e4c3f41 Linus Torvalds 2005-04-16 23 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 24 * @hub: hub to perform PIO mapping on
^1da177e4c3f41 Linus Torvalds 2005-04-16 25 * @widget: widget ID to perform PIO mapping for
^1da177e4c3f41 Linus Torvalds 2005-04-16 26 * @xtalk_addr: xtalk_address that needs to be mapped
^1da177e4c3f41 Linus Torvalds 2005-04-16 27 * @size: size of the PIO mapping
^1da177e4c3f41 Linus Torvalds 2005-04-16 28 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 29 **/
4bf841ebf17aaa Thomas Bogendoerfer 2019-10-03 @30 unsigned long hub_pio_map(nasid_t nasid, xwidgetnum_t widget,
^1da177e4c3f41 Linus Torvalds 2005-04-16 31 unsigned long xtalk_addr, size_t size)
^1da177e4c3f41 Linus Torvalds 2005-04-16 32 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 33 unsigned i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 34
^1da177e4c3f41 Linus Torvalds 2005-04-16 35 /* use small-window mapping if possible */
^1da177e4c3f41 Linus Torvalds 2005-04-16 36 if ((xtalk_addr % SWIN_SIZE) + size <= SWIN_SIZE)
^1da177e4c3f41 Linus Torvalds 2005-04-16 37 return NODE_SWIN_BASE(nasid, widget) + (xtalk_addr % SWIN_SIZE);
^1da177e4c3f41 Linus Torvalds 2005-04-16 38
^1da177e4c3f41 Linus Torvalds 2005-04-16 39 if ((xtalk_addr % BWIN_SIZE) + size > BWIN_SIZE) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 40 printk(KERN_WARNING "PIO mapping at hub %d widget %d addr 0x%lx"
^1da177e4c3f41 Linus Torvalds 2005-04-16 41 " too big (%ld)\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 42 nasid, widget, xtalk_addr, size);
^1da177e4c3f41 Linus Torvalds 2005-04-16 43 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 44 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 45
^1da177e4c3f41 Linus Torvalds 2005-04-16 46 xtalk_addr &= ~(BWIN_SIZE-1);
^1da177e4c3f41 Linus Torvalds 2005-04-16 47 for (i = 0; i < HUB_NUM_BIG_WINDOW; i++) {
4bf841ebf17aaa Thomas Bogendoerfer 2019-10-03 48 if (test_and_set_bit(i, hub_data(nasid)->h_bigwin_used))
^1da177e4c3f41 Linus Torvalds 2005-04-16 49 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 50
^1da177e4c3f41 Linus Torvalds 2005-04-16 51 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 52 * The code below does a PIO write to setup an ITTE entry.
^1da177e4c3f41 Linus Torvalds 2005-04-16 53 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 54 * We need to prevent other CPUs from seeing our updated
^1da177e4c3f41 Linus Torvalds 2005-04-16 55 * memory shadow of the ITTE (in the piomap) until the ITTE
^1da177e4c3f41 Linus Torvalds 2005-04-16 56 * entry is actually set up; otherwise, another CPU might
^1da177e4c3f41 Linus Torvalds 2005-04-16 57 * attempt a PIO prematurely.
^1da177e4c3f41 Linus Torvalds 2005-04-16 58 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 59 * Also, the only way we can know that an entry has been
^1da177e4c3f41 Linus Torvalds 2005-04-16 60 * received by the hub and can be used by future PIO reads/
^1da177e4c3f41 Linus Torvalds 2005-04-16 61 * writes is by reading back the ITTE entry after writing it.
^1da177e4c3f41 Linus Torvalds 2005-04-16 62 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 63 * For these two reasons, we PIO read back the ITTE entry
^1da177e4c3f41 Linus Torvalds 2005-04-16 64 * after we write it.
^1da177e4c3f41 Linus Torvalds 2005-04-16 65 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 66 IIO_ITTE_PUT(nasid, i, HUB_PIO_MAP_TO_MEM, widget, xtalk_addr);
db0e7d4e42b055 Thomas Bogendoerfer 2019-02-19 67 __raw_readq(IIO_ITTE_GET(nasid, i));
^1da177e4c3f41 Linus Torvalds 2005-04-16 68
^1da177e4c3f41 Linus Torvalds 2005-04-16 69 return NODE_BWIN_BASE(nasid, widget) + (xtalk_addr % BWIN_SIZE);
^1da177e4c3f41 Linus Torvalds 2005-04-16 70 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 71
^1da177e4c3f41 Linus Torvalds 2005-04-16 72 printk(KERN_WARNING "unable to establish PIO mapping for at"
^1da177e4c3f41 Linus Torvalds 2005-04-16 73 " hub %d widget %d addr 0x%lx\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 74 nasid, widget, xtalk_addr);
^1da177e4c3f41 Linus Torvalds 2005-04-16 75 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 76 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 77
^1da177e4c3f41 Linus Torvalds 2005-04-16 78
^1da177e4c3f41 Linus Torvalds 2005-04-16 79 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 80 * hub_setup_prb(nasid, prbnum, credits, conveyor)
^1da177e4c3f41 Linus Torvalds 2005-04-16 81 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 82 * Put a PRB into fire-and-forget mode if conveyor isn't set. Otherwise,
^1da177e4c3f41 Linus Torvalds 2005-04-16 83 * put it into conveyor belt mode with the specified number of credits.
^1da177e4c3f41 Linus Torvalds 2005-04-16 84 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 85 static void hub_setup_prb(nasid_t nasid, int prbnum, int credits)
^1da177e4c3f41 Linus Torvalds 2005-04-16 86 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 87 iprb_t prb;
^1da177e4c3f41 Linus Torvalds 2005-04-16 88 int prb_offset;
^1da177e4c3f41 Linus Torvalds 2005-04-16 89
^1da177e4c3f41 Linus Torvalds 2005-04-16 90 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 91 * Get the current register value.
^1da177e4c3f41 Linus Torvalds 2005-04-16 92 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 93 prb_offset = IIO_IOPRB(prbnum);
^1da177e4c3f41 Linus Torvalds 2005-04-16 94 prb.iprb_regval = REMOTE_HUB_L(nasid, prb_offset);
^1da177e4c3f41 Linus Torvalds 2005-04-16 95
^1da177e4c3f41 Linus Torvalds 2005-04-16 96 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 97 * Clear out some fields.
^1da177e4c3f41 Linus Torvalds 2005-04-16 98 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 99 prb.iprb_ovflow = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 100 prb.iprb_bnakctr = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 101 prb.iprb_anakctr = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 102
^1da177e4c3f41 Linus Torvalds 2005-04-16 103 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 104 * Enable or disable fire-and-forget mode.
^1da177e4c3f41 Linus Torvalds 2005-04-16 105 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 106 prb.iprb_ff = force_fire_and_forget ? 1 : 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 107
^1da177e4c3f41 Linus Torvalds 2005-04-16 108 /*
87fd4e2692a2ad Andrea Gelmini 2016-05-21 109 * Set the appropriate number of PIO credits for the widget.
^1da177e4c3f41 Linus Torvalds 2005-04-16 110 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 111 prb.iprb_xtalkctr = credits;
^1da177e4c3f41 Linus Torvalds 2005-04-16 112
^1da177e4c3f41 Linus Torvalds 2005-04-16 113 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 114 * Store the new value to the register.
^1da177e4c3f41 Linus Torvalds 2005-04-16 115 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 116 REMOTE_HUB_S(nasid, prb_offset, prb.iprb_regval);
^1da177e4c3f41 Linus Torvalds 2005-04-16 117 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 118
^1da177e4c3f41 Linus Torvalds 2005-04-16 119 /**
^1da177e4c3f41 Linus Torvalds 2005-04-16 120 * hub_set_piomode - set pio mode for a given hub
^1da177e4c3f41 Linus Torvalds 2005-04-16 121 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 122 * @nasid: physical node ID for the hub in question
^1da177e4c3f41 Linus Torvalds 2005-04-16 123 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 124 * Put the hub into either "PIO conveyor belt" mode or "fire-and-forget" mode.
^1da177e4c3f41 Linus Torvalds 2005-04-16 125 * To do this, we have to make absolutely sure that no PIOs are in progress
^1da177e4c3f41 Linus Torvalds 2005-04-16 126 * so we turn off access to all widgets for the duration of the function.
^1da177e4c3f41 Linus Torvalds 2005-04-16 127 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 128 * XXX - This code should really check what kind of widget we're talking
^1da177e4c3f41 Linus Torvalds 2005-04-16 129 * to. Bridges can only handle three requests, but XG will do more.
^1da177e4c3f41 Linus Torvalds 2005-04-16 130 * How many can crossbow handle to widget 0? We're assuming 1.
^1da177e4c3f41 Linus Torvalds 2005-04-16 131 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 132 * XXX - There is a bug in the crossbow that link reset PIOs do not
^1da177e4c3f41 Linus Torvalds 2005-04-16 133 * return write responses. The easiest solution to this problem is to
^1da177e4c3f41 Linus Torvalds 2005-04-16 134 * leave widget 0 (xbow) in fire-and-forget mode at all times. This
^1da177e4c3f41 Linus Torvalds 2005-04-16 135 * only affects pio's to xbow registers, which should be rare.
^1da177e4c3f41 Linus Torvalds 2005-04-16 136 **/
^1da177e4c3f41 Linus Torvalds 2005-04-16 137 static void hub_set_piomode(nasid_t nasid)
^1da177e4c3f41 Linus Torvalds 2005-04-16 138 {
db0e7d4e42b055 Thomas Bogendoerfer 2019-02-19 139 u64 ii_iowa;
^1da177e4c3f41 Linus Torvalds 2005-04-16 140 hubii_wcr_t ii_wcr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 141 unsigned i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 142
^1da177e4c3f41 Linus Torvalds 2005-04-16 143 ii_iowa = REMOTE_HUB_L(nasid, IIO_OUTWIDGET_ACCESS);
^1da177e4c3f41 Linus Torvalds 2005-04-16 144 REMOTE_HUB_S(nasid, IIO_OUTWIDGET_ACCESS, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 145
^1da177e4c3f41 Linus Torvalds 2005-04-16 146 ii_wcr.wcr_reg_value = REMOTE_HUB_L(nasid, IIO_WCR);
^1da177e4c3f41 Linus Torvalds 2005-04-16 147
^1da177e4c3f41 Linus Torvalds 2005-04-16 148 if (ii_wcr.iwcr_dir_con) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 149 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 150 * Assume a bridge here.
^1da177e4c3f41 Linus Torvalds 2005-04-16 151 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 152 hub_setup_prb(nasid, 0, 3);
^1da177e4c3f41 Linus Torvalds 2005-04-16 153 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 154 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 155 * Assume a crossbow here.
^1da177e4c3f41 Linus Torvalds 2005-04-16 156 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 157 hub_setup_prb(nasid, 0, 1);
^1da177e4c3f41 Linus Torvalds 2005-04-16 158 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 159
^1da177e4c3f41 Linus Torvalds 2005-04-16 160 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 161 * XXX - Here's where we should take the widget type into
^1da177e4c3f41 Linus Torvalds 2005-04-16 162 * when account assigning credits.
^1da177e4c3f41 Linus Torvalds 2005-04-16 163 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 164 for (i = HUB_WIDGET_ID_MIN; i <= HUB_WIDGET_ID_MAX; i++)
^1da177e4c3f41 Linus Torvalds 2005-04-16 165 hub_setup_prb(nasid, i, 3);
^1da177e4c3f41 Linus Torvalds 2005-04-16 166
^1da177e4c3f41 Linus Torvalds 2005-04-16 167 REMOTE_HUB_S(nasid, IIO_OUTWIDGET_ACCESS, ii_iowa);
^1da177e4c3f41 Linus Torvalds 2005-04-16 168 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 169
^1da177e4c3f41 Linus Torvalds 2005-04-16 170 /*
603e82edf78ad6 Joe Perches 2008-02-03 171 * hub_pio_init - PIO-related hub initialization
^1da177e4c3f41 Linus Torvalds 2005-04-16 172 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 173 * @hub: hubinfo structure for our hub
^1da177e4c3f41 Linus Torvalds 2005-04-16 174 */
4bf841ebf17aaa Thomas Bogendoerfer 2019-10-03 @175 void hub_pio_init(nasid_t nasid)
:::::: The code at line 30 was first introduced by commit
:::::: 4bf841ebf17aaa0f7712623896c699b44fa92f44 MIPS: SGI-IP27: get rid of compact node ids
:::::: TO: Thomas Bogendoerfer <tbogendoerfer(a)suse.de>
:::::: CC: Paul Burton <paul.burton(a)mips.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months