Thread (48 messages) 48 messages, 8 authors, 2016-08-03

Re: [RFC v0 3/8] firmware: Factor out firmware load helpers

From: Daniel Wagner <hidden>
Date: 2016-07-29 06:09:05
Also in: linux-wireless, lkml

On 07/28/2016 07:57 PM, Dmitry Torokhov wrote:
On Thu, Jul 28, 2016 at 09:55:07AM +0200, Daniel Wagner wrote:
quoted
+int __firmware_stat_wait(struct firmware_stat *fwst,
+				long timeout)
+{
+	int err;
+	err = swait_event_interruptible_timeout(fwst->wq,
+				is_fw_sync_done(READ_ONCE(fwst->status)),
+				timeout);
+	if (err == 0 && fwst->status == FW_STATUS_ABORT)
+		return -ENOENT;
+
+	return err;
+}
+EXPORT_SYMBOL(__firmware_stat_wait);
+
+void __firmware_stat_set(struct firmware_stat *fwst, unsigned long status)
+{
+	WRITE_ONCE(fwst->status, status);
+	swake_up(&fwst->wq);
Do we need to notify everyone for FW_STATUS_LOADING status?
Hmm, I don't think so. In the end drivers are probably only interested 
in the final result which is either success or fail.

cheers,
daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help