You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(8) |
Sep
(14) |
Oct
(7) |
Nov
(9) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(11) |
Feb
(4) |
Mar
(6) |
Apr
(3) |
May
(7) |
Jun
(12) |
Jul
(4) |
Aug
(6) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(2) |
2011 |
Jan
(2) |
Feb
(3) |
Mar
(10) |
Apr
(7) |
May
(5) |
Jun
(3) |
Jul
(7) |
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(4) |
Dec
(6) |
2012 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(2) |
May
(21) |
Jun
(6) |
Jul
(3) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(10) |
2013 |
Jan
(10) |
Feb
(8) |
Mar
|
Apr
(9) |
May
(33) |
Jun
(11) |
Jul
(16) |
Aug
(3) |
Sep
(8) |
Oct
(1) |
Nov
(16) |
Dec
(7) |
2014 |
Jan
(19) |
Feb
(71) |
Mar
(46) |
Apr
(16) |
May
(1) |
Jun
(18) |
Jul
(6) |
Aug
(12) |
Sep
(7) |
Oct
(4) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(15) |
Feb
(6) |
Mar
(10) |
Apr
(7) |
May
(16) |
Jun
(21) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Joel S. <jo...@jm...> - 2014-08-07 00:58:44
|
It is unused. Also add a forward declaration at the top so we can call do_info in other interesting places. Signed-off-by: Joel Stanley <jo...@jm...> --- src/ppc64_cpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ppc64_cpu.c b/src/ppc64_cpu.c index 9864ca0..ddd6c0e 100644 --- a/src/ppc64_cpu.c +++ b/src/ppc64_cpu.c @@ -57,6 +57,8 @@ static int threads_per_cpu = 0; static int cpus_in_system = 0; static int threads_in_system = 0; +static int do_info(void); + static int test_sysattr(char *attribute, int perms) { char path[SYSFS_PATH_MAX]; @@ -1126,7 +1128,7 @@ static int do_cores_online(char *state) return 0; } -static int do_info(char *arg) +static int do_info(void) { int i, j, thread_num; char online; @@ -1287,7 +1289,7 @@ int main(int argc, char *argv[]) else if (!strcmp(action, "threads-per-core")) do_threads_per_core(); else if (!strcmp(action, "info")) - rc = do_info(action_arg); + rc = do_info(); else if (!strcmp(action, "version")) printf("ppc64_cpu: version %s\n", PPC64_CPU_VERSION); else -- 2.0.1 |
From: Joel S. <jo...@jm...> - 2014-08-05 07:11:55
|
With the use of splitcore, users are more likely to end up in a strange SMT state. Be kind and display what the online state of all our CPUs is, and explain how to get out of this hole. Signed-off-by: Joel Stanley <jo...@jm...> --- src/ppc64_cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ppc64_cpu.c b/src/ppc64_cpu.c index ddd6c0e..c6b9a19 100644 --- a/src/ppc64_cpu.c +++ b/src/ppc64_cpu.c @@ -1070,7 +1070,9 @@ static int do_cores_online(char *state) smt_state = get_smt_state(); if (smt_state == -1) { - printf("Bad or inconsistent SMT state\n"); + printf("Bad or inconsistent SMT state: use ppc64_cpu --smt to set all cores have\n" + "the same number of online threads to continue.\n"); + do_info(); return -1; } -- 2.0.1 |
From: Joel S. <jo...@jm...> - 2014-08-05 07:10:35
|
It is unused. Also add a forward declaration at the top so we can call do_info in other interesting places. Signed-off-by: Joel Stanley <jo...@jm...> --- src/ppc64_cpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ppc64_cpu.c b/src/ppc64_cpu.c index 9864ca0..ddd6c0e 100644 --- a/src/ppc64_cpu.c +++ b/src/ppc64_cpu.c @@ -57,6 +57,8 @@ static int threads_per_cpu = 0; static int cpus_in_system = 0; static int threads_in_system = 0; +static int do_info(void); + static int test_sysattr(char *attribute, int perms) { char path[SYSFS_PATH_MAX]; @@ -1126,7 +1128,7 @@ static int do_cores_online(char *state) return 0; } -static int do_info(char *arg) +static int do_info(void) { int i, j, thread_num; char online; @@ -1287,7 +1289,7 @@ int main(int argc, char *argv[]) else if (!strcmp(action, "threads-per-core")) do_threads_per_core(); else if (!strcmp(action, "info")) - rc = do_info(action_arg); + rc = do_info(); else if (!strcmp(action, "version")) printf("ppc64_cpu: version %s\n", PPC64_CPU_VERSION); else -- 2.0.1 |
From: Vasant H. <heg...@li...> - 2014-07-14 08:07:15
|
On 07/03/2014 11:05 AM, Aruna Balakrishnaiah wrote: > Handle endianness of the oops log size in the --unzip > option. > > Signed-off-by: Aruna Balakrishnaiah <ar...@li...> Acked-by: Vasant Hegde <heg...@li...> -Vasant > --- > src/nvram.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/nvram.c b/src/nvram.c > index 13b9128..ce3f7e1 100644 > --- a/src/nvram.c > +++ b/src/nvram.c > @@ -1113,7 +1113,7 @@ unzip_partition(struct nvram *nvram, char *name) > start = (char*) phead; > next = start + sizeof(*phead); /* Skip partition header. */ > next += sizeof(struct err_log_info); /* Skip sub-header. */ > - zipped_length = *((unsigned short*) next); > + zipped_length = be16toh(*((unsigned short*) next)); > next += sizeof(unsigned short); > > /* New format oops header, zipped_length > OOPS_PARTITION_SZ > @@ -1121,7 +1121,7 @@ unzip_partition(struct nvram *nvram, char *name) > * and from where the compressed data starts. > */ > if (zipped_length > OOPS_PARTITION_SZ) { > - zipped_length = *((unsigned short*) next); > + zipped_length = be16toh(*((unsigned short*) next)); > next += sizeof(struct oops_log_info) - sizeof(unsigned short); > } > > > > ------------------------------------------------------------------------------ > Open source business process management suite built on Java and Eclipse > Turn processes into business applications with Bonita BPM Community Edition > Quickly connect people, data, and systems into organized workflows > Winner of BOSSIE, CODIE, OW2 and Gartner awards > http://p.sf.net/sfu/Bonitasoft > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel > |
From: Thomas F. <tlf...@li...> - 2014-07-10 21:31:01
|
The Power8 cpu can support eight threads per cpu core. This patch increases the maximum number of threads from four to eight. Signed-off-by: Thomas Falcon <tlf...@li...> --- src/drmgr/ofdt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drmgr/ofdt.h b/src/drmgr/ofdt.h index 28a3fab..954377b 100644 --- a/src/drmgr/ofdt.h +++ b/src/drmgr/ofdt.h @@ -14,7 +14,7 @@ #define DR_PATH_MAX 1024 #define DR_STR_MAX 128 -#define MAX_CPU_INTSERV_NUMS 4 +#define MAX_CPU_INTSERV_NUMS 8 struct dr_connector { char name[DRC_STR_MAX]; -- 1.8.5.2 |
From: Thomas F. <tlf...@li...> - 2014-07-10 21:30:58
|
This patch adds some support in retrieving memory slot information on little endian systems. These changes have only been tested using lsslot. Adding or removing memory via drmgr has not been attempted. Signed-off-by: Thomas Falcon <tlf...@li...> --- src/drmgr/drslot_chrp_mem.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/drmgr/drslot_chrp_mem.c b/src/drmgr/drslot_chrp_mem.c index 7b3fb5e..f47e67a 100644 --- a/src/drmgr/drslot_chrp_mem.c +++ b/src/drmgr/drslot_chrp_mem.c @@ -48,13 +48,10 @@ get_phandle(char *path, int *phandle) int rc1,rc2; /* get "linux,phandle" property */ - rc1 = get_property(path, "linux,phandle", phandle, - sizeof(*phandle)); + rc1 = get_ofdt_uint_property(path, "linux,phandle", phandle); /* overwrite with "ibm,handle" if it exists */ - rc2 = get_property(path, "ibm,phandle", phandle, - sizeof(*phandle)); - + rc2 = get_ofdt_uint_property(path, "ibm,phandle", phandle); /* return bad if both gets failed */ if (rc1 && rc2) return rc1; @@ -158,7 +155,7 @@ get_lmb_size(struct dr_node *lmb) return rc; } - lmb->lmb_size = regs[3]; + lmb->lmb_size = be32toh(regs[3]); return 0; } @@ -263,6 +260,10 @@ get_dynamic_reconfig_lmbs(struct lmb_list_head *lmb_list) rc = get_property(DYNAMIC_RECONFIG_MEM, "ibm,lmb-size", &lmb_sz, sizeof(lmb_sz)); + + /* convert for LE systems */ + lmb_sz = be64toh(lmb_sz); + if (rc) { say(DEBUG, "Could not retrieve drconf LMB size\n"); return rc; @@ -288,12 +289,20 @@ get_dynamic_reconfig_lmbs(struct lmb_list_head *lmb_list) /* The first integer of the buffer is the number of entries */ num_entries = *(int *)lmb_list->drconf_buf; + /* convert for LE systems */ + num_entries = be32toh(num_entries); + /* Followed by the actual entries */ drmem = (struct drconf_mem *) (lmb_list->drconf_buf + sizeof(num_entries)); for (i = 0; i < num_entries; i++) { struct dr_node *lmb; + /* convert for LE systems */ + drmem->address = be64toh(drmem->address); + drmem->drc_index = be32toh(drmem->drc_index); + drmem->flags = be32toh(drmem->flags); + for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { if (lmb->drc_index == drmem->drc_index) break; @@ -560,9 +569,17 @@ update_drconf_node(struct dr_node *lmb, struct lmb_list_head *lmb_list, /* The first int of the buffer is the number of entries */ entries = *(int *)lmb_list->drconf_buf; + /* convert for LE systems */ + entries = be32toh(entries); + drmem = (struct drconf_mem *)(lmb_list->drconf_buf + sizeof(entries)); for (i = 0; i < entries; i++) { + + /* convert for LE systems */ + drmem->drc_index = be32toh(drmem->drc_index); + drmem->flags = be32toh(drmem->flags); + if (drmem->drc_index != lmb->drc_index) { drmem++; continue; -- 1.8.5.2 |
From: Thomas F. <tlf...@li...> - 2014-07-10 21:30:57
|
This patch adds some support in retrieving cpu slot information on little endian systems. These changes have only been tested using lsslot. Adding or removing cpu's via drmgr has not been attempted. Signed-off-by: Thomas Falcon <tlf...@li...> --- src/drmgr/common_cpu.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/drmgr/common_cpu.c b/src/drmgr/common_cpu.c index d8d5bb8..8e37a5f 100644 --- a/src/drmgr/common_cpu.c +++ b/src/drmgr/common_cpu.c @@ -205,7 +205,7 @@ update_cpu_node(struct dr_node *cpu, const char *path, struct dr_info *dr_info) { struct stat sb; char intserv_path[DR_PATH_MAX]; - int rc; + int rc, i; if (path) { snprintf(cpu->ofdt_path, DR_PATH_MAX, "%s", path); @@ -220,11 +220,15 @@ update_cpu_node(struct dr_node *cpu, const char *path, struct dr_info *dr_info) /* Skip past CPU_OFDT_BASE plus the '/' */ cpu->name = cpu->ofdt_path + strlen(CPU_OFDT_BASE) + 1; - memset(&cpu->cpu_intserv_nums, -1, sizeof(cpu->cpu_intserv_nums)); rc = get_property(cpu->ofdt_path, "ibm,ppc-interrupt-server#s", &cpu->cpu_intserv_nums, sizeof(cpu->cpu_intserv_nums)); + + /* Making sure the intserv_nums are in correct endian format */ + for (i = 0; i < MAX_CPU_INTSERV_NUMS; i++) + cpu->cpu_intserv_nums[i]=be32toh(cpu->cpu_intserv_nums[i]); + if (rc) { say(ERROR, "Could not retrieve ibm,ppc-interrupt-server#s " "property for %s\n", cpu->name); @@ -244,8 +248,7 @@ update_cpu_node(struct dr_node *cpu, const char *path, struct dr_info *dr_info) else cpu->cpu_nthreads = sb.st_size / 4; - rc = get_property(cpu->ofdt_path, "reg", &cpu->cpu_reg, - sizeof(cpu->cpu_reg)); + rc = get_ofdt_uint_property(cpu->ofdt_path, "reg", &cpu->cpu_reg); if (rc) { say(ERROR, "Could not retrieve reg property for %s\n", cpu->name); @@ -254,8 +257,7 @@ update_cpu_node(struct dr_node *cpu, const char *path, struct dr_info *dr_info) /* l2-cache may not exist */ cpu->cpu_l2cache = 0xffffffff; - get_property(cpu->ofdt_path, "l2-cache", &cpu->cpu_l2cache, - sizeof(cpu->cpu_l2cache)); + get_ofdt_uint_property(cpu->ofdt_path, "l2-cache", &cpu->cpu_l2cache); get_cpu_threads(cpu, dr_info->all_threads); cpu->is_owned = 1; @@ -543,9 +545,8 @@ init_cache_info(struct dr_info *dr_info) cache->next = cache_list; cache_list = cache; - rc = get_property(cache->path, "ibm,phandle", - &cache->phandle, - sizeof(cache->phandle)); + rc = get_ofdt_uint_property(cache->path, "ibm,phandle", + &cache->phandle); if (rc) { say(ERROR, "Could not retreive ibm,phandle " "property for %s\n", cache->path); @@ -555,8 +556,8 @@ init_cache_info(struct dr_info *dr_info) /* l3-caches do not have a l2-cache property */ cache->l2cache = 0xffffffff; - get_property(cache->path, "l2-cache", &cache->l2cache, - sizeof(cache->l2cache)); + get_ofdt_uint_property(cache->path, "l2-cache", + &cache->l2cache); say(DEBUG, "Found cache %s\n", cache->name); } -- 1.8.5.2 |
From: Aruna B. <ar...@li...> - 2014-07-03 05:35:47
|
Handle endianness of the oops log size in the --unzip option. Signed-off-by: Aruna Balakrishnaiah <ar...@li...> --- src/nvram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvram.c b/src/nvram.c index 13b9128..ce3f7e1 100644 --- a/src/nvram.c +++ b/src/nvram.c @@ -1113,7 +1113,7 @@ unzip_partition(struct nvram *nvram, char *name) start = (char*) phead; next = start + sizeof(*phead); /* Skip partition header. */ next += sizeof(struct err_log_info); /* Skip sub-header. */ - zipped_length = *((unsigned short*) next); + zipped_length = be16toh(*((unsigned short*) next)); next += sizeof(unsigned short); /* New format oops header, zipped_length > OOPS_PARTITION_SZ @@ -1121,7 +1121,7 @@ unzip_partition(struct nvram *nvram, char *name) * and from where the compressed data starts. */ if (zipped_length > OOPS_PARTITION_SZ) { - zipped_length = *((unsigned short*) next); + zipped_length = be16toh(*((unsigned short*) next)); next += sizeof(struct oops_log_info) - sizeof(unsigned short); } |
From: George W. <lt...@us...> - 2014-07-01 23:56:26
|
The following patch replaces unsafe pickler serialization with colander serialization. Because the pickler accepts multiple types, it is able to handle different message formats transparently, including error strings. Colander enforces type checking for safety. Doing so, however, means that the error messages must now be explicitly encapsulated so that they can be deencapsulated like everything else. The pickler also works nicely with sockets by transparently implementing the handshaking for passing arbitrarily sized buffers. Because the protocol is simple enough, this patch just shuts down one side of the socket to synchronize. All this breaks backwards compatibility in a way that likely doesn't allow version detection so cmdvers hasn't been bumped. Signed-off-by: George Wilson <gcw...@us...> amsnet.py | 50 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 13 deletions(-) --- --- powerpc-utils-python-1.2.1-orig/scripts/amsvis/powerpcAMS/amsnet.py 2009-10-22 14:02:15.000000000 -0500 +++ powerpc-utils-python-1.2.1/scripts/amsvis/powerpcAMS/amsnet.py 2014-01-16 18:13:17.704795365 -0600 @@ -16,6 +16,8 @@ import types import logging import cPickle as pickle from optparse import OptionParser +import colander +import ast from powerpcAMS.amsdata import * @@ -28,10 +30,26 @@ data_methods = (gather_all_data, gather_ # The update should increment the digits to the right of the decimal point. # The digits to the left of the decimal point should be increased when # backwards compatibility is broken. +orig_cmdvers = 1.0000000 cmdvers = 1.0000000 +class Request(colander.MappingSchema): + command = colander.SchemaNode(colander.Int(), + validator = colander.Range(0, cmd_MAX)) + version = colander.SchemaNode(colander.Float(), + validator = colander.Range(orig_cmdvers, cmdvers)) + +class DataTuple(colander.TupleSchema): + sys_data = colander.SchemaNode(colander.Mapping(unknown='preserve')) + bus_data = colander.SchemaNode(colander.Mapping(unknown='preserve')) + devices_data = colander.SchemaNode(colander.Mapping(unknown='preserve')) + +class Response(colander.MappingSchema): + result = colander.SchemaNode(colander.String()) + data = DataTuple() + def send_data_loop(port): - """Send pickled data to any client that connects to a given network port. + """Send serialized data to any client that connects to a given network port. Keyword arguments: port -- network port number to use for this server @@ -64,12 +82,13 @@ def send_data_loop(port): # request data version we can change what the server will # send in the future. try: - client_data = pickle.Unpickler(sockfile).load() + request_schema = Request() + client_data = request_schema.deserialize(ast.literal_eval(sockfile.read())) except: logging.debug("Unable to parse client request.") logging.info("Bad client request, ignoring.") result = "error" - data = "bad client request" + data = ({"error":"bad client request"}, {}, {}) # Currently the server only expects a dictionary from the client # with the following values to send AMS data: @@ -80,7 +99,7 @@ def send_data_loop(port): int(client_data["version"]) != int(cmdvers))): logging.debug("Unsupported client request version, ignoring.") result = "error" - data = "Unsupported version, server is %f" % cmdvers + data = ({"error":"Unsupported version, server is %f" % cmdvers}, {}, {}) if (result is not "error" and ("command" not in client_data or @@ -88,7 +107,7 @@ def send_data_loop(port): client_data["command"] > cmd_MAX)): logging.debug("Unsupported request from client, ignoring.") result = "error" - data = "Unsupported request" + data = ({"error":"Unsupported request"}, {}, {}) if result is not "error": data_method = data_methods[client_data["command"]] @@ -97,11 +116,11 @@ def send_data_loop(port): data = data_method() if data is None: result = "error" - data = "Unspecified data gathering error, check server log." + data = ({"error":"Unspecified data gathering error, check server log."}, {}, {}) logging.debug("Sending %d data objects to client." % len(data)) - response = {"result":result, "data":data} - sockfile.writelines(pickle.dumps(response, -1)) + response_schema = Response() + sockfile.write(response_schema.serialize(response)) # Clean up sockfile.close() @@ -143,7 +162,7 @@ def send_data_loop(port): # Client def net_get_data(host="localhost", port=50000, cmd=cmd_GET_ALL_DATA): - """Get pickled data from a simple network server. + """Get serialized data from a simple network server. Keywork arguments: host -- server host name (default localhost) @@ -177,20 +196,25 @@ def net_get_data(host="localhost", port= print repr(cmd) return {"result":"error","data":"Client: Bad request."} - sockfile.writelines(pickle.dumps(client_request, -1)) + request_schema = Request() + sockfile.write(request_schema.serialize(client_request)) + sock.shutdown(socket.SHUT_WR) # Get server response - pickler = pickle.Unpickler(sockfile) try: - data = pickler.load() + response_schema = Response() + data = response_schema.deserialize(ast.literal_eval(sockfile.read())); except EOFError: pass sockfile.close() sock.close() - if type(data) is not types.DictType or "result" not in data: + if "result" not in data or "data" not in data: data = {"result":"error", "data":"Unknown server error"} + if data["result"] == "error" and "error" in data["data"][0]: + data["data"] = data["data"][0]["error"] + logging.debug("Data returned to client: " + repr(data)) return data -- George Wilson IBM Linux Technology Center Security Development |
From: Nathan F. <nf...@li...> - 2014-06-25 21:43:09
|
Remove the unused platform variable that appears to be an accidental leftover from updating the platform checking code. This was producing a build warning. Signed-off-by: Nathan Fontenot <nf...@li...> --- diff --git a/src/uesensor.c b/src/uesensor.c index a7fca43..8594d04 100644 --- a/src/uesensor.c +++ b/src/uesensor.c @@ -301,7 +301,6 @@ int main (int argc, char **argv) { int c, text=0, numerical=0, measured=0, i; - int platform=0; int fd, rc; uint32_t tok, max_index; char *token=NULL, *index=NULL; |
From: Nathan F. <nf...@li...> - 2014-06-25 21:05:02
|
On 06/23/2014 03:31 PM, Tyrel Datwyler wrote: > The nvram_read function always calls read with a 512 byte chunk size. If the > actual nvram size is greater than nvram->nbytes, which can be overriden by the > --nvram-size option, the allocated read buffer will be overrun. > > Fixed read logic to only read upto nvram->nbytes of data. > > Signed-off-by: Tyrel Datwyler <ty...@us...> > --- > src/nvram.c | 17 +++++++++-------- > src/nvram.h | 1 + > 2 files changed, 10 insertions(+), 8 deletions(-) > > diff --git a/src/nvram.c b/src/nvram.c > index f3701e9..73449c1 100644 > --- a/src/nvram.c > +++ b/src/nvram.c > @@ -205,17 +205,18 @@ warn_msg(const char *fmt, ...) > int > nvram_read(struct nvram *nvram) > { > - int len, remaining; > + int len, remaining, chunk; > char *p; > > /* read in small chunks */ > - for (p = nvram->data, remaining = nvram->nbytes; > - (len = read(nvram->fd, p, 512)) > 0; > - p += len, remaining -= len) { > - if (remaining <= 0) { > - remaining = 0; > - break; > - } > + p = nvram->data; > + remaining = nvram->nbytes; > + chunk = (NVRAM_READ_SIZE < remaining) ? NVRAM_READ_SIZE : remaining; > + > + while ((len = read(nvram->fd, p, chunk)) > 0) { > + p+=len; Tiny nit. spaces. Can be cleaned up on commit -Nathan > + remaining -= len; > + chunk = (NVRAM_READ_SIZE < remaining) ? NVRAM_READ_SIZE : remaining; > } > > if (len == -1) { > diff --git a/src/nvram.h b/src/nvram.h > index c5036e9..b4961fe 100644 > --- a/src/nvram.h > +++ b/src/nvram.h > @@ -31,6 +31,7 @@ > #define printmap(ch) (isgraph(ch) ? (ch) : '.') > > #define NVRAM_BLOCK_SIZE 16 > +#define NVRAM_READ_SIZE 512 > #define NVRAM_FILENAME1 "/dev/nvram" > #define NVRAM_FILENAME2 "/dev/misc/nvram" > |
From: Nathan F. <nf...@li...> - 2014-06-25 21:01:32
|
On 06/25/2014 12:16 AM, Joel Stanley wrote: > Hey Nathan, > > We have a decent number of patches living in your next branch. Could > we do a new release with these merged in? In particular, I'd like to > get a new version of ppc64_cpu out to users. You've been reading my mind. I'm working on getting all of the patches committed right now and should have a new release pushed out today or tomorrow. -Nathan > > If you need any help rolling the release I'm here to help. > > Cheers, > > Joel > |
From: Joel S. <jo...@jm...> - 2014-06-25 05:16:56
|
Hey Nathan, We have a decent number of patches living in your next branch. Could we do a new release with these merged in? In particular, I'd like to get a new version of ppc64_cpu out to users. If you need any help rolling the release I'm here to help. Cheers, Joel |
From: Tyrel D. <ty...@li...> - 2014-06-23 20:37:50
|
On 06/23/2014 01:31 PM, Tyrel Datwyler wrote: > The nvram_read function always calls read with a 512 byte chunk size. If the > actual nvram size is greater than nvram->nbytes, which can be overriden by the > --nvram-size option, the allocated read buffer will be overrun. > > Fixed read logic to only read upto nvram->nbytes of data. > > Signed-off-by: Tyrel Datwyler <ty...@us...> Ugh, wrong email. Should be <ty...@li...> > --- > src/nvram.c | 17 +++++++++-------- > src/nvram.h | 1 + > 2 files changed, 10 insertions(+), 8 deletions(-) > > diff --git a/src/nvram.c b/src/nvram.c > index f3701e9..73449c1 100644 > --- a/src/nvram.c > +++ b/src/nvram.c > @@ -205,17 +205,18 @@ warn_msg(const char *fmt, ...) > int > nvram_read(struct nvram *nvram) > { > - int len, remaining; > + int len, remaining, chunk; > char *p; > > /* read in small chunks */ > - for (p = nvram->data, remaining = nvram->nbytes; > - (len = read(nvram->fd, p, 512)) > 0; > - p += len, remaining -= len) { > - if (remaining <= 0) { > - remaining = 0; > - break; > - } > + p = nvram->data; > + remaining = nvram->nbytes; > + chunk = (NVRAM_READ_SIZE < remaining) ? NVRAM_READ_SIZE : remaining; > + > + while ((len = read(nvram->fd, p, chunk)) > 0) { > + p+=len; > + remaining -= len; > + chunk = (NVRAM_READ_SIZE < remaining) ? NVRAM_READ_SIZE : remaining; > } > > if (len == -1) { > diff --git a/src/nvram.h b/src/nvram.h > index c5036e9..b4961fe 100644 > --- a/src/nvram.h > +++ b/src/nvram.h > @@ -31,6 +31,7 @@ > #define printmap(ch) (isgraph(ch) ? (ch) : '.') > > #define NVRAM_BLOCK_SIZE 16 > +#define NVRAM_READ_SIZE 512 > #define NVRAM_FILENAME1 "/dev/nvram" > #define NVRAM_FILENAME2 "/dev/misc/nvram" > |
From: Tyrel D. <ty...@li...> - 2014-06-23 20:32:16
|
PAPR defines a 16 byte block size for nvram partitions. This patch restricts the --nvram-size option to sizes that are multiples of 16. Signed-off-by: Tyrel Datwyler <ty...@li...> --- src/nvram.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nvram.c b/src/nvram.c index 73449c1..2c68a5d 100644 --- a/src/nvram.c +++ b/src/nvram.c @@ -1486,6 +1486,10 @@ main (int argc, char *argv[]) err_msg("specify nvram-size as an integer\n"); exit(1); } + if (nvram.nbytes % NVRAM_BLOCK_SIZE) { + err_msg("nvram-size must be a multiple of 16\n"); + exit(1); + } break; case 'V': /* print-vpd */ print_vpd = 1; -- 1.8.5.2 |
From: Tyrel D. <ty...@li...> - 2014-06-23 20:32:14
|
The nvram_read function always calls read with a 512 byte chunk size. If the actual nvram size is greater than nvram->nbytes, which can be overriden by the --nvram-size option, the allocated read buffer will be overrun. Fixed read logic to only read upto nvram->nbytes of data. Signed-off-by: Tyrel Datwyler <ty...@us...> --- src/nvram.c | 17 +++++++++-------- src/nvram.h | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/nvram.c b/src/nvram.c index f3701e9..73449c1 100644 --- a/src/nvram.c +++ b/src/nvram.c @@ -205,17 +205,18 @@ warn_msg(const char *fmt, ...) int nvram_read(struct nvram *nvram) { - int len, remaining; + int len, remaining, chunk; char *p; /* read in small chunks */ - for (p = nvram->data, remaining = nvram->nbytes; - (len = read(nvram->fd, p, 512)) > 0; - p += len, remaining -= len) { - if (remaining <= 0) { - remaining = 0; - break; - } + p = nvram->data; + remaining = nvram->nbytes; + chunk = (NVRAM_READ_SIZE < remaining) ? NVRAM_READ_SIZE : remaining; + + while ((len = read(nvram->fd, p, chunk)) > 0) { + p+=len; + remaining -= len; + chunk = (NVRAM_READ_SIZE < remaining) ? NVRAM_READ_SIZE : remaining; } if (len == -1) { diff --git a/src/nvram.h b/src/nvram.h index c5036e9..b4961fe 100644 --- a/src/nvram.h +++ b/src/nvram.h @@ -31,6 +31,7 @@ #define printmap(ch) (isgraph(ch) ? (ch) : '.') #define NVRAM_BLOCK_SIZE 16 +#define NVRAM_READ_SIZE 512 #define NVRAM_FILENAME1 "/dev/nvram" #define NVRAM_FILENAME2 "/dev/misc/nvram" -- 1.8.5.2 |
From: Thomas F. <tlf...@li...> - 2014-06-23 17:50:31
|
set_power_on reads device-tree to get the max latency value, which is in a big endian format. This needs to be converted for little endian architectures. Signed-off-by: Thomas Falcon <tlf...@li...> --- src/set_poweron_time.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/set_poweron_time.c b/src/set_poweron_time.c index 75be9fb..32bab76 100644 --- a/src/set_poweron_time.c +++ b/src/set_poweron_time.c @@ -142,6 +142,7 @@ uint32_t get_max_latency(void) { return 28; /* assumed default of 28 days, per RPA */ } n = read(fd, &max, 4); + max = be32toh(max); close(fd); if (n != 4) -- 1.8.5.2 |
From: Thomas F. <tlf...@li...> - 2014-06-23 17:50:10
|
ppc64_cpu passes a buffer to rtas_set_sysparm. The first two bytes of this buffer must encode a integer denoting the size of the remaining the buffer. This integer must be in a big endian format. Signed-off-by: Thomas Falcon <tlf...@li...> --- src/ppc64_cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ppc64_cpu.c b/src/ppc64_cpu.c index 49f8efa..53f1aaf 100644 --- a/src/ppc64_cpu.c +++ b/src/ppc64_cpu.c @@ -739,7 +739,7 @@ static int do_run_mode(char *run_mode) return -1; } - *(short *)mode = 1; + *(short *)mode = htobe16(1); mode[2] = rmode; rc = rtas_set_sysparm(DIAGNOSTICS_RUN_MODE, mode); -- 1.8.5.2 |
From: Thomas F. <tlf...@li...> - 2014-06-23 17:49:42
|
The values in /proc/device-tree/rtas/rtas-sensors are big endian so this needs to be handled for little endian architectures. Signed-off-by: Thomas Falcon <tlf...@li...> --- src/uesensor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uesensor.c b/src/uesensor.c index 3fcd457..a7fca43 100644 --- a/src/uesensor.c +++ b/src/uesensor.c @@ -415,8 +415,9 @@ main (int argc, char **argv) while (read(fd, (char *)&tok, sizeof(uint32_t)) == sizeof(uint32_t)) { - + tok = be32toh(tok); rc = read(fd, (char *)&max_index, sizeof(uint32_t)); + max_index=be32toh(max_index); if (rc != sizeof(uint32_t)) { err_msg(ERR_MSG, "Error reading the " "list of sensors.\n"); -- 1.8.5.2 |
From: Thomas F. <tlf...@li...> - 2014-06-23 17:49:22
|
rtas_get_sysparm and rtas_set_sysparm commands both manipulate buffers in which the first two bytes are a big endian integer indicating the size of the remaining buffer. This patch makes sure those bytes are in the correct format. Signed-off-by: Thomas Falcon <tlf...@li...> --- Changes since v1: Handling endianess in call_home_buffer --- src/serv_config.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/serv_config.c b/src/serv_config.c index 5a7b97b..46e02f3 100644 --- a/src/serv_config.c +++ b/src/serv_config.c @@ -614,7 +614,7 @@ parse_call_home_buffer(char *var, char *buf, size_t size) { if (!call_home_buffer) return RC_OTHER; /* should never happen */ - buf_size = *(uint16_t *)call_home_buffer; + buf_size = be16toh(*(uint16_t *)call_home_buffer); loc = call_home_buffer + sizeof(uint16_t); while (loc[0] != '\0') { @@ -674,7 +674,7 @@ retrieve_value(struct service_var *var, char *buf, size_t size) { if (var->sysparm_num == USE_CALL_HOME_SYSPARM) break; - ret_size = *(uint16_t *)param; + ret_size = be16toh(*(uint16_t *)param); if (!strcmp(var->nvram_var, "sp-ri-pon") || !strcmp(var->nvram_var, "sp-remote-pon") || !strcmp(var->nvram_var, "sp-sen")) { @@ -825,7 +825,7 @@ update_value(struct service_var *var, char *val) { if (!strcmp(var->nvram_var, "sp-ri-pon") || !strcmp(var->nvram_var, "sp-remote-pon") || !strcmp(var->nvram_var, "sp-sen")) { - *(uint16_t *)param = 1; + *(uint16_t *)param = htobe16(1); if (!strcmp(val, "on")) param[2] = (uint8_t)(1); if (!strcmp(val, "off")) @@ -837,11 +837,11 @@ update_value(struct service_var *var, char *val) { (var->type == TYPE_NUM_1_120) || (var->type == TYPE_NUM_1_255)) { - *(uint16_t *)param = 1; + *(uint16_t *)param = htobe16(1); param[2] = (uint8_t)atoi(val); } else { - *(uint16_t *)param = sizeof(val); + *(uint16_t *)param = htobe16(sizeof(val)); strncpy(param+2, val, BUF_SIZE-2); } -- 1.8.5.2 |
From: Thomas F. <tlf...@li...> - 2014-06-20 20:22:51
|
rtas_get_sysparm and rtas_set_sysparm commands both manipulate buffers in which the first two bytes are a big endian integer indicating the size of the remaining buffer. This patch makes sure those bytes are in the correct format. Signed-off-by: Thomas Falcon <tlf...@li...> --- src/serv_config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/serv_config.c b/src/serv_config.c index 5a7b97b..2644d90 100644 --- a/src/serv_config.c +++ b/src/serv_config.c @@ -674,7 +674,7 @@ retrieve_value(struct service_var *var, char *buf, size_t size) { if (var->sysparm_num == USE_CALL_HOME_SYSPARM) break; - ret_size = *(uint16_t *)param; + ret_size = be16toh(*(uint16_t *)param); if (!strcmp(var->nvram_var, "sp-ri-pon") || !strcmp(var->nvram_var, "sp-remote-pon") || !strcmp(var->nvram_var, "sp-sen")) { @@ -825,7 +825,7 @@ update_value(struct service_var *var, char *val) { if (!strcmp(var->nvram_var, "sp-ri-pon") || !strcmp(var->nvram_var, "sp-remote-pon") || !strcmp(var->nvram_var, "sp-sen")) { - *(uint16_t *)param = 1; + *(uint16_t *)param = htobe16(1); if (!strcmp(val, "on")) param[2] = (uint8_t)(1); if (!strcmp(val, "off")) @@ -837,11 +837,11 @@ update_value(struct service_var *var, char *val) { (var->type == TYPE_NUM_1_120) || (var->type == TYPE_NUM_1_255)) { - *(uint16_t *)param = 1; + *(uint16_t *)param = htobe16(1); param[2] = (uint8_t)atoi(val); } else { - *(uint16_t *)param = sizeof(val); + *(uint16_t *)param = htobe16(sizeof(val)); strncpy(param+2, val, BUF_SIZE-2); } -- 1.8.5.2 |
From: Tyrel D. <ty...@li...> - 2014-06-14 00:06:32
|
PowerKVM guests currently do not support dynamically reconfigurable memory, and as such get_lmbs will return a lmb_list struct whose lmbs field is NULL. Added a NULL check to avoid segfault for the case where no LMB drc-names are defined in device tree. Signed-off-by: Tyrel Datwyler <ty...@li...> --- src/drmgr/lsslot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drmgr/lsslot.c b/src/drmgr/lsslot.c index 72154b9..22d1346 100644 --- a/src/drmgr/lsslot.c +++ b/src/drmgr/lsslot.c @@ -709,7 +709,7 @@ lsslot_chrp_mem(void) int lmb_offset = strlen(OFDT_BASE); lmb_list = get_lmbs(LMB_NORMAL_SORT); - if (lmb_list == NULL) + if (lmb_list == NULL || lmb_list->lmbs == NULL) return -1; printf("lmb size: 0x%x\n", lmb_list->lmbs->lmb_size); -- 1.7.12.2 |
From: Vasant H. <heg...@li...> - 2014-06-05 10:03:39
|
On 06/05/2014 12:36 AM, Nathan Fontenot wrote: > Update the access checking for system attributes. > > The use of fopen() to check for read/write access of system attribute > files (i.e. sysfs) no longer works with kernels 3.14 and later. The man > page for fopen() states that there is an implied file creation if the > file does not exist. This now causes fopen() to return EACCES instead > of ENOENT for files that do not exist. > > This patch updates ppc64_cpu to use access() to validate file existence > and file read/write permissions. > > Signed-off-by: Nathan Fontenot <nf...@li...> Acked-by: Vasant Hegde <heg...@li...> access() call is better than stat.. Thanks for the fix.. Will apply this patch to fedora 20 as soon as it goes to your next branch. -Vasant > --- > diff --git a/src/ppc64_cpu.c b/src/ppc64_cpu.c > index 49f8efa..e0a0c8f 100644 > --- a/src/ppc64_cpu.c > +++ b/src/ppc64_cpu.c > @@ -57,43 +57,17 @@ static int threads_per_cpu = 0; > static int cpus_in_system = 0; > static int threads_in_system = 0; > > -static int test_attr(char *path, char *perms) > -{ > - FILE *fp; > - > - fp = fopen(path, perms); > - if (fp) { > - fclose(fp); > - return 1; > - } > - > - if (errno == ENOENT) { > - /* When CPU is offline, attr may not exist. Return 2 so caller > - * will not see 'false' and continue to try next CPU. */ > - return 2; > - } > - > - return 0; > -} > - > -static int attr_is_readable(char *path) > -{ > - return test_attr(path, "r"); > -} > - > -static int attr_is_writeable(char *path) > -{ > - return test_attr(path, "w"); > -} > - > -static int test_sysattr(char *attribute, char *perms) > +static int test_sysattr(char *attribute, int perms) > { > char path[SYSFS_PATH_MAX]; > int i; > > for (i = 0; i < threads_in_system; i++) { > sprintf(path, SYSFS_CPUDIR"/%s", i, attribute); > - if (!test_attr(path, perms)) > + if (access(path, F_OK)) > + continue; > + > + if (access(path, perms)) > return 0; > } > > @@ -102,12 +76,12 @@ static int test_sysattr(char *attribute, char *perms) > > static int sysattr_is_readable(char *attribute) > { > - return test_sysattr(attribute, "r"); > + return test_sysattr(attribute, R_OK); > } > > static int sysattr_is_writeable(char *attribute) > { > - return test_sysattr(attribute, "w"); > + return test_sysattr(attribute, W_OK); > } > > static int get_attribute(char *path, const char *fmt, int *value) > @@ -115,14 +89,14 @@ static int get_attribute(char *path, const char *fmt, int *value) > FILE *fp; > int rc; > > + rc = access(path, F_OK); > + if (rc) > + return -1; > + > + > fp = fopen(path, "r"); > - if (fp == NULL) { > - if (errno == ENOENT) > - /* No attribute, cpu probably offline */ > - return 0; > - else > - return -1; > - } > + if (!fp) > + return -1; > > rc = fscanf(fp, fmt, value); > fclose(fp); > @@ -182,6 +156,9 @@ static int get_system_attribute(char *attribute, const char *fmt, int *value, > for (i = 0; i < threads_in_system; i++) { > int cpu_attribute; > > + if (!cpu_online(i)) > + continue; > + > sprintf(path, SYSFS_CPUDIR"/%s", i, attribute); > rc = get_attribute(path, fmt, &cpu_attribute); > if (rc) > @@ -239,7 +216,7 @@ static int set_dscr(int state) > int rc; > > if (dscr_default_exists()) { > - if (!attr_is_writeable(DSCR_DEFAULT_PATH)) { > + if (access(DSCR_DEFAULT_PATH, W_OK)) { > perror("Cannot set default dscr value"); > return -2; > } > @@ -262,7 +239,7 @@ static int get_dscr(int *value, int *inconsistent) > int rc; > > if (dscr_default_exists()) { > - if (!attr_is_readable(DSCR_DEFAULT_PATH)) { > + if (access(DSCR_DEFAULT_PATH, R_OK)) { > perror("Cannot retrieve default dscr"); > return -2; > } > @@ -313,7 +290,7 @@ static int offline_thread(const char *path) > > static int is_subcore_capable(void) > { > - return attr_is_readable(SYSFS_SUBCORES) == 1; > + return access(SYSFS_SUBCORES, F_OK) == 0; > } > > static int num_subcores(void) > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel > |
From: Vasant H. <heg...@li...> - 2014-06-05 09:49:20
|
Signed-off-by: Vasant Hegde <heg...@li...> --- man/update_flash.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/update_flash.8 b/man/update_flash.8 index 9ff7a5f..0e5ccf6 100644 --- a/man/update_flash.8 +++ b/man/update_flash.8 @@ -93,7 +93,7 @@ machines supporting two firmware image areas. .SH OPTIONS .TP -.B\-h +.B \-h Print the usage message and exit. .TP \fB\-f \fIfilename |
From: Vasant H. <heg...@li...> - 2014-06-05 09:49:13
|
Add support to display current firmware version detail on PowerKVM host. Sample output: [root@abc123 tmp]# update_flash -d Current firwmare version : T side : FW770.20 (ZL770_060) P side : FW770.20 (ZL770_060) Boot side : FW770.20 (ZL770_060) Suggested-by: Benjamin Herrenschmidt <be...@ke...> Signed-off-by: Vasant Hegde <heg...@li...> --- scripts/update_flash_nv | 50 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/scripts/update_flash_nv b/scripts/update_flash_nv index 954a58d..d507664 100755 --- a/scripts/update_flash_nv +++ b/scripts/update_flash_nv @@ -32,6 +32,10 @@ SYS_VALIDATE_FLASH=/sys/firmware/opal/validate_flash SYS_MANAGE_FLASH=/sys/firmware/opal/manage_flash SYS_UPDATE_FLASH=/sys/firmware/opal/update_flash +# Current firmware version files +DT_FW_MI_FILE=/proc/device-tree/ibm,opal/firmware/mi-version +DT_FW_ML_FILE=/proc/device-tree/ibm,opal/firmware/ml-version + # Code update status values FLASH_SUCCESS=0 # Success FLASH_PARAM_ERR=-1 # Parameter error @@ -105,12 +109,13 @@ usage() { exit_code=$E_USAGE fi - echo "USAGE: update_flash {-h | -s | -r | -c | [-v|-n] -f <image filename>}" >&2 + echo "USAGE: update_flash {-h | -s | -r | -c | -d | [-v|-n] -f <image filename>}" >&2 echo " -h Print this message." >&2 echo " -s Determine if partition has access to" >&2 echo " perform flash image management." >&2 echo " -r Reject temporary image." >&2 echo " -c Commit temporary image." >&2 + echo " -d Display current firmware version." >&2 echo " -v Validate the given image file." >&2 echo " -n Do not overwrite Permanent side" >&2 echo " image automatically." >&2 @@ -363,8 +368,35 @@ manage_flash() { exit $E_SUCCESS } +display_current_fw_version() { + + if [ ! -r "$DT_FW_MI_FILE" ] || [ ! -r "$DT_FW_ML_FILE" ]; then + error $E_SYS_FS "Firmware version information is not available" + fi + + echo "Current firwmare version :" + + # P side + local ml_ver=`cat $DT_FW_ML_FILE | head -n 1 | awk ' { print $3 }'` + local mi_ver=`cat $DT_FW_MI_FILE | head -n 1 | awk ' { print $3 }'` + echo " P side : $ml_ver ($mi_ver)" + + # T side + local ml_ver=`cat $DT_FW_ML_FILE | head -n 1 | awk ' { print $2 }'` + local mi_ver=`cat $DT_FW_MI_FILE | head -n 1 | awk ' { print $2 }'` + echo " T side : $ml_ver ($mi_ver)" + + # Boot side + local ml_ver=`cat $DT_FW_ML_FILE | head -n 1 | awk ' { print $4 }'` + local mi_ver=`cat $DT_FW_MI_FILE | head -n 1 | awk ' { print $4 }'` + echo " Boot side : $ml_ver ($mi_ver)" + + exit $E_SUCCESS +} + file="" check_opt=0 +display_opt=0 commit_opt=0 reject_opt=0 validate_opt=0 @@ -382,6 +414,7 @@ while [ -n "$1" ]; do -q|-l|-D|-S) error $E_USAGE "The $arg option is not implemented.";; -h) usage $E_SUCCESS;; -s) check_opt=1;; + -d) display_opt=1;; -c) commit_opt=1;; -r) reject_opt=1;; -v) validate_opt=1;; @@ -393,7 +426,7 @@ done if [ -n "$file" ]; then if [ $commit_opt -eq 1 ] || [ $reject_opt -eq 1 ] || - [ $check_opt -eq 1 ]; then + [ $display_opt -eq 1 ] || [ $check_opt -eq 1 ]; then usage elif [ $validate_opt -eq 1 ] && [ $no_overwrite_opt -eq 1 ]; then usage @@ -404,12 +437,23 @@ if [ -n "$file" ]; then fi else if [ $check_opt -eq 1 ]; then - if [ $commit_opt -eq 1 ] || [ $reject_opt -eq 1 ]; then + if [ $commit_opt -eq 1 ] || [ $reject_opt -eq 1 ] || + [ $display_opt -eq 1 ]; then usage else query_flash_support fi fi + + # Display current firmware version + if [ $display_opt -eq 1 ]; then + if [ $commit_opt -eq 1 ] || [ $reject_opt -eq 1 ]; then + usage + else + display_current_fw_version + fi + fi + [ $commit_opt -eq 0 ] && [ $reject_opt -eq 0 ] && usage [ $commit_opt -eq 1 ] && [ $reject_opt -eq 1 ] && usage manage_flash $commit_opt |