* [chrome-os:chromeos-5.4 95/109] drivers/of/device.c:172:10: error: implicit declaration of function 'of_dma_set_restricted_buffer'; did you mean
@ 2021-03-19 8:34 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-19 8:34 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 5302 bytes --]
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 9dbb318936be022de92f893824a3c93f4ab856c1
commit: 9add50386637e888e96183167ff28bf831173c53 [95/109] FROMLIST: of: Add plumbing for restricted DMA pool
config: sparc-defconfig (attached as .config)
compiler: sparc-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout 9add50386637e888e96183167ff28bf831173c53
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/of/device.c: In function 'of_dma_configure':
>> drivers/of/device.c:172:10: error: implicit declaration of function 'of_dma_set_restricted_buffer'; did you mean 'of_dma_get_restricted_buffer'? [-Werror=implicit-function-declaration]
172 | return of_dma_set_restricted_buffer(dev);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| of_dma_get_restricted_buffer
cc1: some warnings being treated as errors
vim +172 drivers/of/device.c
74
75 /**
76 * of_dma_configure - Setup DMA configuration
77 * @dev: Device to apply DMA configuration
78 * @np: Pointer to OF node having DMA configuration
79 * @force_dma: Whether device is to be set up by of_dma_configure() even if
80 * DMA capability is not explicitly described by firmware.
81 *
82 * Try to get devices's DMA configuration from DT and update it
83 * accordingly.
84 *
85 * If platform code needs to use its own special DMA configuration, it
86 * can use a platform bus notifier and handle BUS_NOTIFY_ADD_DEVICE events
87 * to fix up DMA configuration.
88 */
89 int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
90 {
91 u64 dma_addr, paddr, size = 0;
92 int ret;
93 bool coherent;
94 unsigned long offset;
95 const struct iommu_ops *iommu;
96 u64 mask;
97
98 ret = of_dma_get_range(np, &dma_addr, &paddr, &size);
99 if (ret < 0) {
100 /*
101 * For legacy reasons, we have to assume some devices need
102 * DMA configuration regardless of whether "dma-ranges" is
103 * correctly specified or not.
104 */
105 if (!force_dma)
106 return ret == -ENODEV ? 0 : ret;
107
108 dma_addr = offset = 0;
109 } else {
110 offset = PFN_DOWN(paddr - dma_addr);
111
112 /*
113 * Add a work around to treat the size as mask + 1 in case
114 * it is defined in DT as a mask.
115 */
116 if (size & 1) {
117 dev_warn(dev, "Invalid size 0x%llx for dma-range\n",
118 size);
119 size = size + 1;
120 }
121
122 if (!size) {
123 dev_err(dev, "Adjusted size 0x%llx invalid\n", size);
124 return -EINVAL;
125 }
126 dev_dbg(dev, "dma_pfn_offset(%#08lx)\n", offset);
127 }
128
129 /*
130 * If @dev is expected to be DMA-capable then the bus code that created
131 * it should have initialised its dma_mask pointer by this point. For
132 * now, we'll continue the legacy behaviour of coercing it to the
133 * coherent mask if not, but we'll no longer do so quietly.
134 */
135 if (!dev->dma_mask) {
136 dev_warn(dev, "DMA mask not set\n");
137 dev->dma_mask = &dev->coherent_dma_mask;
138 }
139
140 if (!size && dev->coherent_dma_mask)
141 size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1);
142 else if (!size)
143 size = 1ULL << 32;
144
145 dev->dma_pfn_offset = offset;
146
147 /*
148 * Limit coherent and dma mask based on size and default mask
149 * set by the driver.
150 */
151 mask = DMA_BIT_MASK(ilog2(dma_addr + size - 1) + 1);
152 dev->coherent_dma_mask &= mask;
153 *dev->dma_mask &= mask;
154 /* ...but only set bus mask if we found valid dma-ranges earlier */
155 if (!ret)
156 dev->bus_dma_mask = mask;
157
158 coherent = of_dma_is_coherent(np);
159 dev_dbg(dev, "device is%sdma coherent\n",
160 coherent ? " " : " not ");
161
162 iommu = of_iommu_configure(dev, np);
163 if (IS_ERR(iommu) && PTR_ERR(iommu) == -EPROBE_DEFER)
164 return -EPROBE_DEFER;
165
166 dev_dbg(dev, "device is%sbehind an iommu\n",
167 iommu ? " " : " not ");
168
169 arch_setup_dma_ops(dev, dma_addr, size, iommu, coherent);
170
171 if (!iommu)
> 172 return of_dma_set_restricted_buffer(dev);
173
174 return 0;
175 }
176 EXPORT_SYMBOL_GPL(of_dma_configure);
177
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 12963 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-19 8:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 8:34 [chrome-os:chromeos-5.4 95/109] drivers/of/device.c:172:10: error: implicit declaration of function 'of_dma_set_restricted_buffer'; did you mean kernel test robot
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.