drivers/pci/controller/pci-v3-semi.c:808:2-9: line 808 is redundant because platform_get_irq() already prints an error
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: YueHaibing <yuehaibing(a)huawei.com>
CC: "Greg Kroah-Hartman" <gregkh(a)linuxfoundation.org>
CC: Stephen Boyd <swboyd(a)chromium.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e9919e11e219eaa5e8041b7b1a196839143e9125
commit: ca7ce5a2710ad2a57bf7d0c4c712590bb69a5e1c coccinelle: platform_get_irq: Fix parse error
date: 10 months ago
:::::: branch date: 2 days ago
:::::: commit date: 10 months ago
config: arm-randconfig-c021-20200715 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 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: Julia Lawall <julia.lawall(a)lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> drivers/pci/controller/pci-v3-semi.c:808:2-9: line 808 is redundant because platform_get_irq() already prints an error
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout ca7ce5a2710ad2a57bf7d0c4c712590bb69a5e1c
vim +808 drivers/pci/controller/pci-v3-semi.c
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 730
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 731 static int v3_pci_probe(struct platform_device *pdev)
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 732 {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 733 struct device *dev = &pdev->dev;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 734 struct device_node *np = dev->of_node;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 735 resource_size_t io_base;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 736 struct resource *regs;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 737 struct resource_entry *win;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 738 struct v3_pci *v3;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 739 struct pci_host_bridge *host;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 740 struct clk *clk;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 741 u16 val;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 742 int irq;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 743 int ret;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 744 LIST_HEAD(res);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 745
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 746 host = pci_alloc_host_bridge(sizeof(*v3));
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 747 if (!host)
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 748 return -ENOMEM;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 749
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 750 host->dev.parent = dev;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 751 host->ops = &v3_pci_ops;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 752 host->busnr = 0;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 753 host->msi = NULL;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 754 host->map_irq = of_irq_parse_and_map_pci;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 755 host->swizzle_irq = pci_common_swizzle;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 756 v3 = pci_host_bridge_priv(host);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 757 host->sysdata = v3;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 758 v3->dev = dev;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 759
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 760 /* Get and enable host clock */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 761 clk = devm_clk_get(dev, NULL);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 762 if (IS_ERR(clk)) {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 763 dev_err(dev, "clock not found\n");
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 764 return PTR_ERR(clk);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 765 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 766 ret = clk_prepare_enable(clk);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 767 if (ret) {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 768 dev_err(dev, "unable to enable clock\n");
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 769 return ret;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 770 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 771
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 772 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 773 v3->base = devm_ioremap_resource(dev, regs);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 774 if (IS_ERR(v3->base))
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 775 return PTR_ERR(v3->base);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 776 /*
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 777 * The hardware has a register with the physical base address
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 778 * of the V3 controller itself, verify that this is the same
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 779 * as the physical memory we've remapped it from.
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 780 */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 781 if (readl(v3->base + V3_LB_IO_BASE) != (regs->start >> 16))
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 782 dev_err(dev, "V3_LB_IO_BASE = %08x but device is @%pR\n",
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 783 readl(v3->base + V3_LB_IO_BASE), regs);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 784
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 785 /* Configuration space is 16MB directly mapped */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 786 regs = platform_get_resource(pdev, IORESOURCE_MEM, 1);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 787 if (resource_size(regs) != SZ_16M) {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 788 dev_err(dev, "config mem is not 16MB!\n");
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 789 return -EINVAL;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 790 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 791 v3->config_mem = regs->start;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 792 v3->config_base = devm_ioremap_resource(dev, regs);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 793 if (IS_ERR(v3->config_base))
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 794 return PTR_ERR(v3->config_base);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 795
5bd51b35c7cbbc9 drivers/pci/host/pci-v3-semi.c Jan Kiszka 2018-05-15 796 ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res,
055f87a2a336409 drivers/pci/host/pci-v3-semi.c Jan Kiszka 2018-05-15 797 &io_base);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 798 if (ret)
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 799 return ret;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 800
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 801 ret = devm_request_pci_bus_resources(dev, &res);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 802 if (ret)
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 803 return ret;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 804
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 805 /* Get and request error IRQ resource */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 806 irq = platform_get_irq(pdev, 0);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 807 if (irq <= 0) {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 @808 dev_err(dev, "unable to obtain PCIv3 error IRQ\n");
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 809 return -ENODEV;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 810 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 811 ret = devm_request_irq(dev, irq, v3_irq, 0,
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 812 "PCIv3 error", v3);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 813 if (ret < 0) {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 814 dev_err(dev,
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 815 "unable to request PCIv3 error IRQ %d (%d)\n",
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 816 irq, ret);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 817 return ret;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 818 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 819
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 820 /*
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 821 * Unlock V3 registers, but only if they were previously locked.
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 822 */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 823 if (readw(v3->base + V3_SYSTEM) & V3_SYSTEM_M_LOCK)
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 824 writew(V3_SYSTEM_UNLOCK, v3->base + V3_SYSTEM);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 825
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 826 /* Disable all slave access while we set up the windows */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 827 val = readw(v3->base + V3_PCI_CMD);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 828 val &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 829 writew(val, v3->base + V3_PCI_CMD);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 830
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 831 /* Put the PCI bus into reset */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 832 val = readw(v3->base + V3_SYSTEM);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 833 val &= ~V3_SYSTEM_M_RST_OUT;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 834 writew(val, v3->base + V3_SYSTEM);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 835
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 836 /* Retry until we're ready */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 837 val = readw(v3->base + V3_PCI_CFG);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 838 val |= V3_PCI_CFG_M_RETRY_EN;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 839 writew(val, v3->base + V3_PCI_CFG);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 840
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 841 /* Set up the local bus protocol */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 842 val = readw(v3->base + V3_LB_CFG);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 843 val |= V3_LB_CFG_LB_BE_IMODE; /* Byte enable input */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 844 val |= V3_LB_CFG_LB_BE_OMODE; /* Byte enable output */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 845 val &= ~V3_LB_CFG_LB_ENDIAN; /* Little endian */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 846 val &= ~V3_LB_CFG_LB_PPC_RDY; /* TODO: when using on PPC403Gx, set to 1 */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 847 writew(val, v3->base + V3_LB_CFG);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 848
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 849 /* Enable the PCI bus master */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 850 val = readw(v3->base + V3_PCI_CMD);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 851 val |= PCI_COMMAND_MASTER;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 852 writew(val, v3->base + V3_PCI_CMD);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 853
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 854 /* Get the I/O and memory ranges from DT */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 855 resource_list_for_each_entry(win, &res) {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 856 ret = v3_pci_setup_resource(v3, io_base, host, win);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 857 if (ret) {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 858 dev_err(dev, "error setting up resources\n");
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 859 return ret;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 860 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 861 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 862 ret = v3_pci_parse_map_dma_ranges(v3, np);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 863 if (ret)
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 864 return ret;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 865
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 866 /*
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 867 * Disable PCI to host IO cycles, enable I/O buffers @3.3V,
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 868 * set AD_LOW0 to 1 if one of the LB_MAP registers choose
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 869 * to use this (should be unused).
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 870 */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 871 writel(0x00000000, v3->base + V3_PCI_IO_BASE);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 872 val = V3_PCI_CFG_M_IO_REG_DIS | V3_PCI_CFG_M_IO_DIS |
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 873 V3_PCI_CFG_M_EN3V | V3_PCI_CFG_M_AD_LOW0;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 874 /*
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 875 * DMA read and write from PCI bus commands types
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 876 */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 877 val |= V3_PCI_CFG_TYPE_DEFAULT << V3_PCI_CFG_M_RTYPE_SHIFT;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 878 val |= V3_PCI_CFG_TYPE_DEFAULT << V3_PCI_CFG_M_WTYPE_SHIFT;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 879 writew(val, v3->base + V3_PCI_CFG);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 880
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 881 /*
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 882 * Set the V3 FIFO such that writes have higher priority than
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 883 * reads, and local bus write causes local bus read fifo flush
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 884 * on aperture 1. Same for PCI.
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 885 */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 886 writew(V3_FIFO_PRIO_LB_RD1_FLUSH_AP1 |
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 887 V3_FIFO_PRIO_LB_RD0_FLUSH_AP1 |
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 888 V3_FIFO_PRIO_PCI_RD1_FLUSH_AP1 |
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 889 V3_FIFO_PRIO_PCI_RD0_FLUSH_AP1,
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 890 v3->base + V3_FIFO_PRIORITY);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 891
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 892
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 893 /*
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 894 * Clear any error interrupts, and enable parity and write error
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 895 * interrupts
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 896 */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 897 writeb(0, v3->base + V3_LB_ISTAT);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 898 val = readw(v3->base + V3_LB_CFG);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 899 val |= V3_LB_CFG_LB_LB_INT;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 900 writew(val, v3->base + V3_LB_CFG);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 901 writeb(V3_LB_ISTAT_PCI_WR | V3_LB_ISTAT_PCI_PERR,
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 902 v3->base + V3_LB_IMASK);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 903
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 904 /* Special Integrator initialization */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 905 if (of_device_is_compatible(np, "arm,integrator-ap-pci")) {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 906 ret = v3_integrator_init(v3);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 907 if (ret)
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 908 return ret;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 909 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 910
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 911 /* Post-init: enable PCI memory and invalidate (master already on) */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 912 val = readw(v3->base + V3_PCI_CMD);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 913 val |= PCI_COMMAND_MEMORY | PCI_COMMAND_INVALIDATE;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 914 writew(val, v3->base + V3_PCI_CMD);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 915
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 916 /* Clear pending interrupts */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 917 writeb(0, v3->base + V3_LB_ISTAT);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 918 /* Read or write errors and parity errors cause interrupts */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 919 writeb(V3_LB_ISTAT_PCI_RD | V3_LB_ISTAT_PCI_WR | V3_LB_ISTAT_PCI_PERR,
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 920 v3->base + V3_LB_IMASK);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 921
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 922 /* Take the PCI bus out of reset so devices can initialize */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 923 val = readw(v3->base + V3_SYSTEM);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 924 val |= V3_SYSTEM_M_RST_OUT;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 925 writew(val, v3->base + V3_SYSTEM);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 926
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 927 /*
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 928 * Re-lock the system register.
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 929 */
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 930 val = readw(v3->base + V3_SYSTEM);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 931 val |= V3_SYSTEM_M_LOCK;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 932 writew(val, v3->base + V3_SYSTEM);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 933
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 934 list_splice_init(&res, &host->windows);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 935 ret = pci_scan_root_bus_bridge(host);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 936 if (ret) {
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 937 dev_err(dev, "failed to register host: %d\n", ret);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 938 return ret;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 939 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 940 v3->bus = host->bus;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 941
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 942 pci_bus_assign_resources(v3->bus);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 943 pci_bus_add_devices(v3->bus);
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 944
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 945 return 0;
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 946 }
68a15eb7bd0cf18 drivers/pci/host/pci-v3-semi.c Linus Walleij 2017-09-26 947
:::::: The code at line 808 was first introduced by commit
:::::: 68a15eb7bd0cf180eb214c79aa4e1662c5eeb97c PCI: v3-semi: Add V3 Semiconductor PCI host driver
:::::: TO: Linus Walleij <linus.walleij(a)linaro.org>
:::::: CC: Bjorn Helgaas <bhelgaas(a)google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
arch/x86/kvm/svm/sev.c:982 svm_register_enc_region() warn: impossible condition '(range->addr > (~0)) => (0-u64max > u64max)'
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Joerg Roedel <jroedel(a)suse.de>
CC: Paolo Bonzini <pbonzini(a)redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e9919e11e219eaa5e8041b7b1a196839143e9125
commit: eaf78265a4ab33935d3a0f1407ce4a91aac4d4d5 KVM: SVM: Move SEV code to separate file
date: 3 months ago
:::::: branch date: 2 days ago
:::::: commit date: 3 months ago
config: x86_64-randconfig-m001-20200716 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 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:
arch/x86/kvm/svm/sev.c:982 svm_register_enc_region() warn: impossible condition '(range->addr > (~0)) => (0-u64max > u64max)'
arch/x86/kvm/svm/sev.c:982 svm_register_enc_region() warn: impossible condition '(range->size > (~0)) => (0-u64max > u64max)'
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout eaf78265a4ab33935d3a0f1407ce4a91aac4d4d5
vim +982 arch/x86/kvm/svm/sev.c
eaf78265a4ab339 Joerg Roedel 2020-03-24 971
eaf78265a4ab339 Joerg Roedel 2020-03-24 972 int svm_register_enc_region(struct kvm *kvm,
eaf78265a4ab339 Joerg Roedel 2020-03-24 973 struct kvm_enc_region *range)
eaf78265a4ab339 Joerg Roedel 2020-03-24 974 {
eaf78265a4ab339 Joerg Roedel 2020-03-24 975 struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
eaf78265a4ab339 Joerg Roedel 2020-03-24 976 struct enc_region *region;
eaf78265a4ab339 Joerg Roedel 2020-03-24 977 int ret = 0;
eaf78265a4ab339 Joerg Roedel 2020-03-24 978
eaf78265a4ab339 Joerg Roedel 2020-03-24 979 if (!sev_guest(kvm))
eaf78265a4ab339 Joerg Roedel 2020-03-24 980 return -ENOTTY;
eaf78265a4ab339 Joerg Roedel 2020-03-24 981
eaf78265a4ab339 Joerg Roedel 2020-03-24 @982 if (range->addr > ULONG_MAX || range->size > ULONG_MAX)
eaf78265a4ab339 Joerg Roedel 2020-03-24 983 return -EINVAL;
eaf78265a4ab339 Joerg Roedel 2020-03-24 984
eaf78265a4ab339 Joerg Roedel 2020-03-24 985 region = kzalloc(sizeof(*region), GFP_KERNEL_ACCOUNT);
eaf78265a4ab339 Joerg Roedel 2020-03-24 986 if (!region)
eaf78265a4ab339 Joerg Roedel 2020-03-24 987 return -ENOMEM;
eaf78265a4ab339 Joerg Roedel 2020-03-24 988
eaf78265a4ab339 Joerg Roedel 2020-03-24 989 region->pages = sev_pin_memory(kvm, range->addr, range->size, ®ion->npages, 1);
eaf78265a4ab339 Joerg Roedel 2020-03-24 990 if (!region->pages) {
eaf78265a4ab339 Joerg Roedel 2020-03-24 991 ret = -ENOMEM;
eaf78265a4ab339 Joerg Roedel 2020-03-24 992 goto e_free;
eaf78265a4ab339 Joerg Roedel 2020-03-24 993 }
eaf78265a4ab339 Joerg Roedel 2020-03-24 994
eaf78265a4ab339 Joerg Roedel 2020-03-24 995 /*
eaf78265a4ab339 Joerg Roedel 2020-03-24 996 * The guest may change the memory encryption attribute from C=0 -> C=1
eaf78265a4ab339 Joerg Roedel 2020-03-24 997 * or vice versa for this memory range. Lets make sure caches are
eaf78265a4ab339 Joerg Roedel 2020-03-24 998 * flushed to ensure that guest data gets written into memory with
eaf78265a4ab339 Joerg Roedel 2020-03-24 999 * correct C-bit.
eaf78265a4ab339 Joerg Roedel 2020-03-24 1000 */
eaf78265a4ab339 Joerg Roedel 2020-03-24 1001 sev_clflush_pages(region->pages, region->npages);
eaf78265a4ab339 Joerg Roedel 2020-03-24 1002
eaf78265a4ab339 Joerg Roedel 2020-03-24 1003 region->uaddr = range->addr;
eaf78265a4ab339 Joerg Roedel 2020-03-24 1004 region->size = range->size;
eaf78265a4ab339 Joerg Roedel 2020-03-24 1005
eaf78265a4ab339 Joerg Roedel 2020-03-24 1006 mutex_lock(&kvm->lock);
eaf78265a4ab339 Joerg Roedel 2020-03-24 1007 list_add_tail(®ion->list, &sev->regions_list);
eaf78265a4ab339 Joerg Roedel 2020-03-24 1008 mutex_unlock(&kvm->lock);
eaf78265a4ab339 Joerg Roedel 2020-03-24 1009
eaf78265a4ab339 Joerg Roedel 2020-03-24 1010 return ret;
eaf78265a4ab339 Joerg Roedel 2020-03-24 1011
eaf78265a4ab339 Joerg Roedel 2020-03-24 1012 e_free:
eaf78265a4ab339 Joerg Roedel 2020-03-24 1013 kfree(region);
eaf78265a4ab339 Joerg Roedel 2020-03-24 1014 return ret;
eaf78265a4ab339 Joerg Roedel 2020-03-24 1015 }
eaf78265a4ab339 Joerg Roedel 2020-03-24 1016
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [PATCH 1/2] spi: Add the SPI daisy chain support.
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200703141246.17281-1-adrian.fiergolski(a)fastree3d.com>
References: <20200703141246.17281-1-adrian.fiergolski(a)fastree3d.com>
TO: Adrian Fiergolski <adrian.fiergolski(a)fastree3d.com>
CC: geert(a)linux-m68k.org
CC: lukas(a)wunner.de
CC: Adrian Fiergolski <adrian.fiergolski(a)fastree3d.com>
CC: Mark Brown <broonie(a)kernel.org>
CC: Rob Herring <robh+dt(a)kernel.org>
CC: linux-spi(a)vger.kernel.org
CC: devicetree(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
Hi Adrian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on spi/for-next]
[also build test WARNING on v5.8-rc5 next-20200715]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Adrian-Fiergolski/spi-Add-the-SP...
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
:::::: branch date: 12 days ago
:::::: commit date: 12 days ago
config: i386-randconfig-c001-20200715 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 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: Julia Lawall <julia.lawall(a)lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> drivers/spi/spi.c:648:1-7: preceding lock on line 603
# https://github.com/0day-ci/linux/commit/34bc72e614ee4d07d46404d78d1e38369...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 34bc72e614ee4d07d46404d78d1e38369274b2cd
vim +648 drivers/spi/spi.c
b6fb8d3a1f156c5 Mika Westerberg 2014-01-09 566
dc87c98e8f635a7 Grant Likely 2008-05-15 567 /**
dc87c98e8f635a7 Grant Likely 2008-05-15 568 * spi_add_device - Add spi_device allocated with spi_alloc_device
dc87c98e8f635a7 Grant Likely 2008-05-15 569 * @spi: spi_device to register
dc87c98e8f635a7 Grant Likely 2008-05-15 570 *
dc87c98e8f635a7 Grant Likely 2008-05-15 571 * Companion function to spi_alloc_device. Devices allocated with
dc87c98e8f635a7 Grant Likely 2008-05-15 572 * spi_alloc_device can be added onto the spi bus with this function.
dc87c98e8f635a7 Grant Likely 2008-05-15 573 *
97d56dc68268968 Javier Martinez Canillas 2015-10-22 574 * Return: 0 on success; negative errno on failure
dc87c98e8f635a7 Grant Likely 2008-05-15 575 */
dc87c98e8f635a7 Grant Likely 2008-05-15 576 int spi_add_device(struct spi_device *spi)
dc87c98e8f635a7 Grant Likely 2008-05-15 577 {
e48880e02e7e7ea David Brownell 2008-08-15 578 static DEFINE_MUTEX(spi_add_lock);
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 579 struct spi_controller *ctlr = spi->controller;
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 580 struct device *dev = ctlr->dev.parent;
dc87c98e8f635a7 Grant Likely 2008-05-15 581 int status;
dc87c98e8f635a7 Grant Likely 2008-05-15 582
dc87c98e8f635a7 Grant Likely 2008-05-15 583 /* Chipselects are numbered 0..max; validate. */
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 584 if (spi->chip_select >= ctlr->num_chipselect) {
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 585 dev_err(dev, "cs%d >= max %d\n", spi->chip_select,
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 586 ctlr->num_chipselect);
dc87c98e8f635a7 Grant Likely 2008-05-15 587 return -EINVAL;
dc87c98e8f635a7 Grant Likely 2008-05-15 588 }
dc87c98e8f635a7 Grant Likely 2008-05-15 589
dc87c98e8f635a7 Grant Likely 2008-05-15 590 /* Set the bus ID string */
e13ac47bec20797 Jarkko Nikula 2013-11-14 591 spi_dev_set_name(spi);
e48880e02e7e7ea David Brownell 2008-08-15 592
e48880e02e7e7ea David Brownell 2008-08-15 593 /* We need to make sure there's no other device with this
e48880e02e7e7ea David Brownell 2008-08-15 594 * chipselect **BEFORE** we call setup(), else we'll trash
e48880e02e7e7ea David Brownell 2008-08-15 595 * its configuration. Lock against concurrent add() calls.
e48880e02e7e7ea David Brownell 2008-08-15 596 */
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 597 #ifdef CONFIG_SPI_DAISY_CHAIN
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 598 /* Do not lock the controller when registering the daisy_chain driver
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 599 * as the last one wouldn't be able to register its subnodes
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 600 */
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 601 if (strcmp((const char *)spi->dev.of_node->name, "daisy_chain") == 0)
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 602 #endif
e48880e02e7e7ea David Brownell 2008-08-15 @603 mutex_lock(&spi_add_lock);
e48880e02e7e7ea David Brownell 2008-08-15 604
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 605 #ifdef CONFIG_SPI_DAISY_CHAIN
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 606 if (spi->daisy_chain_devs == NULL) {
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 607 #endif
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 608 status = bus_for_each_dev(&spi_bus_type, NULL, spi,
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 609 spi_dev_check);
b6fb8d3a1f156c5 Mika Westerberg 2014-01-09 610 if (status) {
e48880e02e7e7ea David Brownell 2008-08-15 611 dev_err(dev, "chipselect %d already in use\n",
e48880e02e7e7ea David Brownell 2008-08-15 612 spi->chip_select);
e48880e02e7e7ea David Brownell 2008-08-15 613 goto done;
e48880e02e7e7ea David Brownell 2008-08-15 614 }
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 615 #ifdef CONFIG_SPI_DAISY_CHAIN
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 616 }
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 617 #endif
f3186dd876697e6 Linus Walleij 2019-01-07 618 /* Descriptors take precedence */
f3186dd876697e6 Linus Walleij 2019-01-07 619 if (ctlr->cs_gpiods)
f3186dd876697e6 Linus Walleij 2019-01-07 620 spi->cs_gpiod = ctlr->cs_gpiods[spi->chip_select];
f3186dd876697e6 Linus Walleij 2019-01-07 621 else if (ctlr->cs_gpios)
8caab75fd2c2a92 Geert Uytterhoeven 2017-06-13 622 spi->cs_gpio = ctlr->cs_gpios[spi->chip_select];
743179849015dc7 Jean-Christophe PLAGNIOL-VILLARD 2012-11-15 623
e48880e02e7e7ea David Brownell 2008-08-15 624 /* Drivers may modify this initial i/o setup, but will
e48880e02e7e7ea David Brownell 2008-08-15 625 * normally rely on the device being setup. Devices
e48880e02e7e7ea David Brownell 2008-08-15 626 * using SPI_CS_HIGH can't coexist well otherwise...
e48880e02e7e7ea David Brownell 2008-08-15 627 */
7d0771970c51e73 David Brownell 2009-06-17 628 status = spi_setup(spi);
dc87c98e8f635a7 Grant Likely 2008-05-15 629 if (status < 0) {
eb288a1f45e2aa9 Linus Walleij 2010-10-21 630 dev_err(dev, "can't setup %s, status %d\n",
eb288a1f45e2aa9 Linus Walleij 2010-10-21 631 dev_name(&spi->dev), status);
e48880e02e7e7ea David Brownell 2008-08-15 632 goto done;
dc87c98e8f635a7 Grant Likely 2008-05-15 633 }
dc87c98e8f635a7 Grant Likely 2008-05-15 634
e48880e02e7e7ea David Brownell 2008-08-15 635 /* Device may be bound to an active driver when this returns */
dc87c98e8f635a7 Grant Likely 2008-05-15 636 status = device_add(&spi->dev);
e48880e02e7e7ea David Brownell 2008-08-15 637 if (status < 0)
eb288a1f45e2aa9 Linus Walleij 2010-10-21 638 dev_err(dev, "can't add %s, status %d\n",
eb288a1f45e2aa9 Linus Walleij 2010-10-21 639 dev_name(&spi->dev), status);
e48880e02e7e7ea David Brownell 2008-08-15 640 else
35f74fcab1228be Kay Sievers 2009-01-06 641 dev_dbg(dev, "registered child %s\n", dev_name(&spi->dev));
e48880e02e7e7ea David Brownell 2008-08-15 642
e48880e02e7e7ea David Brownell 2008-08-15 643 done:
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 644 #ifdef CONFIG_SPI_DAISY_CHAIN
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 645 if (strcmp((const char *)spi->dev.of_node->name, "daisy_chain") == 0)
34bc72e614ee4d0 Adrian Fiergolski 2020-07-03 646 #endif
e48880e02e7e7ea David Brownell 2008-08-15 647 mutex_unlock(&spi_add_lock);
e48880e02e7e7ea David Brownell 2008-08-15 @648 return status;
dc87c98e8f635a7 Grant Likely 2008-05-15 649 }
dc87c98e8f635a7 Grant Likely 2008-05-15 650 EXPORT_SYMBOL_GPL(spi_add_device);
8ae12a0d85987dc David Brownell 2006-01-08 651
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [PATCH bpf-next v2 3/6] bpf: support attaching freplace programs to multiple attach points
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <159481854255.454654.15065796817034016611.stgit(a)toke.dk>
References: <159481854255.454654.15065796817034016611.stgit(a)toke.dk>
TO: "Toke Høiland-Jørgensen" <toke(a)redhat.com>
TO: Alexei Starovoitov <ast(a)kernel.org>
CC: Daniel Borkmann <daniel(a)iogearbox.net>
CC: Martin KaFai Lau <kafai(a)fb.com>
CC: Song Liu <songliubraving(a)fb.com>
CC: Yonghong Song <yhs(a)fb.com>
CC: Andrii Nakryiko <andriin(a)fb.com>
CC: John Fastabend <john.fastabend(a)gmail.com>
CC: KP Singh <kpsingh(a)chromium.org>
CC: netdev(a)vger.kernel.org
CC: bpf(a)vger.kernel.org
Hi "Toke,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Toke-H-iland-J-rgensen/bpf-Suppo...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: x86_64-randconfig-m001-20200715 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 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:
kernel/bpf/verifier.c:10900 bpf_check_attach_target() error: we previously assumed 'tgt_prog' could be null (see line 10772)
Old smatch warnings:
include/linux/bpf_verifier.h:351 bpf_verifier_log_needed() error: we previously assumed 'log' could be null (see line 350)
# https://github.com/0day-ci/linux/commit/cc8571ec751a3a6065838e0b15105f8be...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout cc8571ec751a3a6065838e0b15105f8be0ced6fe
vim +/tgt_prog +10900 kernel/bpf/verifier.c
27ae7997a66174 Martin KaFai Lau 2020-01-08 10733
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10734 int bpf_check_attach_target(struct bpf_verifier_log *log,
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10735 const struct bpf_prog *prog,
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10736 const struct bpf_prog *tgt_prog,
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10737 u32 btf_id,
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10738 struct btf_func_model *fmodel,
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10739 long *tgt_addr,
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10740 const char **tgt_name,
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10741 const struct btf_type **tgt_type)
38207291604401 Martin KaFai Lau 2019-10-24 10742 {
be8704ff07d237 Alexei Starovoitov 2020-01-20 10743 bool prog_extension = prog->type == BPF_PROG_TYPE_EXT;
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10744 const char prefix[] = "btf_trace_";
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10745 int ret = 0, subprog = -1, i;
38207291604401 Martin KaFai Lau 2019-10-24 10746 const struct btf_type *t;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10747 bool conservative = true;
38207291604401 Martin KaFai Lau 2019-10-24 10748 const char *tname;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10749 struct btf *btf;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10750 long addr = 0;
38207291604401 Martin KaFai Lau 2019-10-24 10751
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10752 if (!btf_id) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10753 bpf_log(log, "Tracing programs must provide btf_id\n");
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10754 return -EINVAL;
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10755 }
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10756 btf = bpf_prog_get_target_btf(prog);
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10757 if (!btf) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10758 bpf_log(log,
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10759 "FENTRY/FEXIT program can only be attached to another program annotated with BTF\n");
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10760 return -EINVAL;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10761 }
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10762 t = btf_type_by_id(btf, btf_id);
38207291604401 Martin KaFai Lau 2019-10-24 10763 if (!t) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10764 bpf_log(log, "attach_btf_id %u is invalid\n", btf_id);
38207291604401 Martin KaFai Lau 2019-10-24 10765 return -EINVAL;
38207291604401 Martin KaFai Lau 2019-10-24 10766 }
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10767 tname = btf_name_by_offset(btf, t->name_off);
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10768 if (!tname) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10769 bpf_log(log, "attach_btf_id %u doesn't have a name\n", btf_id);
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10770 return -EINVAL;
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10771 }
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 @10772 if (tgt_prog) {
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10773 struct bpf_prog_aux *aux = tgt_prog->aux;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10774
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10775 for (i = 0; i < aux->func_info_cnt; i++)
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10776 if (aux->func_info[i].type_id == btf_id) {
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10777 subprog = i;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10778 break;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10779 }
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10780 if (subprog == -1) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10781 bpf_log(log, "Subprog %s doesn't exist\n", tname);
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10782 return -EINVAL;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10783 }
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10784 conservative = aux->func_info_aux[subprog].unreliable;
be8704ff07d237 Alexei Starovoitov 2020-01-20 10785 if (prog_extension) {
be8704ff07d237 Alexei Starovoitov 2020-01-20 10786 if (conservative) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10787 bpf_log(log,
be8704ff07d237 Alexei Starovoitov 2020-01-20 10788 "Cannot replace static functions\n");
be8704ff07d237 Alexei Starovoitov 2020-01-20 10789 return -EINVAL;
be8704ff07d237 Alexei Starovoitov 2020-01-20 10790 }
be8704ff07d237 Alexei Starovoitov 2020-01-20 10791 if (!prog->jit_requested) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10792 bpf_log(log,
be8704ff07d237 Alexei Starovoitov 2020-01-20 10793 "Extension programs should be JITed\n");
be8704ff07d237 Alexei Starovoitov 2020-01-20 10794 return -EINVAL;
be8704ff07d237 Alexei Starovoitov 2020-01-20 10795 }
be8704ff07d237 Alexei Starovoitov 2020-01-20 10796 }
be8704ff07d237 Alexei Starovoitov 2020-01-20 10797 if (!tgt_prog->jited) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10798 bpf_log(log, "Can attach to only JITed progs\n");
be8704ff07d237 Alexei Starovoitov 2020-01-20 10799 return -EINVAL;
be8704ff07d237 Alexei Starovoitov 2020-01-20 10800 }
be8704ff07d237 Alexei Starovoitov 2020-01-20 10801 if (tgt_prog->type == prog->type) {
be8704ff07d237 Alexei Starovoitov 2020-01-20 10802 /* Cannot fentry/fexit another fentry/fexit program.
be8704ff07d237 Alexei Starovoitov 2020-01-20 10803 * Cannot attach program extension to another extension.
be8704ff07d237 Alexei Starovoitov 2020-01-20 10804 * It's ok to attach fentry/fexit to extension program.
be8704ff07d237 Alexei Starovoitov 2020-01-20 10805 */
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10806 bpf_log(log, "Cannot recursively attach\n");
be8704ff07d237 Alexei Starovoitov 2020-01-20 10807 return -EINVAL;
be8704ff07d237 Alexei Starovoitov 2020-01-20 10808 }
be8704ff07d237 Alexei Starovoitov 2020-01-20 10809 if (tgt_prog->type == BPF_PROG_TYPE_TRACING &&
be8704ff07d237 Alexei Starovoitov 2020-01-20 10810 prog_extension &&
be8704ff07d237 Alexei Starovoitov 2020-01-20 10811 (tgt_prog->expected_attach_type == BPF_TRACE_FENTRY ||
be8704ff07d237 Alexei Starovoitov 2020-01-20 10812 tgt_prog->expected_attach_type == BPF_TRACE_FEXIT)) {
be8704ff07d237 Alexei Starovoitov 2020-01-20 10813 /* Program extensions can extend all program types
be8704ff07d237 Alexei Starovoitov 2020-01-20 10814 * except fentry/fexit. The reason is the following.
be8704ff07d237 Alexei Starovoitov 2020-01-20 10815 * The fentry/fexit programs are used for performance
be8704ff07d237 Alexei Starovoitov 2020-01-20 10816 * analysis, stats and can be attached to any program
be8704ff07d237 Alexei Starovoitov 2020-01-20 10817 * type except themselves. When extension program is
be8704ff07d237 Alexei Starovoitov 2020-01-20 10818 * replacing XDP function it is necessary to allow
be8704ff07d237 Alexei Starovoitov 2020-01-20 10819 * performance analysis of all functions. Both original
be8704ff07d237 Alexei Starovoitov 2020-01-20 10820 * XDP program and its program extension. Hence
be8704ff07d237 Alexei Starovoitov 2020-01-20 10821 * attaching fentry/fexit to BPF_PROG_TYPE_EXT is
be8704ff07d237 Alexei Starovoitov 2020-01-20 10822 * allowed. If extending of fentry/fexit was allowed it
be8704ff07d237 Alexei Starovoitov 2020-01-20 10823 * would be possible to create long call chain
be8704ff07d237 Alexei Starovoitov 2020-01-20 10824 * fentry->extension->fentry->extension beyond
be8704ff07d237 Alexei Starovoitov 2020-01-20 10825 * reasonable stack size. Hence extending fentry is not
be8704ff07d237 Alexei Starovoitov 2020-01-20 10826 * allowed.
be8704ff07d237 Alexei Starovoitov 2020-01-20 10827 */
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10828 bpf_log(log, "Cannot extend fentry/fexit\n");
be8704ff07d237 Alexei Starovoitov 2020-01-20 10829 return -EINVAL;
be8704ff07d237 Alexei Starovoitov 2020-01-20 10830 }
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10831 } else {
be8704ff07d237 Alexei Starovoitov 2020-01-20 10832 if (prog_extension) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10833 bpf_log(log, "Cannot replace kernel functions\n");
be8704ff07d237 Alexei Starovoitov 2020-01-20 10834 return -EINVAL;
be8704ff07d237 Alexei Starovoitov 2020-01-20 10835 }
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10836 }
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10837
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10838 switch (prog->expected_attach_type) {
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10839 case BPF_TRACE_RAW_TP:
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10840 if (tgt_prog) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10841 bpf_log(log,
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10842 "Only FENTRY/FEXIT progs are attachable to another BPF prog\n");
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10843 return -EINVAL;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10844 }
38207291604401 Martin KaFai Lau 2019-10-24 10845 if (!btf_type_is_typedef(t)) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10846 bpf_log(log, "attach_btf_id %u is not a typedef\n",
38207291604401 Martin KaFai Lau 2019-10-24 10847 btf_id);
38207291604401 Martin KaFai Lau 2019-10-24 10848 return -EINVAL;
38207291604401 Martin KaFai Lau 2019-10-24 10849 }
f1b9509c2fb0ef Alexei Starovoitov 2019-10-30 10850 if (strncmp(prefix, tname, sizeof(prefix) - 1)) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10851 bpf_log(log, "attach_btf_id %u points to wrong type name %s\n",
38207291604401 Martin KaFai Lau 2019-10-24 10852 btf_id, tname);
38207291604401 Martin KaFai Lau 2019-10-24 10853 return -EINVAL;
38207291604401 Martin KaFai Lau 2019-10-24 10854 }
38207291604401 Martin KaFai Lau 2019-10-24 10855 tname += sizeof(prefix) - 1;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10856 t = btf_type_by_id(btf, t->type);
38207291604401 Martin KaFai Lau 2019-10-24 10857 if (!btf_type_is_ptr(t))
38207291604401 Martin KaFai Lau 2019-10-24 10858 /* should never happen in valid vmlinux build */
38207291604401 Martin KaFai Lau 2019-10-24 10859 return -EINVAL;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10860 t = btf_type_by_id(btf, t->type);
38207291604401 Martin KaFai Lau 2019-10-24 10861 if (!btf_type_is_func_proto(t))
38207291604401 Martin KaFai Lau 2019-10-24 10862 /* should never happen in valid vmlinux build */
38207291604401 Martin KaFai Lau 2019-10-24 10863 return -EINVAL;
38207291604401 Martin KaFai Lau 2019-10-24 10864
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10865 break;
15d83c4d7cef5c Yonghong Song 2020-05-09 10866 case BPF_TRACE_ITER:
15d83c4d7cef5c Yonghong Song 2020-05-09 10867 if (!btf_type_is_func(t)) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10868 bpf_log(log, "attach_btf_id %u is not a function\n",
15d83c4d7cef5c Yonghong Song 2020-05-09 10869 btf_id);
15d83c4d7cef5c Yonghong Song 2020-05-09 10870 return -EINVAL;
15d83c4d7cef5c Yonghong Song 2020-05-09 10871 }
15d83c4d7cef5c Yonghong Song 2020-05-09 10872 t = btf_type_by_id(btf, t->type);
15d83c4d7cef5c Yonghong Song 2020-05-09 10873 if (!btf_type_is_func_proto(t))
15d83c4d7cef5c Yonghong Song 2020-05-09 10874 return -EINVAL;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10875 ret = btf_distill_func_proto(log, btf, t, tname, fmodel);
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10876 if (ret)
15d83c4d7cef5c Yonghong Song 2020-05-09 10877 return ret;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10878 break;
be8704ff07d237 Alexei Starovoitov 2020-01-20 10879 default:
be8704ff07d237 Alexei Starovoitov 2020-01-20 10880 if (!prog_extension)
be8704ff07d237 Alexei Starovoitov 2020-01-20 10881 return -EINVAL;
be8704ff07d237 Alexei Starovoitov 2020-01-20 10882 /* fallthrough */
ae24082331d9bb KP Singh 2020-03-04 10883 case BPF_MODIFY_RETURN:
9e4e01dfd3254c KP Singh 2020-03-29 10884 case BPF_LSM_MAC:
fec56f5890d93f Alexei Starovoitov 2019-11-14 10885 case BPF_TRACE_FENTRY:
fec56f5890d93f Alexei Starovoitov 2019-11-14 10886 case BPF_TRACE_FEXIT:
fec56f5890d93f Alexei Starovoitov 2019-11-14 10887 if (!btf_type_is_func(t)) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10888 bpf_log(log, "attach_btf_id %u is not a function\n",
fec56f5890d93f Alexei Starovoitov 2019-11-14 10889 btf_id);
fec56f5890d93f Alexei Starovoitov 2019-11-14 10890 return -EINVAL;
fec56f5890d93f Alexei Starovoitov 2019-11-14 10891 }
be8704ff07d237 Alexei Starovoitov 2020-01-20 10892 if (prog_extension &&
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10893 btf_check_type_match(log, prog, btf, t))
be8704ff07d237 Alexei Starovoitov 2020-01-20 10894 return -EINVAL;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10895 t = btf_type_by_id(btf, t->type);
fec56f5890d93f Alexei Starovoitov 2019-11-14 10896 if (!btf_type_is_func_proto(t))
fec56f5890d93f Alexei Starovoitov 2019-11-14 10897 return -EINVAL;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10898
cc8571ec751a3a Toke Høiland-Jørgensen 2020-07-15 10899 if ((prog->aux->tgt_prog_type &&
cc8571ec751a3a Toke Høiland-Jørgensen 2020-07-15 @10900 prog->aux->tgt_prog_type != tgt_prog->type) ||
cc8571ec751a3a Toke Høiland-Jørgensen 2020-07-15 10901 (prog->aux->tgt_attach_type &&
cc8571ec751a3a Toke Høiland-Jørgensen 2020-07-15 10902 prog->aux->tgt_attach_type != tgt_prog->expected_attach_type))
cc8571ec751a3a Toke Høiland-Jørgensen 2020-07-15 10903 return -EINVAL;
cc8571ec751a3a Toke Høiland-Jørgensen 2020-07-15 10904
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10905 if (tgt_prog && conservative)
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10906 t = NULL;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10907
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10908 ret = btf_distill_func_proto(log, btf, t, tname, fmodel);
fec56f5890d93f Alexei Starovoitov 2019-11-14 10909 if (ret < 0)
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10910 return ret;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10911
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10912 if (tgt_prog) {
e9eeec58c992c4 Yonghong Song 2019-12-04 10913 if (subprog == 0)
e9eeec58c992c4 Yonghong Song 2019-12-04 10914 addr = (long) tgt_prog->bpf_func;
e9eeec58c992c4 Yonghong Song 2019-12-04 10915 else
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10916 addr = (long) tgt_prog->aux->func[subprog]->bpf_func;
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10917 } else {
fec56f5890d93f Alexei Starovoitov 2019-11-14 10918 addr = kallsyms_lookup_name(tname);
fec56f5890d93f Alexei Starovoitov 2019-11-14 10919 if (!addr) {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 10920 bpf_log(log,
fec56f5890d93f Alexei Starovoitov 2019-11-14 10921 "The address of function %s cannot be found\n",
fec56f5890d93f Alexei Starovoitov 2019-11-14 10922 tname);
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10923 return -ENOENT;
fec56f5890d93f Alexei Starovoitov 2019-11-14 10924 }
5b92a28aae4dd0 Alexei Starovoitov 2019-11-14 10925 }
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10926 break;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10927 }
18644cec714aab Alexei Starovoitov 2020-05-28 10928
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10929 *tgt_addr = addr;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10930 if (tgt_name)
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10931 *tgt_name = tname;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10932 if (tgt_type)
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10933 *tgt_type = t;
c2d0f6ffe7709e Toke Høiland-Jørgensen 2020-07-15 10934 return 0;
18644cec714aab Alexei Starovoitov 2020-05-28 10935 }
18644cec714aab Alexei Starovoitov 2020-05-28 10936
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[ambarus:spi-nor/port-gbulk-v5.8 3/3] drivers/spi/atmel-quadspi.c:440:10: warning: Identical condition 'err', second condition is always false
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: Tudor Ambarus <tudor.ambarus(a)microchip.com>
tree: https://github.com/ambarus/linux-0day spi-nor/port-gbulk-v5.8
head: 38278daad477e9dff1fc6f4f79bec89569404696
commit: 38278daad477e9dff1fc6f4f79bec89569404696 [3/3] spi: atmel-quadspi: Use optimezed memcpy_fromio()/memcpy_toio()
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> drivers/spi/atmel-quadspi.c:440:10: warning: Identical condition 'err', second condition is always false [identicalConditionAfterEarlyExit]
return err;
^
drivers/spi/atmel-quadspi.c:417:6: note: first condition
if (err)
^
drivers/spi/atmel-quadspi.c:440:10: note: second condition
return err;
^
# https://github.com/ambarus/linux-0day/commit/38278daad477e9dff1fc6f4f79be...
git remote add ambarus https://github.com/ambarus/linux-0day
git remote update ambarus
git checkout 38278daad477e9dff1fc6f4f79bec89569404696
vim +/err +440 drivers/spi/atmel-quadspi.c
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 401
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 402 static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 403 {
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 404 struct atmel_qspi *aq = spi_controller_get_devdata(mem->spi->master);
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 405 u32 sr, offset;
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 406 int err;
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 407
8e093ea4d35933 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-02-28 408 /*
8e093ea4d35933 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-02-28 409 * Check if the address exceeds the MMIO window size. An improvement
8e093ea4d35933 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-02-28 410 * would be to add support for regular SPI mode and fall back to it
8e093ea4d35933 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-02-28 411 * when the flash memories overrun the controller's memory space.
8e093ea4d35933 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-02-28 412 */
8e093ea4d35933 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-02-28 413 if (op->addr.val + op->data.nbytes > aq->mmap_size)
8e093ea4d35933 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-02-28 414 return -ENOTSUPP;
8e093ea4d35933 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-02-28 415
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 416 err = atmel_qspi_set_cfg(aq, op, &offset);
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 417 if (err)
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 418 return err;
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 419
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 420 /* Skip to the final steps if there is no data */
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 421 if (op->data.nbytes) {
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 422 /* Dummy read of QSPI_IFR to synchronize APB and AHB accesses */
c528ecfbef040b drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-03-20 423 (void)atmel_qspi_read(aq, QSPI_IFR);
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 424
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 425 /* Send/Receive data */
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 426 if (op->data.dir == SPI_MEM_DATA_IN)
38278daad477e9 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-07-14 427 memcpy_fromio(op->data.buf.in, aq->mem + offset,
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 428 op->data.nbytes);
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 429 else
38278daad477e9 drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-07-14 430 memcpy_toio(aq->mem + offset, op->data.buf.out,
2e5c8888735864 drivers/spi/atmel-quadspi.c Tudor Ambarus 2019-02-05 431 op->data.nbytes);
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 432
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 433 /* Release the chip-select */
c528ecfbef040b drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-03-20 434 atmel_qspi_write(QSPI_CR_LASTXFER, aq, QSPI_CR);
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 435 }
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 436
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 437 /* Poll INSTRuction End status */
c528ecfbef040b drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-03-20 438 sr = atmel_qspi_read(aq, QSPI_SR);
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 439 if ((sr & QSPI_SR_CMD_COMPLETED) == QSPI_SR_CMD_COMPLETED)
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 @440 return err;
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 441
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 442 /* Wait for INSTRuction End interrupt */
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 443 reinit_completion(&aq->cmd_completion);
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 444 aq->pending = sr & QSPI_SR_CMD_COMPLETED;
c528ecfbef040b drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-03-20 445 atmel_qspi_write(QSPI_SR_CMD_COMPLETED, aq, QSPI_IER);
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 446 if (!wait_for_completion_timeout(&aq->cmd_completion,
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 447 msecs_to_jiffies(1000)))
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 448 err = -ETIMEDOUT;
c528ecfbef040b drivers/spi/atmel-quadspi.c Tudor Ambarus 2020-03-20 449 atmel_qspi_write(QSPI_SR_CMD_COMPLETED, aq, QSPI_IDR);
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 450
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 451 return err;
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 452 }
d5433def31531b drivers/mtd/spi-nor/atmel-quadspi.c Piotr Bugalski 2018-11-05 453
:::::: The code at line 440 was first introduced by commit
:::::: d5433def31531bd07984f167f6ab0afef70b6a3e mtd: spi-nor: atmel-quadspi: Add spi-mem support to atmel-quadspi
:::::: TO: Piotr Bugalski <bugalski.piotr(a)gmail.com>
:::::: CC: Mark Brown <broonie(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [PATCH bpf-next v2 1/6] bpf: change logging calls from verbose() to bpf_log() and use log pointer
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <159481854034.454654.14793846101394162640.stgit(a)toke.dk>
References: <159481854034.454654.14793846101394162640.stgit(a)toke.dk>
TO: "Toke Høiland-Jørgensen" <toke(a)redhat.com>
TO: Alexei Starovoitov <ast(a)kernel.org>
CC: Daniel Borkmann <daniel(a)iogearbox.net>
CC: Martin KaFai Lau <kafai(a)fb.com>
CC: Song Liu <songliubraving(a)fb.com>
CC: Yonghong Song <yhs(a)fb.com>
CC: Andrii Nakryiko <andriin(a)fb.com>
CC: John Fastabend <john.fastabend(a)gmail.com>
CC: KP Singh <kpsingh(a)chromium.org>
CC: netdev(a)vger.kernel.org
CC: bpf(a)vger.kernel.org
Hi "Toke,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Toke-H-iland-J-rgensen/bpf-Suppo...
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: x86_64-randconfig-m001-20200715 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 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:
include/linux/bpf_verifier.h:351 bpf_verifier_log_needed() error: we previously assumed 'log' could be null (see line 350)
include/linux/bpf_verifier.h:351 bpf_verifier_log_needed() error: we previously assumed 'log' could be null (see line 350)
# https://github.com/0day-ci/linux/commit/e33243ff1dd2cbb3628e4044dd9e00a6a...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout e33243ff1dd2cbb3628e4044dd9e00a6abf99c7e
vim +/log +351 include/linux/bpf_verifier.h
06ee7115b0d174 Alexei Starovoitov 2019-04-01 347
77d2e05abd4588 Martin KaFai Lau 2018-03-24 348 static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log)
77d2e05abd4588 Martin KaFai Lau 2018-03-24 349 {
e33243ff1dd2cb Toke Høiland-Jørgensen 2020-07-15 @350 return (log && log->level && log->ubuf && !bpf_verifier_log_full(log)) ||
8580ac9404f624 Alexei Starovoitov 2019-10-15 @351 log->level == BPF_LOG_KERNEL;
77d2e05abd4588 Martin KaFai Lau 2018-03-24 352 }
77d2e05abd4588 Martin KaFai Lau 2018-03-24 353
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
drivers/s390/net/qeth_core_main.c:1800 qeth_read_conf_data_cb() warn: impossible condition == 240) => ((-128)-127 == 240)'
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Julian Wiedmann <jwi(a)linux.ibm.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e9919e11e219eaa5e8041b7b1a196839143e9125
commit: afc1f67b99d59c4ddd29013fbb404032b4b6d08e s390/qeth: use node_descriptor struct
date: 11 months ago
:::::: branch date: 2 days ago
:::::: commit date: 11 months ago
config: s390-randconfig-m031-20200715 (attached as .config)
compiler: s390-linux-gcc (GCC) 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/s390/net/qeth_core_main.c:1800 qeth_read_conf_data_cb() warn: impossible condition '(nd->nd3.model[0] == 240) => ((-128)-127 == 240)'
drivers/s390/net/qeth_core_main.c:1803 qeth_read_conf_data_cb() warn: always true condition '(nd->nd3.model[2] <= 244) => ((-128)-127 <= 244)'
Old smatch warnings:
drivers/s390/net/qeth_core_main.c:942 qeth_get_problem() warn: impossible condition '(sense[2] == 175) => ((-128)-127 == 175)'
drivers/s390/net/qeth_core_main.c:942 qeth_get_problem() warn: impossible condition '(sense[3] == 254) => ((-128)-127 == 254)'
drivers/s390/net/qeth_core_main.c:951 qeth_get_problem() warn: inconsistent indenting
drivers/s390/net/qeth_core_main.c:1801 qeth_read_conf_data_cb() warn: impossible condition '(nd->nd3.model[1] == 240) => ((-128)-127 == 240)'
drivers/s390/net/qeth_core_main.c:1802 qeth_read_conf_data_cb() warn: impossible condition '(nd->nd3.model[2] >= 241) => ((-128)-127 >= 241)'
drivers/s390/net/qeth_core_main.c:2481 qeth_print_status_message() warn: argument 3 to %02x specifier has type 'char'
drivers/s390/net/qeth_core_main.c:2481 qeth_print_status_message() warn: argument 4 to %02x specifier has type 'char'
arch/s390/include/asm/uaccess.h:143 __get_user_fn() error: uninitialized symbol 'rc'.
drivers/s390/net/qeth_core_main.c:5598 qeth_core_set_online() error: we previously assumed 'card->discipline' could be null (see line 5592)
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout afc1f67b99d59c4ddd29013fbb404032b4b6d08e
vim +1800 drivers/s390/net/qeth_core_main.c
afc1f67b99d59c Julian Wiedmann 2019-08-20 1783
2066e1db9eef8e Julian Wiedmann 2019-06-11 1784 static void qeth_read_conf_data_cb(struct qeth_card *card,
2066e1db9eef8e Julian Wiedmann 2019-06-11 1785 struct qeth_cmd_buffer *iob)
2066e1db9eef8e Julian Wiedmann 2019-06-11 1786 {
afc1f67b99d59c Julian Wiedmann 2019-08-20 1787 struct qeth_node_desc *nd = (struct qeth_node_desc *) iob->data;
afc1f67b99d59c Julian Wiedmann 2019-08-20 1788 u8 *tag;
2066e1db9eef8e Julian Wiedmann 2019-06-11 1789
2066e1db9eef8e Julian Wiedmann 2019-06-11 1790 QETH_CARD_TEXT(card, 2, "cfgunit");
afc1f67b99d59c Julian Wiedmann 2019-08-20 1791 card->info.is_vm_nic = nd->nd1.plant[0] == _ascebc['V'] &&
afc1f67b99d59c Julian Wiedmann 2019-08-20 1792 nd->nd1.plant[1] == _ascebc['M'];
afc1f67b99d59c Julian Wiedmann 2019-08-20 1793 tag = (u8 *)&nd->nd1.tag;
afc1f67b99d59c Julian Wiedmann 2019-08-20 1794 card->info.chpid = tag[0];
afc1f67b99d59c Julian Wiedmann 2019-08-20 1795 card->info.unit_addr2 = tag[1];
afc1f67b99d59c Julian Wiedmann 2019-08-20 1796
afc1f67b99d59c Julian Wiedmann 2019-08-20 1797 tag = (u8 *)&nd->nd2.tag;
afc1f67b99d59c Julian Wiedmann 2019-08-20 1798 card->info.cula = tag[1];
afc1f67b99d59c Julian Wiedmann 2019-08-20 1799
afc1f67b99d59c Julian Wiedmann 2019-08-20 @1800 card->info.use_v1_blkt = nd->nd3.model[0] == 0xF0 &&
afc1f67b99d59c Julian Wiedmann 2019-08-20 1801 nd->nd3.model[1] == 0xF0 &&
afc1f67b99d59c Julian Wiedmann 2019-08-20 1802 nd->nd3.model[2] >= 0xF1 &&
afc1f67b99d59c Julian Wiedmann 2019-08-20 @1803 nd->nd3.model[2] <= 0xF4;
2066e1db9eef8e Julian Wiedmann 2019-06-11 1804
2066e1db9eef8e Julian Wiedmann 2019-06-11 1805 qeth_notify_reply(iob->reply, 0);
c3b2218d317017 Julian Wiedmann 2019-06-27 1806 qeth_put_cmd(iob);
2066e1db9eef8e Julian Wiedmann 2019-06-11 1807 }
2066e1db9eef8e Julian Wiedmann 2019-06-11 1808
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[xlnx:master 9614/10089] drivers/usb/gadget/function/uvc_video.c:333:17: sparse: sparse: context imbalance in 'uvcg_video_pump' - unexpected unlock
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-arm-kernel(a)lists.infradead.org
TO: Anurag Kumar Vulisha <anurag.kumar.vulisha(a)xilinx.com>
CC: Michal Simek <monstr(a)monstr.eu>
CC: Piyush Mehta <piyush.mehta(a)xilinx.com>
tree: https://github.com/Xilinx/linux-xlnx master
head: 6149366c870abff893fe2b6efce7a5607accd773
commit: 75684e8cb49926c7d118d4b7648cd2bdbaf6404b [9614/10089] usb: gadget: uvc_video: unlock before submitting a request to ep
:::::: branch date: 7 days ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-s021-20200715 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-49-g707c5017-dirty
git checkout 75684e8cb49926c7d118d4b7648cd2bdbaf6404b
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/usb/gadget/function/uvc_video.c:333:17: sparse: sparse: context imbalance in 'uvcg_video_pump' - unexpected unlock
# https://github.com/Xilinx/linux-xlnx/commit/75684e8cb49926c7d118d4b7648cd...
git remote add xlnx https://github.com/Xilinx/linux-xlnx
git remote update xlnx
git checkout 75684e8cb49926c7d118d4b7648cd2bdbaf6404b
vim +/uvcg_video_pump +333 drivers/usb/gadget/function/uvc_video.c
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 286
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 287 /* --------------------------------------------------------------------------
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 288 * Video streaming
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 289 */
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 290
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 291 /*
7ea95b110811fa drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09 292 * uvcg_video_pump - Pump video data into the USB requests
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 293 *
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 294 * This function fills the available USB requests (listed in req_free) with
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 295 * video data from the queued buffers.
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 296 */
3a83c16ef0e03e drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09 297 int uvcg_video_pump(struct uvc_video *video)
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 298 {
bd52b813a999e4 drivers/usb/gadget/function/uvc_video.c Michael Grzeschik 2014-08-08 299 struct uvc_video_queue *queue = &video->queue;
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 300 struct usb_request *req;
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 301 struct uvc_buffer *buf;
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 302 unsigned long flags;
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 303 int ret;
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 304
7ea95b110811fa drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09 305 /* FIXME TODO Race between uvcg_video_pump and requests completion
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 306 * handler ???
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 307 */
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 308
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 309 while (1) {
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 310 /* Retrieve the first available USB request, protected by the
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 311 * request lock.
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 312 */
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 313 spin_lock_irqsave(&video->req_lock, flags);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 314 if (list_empty(&video->req_free)) {
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 315 spin_unlock_irqrestore(&video->req_lock, flags);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 316 return 0;
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 317 }
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 318 req = list_first_entry(&video->req_free, struct usb_request,
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 319 list);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 320 list_del(&req->list);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 321 spin_unlock_irqrestore(&video->req_lock, flags);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 322
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 323 /* Retrieve the first available video buffer and fill the
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 324 * request, protected by the video queue irqlock.
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 325 */
6dd5b021bd6c73 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2014-09-16 326 spin_lock_irqsave(&queue->irqlock, flags);
6dd5b021bd6c73 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2014-09-16 327 buf = uvcg_queue_head(queue);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 328 if (buf == NULL) {
6dd5b021bd6c73 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2014-09-16 329 spin_unlock_irqrestore(&queue->irqlock, flags);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 330 break;
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 331 }
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 332
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 @333 video->encode(req, video, buf);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 334
75684e8cb49926 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha 2020-01-23 335 spin_unlock_irqrestore(&queue->irqlock, flags);
75684e8cb49926 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha 2020-01-23 336
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 337 /* Queue the USB request */
9d1ff5dcb3cd33 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2018-08-10 338 ret = uvcg_video_ep_queue(video, req);
6dd5b021bd6c73 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2014-09-16 339 spin_unlock_irqrestore(&queue->irqlock, flags);
9d1ff5dcb3cd33 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2018-08-10 340
9d1ff5dcb3cd33 drivers/usb/gadget/function/uvc_video.c Laurent Pinchart 2018-08-10 341 if (ret < 0) {
75684e8cb49926 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha 2020-01-23 342 printk(KERN_INFO "Failed to queue request (%d)\n", ret);
75684e8cb49926 drivers/usb/gadget/function/uvc_video.c Anurag Kumar Vulisha 2020-01-23 343 usb_ep_set_halt(video->ep);
7ea95b110811fa drivers/usb/gadget/function/uvc_video.c Andrzej Pietrasiewicz 2014-09-09 344 uvcg_queue_cancel(queue, 0);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 345 break;
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 346 }
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 347 }
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 348
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 349 spin_lock_irqsave(&video->req_lock, flags);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 350 list_add_tail(&req->list, &video->req_free);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 351 spin_unlock_irqrestore(&video->req_lock, flags);
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 352 return 0;
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 353 }
cdda479f15cd13 drivers/usb/gadget/uvc_video.c Laurent Pinchart 2010-05-02 354
:::::: The code at line 333 was first introduced by commit
:::::: cdda479f15cd13fa50a913ca85129c0437cc7b91 USB gadget: video class function driver
:::::: TO: Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[radeon-alex:amd-staging-drm-next-navy-flounder 538/1075] drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c:1275:5-8: Unneeded variable: "ret". Return "0" on line 1278
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: dri-devel(a)lists.freedesktop.org
TO: Likun Gao <Likun.Gao(a)amd.com>
CC: Alex Deucher <alexander.deucher(a)amd.com>
CC: Kenneth Feng <kenneth.feng(a)amd.com>
tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next-navy-flounder
head: b19b986cd4f530affe61cabed3a674d82ba112c5
commit: 893bbe63b1fd4ca115c1020f2b856e16d88732a0 [538/1075] drm/amd/powerplay: add support to set performance level for sienna_cichlid
:::::: branch date: 9 hours ago
:::::: commit date: 6 weeks ago
config: x86_64-randconfig-c002-20200714 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 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: Julia Lawall <julia.lawall(a)lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c:541:14-18: Unneeded variable: "size". Return "0" on line 563
>> drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c:1275:5-8: Unneeded variable: "ret". Return "0" on line 1278
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[radeon-alex:amd-staging-drm-next-navy-flounder 537/1075] drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c:470:47-52: WARNING: conversion to bool not needed here
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: dri-devel(a)lists.freedesktop.org
TO: Likun Gao <Likun.Gao(a)amd.com>
CC: Alex Deucher <alexander.deucher(a)amd.com>
CC: Evan Quan <evan.quan(a)amd.com>
CC: Kevin Wang <kevin1.wang(a)amd.com>
tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next-navy-flounder
head: b19b986cd4f530affe61cabed3a674d82ba112c5
commit: 3c34e3b50e0e434543c4abedd79f582c10160a80 [537/1075] drm/amdgpu/powerplay: add initial swSMU support for sienna_cichlid (v2)
:::::: branch date: 7 hours ago
:::::: commit date: 6 weeks ago
config: x86_64-randconfig-c002-20200714 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 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: Julia Lawall <julia.lawall(a)lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c:470:47-52: WARNING: conversion to bool not needed here
--
>> drivers/gpu/drm/amd/powerplay/sienna_cichlid_ppt.c:541:14-18: Unneeded variable: "size". Return "0" on line 557
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months