From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [intel-tdx:v7.3-rc4_tdx_connect_phase2.for_upstream 12/44] drivers/pci/tsm/core.c:777 pci_tsm_enable_dma() warn: set_bit() takes a bit number
Date: Thu, 24 Sep 2026 20:07:57 +0200 [thread overview]
Message-ID: <202609242048.Wd3SNMSN-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Zhenzhong Duan <zhenzhong.duan@intel.com>
tree: https://github.com/intel/tdx.git v7.3-rc4_tdx_connect_phase2.for_upstream
head: 69fd611d89afafa408b11f0e1304297433d3d471
commit: c0574e0bc66aaa1e44d4a31e64b79c4197d3285f [12/44] PCI/TSM: Add device interface security DMA enable/disable
:::::: branch date: 14 hours ago
:::::: commit date: 15 hours ago
config: i386-randconfig-r2202-20260924 (https://download.01.org/0day-ci/archive/20260924/202609242048.Wd3SNMSN-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch: v0.5.0-9187-g5189e3fb
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202609242048.Wd3SNMSN-lkp@intel.com/
New smatch warnings:
drivers/pci/tsm/core.c:777 pci_tsm_enable_dma() warn: set_bit() takes a bit number
drivers/pci/tsm/core.c:792 pci_tsm_disable_dma() warn: test_and_clear_bit() takes a bit number
Old smatch warnings:
drivers/pci/tsm/core.c:589 pci_tsm_accept() warn: set_bit() takes a bit number
vim +777 drivers/pci/tsm/core.c
da2ae199703c8a Dan Williams 2026-09-24 756
c0574e0bc66aaa Dan Williams 2026-09-24 757 /* pci_dma_configure() helper to finalize access to private memory. */
c0574e0bc66aaa Dan Williams 2026-09-24 758 int pci_tsm_enable_dma(struct pci_dev *pdev) __must_hold(&pdev->dev->mutex)
c0574e0bc66aaa Dan Williams 2026-09-24 759 {
c0574e0bc66aaa Dan Williams 2026-09-24 760 struct device *dev = &pdev->dev;
c0574e0bc66aaa Dan Williams 2026-09-24 761 const struct pci_tsm_ops *ops;
c0574e0bc66aaa Dan Williams 2026-09-24 762 int rc;
c0574e0bc66aaa Dan Williams 2026-09-24 763
c0574e0bc66aaa Dan Williams 2026-09-24 764 if (dev_WARN_ONCE(dev, !dev->driver,
c0574e0bc66aaa Dan Williams 2026-09-24 765 "DMA access only finalized at driver attach\n"))
c0574e0bc66aaa Dan Williams 2026-09-24 766 return -ENXIO;
c0574e0bc66aaa Dan Williams 2026-09-24 767
c0574e0bc66aaa Dan Williams 2026-09-24 768 if (!pdev->tsm)
c0574e0bc66aaa Dan Williams 2026-09-24 769 return 0;
c0574e0bc66aaa Dan Williams 2026-09-24 770
c0574e0bc66aaa Dan Williams 2026-09-24 771 ops = to_pci_tsm_ops(pdev->tsm);
c0574e0bc66aaa Dan Williams 2026-09-24 772 if (!ops->enable_dma)
c0574e0bc66aaa Dan Williams 2026-09-24 773 return 0;
c0574e0bc66aaa Dan Williams 2026-09-24 774
c0574e0bc66aaa Dan Williams 2026-09-24 775 rc = ops->enable_dma(pdev);
c0574e0bc66aaa Dan Williams 2026-09-24 776 if (rc == 0)
c0574e0bc66aaa Dan Williams 2026-09-24 @777 set_bit(PCI_TSM_F_DMA, &pdev->tsm->flags);
c0574e0bc66aaa Dan Williams 2026-09-24 778 return rc;
c0574e0bc66aaa Dan Williams 2026-09-24 779 }
c0574e0bc66aaa Dan Williams 2026-09-24 780
c0574e0bc66aaa Dan Williams 2026-09-24 781 /*
c0574e0bc66aaa Dan Williams 2026-09-24 782 * pci_dma_cleanup() helper to block private memory access as device is
c0574e0bc66aaa Dan Williams 2026-09-24 783 * going idle
c0574e0bc66aaa Dan Williams 2026-09-24 784 */
c0574e0bc66aaa Dan Williams 2026-09-24 785 void pci_tsm_disable_dma(struct pci_dev *pdev) __must_hold(&pdev->dev->mutex)
c0574e0bc66aaa Dan Williams 2026-09-24 786 {
c0574e0bc66aaa Dan Williams 2026-09-24 787 const struct pci_tsm_ops *ops;
c0574e0bc66aaa Dan Williams 2026-09-24 788
c0574e0bc66aaa Dan Williams 2026-09-24 789 if (!pdev->tsm)
c0574e0bc66aaa Dan Williams 2026-09-24 790 return;
c0574e0bc66aaa Dan Williams 2026-09-24 791
c0574e0bc66aaa Dan Williams 2026-09-24 @792 if (!test_and_clear_bit(PCI_TSM_F_DMA, &pdev->tsm->flags))
c0574e0bc66aaa Dan Williams 2026-09-24 793 return;
c0574e0bc66aaa Dan Williams 2026-09-24 794
c0574e0bc66aaa Dan Williams 2026-09-24 795 ops = to_pci_tsm_ops(pdev->tsm);
c0574e0bc66aaa Dan Williams 2026-09-24 796 ops->disable_dma(pdev);
c0574e0bc66aaa Dan Williams 2026-09-24 797 }
c0574e0bc66aaa Dan Williams 2026-09-24 798
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-09-24 18:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202609242048.Wd3SNMSN-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@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.