remoteproc: add rproc_coredump_set_elf_info
Subsystems (3)
cover remoteproc: add rproc_coredump_set_elf_info
This patch adds a way to set the elf informations that will be used to generate the coredump. Second patch fixes drivers to use this function.
Clement Leger (2):
remoteproc: add rproc_coredump_set_elf_info
remoteproc: use rproc_coredump_set_elf_info in drivers
drivers/remoteproc/qcom_q6v5_adsp.c | 1 + drivers/remoteproc/qcom_q6v5_mss.c | 3 ++ drivers/remoteproc/qcom_q6v5_pas.c | 1 + drivers/remoteproc/qcom_wcnss.c | 1 + drivers/remoteproc/remoteproc_core.c | 32 ++++++++++++++++++++-- drivers/remoteproc/remoteproc_elf_loader.c | 3 -- drivers/remoteproc/stm32_rproc.c | 1 + include/linux/remoteproc.h | 2 ++ 8 files changed, 39 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 remoteproc: add rproc_coredump_set_elf_info
This function allows drivers to correctly setup the coredump output elf information.
--- drivers/remoteproc/remoteproc_core.c | 32 ++++++++++++++++++++-- drivers/remoteproc/remoteproc_elf_loader.c | 3 -- include/linux/remoteproc.h | 2 ++ 3 files changed, 32 insertions(+), 5 deletions(-)
drivers/remoteproc/remoteproc_core.c +30 -2
@@ -1562,6 +1562,28 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc, }EXPORT_SYMBOL (rproc_coredump_add_custom_segment); +/** +* rproc_coredump_set_elf_info() - set coredump elf information +* @rproc: handle of a remote processor +* @class: elf class for coredump elf file +* @size: elf machine for coredump elf file +* +* Set elf information which will be used for coredump elf file. +* +* Return: 0 on success, negative errno on error. +*/ +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine) +{ +if (class !=ELFCLASS64 && class !=ELFCLASS32 ) +return -EINVAL ; + + rproc->elf_class = class; + rproc->elf_machine = machine; + +return 0 ; +} +EXPORT_SYMBOL (rproc_coredump_set_elf_info); +/** * rproc_coredump() - perform coredump * @rproc: rproc handle
@@ -1584,6 +1606,11 @@ static void rproc_coredump(struct rproc *rproc)if (list_empty (&rproc->dump_segments))return ; +if (class ==ELFCLASSNONE ) { +dev_err (&rproc->dev,"Elf class is not set\n" ); +return ; + } + data_size =elf_size_of_hdr (class);list_for_each_entry (segment, &rproc->dump_segments, node) { data_size +=elf_size_of_phdr (class) + segment->size;
@@ -1602,7 +1629,7 @@ static void rproc_coredump(struct rproc *rproc)elf_hdr_init_ident (ehdr, class);elf_hdr_set_e_type (class, ehdr,ET_CORE ); -elf_hdr_set_e_machine (class, ehdr,EM_NONE ); +elf_hdr_set_e_machine (class, ehdr, rproc->elf_machine);elf_hdr_set_e_version (class, ehdr,EV_CURRENT );elf_hdr_set_e_entry (class, ehdr, rproc->bootaddr);elf_hdr_set_e_phoff (class, ehdr,elf_size_of_hdr (class));
@@ -2043,7 +2070,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, rproc->name = name; rproc->priv = &rproc[1 ]; rproc->auto_boot = true; - rproc->elf_class =ELFCLASS32 ; + rproc->elf_class =ELFCLASSNONE ; + rproc->elf_machine =EM_NONE ;device_initialize (&rproc->dev); rproc->dev.parent = dev;
drivers/remoteproc/remoteproc_elf_loader.c +0 -3
@@ -248,9 +248,6 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw)memset (ptr + filesz,0 , memsz - filesz); } -if (ret ==0 ) - rproc->elf_class = class; -return ret; }EXPORT_SYMBOL (rproc_elf_load_segments);
include/linux/remoteproc.h +2 -0
@@ -515,6 +515,7 @@ struct rproc {struct list_head dump_segments;int nb_vdev;u8 elf_class; +u16 elf_machine; };/**
@@ -619,6 +620,7 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc,struct rproc_dump_segment *segment, void *dest), void *priv); +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine);static inline struct rproc_vdev *vdev_to_rvdev (struct virtio_device *vdev) {
Signature · 1 line
2.17.1
Quoted 4 lines · Clement Leger
This function allows drivers to correctly setup the coredump output elf information.
Signed-off-by Clement Leger <[email protected]>
Quoted 107 lines
--- drivers/remoteproc/remoteproc_core.c | 32 ++++++++++++++++++++-- drivers/remoteproc/remoteproc_elf_loader.c | 3 -- include/linux/remoteproc.h | 2 ++ 3 files changed, 32 insertions(+), 5 deletions(-)drivers/remoteproc/remoteproc_core.c +30
-2@@ -1562,6 +1562,28 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc, }EXPORT_SYMBOL (rproc_coredump_add_custom_segment); +/** +* rproc_coredump_set_elf_info() - set coredump elf information +* @rproc: handle of a remote processor +* @class: elf class for coredump elf file +* @size: elf machine for coredump elf file +* +* Set elf information which will be used for coredump elf file. +* +* Return: 0 on success, negative errno on error. +*/ +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine) +{ +if (class !=ELFCLASS64 && class !=ELFCLASS32 ) +return -EINVAL ; + + rproc->elf_class = class; + rproc->elf_machine = machine; + +return 0 ; +} +EXPORT_SYMBOL (rproc_coredump_set_elf_info); +/** * rproc_coredump() - perform coredump * @rproc: rproc handle @@ -1584,6 +1606,11 @@ static void rproc_coredump(struct rproc *rproc)if (list_empty (&rproc->dump_segments))return ; +if (class ==ELFCLASSNONE ) { +dev_err (&rproc->dev,"Elf class is not set\n" ); +return ; + } + data_size =elf_size_of_hdr (class);list_for_each_entry (segment, &rproc->dump_segments, node) { data_size +=elf_size_of_phdr (class) + segment->size;@@ -1602,7 +1629,7 @@ static void rproc_coredump(struct rproc *rproc)elf_hdr_init_ident (ehdr, class);elf_hdr_set_e_type (class, ehdr,ET_CORE ); -elf_hdr_set_e_machine (class, ehdr,EM_NONE ); +elf_hdr_set_e_machine (class, ehdr, rproc->elf_machine);elf_hdr_set_e_version (class, ehdr,EV_CURRENT );elf_hdr_set_e_entry (class, ehdr, rproc->bootaddr);elf_hdr_set_e_phoff (class, ehdr,elf_size_of_hdr (class));@@ -2043,7 +2070,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, rproc->name = name; rproc->priv = &rproc[1 ]; rproc->auto_boot = true; - rproc->elf_class =ELFCLASS32 ; + rproc->elf_class =ELFCLASSNONE ; + rproc->elf_machine =EM_NONE ;device_initialize (&rproc->dev); rproc->dev.parent = dev;drivers/remoteproc/remoteproc_elf_loader.c +0
-3@@ -248,9 +248,6 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw)memset (ptr + filesz,0 , memsz - filesz); } -if (ret ==0 ) - rproc->elf_class = class; -return ret; }EXPORT_SYMBOL (rproc_elf_load_segments);include/linux/remoteproc.h +2
-0@@ -515,6 +515,7 @@ struct rproc {struct list_head dump_segments;int nb_vdev;u8 elf_class; +u16 elf_machine; };/** @@ -619,6 +620,7 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc,struct rproc_dump_segment *segment, void *dest), void *priv); +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine);static inline struct rproc_vdev *vdev_to_rvdev (struct virtio_device *vdev) {Signature · 1 line
2.17.1
Quoted 93 lines · Clement Leger
This function allows drivers to correctly setup the coredump output elf information.
Signed-off-by Clement Leger <[email protected]>--- drivers/remoteproc/remoteproc_core.c | 32 ++++++++++++++++++++-- drivers/remoteproc/remoteproc_elf_loader.c | 3 -- include/linux/remoteproc.h | 2 ++ 3 files changed, 32 insertions(+), 5 deletions(-)drivers/remoteproc/remoteproc_core.c +30
-2@@ -1562,6 +1562,28 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc, }EXPORT_SYMBOL (rproc_coredump_add_custom_segment); +/** +* rproc_coredump_set_elf_info() - set coredump elf information +* @rproc: handle of a remote processor +* @class: elf class for coredump elf file +* @size: elf machine for coredump elf file +* +* Set elf information which will be used for coredump elf file. +* +* Return: 0 on success, negative errno on error. +*/ +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine) +{ +if (class !=ELFCLASS64 && class !=ELFCLASS32 ) +return -EINVAL ; + + rproc->elf_class = class; + rproc->elf_machine = machine; + +return 0 ; +} +EXPORT_SYMBOL (rproc_coredump_set_elf_info); +/** * rproc_coredump() - perform coredump * @rproc: rproc handle @@ -1584,6 +1606,11 @@ static void rproc_coredump(struct rproc *rproc)if (list_empty (&rproc->dump_segments))return ; +if (class ==ELFCLASSNONE ) { +dev_err (&rproc->dev,"Elf class is not set\n" ); +return ; + } + data_size =elf_size_of_hdr (class);list_for_each_entry (segment, &rproc->dump_segments, node) { data_size +=elf_size_of_phdr (class) + segment->size;@@ -1602,7 +1629,7 @@ static void rproc_coredump(struct rproc *rproc)elf_hdr_init_ident (ehdr, class);elf_hdr_set_e_type (class, ehdr,ET_CORE ); -elf_hdr_set_e_machine (class, ehdr,EM_NONE ); +elf_hdr_set_e_machine (class, ehdr, rproc->elf_machine);elf_hdr_set_e_version (class, ehdr,EV_CURRENT );elf_hdr_set_e_entry (class, ehdr, rproc->bootaddr);elf_hdr_set_e_phoff (class, ehdr,elf_size_of_hdr (class));@@ -2043,7 +2070,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, rproc->name = name; rproc->priv = &rproc[1 ]; rproc->auto_boot = true; - rproc->elf_class =ELFCLASS32 ; + rproc->elf_class =ELFCLASSNONE ; + rproc->elf_machine =EM_NONE ;device_initialize (&rproc->dev); rproc->dev.parent = dev;drivers/remoteproc/remoteproc_elf_loader.c +0
-3@@ -248,9 +248,6 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw)memset (ptr + filesz,0 , memsz - filesz); } -if (ret ==0 ) - rproc->elf_class = class; -return ret; }EXPORT_SYMBOL (rproc_elf_load_segments);include/linux/remoteproc.h +0
-0
include/linux/remoteproc.h struct rproc { · line 519
Quoted 5 lines
include/linux/remoteproc.h +1
-0@@ -515,6 +515,7 @@ struct rproc {struct list_head dump_segments;int nb_vdev;u8 elf_class; +u16 elf_machine; };
Quoted 13 lines
include/linux/remoteproc.h +1
-0/** @@ -619,6 +620,7 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc,struct rproc_dump_segment *segment, void *dest), void *priv); +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine);static inline struct rproc_vdev *vdev_to_rvdev (struct virtio_device *vdev) {Signature · 1 line
2.17.1
Quoted 21 lines · ----- On 17 Apr, 2020, at 21:38, Mathieu Poirier [email protected]…
Quoted 20 lines · Clement Leger
This function allows drivers to correctly setup the coredump output elf information.
Signed-off-by Clement Leger <[email protected]>--- drivers/remoteproc/remoteproc_core.c | 32 ++++++++++++++++++++-- drivers/remoteproc/remoteproc_elf_loader.c | 3 -- include/linux/remoteproc.h | 2 ++ 3 files changed, 32 insertions(+), 5 deletions(-)drivers/remoteproc/remoteproc_core.c +0
-0@@ -1562,6 +1562,28 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc, }EXPORT_SYMBOL (rproc_coredump_add_custom_segment);
Quoted 5 lines
drivers/remoteproc/remoteproc_core.c int rproc_coredump_add_custom_segment(struct rproc *rproc, · line 1569
Quoted 5 lines
drivers/remoteproc/remoteproc_core.c +5
-0+/** +* rproc_coredump_set_elf_info() - set coredump elf information +* @rproc: handle of a remote processor +* @class: elf class for coredump elf file +* @size: elf machine for coredump elf file
I just noticed that there is a typo, this should be "machine" and not "size". Let me know if you'll fix it when applying.
Thanks,
Clément
Quoted 93 lines
Quoted 73 lines
drivers/remoteproc/remoteproc_core.c +17
-0+* +* Set elf information which will be used for coredump elf file. +* +* Return: 0 on success, negative errno on error. +*/ +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine) +{ +if (class !=ELFCLASS64 && class !=ELFCLASS32 ) +return -EINVAL ; + + rproc->elf_class = class; + rproc->elf_machine = machine; + +return 0 ; +} +EXPORT_SYMBOL (rproc_coredump_set_elf_info); +/** * rproc_coredump() - perform coredump * @rproc: rproc handle
drivers/remoteproc/remoteproc_core.c +8
-2@@ -1584,6 +1606,11 @@ static void rproc_coredump(struct rproc *rproc)if (list_empty (&rproc->dump_segments))return ; +if (class ==ELFCLASSNONE ) { +dev_err (&rproc->dev,"Elf class is not set\n" ); +return ; + } + data_size =elf_size_of_hdr (class);list_for_each_entry (segment, &rproc->dump_segments, node) { data_size +=elf_size_of_phdr (class) + segment->size;@@ -1602,7 +1629,7 @@ static void rproc_coredump(struct rproc *rproc)elf_hdr_init_ident (ehdr, class);elf_hdr_set_e_type (class, ehdr,ET_CORE ); -elf_hdr_set_e_machine (class, ehdr,EM_NONE ); +elf_hdr_set_e_machine (class, ehdr, rproc->elf_machine);elf_hdr_set_e_version (class, ehdr,EV_CURRENT );elf_hdr_set_e_entry (class, ehdr, rproc->bootaddr);elf_hdr_set_e_phoff (class, ehdr,elf_size_of_hdr (class));@@ -2043,7 +2070,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, rproc->name = name; rproc->priv = &rproc[1 ]; rproc->auto_boot = true; - rproc->elf_class =ELFCLASS32 ; + rproc->elf_class =ELFCLASSNONE ; + rproc->elf_machine =EM_NONE ;device_initialize (&rproc->dev);drivers/remoteproc/remoteproc_core.c +0
-0rproc->dev.parent = dev;drivers/remoteproc/remoteproc_elf_loader.c +0
-3@@ -248,9 +248,6 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) memset(ptr + filesz, 0, memsz - filesz); } -if (ret ==0 ) - rproc->elf_class = class; -return ret; }
EXPORT_SYMBOL(rproc_elf_load_segments);include/linux/remoteproc.h +0
-0include/linux/remoteproc.h struct rproc { · line 519
Quoted 5 lines
include/linux/remoteproc.h +1
-0@@ -515,6 +515,7 @@ struct rproc {struct list_head dump_segments;int nb_vdev;u8 elf_class; +u16 elf_machine; };Reviewed-by Mathieu Poirier <[email protected]>Quoted 12 lines
include/linux/remoteproc.h +1
-1/** @@ -619,6 +620,7 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc,struct rproc_dump_segment *segment, void *dest), void *priv); +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine);static inline struct rproc_vdev *vdev_to_rvdev (struct virtio_device *vdev) { --2.17.1
Quoted 23 lines · Cl?ment Leger
Quoted 21 lines · ----- On 17 Apr, 2020, at 21:38, Mathieu Poirier [email protected]…
Quoted 20 lines · Clement Leger
This function allows drivers to correctly setup the coredump output elf information.
Signed-off-by Clement Leger <[email protected]>--- drivers/remoteproc/remoteproc_core.c | 32 ++++++++++++++++++++-- drivers/remoteproc/remoteproc_elf_loader.c | 3 -- include/linux/remoteproc.h | 2 ++ 3 files changed, 32 insertions(+), 5 deletions(-)drivers/remoteproc/remoteproc_core.c +0
-0@@ -1562,6 +1562,28 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc, }EXPORT_SYMBOL (rproc_coredump_add_custom_segment);
Quoted 9 lines
Quoted 5 lines
drivers/remoteproc/remoteproc_core.c int rproc_coredump_add_custom_segment(struct rproc *rproc, · line 1569
Quoted 5 lines
drivers/remoteproc/remoteproc_core.c +5
-0+/** +* rproc_coredump_set_elf_info() - set coredump elf information +* @rproc: handle of a remote processor +* @class: elf class for coredump elf file +* @size: elf machine for coredump elf file I just noticed that there is a typo, this should be "machine" and not "size". Let me know if you'll fix it when applying.
Thanks for noticing, I fixed this up and applied the two patches.
Thanks,
Bjorn
Quoted 97 lines
Thanks,
Clément
Quoted 93 lines
Quoted 73 lines
drivers/remoteproc/remoteproc_core.c +17
-0+* +* Set elf information which will be used for coredump elf file. +* +* Return: 0 on success, negative errno on error. +*/ +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine) +{ +if (class !=ELFCLASS64 && class !=ELFCLASS32 ) +return -EINVAL ; + + rproc->elf_class = class; + rproc->elf_machine = machine; + +return 0 ; +} +EXPORT_SYMBOL (rproc_coredump_set_elf_info); +/** * rproc_coredump() - perform coredump * @rproc: rproc handle
drivers/remoteproc/remoteproc_core.c +8
-2@@ -1584,6 +1606,11 @@ static void rproc_coredump(struct rproc *rproc)if (list_empty (&rproc->dump_segments))return ; +if (class ==ELFCLASSNONE ) { +dev_err (&rproc->dev,"Elf class is not set\n" ); +return ; + } + data_size =elf_size_of_hdr (class);list_for_each_entry (segment, &rproc->dump_segments, node) { data_size +=elf_size_of_phdr (class) + segment->size;@@ -1602,7 +1629,7 @@ static void rproc_coredump(struct rproc *rproc)elf_hdr_init_ident (ehdr, class);elf_hdr_set_e_type (class, ehdr,ET_CORE ); -elf_hdr_set_e_machine (class, ehdr,EM_NONE ); +elf_hdr_set_e_machine (class, ehdr, rproc->elf_machine);elf_hdr_set_e_version (class, ehdr,EV_CURRENT );elf_hdr_set_e_entry (class, ehdr, rproc->bootaddr);elf_hdr_set_e_phoff (class, ehdr,elf_size_of_hdr (class));@@ -2043,7 +2070,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, rproc->name = name; rproc->priv = &rproc[1 ]; rproc->auto_boot = true; - rproc->elf_class =ELFCLASS32 ; + rproc->elf_class =ELFCLASSNONE ; + rproc->elf_machine =EM_NONE ;device_initialize (&rproc->dev);drivers/remoteproc/remoteproc_core.c +0
-0rproc->dev.parent = dev;drivers/remoteproc/remoteproc_elf_loader.c +0
-3@@ -248,9 +248,6 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) memset(ptr + filesz, 0, memsz - filesz); } -if (ret ==0 ) - rproc->elf_class = class; -return ret; }
EXPORT_SYMBOL(rproc_elf_load_segments);include/linux/remoteproc.h +0
-0include/linux/remoteproc.h struct rproc { · line 519
Quoted 5 lines
include/linux/remoteproc.h +1
-0@@ -515,6 +515,7 @@ struct rproc {struct list_head dump_segments;int nb_vdev;u8 elf_class; +u16 elf_machine; };Reviewed-by Mathieu Poirier <[email protected]>Quoted 12 lines
include/linux/remoteproc.h +1
-1/** @@ -619,6 +620,7 @@ int rproc_coredump_add_custom_segment(struct rproc *rproc,struct rproc_dump_segment *segment, void *dest), void *priv); +int rproc_coredump_set_elf_info (struct rproc *rproc,u8 class,u16 machine);static inline struct rproc_vdev *vdev_to_rvdev (struct virtio_device *vdev) { --2.17.1
PATCH 2/2 remoteproc: use rproc_coredump_set_elf_info in drivers
In reply to Clement LegerModify drivers which are using remoteproc coredump functionnality to use rproc_coredump_set_elf_info in order to create correct elf coredump format.
--- drivers/remoteproc/qcom_q6v5_adsp.c | 1 + drivers/remoteproc/qcom_q6v5_mss.c | 3 +++ drivers/remoteproc/qcom_q6v5_pas.c | 1 + drivers/remoteproc/qcom_wcnss.c | 1 + drivers/remoteproc/stm32_rproc.c | 1 + 5 files changed, 7 insertions(+)
drivers/remoteproc/qcom_q6v5_adsp.c +1 -0
@@ -423,6 +423,7 @@ static int adsp_probe(struct platform_device *pdev)dev_err (&pdev->dev,"unable to allocate remoteproc\n" );return -ENOMEM ; } +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); adsp = (struct qcom_adsp *)rproc->priv; adsp->dev = &pdev->dev;
drivers/remoteproc/qcom_q6v5_mss.c +3 -0
@@ -1355,6 +1355,8 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,return ret; } +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); + ehdr = (struct elf32_hdr *)fw->data; phdrs = (struct elf32_phdr *)(ehdr +1 ); qproc->dump_complete_mask =0 ;
@@ -1632,6 +1634,7 @@ static int q6v5_probe(struct platform_device *pdev) } rproc->auto_boot = false; +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); qproc = (struct q6v5 *)rproc->priv; qproc->dev = &pdev->dev;
drivers/remoteproc/qcom_q6v5_pas.c +1 -0
@@ -390,6 +390,7 @@ static int adsp_probe(struct platform_device *pdev) } rproc->auto_boot = desc->auto_boot; +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); adsp = (struct qcom_adsp *)rproc->priv; adsp->dev = &pdev->dev;
drivers/remoteproc/qcom_wcnss.c +1 -0
@@ -480,6 +480,7 @@ static int wcnss_probe(struct platform_device *pdev)dev_err (&pdev->dev,"unable to allocate remoteproc\n" );return -ENOMEM ; } +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); wcnss = (struct qcom_wcnss *)rproc->priv; wcnss->dev = &pdev->dev;
drivers/remoteproc/stm32_rproc.c +1 -0
@@ -625,6 +625,7 @@ static int stm32_rproc_probe(struct platform_device *pdev)if (!rproc)return -ENOMEM ; +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); rproc->has_iommu = false; ddata = rproc->priv; ddata->workqueue =create_workqueue (dev_name (dev));
Signature · 1 line
2.17.1
Re: [PATCH 2/2] remoteproc: use rproc_coredump_set_elf_info in drivers
Quoted 4 lines · Clement Leger
Modify drivers which are using remoteproc coredump functionnality to use
rproc_coredump_set_elf_infoin order to create correct elf coredump format.
Quoted 81 lines
Signed-off-by Clement Leger <[email protected]>--- drivers/remoteproc/qcom_q6v5_adsp.c | 1 + drivers/remoteproc/qcom_q6v5_mss.c | 3 +++ drivers/remoteproc/qcom_q6v5_pas.c | 1 + drivers/remoteproc/qcom_wcnss.c | 1 + drivers/remoteproc/stm32_rproc.c | 1 + 5 files changed, 7 insertions(+)drivers/remoteproc/qcom_q6v5_adsp.c +1
-0@@ -423,6 +423,7 @@ static int adsp_probe(struct platform_device *pdev)dev_err (&pdev->dev,"unable to allocate remoteproc\n" );return -ENOMEM ; } +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); adsp = (struct qcom_adsp *)rproc->priv; adsp->dev = &pdev->dev;drivers/remoteproc/qcom_q6v5_mss.c +3
-0@@ -1355,6 +1355,8 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,return ret; } +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); + ehdr = (struct elf32_hdr *)fw->data; phdrs = (struct elf32_phdr *)(ehdr +1 ); qproc->dump_complete_mask =0 ;@@ -1632,6 +1634,7 @@ static int q6v5_probe(struct platform_device *pdev) } rproc->auto_boot = false; +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); qproc = (struct q6v5 *)rproc->priv; qproc->dev = &pdev->dev;drivers/remoteproc/qcom_q6v5_pas.c +1
-0@@ -390,6 +390,7 @@ static int adsp_probe(struct platform_device *pdev) } rproc->auto_boot = desc->auto_boot; +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); adsp = (struct qcom_adsp *)rproc->priv; adsp->dev = &pdev->dev;drivers/remoteproc/qcom_wcnss.c +1
-0@@ -480,6 +480,7 @@ static int wcnss_probe(struct platform_device *pdev)dev_err (&pdev->dev,"unable to allocate remoteproc\n" );return -ENOMEM ; } +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); wcnss = (struct qcom_wcnss *)rproc->priv; wcnss->dev = &pdev->dev;drivers/remoteproc/stm32_rproc.c +1
-0@@ -625,6 +625,7 @@ static int stm32_rproc_probe(struct platform_device *pdev)if (!rproc)return -ENOMEM ; +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); rproc->has_iommu = false; ddata = rproc->priv; ddata->workqueue =create_workqueue (dev_name (dev));Signature · 1 line
2.17.1
Re: [PATCH 2/2] remoteproc: use rproc_coredump_set_elf_info in drivers
In reply to Clement LegerQuoted 1 line · Clement Leger
Modify drivers which are using remoteproc coredump functionnality to use
s/functionnality/functionality
Quoted 74 lines
rproc_coredump_set_elf_infoin order to create correct elf coredump format.Signed-off-by Clement Leger <[email protected]>--- drivers/remoteproc/qcom_q6v5_adsp.c | 1 + drivers/remoteproc/qcom_q6v5_mss.c | 3 +++ drivers/remoteproc/qcom_q6v5_pas.c | 1 + drivers/remoteproc/qcom_wcnss.c | 1 + drivers/remoteproc/stm32_rproc.c | 1 + 5 files changed, 7 insertions(+)drivers/remoteproc/qcom_q6v5_adsp.c +1
-0@@ -423,6 +423,7 @@ static int adsp_probe(struct platform_device *pdev)dev_err (&pdev->dev,"unable to allocate remoteproc\n" );return -ENOMEM ; } +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); adsp = (struct qcom_adsp *)rproc->priv; adsp->dev = &pdev->dev;drivers/remoteproc/qcom_q6v5_mss.c +3
-0@@ -1355,6 +1355,8 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,return ret; } +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); + ehdr = (struct elf32_hdr *)fw->data; phdrs = (struct elf32_phdr *)(ehdr +1 ); qproc->dump_complete_mask =0 ;@@ -1632,6 +1634,7 @@ static int q6v5_probe(struct platform_device *pdev) } rproc->auto_boot = false; +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); qproc = (struct q6v5 *)rproc->priv; qproc->dev = &pdev->dev;drivers/remoteproc/qcom_q6v5_pas.c +1
-0@@ -390,6 +390,7 @@ static int adsp_probe(struct platform_device *pdev) } rproc->auto_boot = desc->auto_boot; +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); adsp = (struct qcom_adsp *)rproc->priv; adsp->dev = &pdev->dev;drivers/remoteproc/qcom_wcnss.c +1
-0@@ -480,6 +480,7 @@ static int wcnss_probe(struct platform_device *pdev)dev_err (&pdev->dev,"unable to allocate remoteproc\n" );return -ENOMEM ; } +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE ); wcnss = (struct qcom_wcnss *)rproc->priv; wcnss->dev = &pdev->dev;drivers/remoteproc/stm32_rproc.c +0
-0
drivers/remoteproc/stm32_rproc.c static int stm32_rproc_probe(struct platform_device *pdev) · line 628
Quoted 4 lines
drivers/remoteproc/stm32_rproc.c +1
-0@@ -625,6 +625,7 @@ static int stm32_rproc_probe(struct platform_device *pdev)if (!rproc)return -ENOMEM ; +rproc_coredump_set_elf_info (rproc,ELFCLASS32 ,EM_NONE );
With the above:
Quoted 6 lines
drivers/remoteproc/stm32_rproc.c +0
-0rproc->has_iommu = false; ddata = rproc->priv; ddata->workqueue =create_workqueue (dev_name (dev));Signature · 1 line
2.17.1