Skip to content

Commit ff9ec95

Browse files
ovpanaitgregkh
authored andcommitted
staging: axis-fifo: remove sysfs interface
Unhandled fault: imprecise external abort (0x1406) at 0xaec8d000 [aec8d000] *pgd=03f74831, *pte=0525c75f, *ppte=0525cc7f Internal error: Oops - BUG: 1406 [#1] SMP ARM Hardware name: Xilinx Zynq Platform PC is at sysfs_read+0xc4/0xd8 LR is at dev_attr_show+0x6c/0xc0 pc : [<c0ff9298>] lr : [<c0adad38>] psr: 60070013 sp : e09abd18 ip : c3193000 fp : c0adaccc r10: 00000000 r9 : c3192000 r8 : 183abab5 r7 : c1d5d5a8 r6 : c2d71440 r5 : 00000024 r4 : c3192000 r3 : e0a60024 r2 : 00000000 r1 : c3192000 r0 : c2d71444 ... Call trace: sysfs_read from dev_attr_show+0x6c/0xc0 dev_attr_show from sysfs_kf_seq_show+0x270/0x360 sysfs_kf_seq_show from seq_read_iter+0x7f4/0x10bc seq_read_iter from vfs_read+0x350/0x3d0 vfs_read from ksys_read+0x104/0x194 ksys_read from ret_fast_syscall+0x0/0x54 The same abort is triggered if a read is attempted on RDFD register when the fifo is empty. Therefore, remove the sysfs interface and only let read()/write() modify the fifo registers. For debugging purposes, a simple read-only debugfs interface is added in the next patch. Fixes: 4a965c5 ("staging: add driver for Xilinx AXI-Stream FIFO v4.1 IP core") Signed-off-by: Ovidiu Panait <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a893435 commit ff9ec95

File tree

1 file changed

+0
-175
lines changed

1 file changed

+0
-175
lines changed

drivers/staging/axis-fifo/axis-fifo.c

Lines changed: 0 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -139,180 +139,6 @@ struct axis_fifo {
139139
struct miscdevice miscdev;
140140
};
141141

142-
/* ----------------------------
143-
* sysfs entries
144-
* ----------------------------
145-
*/
146-
147-
static ssize_t sysfs_write(struct device *dev, const char *buf,
148-
size_t count, unsigned int addr_offset)
149-
{
150-
struct axis_fifo *fifo = dev_get_drvdata(dev);
151-
unsigned long tmp;
152-
int rc;
153-
154-
rc = kstrtoul(buf, 0, &tmp);
155-
if (rc < 0)
156-
return rc;
157-
158-
iowrite32(tmp, fifo->base_addr + addr_offset);
159-
160-
return count;
161-
}
162-
163-
static ssize_t sysfs_read(struct device *dev, char *buf,
164-
unsigned int addr_offset)
165-
{
166-
struct axis_fifo *fifo = dev_get_drvdata(dev);
167-
unsigned int read_val;
168-
169-
read_val = ioread32(fifo->base_addr + addr_offset);
170-
return sysfs_emit(buf, "0x%x\n", read_val);
171-
}
172-
173-
static ssize_t isr_store(struct device *dev, struct device_attribute *attr,
174-
const char *buf, size_t count)
175-
{
176-
return sysfs_write(dev, buf, count, XLLF_ISR_OFFSET);
177-
}
178-
179-
static ssize_t isr_show(struct device *dev,
180-
struct device_attribute *attr, char *buf)
181-
{
182-
return sysfs_read(dev, buf, XLLF_ISR_OFFSET);
183-
}
184-
185-
static DEVICE_ATTR_RW(isr);
186-
187-
static ssize_t ier_store(struct device *dev, struct device_attribute *attr,
188-
const char *buf, size_t count)
189-
{
190-
return sysfs_write(dev, buf, count, XLLF_IER_OFFSET);
191-
}
192-
193-
static ssize_t ier_show(struct device *dev,
194-
struct device_attribute *attr, char *buf)
195-
{
196-
return sysfs_read(dev, buf, XLLF_IER_OFFSET);
197-
}
198-
199-
static DEVICE_ATTR_RW(ier);
200-
201-
static ssize_t tdfr_store(struct device *dev, struct device_attribute *attr,
202-
const char *buf, size_t count)
203-
{
204-
return sysfs_write(dev, buf, count, XLLF_TDFR_OFFSET);
205-
}
206-
207-
static DEVICE_ATTR_WO(tdfr);
208-
209-
static ssize_t tdfv_show(struct device *dev,
210-
struct device_attribute *attr, char *buf)
211-
{
212-
return sysfs_read(dev, buf, XLLF_TDFV_OFFSET);
213-
}
214-
215-
static DEVICE_ATTR_RO(tdfv);
216-
217-
static ssize_t tdfd_store(struct device *dev, struct device_attribute *attr,
218-
const char *buf, size_t count)
219-
{
220-
return sysfs_write(dev, buf, count, XLLF_TDFD_OFFSET);
221-
}
222-
223-
static DEVICE_ATTR_WO(tdfd);
224-
225-
static ssize_t tlr_store(struct device *dev, struct device_attribute *attr,
226-
const char *buf, size_t count)
227-
{
228-
return sysfs_write(dev, buf, count, XLLF_TLR_OFFSET);
229-
}
230-
231-
static DEVICE_ATTR_WO(tlr);
232-
233-
static ssize_t rdfr_store(struct device *dev, struct device_attribute *attr,
234-
const char *buf, size_t count)
235-
{
236-
return sysfs_write(dev, buf, count, XLLF_RDFR_OFFSET);
237-
}
238-
239-
static DEVICE_ATTR_WO(rdfr);
240-
241-
static ssize_t rdfo_show(struct device *dev,
242-
struct device_attribute *attr, char *buf)
243-
{
244-
return sysfs_read(dev, buf, XLLF_RDFO_OFFSET);
245-
}
246-
247-
static DEVICE_ATTR_RO(rdfo);
248-
249-
static ssize_t rdfd_show(struct device *dev,
250-
struct device_attribute *attr, char *buf)
251-
{
252-
return sysfs_read(dev, buf, XLLF_RDFD_OFFSET);
253-
}
254-
255-
static DEVICE_ATTR_RO(rdfd);
256-
257-
static ssize_t rlr_show(struct device *dev,
258-
struct device_attribute *attr, char *buf)
259-
{
260-
return sysfs_read(dev, buf, XLLF_RLR_OFFSET);
261-
}
262-
263-
static DEVICE_ATTR_RO(rlr);
264-
265-
static ssize_t srr_store(struct device *dev, struct device_attribute *attr,
266-
const char *buf, size_t count)
267-
{
268-
return sysfs_write(dev, buf, count, XLLF_SRR_OFFSET);
269-
}
270-
271-
static DEVICE_ATTR_WO(srr);
272-
273-
static ssize_t tdr_store(struct device *dev, struct device_attribute *attr,
274-
const char *buf, size_t count)
275-
{
276-
return sysfs_write(dev, buf, count, XLLF_TDR_OFFSET);
277-
}
278-
279-
static DEVICE_ATTR_WO(tdr);
280-
281-
static ssize_t rdr_show(struct device *dev,
282-
struct device_attribute *attr, char *buf)
283-
{
284-
return sysfs_read(dev, buf, XLLF_RDR_OFFSET);
285-
}
286-
287-
static DEVICE_ATTR_RO(rdr);
288-
289-
static struct attribute *axis_fifo_attrs[] = {
290-
&dev_attr_isr.attr,
291-
&dev_attr_ier.attr,
292-
&dev_attr_tdfr.attr,
293-
&dev_attr_tdfv.attr,
294-
&dev_attr_tdfd.attr,
295-
&dev_attr_tlr.attr,
296-
&dev_attr_rdfr.attr,
297-
&dev_attr_rdfo.attr,
298-
&dev_attr_rdfd.attr,
299-
&dev_attr_rlr.attr,
300-
&dev_attr_srr.attr,
301-
&dev_attr_tdr.attr,
302-
&dev_attr_rdr.attr,
303-
NULL,
304-
};
305-
306-
static const struct attribute_group axis_fifo_attrs_group = {
307-
.name = "ip_registers",
308-
.attrs = axis_fifo_attrs,
309-
};
310-
311-
static const struct attribute_group *axis_fifo_attrs_groups[] = {
312-
&axis_fifo_attrs_group,
313-
NULL,
314-
};
315-
316142
/* ----------------------------
317143
* implementation
318144
* ----------------------------
@@ -877,7 +703,6 @@ static int axis_fifo_probe(struct platform_device *pdev)
877703
fifo->miscdev.fops = &fops;
878704
fifo->miscdev.minor = MISC_DYNAMIC_MINOR;
879705
fifo->miscdev.name = device_name;
880-
fifo->miscdev.groups = axis_fifo_attrs_groups;
881706
fifo->miscdev.parent = dev;
882707
rc = misc_register(&fifo->miscdev);
883708
if (rc < 0)

0 commit comments

Comments
 (0)