tree: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git gpio-of-cleanups
head: 5c6098794cca5ac0a774ee430b72e18b8b98c032
commit: 898163c745e2d3070f1437e65aac0d6e579b3818 [12/17] MIPS: pci: lantiq: switch to using gpiod API
config: mips-xway_defconfig
compiler: mips-linux-gcc (GCC) 12.1.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
# https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git/commit/?id=898163c745e2d3070f1437e65aac0d6e579b3818
git remote add dtor-input https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
git fetch --no-tags dtor-input gpio-of-cleanups
git checkout 898163c745e2d3070f1437e65aac0d6e579b3818
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot [off-list ref]
All errors (new ones prefixed by >>):
quoted
arch/mips/pci/pci-lantiq.c:65:8: error: unknown type name 'gpio_desc'
65 | static gpio_desc *reset_gpio;
| ^~~~~~~~~
arch/mips/pci/pci-lantiq.c: In function 'ltq_pci_startup':quoted
arch/mips/pci/pci-lantiq.c:126:20: error: assignment to 'int *' from incompatible pointer type 'struct gpio_desc *' [-Werror=incompatible-pointer-types]
126 | reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset",
| ^quoted
arch/mips/pci/pci-lantiq.c:128:9: error: 'ret' undeclared (first use in this function); did you mean 'net'?
128 | ret = PTR_ERR_OR_ZERO(reset_gpio);
| ^~~
| net
arch/mips/pci/pci-lantiq.c:128:9: note: each undeclared identifier is reported only once for each function it appears inquoted
arch/mips/pci/pci-lantiq.c:133:33: error: passing argument 1 of 'gpiod_set_consumer_name' from incompatible pointer type [-Werror=incompatible-pointer-types]
133 | gpiod_set_consumer_name(reset_gpio, "pci_reset");
| ^~~~~~~~~~
| |
| int *
In file included from arch/mips/pci/pci-lantiq.c:12:
include/linux/gpio/consumer.h:168:47: note: expected 'struct gpio_desc *' but argument is of type 'int *'
168 | int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name);
| ~~~~~~~~~~~~~~~~~~^~~~quoted
arch/mips/pci/pci-lantiq.c:196:42: error: passing argument 1 of 'gpiod_set_value_cansleep' from incompatible pointer type [-Werror=incompatible-pointer-types]
196 | gpiod_set_value_cansleep(reset_gpio, 1);
| ^~~~~~~~~~
| |
| int *
include/linux/gpio/consumer.h:143:49: note: expected 'struct gpio_desc *' but argument is of type 'int *'
143 | void gpiod_set_value_cansleep(struct gpio_desc *desc, int value);
| ~~~~~~~~~~~~~~~~~~^~~~
arch/mips/pci/pci-lantiq.c:199:42: error: passing argument 1 of 'gpiod_set_value_cansleep' from incompatible pointer type [-Werror=incompatible-pointer-types]
199 | gpiod_set_value_cansleep(reset_gpio, 0);
| ^~~~~~~~~~
| |
| int *
include/linux/gpio/consumer.h:143:49: note: expected 'struct gpio_desc *' but argument is of type 'int *'
143 | void gpiod_set_value_cansleep(struct gpio_desc *desc, int value);
| ~~~~~~~~~~~~~~~~~~^~~~
arch/mips/pci/pci-lantiq.c: At top level:
arch/mips/pci/pci-lantiq.c:240:12: warning: no previous prototype for 'pcibios_init' [-Wmissing-prototypes]
240 | int __init pcibios_init(void)
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/gpio_desc +65 arch/mips/pci/pci-lantiq.c
64
> 65 static gpio_desc *reset_gpio;
66 static struct clk *clk_pci, *clk_external;
67 static struct resource pci_io_resource;
68 static struct resource pci_mem_resource;
69 static struct pci_ops pci_ops = {
70 .read = ltq_pci_read_config_dword,
71 .write = ltq_pci_write_config_dword
72 };
73
74 static struct pci_controller pci_controller = {
75 .pci_ops = &pci_ops,
76 .mem_resource = &pci_mem_resource,
77 .mem_offset = 0x00000000UL,
78 .io_resource = &pci_io_resource,
79 .io_offset = 0x00000000UL,
80 };
81
82 static inline u32 ltq_calc_bar11mask(void)
83 {
84 u32 mem, bar11mask;
85
86 /* BAR11MASK value depends on available memory on system. */
87 mem = get_num_physpages() * PAGE_SIZE;
88 bar11mask = (0x0ffffff0 & ~((1 << (fls(mem) - 1)) - 1)) | 8;
89
90 return bar11mask;
91 }
92
93 static int ltq_pci_startup(struct platform_device *pdev)
94 {
95 struct device_node *node = pdev->dev.of_node;
96 const __be32 *req_mask, *bus_clk;
97 u32 temp_buffer;
98
99 /* get our clocks */
100 clk_pci = clk_get(&pdev->dev, NULL);
101 if (IS_ERR(clk_pci)) {
102 dev_err(&pdev->dev, "failed to get pci clock\n");
103 return PTR_ERR(clk_pci);
104 }
105
106 clk_external = clk_get(&pdev->dev, "external");
107 if (IS_ERR(clk_external)) {
108 clk_put(clk_pci);
109 dev_err(&pdev->dev, "failed to get external pci clock\n");
110 return PTR_ERR(clk_external);
111 }
112
113 /* read the bus speed that we want */
114 bus_clk = of_get_property(node, "lantiq,bus-clock", NULL);
115 if (bus_clk)
116 clk_set_rate(clk_pci, *bus_clk);
117
118 /* and enable the clocks */
119 clk_enable(clk_pci);
120 if (of_find_property(node, "lantiq,external-clock", NULL))
121 clk_enable(clk_external);
122 else
123 clk_disable(clk_external);
124
125 /* setup reset gpio used by pci */
> 126 reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset",
127 GPIOD_OUT_LOW);
> 128 ret = PTR_ERR_OR_ZERO(reset_gpio);
129 if (ret) {
130 dev_err(&pdev->dev, "failed to request gpio: %d\n", ret);
131 return ret;
132 }
> 133 gpiod_set_consumer_name(reset_gpio, "pci_reset");
134
135 /* enable auto-switching between PCI and EBU */
136 ltq_pci_w32(0xa, PCI_CR_CLK_CTRL);
137
138 /* busy, i.e. configuration is not done, PCI access has to be retried */
139 ltq_pci_w32(ltq_pci_r32(PCI_CR_PCI_MOD) & ~(1 << 24), PCI_CR_PCI_MOD);
140 wmb();
141 /* BUS Master/IO/MEM access */
142 ltq_pci_cfg_w32(ltq_pci_cfg_r32(PCI_CS_STS_CMD) | 7, PCI_CS_STS_CMD);
143
144 /* enable external 2 PCI masters */
145 temp_buffer = ltq_pci_r32(PCI_CR_PC_ARB);
146 /* setup the request mask */
147 req_mask = of_get_property(node, "req-mask", NULL);
148 if (req_mask)
149 temp_buffer &= ~((*req_mask & 0xf) << 16);
150 else
151 temp_buffer &= ~0xf0000;
152 /* enable internal arbiter */
153 temp_buffer |= (1 << INTERNAL_ARB_ENABLE_BIT);
154 /* enable internal PCI master reqest */
155 temp_buffer &= (~(3 << PCI_MASTER0_REQ_MASK_2BITS));
156
157 /* enable EBU request */
158 temp_buffer &= (~(3 << PCI_MASTER1_REQ_MASK_2BITS));
159
160 /* enable all external masters request */
161 temp_buffer &= (~(3 << PCI_MASTER2_REQ_MASK_2BITS));
162 ltq_pci_w32(temp_buffer, PCI_CR_PC_ARB);
163 wmb();
164
165 /* setup BAR memory regions */
166 ltq_pci_w32(0x18000000, PCI_CR_FCI_ADDR_MAP0);
167 ltq_pci_w32(0x18400000, PCI_CR_FCI_ADDR_MAP1);
168 ltq_pci_w32(0x18800000, PCI_CR_FCI_ADDR_MAP2);
169 ltq_pci_w32(0x18c00000, PCI_CR_FCI_ADDR_MAP3);
170 ltq_pci_w32(0x19000000, PCI_CR_FCI_ADDR_MAP4);
171 ltq_pci_w32(0x19400000, PCI_CR_FCI_ADDR_MAP5);
172 ltq_pci_w32(0x19800000, PCI_CR_FCI_ADDR_MAP6);
173 ltq_pci_w32(0x19c00000, PCI_CR_FCI_ADDR_MAP7);
174 ltq_pci_w32(0x1ae00000, PCI_CR_FCI_ADDR_MAP11hg);
175 ltq_pci_w32(ltq_calc_bar11mask(), PCI_CR_BAR11MASK);
176 ltq_pci_w32(0, PCI_CR_PCI_ADDR_MAP11);
177 ltq_pci_w32(0, PCI_CS_BASE_ADDR1);
178 /* both TX and RX endian swap are enabled */
179 ltq_pci_w32(ltq_pci_r32(PCI_CR_PCI_EOI) | 3, PCI_CR_PCI_EOI);
180 wmb();
181 ltq_pci_w32(ltq_pci_r32(PCI_CR_BAR12MASK) | 0x80000000,
182 PCI_CR_BAR12MASK);
183 ltq_pci_w32(ltq_pci_r32(PCI_CR_BAR13MASK) | 0x80000000,
184 PCI_CR_BAR13MASK);
185 /*use 8 dw burst length */
186 ltq_pci_w32(0x303, PCI_CR_FCI_BURST_LENGTH);
187 ltq_pci_w32(ltq_pci_r32(PCI_CR_PCI_MOD) | (1 << 24), PCI_CR_PCI_MOD);
188 wmb();
189
190 /* setup irq line */
191 ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_CON) | 0xc, LTQ_EBU_PCC_CON);
192 ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_IEN) | 0x10, LTQ_EBU_PCC_IEN);
193
194 /* toggle reset pin */
195 if (reset_gpio) {
> 196 gpiod_set_value_cansleep(reset_gpio, 1);
197 wmb();
198 mdelay(1);
199 gpiod_set_value_cansleep(reset_gpio, 0);
200 }
201 return 0;
202 }
203
--
0-DAY CI Kernel Test Service
https://01.org/lkp