All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v4] ptp: Add vDSO-style vmclock support
Date: Fri, 23 Aug 2024 08:29:07 +0800	[thread overview]
Message-ID: <202408230722.KxiF5aM0-lkp@intel.com> (raw)
In-Reply-To: <410bbef9771ef8aa51704994a70d5965e367e2ce.camel@infradead.org>

Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on soc/for-next]
[also build test WARNING on linus/master v6.11-rc4 next-20240822]
[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/David-Woodhouse/ptp-Add-vDSO-style-vmclock-support/20240822-055147
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link:    https://lore.kernel.org/r/410bbef9771ef8aa51704994a70d5965e367e2ce.camel%40infradead.org
patch subject: [PATCH v4] ptp: Add vDSO-style vmclock support
config: x86_64-randconfig-r133-20240822 (https://download.01.org/0day-ci/archive/20240823/202408230722.KxiF5aM0-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240823/202408230722.KxiF5aM0-lkp@intel.com/reproduce)

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/202408230722.KxiF5aM0-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/ptp/ptp_vmclock.c:562:13: sparse: sparse: restricted __le32 degrades to integer

vim +562 drivers/ptp/ptp_vmclock.c

   486	
   487	static int vmclock_probe(struct platform_device *pdev)
   488	{
   489		struct device *dev = &pdev->dev;
   490		struct vmclock_state *st;
   491		int ret;
   492	
   493		st = devm_kzalloc(dev, sizeof (*st), GFP_KERNEL);
   494		if (!st)
   495			return -ENOMEM;
   496	
   497		if (has_acpi_companion(dev))
   498			ret = vmclock_probe_acpi(dev, st);
   499		else
   500			ret = -EINVAL; /* Only ACPI for now */
   501	
   502		if (ret) {
   503			dev_info(dev, "Failed to obtain physical address: %d\n", ret);
   504			goto out;
   505		}
   506	
   507		if (resource_size(&st->res) < VMCLOCK_MIN_SIZE) {
   508			dev_info(dev, "Region too small (0x%llx)\n",
   509				 resource_size(&st->res));
   510			ret = -EINVAL;
   511			goto out;
   512		}
   513		st->clk = devm_memremap(dev, st->res.start, resource_size(&st->res),
   514					MEMREMAP_WB | MEMREMAP_DEC);
   515		if (IS_ERR(st->clk)) {
   516			ret = PTR_ERR(st->clk);
   517			dev_info(dev, "failed to map shared memory\n");
   518			st->clk = NULL;
   519			goto out;
   520		}
   521	
   522		if (le32_to_cpu(st->clk->magic) != VMCLOCK_MAGIC ||
   523		    le32_to_cpu(st->clk->size) > resource_size(&st->res) ||
   524		    le16_to_cpu(st->clk->version) != 1) {
   525			dev_info(dev, "vmclock magic fields invalid\n");
   526			ret = -EINVAL;
   527			goto out;
   528		}
   529	
   530		ret = ida_alloc(&vmclock_ida, GFP_KERNEL);
   531		if (ret < 0)
   532			goto out;
   533	
   534		st->index = ret;
   535		ret = devm_add_action_or_reset(&pdev->dev, vmclock_put_idx, st);
   536		if (ret)
   537			goto out;
   538	
   539		st->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "vmclock%d", st->index);
   540		if (!st->name) {
   541			ret = -ENOMEM;
   542			goto out;
   543		}
   544	
   545		/*
   546		 * If the structure is big enough, it can be mapped to userspace.
   547		 * Theoretically a guest OS even using larger pages could still
   548		 * use 4KiB PTEs to map smaller MMIO regions like this, but let's
   549		 * cross that bridge if/when we come to it.
   550		 */
   551		if (le32_to_cpu(st->clk->size) >= PAGE_SIZE) {
   552			st->miscdev.minor = MISC_DYNAMIC_MINOR;
   553			st->miscdev.fops = &vmclock_miscdev_fops;
   554			st->miscdev.name = st->name;
   555	
   556			ret = misc_register(&st->miscdev);
   557			if (ret)
   558				goto out;
   559		}
   560	
   561		/* If there is valid clock information, register a PTP clock */
 > 562		if (VMCLOCK_FIELD_PRESENT(st->clk, time_frac_sec)) {
   563			/* Can return a silent NULL, or an error. */
   564			st->ptp_clock = vmclock_ptp_register(dev, st);
   565			if (IS_ERR(st->ptp_clock)) {
   566				ret = PTR_ERR(st->ptp_clock);
   567				st->ptp_clock = NULL;
   568				vmclock_remove(pdev);
   569				goto out;
   570			}
   571		}
   572	
   573		if (!st->miscdev.minor && !st->ptp_clock) {
   574			/* Neither miscdev nor PTP registered */
   575			dev_info(dev, "vmclock: Neither miscdev nor PTP available; not registering\n");
   576			ret = -ENODEV;
   577			goto out;
   578		}
   579	
   580		dev_info(dev, "%s: registered %s%s%s\n", st->name,
   581			 st->miscdev.minor ? "miscdev" : "",
   582			 (st->miscdev.minor && st->ptp_clock) ? ", " : "",
   583			 st->ptp_clock ? "PTP" : "");
   584	
   585		dev_set_drvdata(dev, st);
   586	
   587	 out:
   588		return ret;
   589	}
   590	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      parent reply	other threads:[~2024-08-23  0:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 21:50 [PATCH v4] ptp: Add vDSO-style vmclock support David Woodhouse
2024-08-22 11:49 ` Simon Horman
2024-08-22 12:31   ` David Woodhouse
2024-08-23  0:29 ` kernel test robot [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=202408230722.KxiF5aM0-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dwmw2@infradead.org \
    --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.