All of lore.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: kernel test robot <lkp@intel.com>, Julia Lawall <julia.lawall@inria.fr>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v3 2/2] PCI: microchip: rework reg region handing to support using either instance 1 or 2
Date: Wed, 3 Jul 2024 21:14:27 +0100	[thread overview]
Message-ID: <20240703-persuaded-replace-abd30141b2eb@spud> (raw)
In-Reply-To: <202407040339.i1nFFozS-lkp@intel.com>

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

On Thu, Jul 04, 2024 at 04:01:42AM +0800, kernel test robot wrote:
> Hi Conor,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on pci/for-linus]
> [also build test WARNING on robh/for-next linus/master v6.10-rc6]
> [cannot apply to pci/next next-20240703]
> [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#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Conor-Dooley/dt-bindings-PCI-microchip-pcie-host-fix-reg-properties/20240701-183154
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git for-linus
> patch link:    https://lore.kernel.org/r/20240701-charger-recognize-fd8a65026a89%40spud
> patch subject: [PATCH v3 2/2] PCI: microchip: rework reg region handing to support using either instance 1 or 2
> config: x86_64-randconfig-102-20240703 (https://download.01.org/0day-ci/archive/20240704/202407040339.i1nFFozS-lkp@intel.com/config)
> compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202407040339.i1nFFozS-lkp@intel.com/
> 
> cocci warnings: (new ones prefixed by >>)
> >> drivers/pci/controller/pcie-microchip-host.c:1142:5-11: inconsistent IS_ERR and PTR_ERR on line 1143.

This is a valid warning and was reported against my patch submission
rather than my kernel.org tree where I had put the patch overnight
before submitting - any reason why it only CCed me and the build issue
mailing list? Seems worth sending to the maintainers etc since it is a
Real Bug^tm.

Also, Julia - any chance of an improved error message here? I was
scratching my head saying wtf cos IS_ERR() and PTR_ERR() are the right
things to use here - missing that the inconsistency was the variable
passed to it. Would something like "inconsistent argument passed to IS_ERR()
and PTR_ERR() on line $" be an improvement here?

Cheers,
Conor.

> 
> vim +1142 drivers/pci/controller/pcie-microchip-host.c
> 
>   1118	
>   1119	static int mc_host_probe(struct platform_device *pdev)
>   1120	{
>   1121		struct device *dev = &pdev->dev;
>   1122		void __iomem *apb_base_addr;
>   1123		int ret;
>   1124		u32 val;
>   1125	
>   1126		port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
>   1127		if (!port)
>   1128			return -ENOMEM;
>   1129	
>   1130		port->dev = dev;
>   1131	
>   1132		port->bridge_base_addr = devm_platform_ioremap_resource_byname(pdev, "bridge");
>   1133		port->ctrl_base_addr = devm_platform_ioremap_resource_byname(pdev, "ctrl");
>   1134		if(!IS_ERR(port->bridge_base_addr) && !IS_ERR(port->ctrl_base_addr))
>   1135			goto addrs_set;
>   1136	
>   1137		/*
>   1138		 * The original, incorrect, binding that lumped the control and
>   1139		 * bridge addresses together still needs to be handled by the driver.
>   1140		 */
>   1141		apb_base_addr = devm_platform_ioremap_resource_byname(pdev, "apb");
> > 1142		if (IS_ERR(apb_base_addr))
> > 1143			return dev_err_probe(dev, PTR_ERR(port->bridge_base_addr),
>   1144					     "both legacy apb register and ctrl/bridge regions missing");
>   1145	
>   1146		port->bridge_base_addr = apb_base_addr + MC_PCIE1_BRIDGE_ADDR;
>   1147		port->ctrl_base_addr = apb_base_addr + MC_PCIE1_CTRL_ADDR;
>   1148	
>   1149	addrs_set:
>   1150		mc_disable_interrupts(port);
>   1151	
>   1152		/* Allow enabling MSI by disabling MSI-X */
>   1153		val = readl(port->bridge_base_addr + PCIE_PCI_IRQ_DW0);
>   1154		val &= ~MSIX_CAP_MASK;
>   1155		writel(val, port->bridge_base_addr + PCIE_PCI_IRQ_DW0);
>   1156	
>   1157		/* Pick num vectors from bitfile programmed onto FPGA fabric */
>   1158		val = readl(port->bridge_base_addr + PCIE_PCI_IRQ_DW0);
>   1159		val &= NUM_MSI_MSGS_MASK;
>   1160		val >>= NUM_MSI_MSGS_SHIFT;
>   1161	
>   1162		port->msi.num_vectors = 1 << val;
>   1163	
>   1164		/* Pick vector address from design */
>   1165		port->msi.vector_phy = readl_relaxed(port->bridge_base_addr + IMSI_ADDR);
>   1166	
>   1167		ret = mc_pcie_init_clks(dev);
>   1168		if (ret) {
>   1169			dev_err(dev, "failed to get clock resources, error %d\n", ret);
>   1170			return -ENODEV;
>   1171		}
>   1172	
>   1173		return pci_host_common_probe(pdev);
>   1174	}
>   1175	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2024-07-03 20:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 10:22 [PATCH v3 0/2] PCI: microchip: support using either instance 1 or 2 Conor Dooley
2024-07-01 10:22 ` Conor Dooley
2024-07-01 10:22 ` [PATCH v3 1/2] dt-bindings: PCI: microchip,pcie-host: fix reg properties Conor Dooley
2024-07-01 10:22   ` Conor Dooley
2024-07-01 10:22 ` [PATCH v3 2/2] PCI: microchip: rework reg region handing to support using either instance 1 or 2 Conor Dooley
2024-07-01 10:22   ` Conor Dooley
2024-07-03 20:01   ` kernel test robot
2024-07-03 20:14     ` Conor Dooley [this message]

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20240703-persuaded-replace-abd30141b2eb@spud \
    --to=conor@kernel.org \
    --cc=julia.lawall@inria.fr \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

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

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