Re: [PATCH v2 2/3] fpga manager: framework core

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> > +int fpga_mgr_write(struct fpga_manager *mgr, const char *buf, size_t count)
> > +{
> > +	int ret;
> > +
> > +	if (test_and_set_bit_lock(FPGA_MGR_BUSY, &mgr->flags))
> > +		return -EBUSY;
> > +
> > +	dev_info(mgr->dev, "writing buffer to %s\n", mgr->name);
> > +
> > +	ret = __fpga_mgr_write(mgr, buf, count);
> > +	clear_bit_unlock(FPGA_MGR_BUSY, &mgr->flags);
> > +
> > +	return ret;
> > +}
> > +EXPORT_SYMBOL_GPL(fpga_mgr_write);
> 
> Is the EBUSY -- userspace please try again, but you don't know when to
> try again -- right interface? I mean, normally kernel would wait, so
> that userland does not have to poll?

And if userland has to also support polling you must support poll/select
on the file handle so it knows when to retry the I/O.

The error should be EAGAIN for a retriable write with O_NDELAY set.

Alan
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux