Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbb8cfeb authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman
Browse files

greybus: bootrom: send timeout in milliseconds to gb_bootrom_set_timeout()



Rename NEXT_REQ_TIMEOUT_J to NEXT_REQ_TIMEOUT_MS and store the timeout
in milliseconds instead of jiffies.

Suggested-by: default avatarAlex Elder <alex.elder@linaro.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent a4293e1d
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -15,7 +15,7 @@
#include "greybus.h"
#include "greybus.h"


/* Timeout, in jiffies, within which the next request must be received */
/* Timeout, in jiffies, within which the next request must be received */
#define NEXT_REQ_TIMEOUT_J	msecs_to_jiffies(1000)
#define NEXT_REQ_TIMEOUT_MS	1000


enum next_request_type {
enum next_request_type {
	NEXT_REQ_FIRMWARE_SIZE,
	NEXT_REQ_FIRMWARE_SIZE,
@@ -82,7 +82,7 @@ static void gb_bootrom_set_timeout(struct gb_bootrom *bootrom,
			enum next_request_type next, unsigned long timeout)
			enum next_request_type next, unsigned long timeout)
{
{
	bootrom->next_request = next;
	bootrom->next_request = next;
	schedule_delayed_work(&bootrom->dwork, timeout);
	schedule_delayed_work(&bootrom->dwork, msecs_to_jiffies(timeout));
}
}


/*
/*
@@ -211,7 +211,7 @@ static int gb_bootrom_firmware_size_request(struct gb_operation *op)
queue_work:
queue_work:
	/* Refresh timeout */
	/* Refresh timeout */
	gb_bootrom_set_timeout(bootrom, NEXT_REQ_GET_FIRMWARE,
	gb_bootrom_set_timeout(bootrom, NEXT_REQ_GET_FIRMWARE,
			       NEXT_REQ_TIMEOUT_J);
			       NEXT_REQ_TIMEOUT_MS);


	return ret;
	return ret;
}
}
@@ -281,7 +281,7 @@ static int gb_bootrom_get_firmware(struct gb_operation *op)
	else
	else
		next_request = NEXT_REQ_GET_FIRMWARE;
		next_request = NEXT_REQ_GET_FIRMWARE;


	gb_bootrom_set_timeout(bootrom, next_request, NEXT_REQ_TIMEOUT_J);
	gb_bootrom_set_timeout(bootrom, next_request, NEXT_REQ_TIMEOUT_MS);


	return ret;
	return ret;
}
}
@@ -327,7 +327,7 @@ static int gb_bootrom_ready_to_boot(struct gb_operation *op)
	 * connection. As that can take some time, increase the timeout a bit.
	 * connection. As that can take some time, increase the timeout a bit.
	 */
	 */
	gb_bootrom_set_timeout(bootrom, NEXT_REQ_MODE_SWITCH,
	gb_bootrom_set_timeout(bootrom, NEXT_REQ_MODE_SWITCH,
			       5 * NEXT_REQ_TIMEOUT_J);
			       5 * NEXT_REQ_TIMEOUT_MS);


	return ret;
	return ret;
}
}
@@ -447,7 +447,7 @@ static int gb_bootrom_probe(struct gb_bundle *bundle,


	/* Refresh timeout */
	/* Refresh timeout */
	gb_bootrom_set_timeout(bootrom, NEXT_REQ_FIRMWARE_SIZE,
	gb_bootrom_set_timeout(bootrom, NEXT_REQ_FIRMWARE_SIZE,
			       NEXT_REQ_TIMEOUT_J);
			       NEXT_REQ_TIMEOUT_MS);


	dev_dbg(&bundle->dev, "AP_READY sent\n");
	dev_dbg(&bundle->dev, "AP_READY sent\n");