lists.linaro.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Dev
January 2016
----- 2024 -----
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
dev@lists.96boards.org
30 participants
22 discussions
Start a n
N
ew thread
[RFC][PATCH] hikey: Add pstore platform driver for HiKey board
by John Stultz
Adds a platform driver to support pstore on HiKey (copied from the in-kernel ChromeOS driver). Also adds reservation in the hikey DTS and enables the feature in hikey_defconfig. Note: Unfortunately the ramoops DT driver never made it upstream, so I'm adding this via a platform driver. Would appreciate thoughts on how to best handle this. Cc: Rob Herring <rob.herring(a)linaro.org> Cc: Arnd Bergmann <arnd.bergmann(a)linaro.org> Cc: Haojian Zhuang <haojian.zhuang(a)linaro.org> Cc: Guodong Xu <guodong.xu(a)linaro.org> Cc: Vishal Bhoj <vishal.bhoj(a)linaro.org> Signed-off-by: John Stultz <john.stultz(a)linaro.org> --- arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 5 +++ arch/arm64/configs/hikey_defconfig | 9 +++++ drivers/platform/Kconfig | 2 ++ drivers/platform/Makefile | 1 + drivers/platform/hikey/Kconfig | 27 +++++++++++++++ drivers/platform/hikey/Makefile | 2 ++ drivers/platform/hikey/hikey_pstore.c | 47 ++++++++++++++++++++++++++ 7 files changed, 93 insertions(+) create mode 100644 drivers/platform/hikey/Kconfig create mode 100644 drivers/platform/hikey/Makefile create mode 100644 drivers/platform/hikey/hikey_pstore.c diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts index f0cd5fa..a94f955 100644 --- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts +++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts @@ -61,6 +61,11 @@ no-map; reg = <0x0 0x06dff000 0x0 0x00001000>; /* Mailbox message buf */ }; + + pstore@0x21f00000 { + no-map; + reg = <0x0 0x21f00000 0x0 0x00100000>; /* pstore/ramoops buffer */ + }; }; reboot_reason: reboot-reason@05f01000 { diff --git a/arch/arm64/configs/hikey_defconfig b/arch/arm64/configs/hikey_defconfig index e3cd02d..5313620 100644 --- a/arch/arm64/configs/hikey_defconfig +++ b/arch/arm64/configs/hikey_defconfig @@ -345,6 +345,8 @@ CONFIG_ANDROID_LOW_MEMORY_KILLER=y CONFIG_SYNC=y CONFIG_ION=y CONFIG_ION_HISI=y +CONFIG_HIKEY_PLATFORM=y +CONFIG_HIKEY_PSTORE=y CONFIG_MAILBOX=y CONFIG_HISI_MBOX=y CONFIG_HI6220_MBOX=y @@ -354,6 +356,7 @@ CONFIG_ANDROID=y CONFIG_ANDROID_BINDER_IPC=y CONFIG_REBOOT_REASON_SRAM=y CONFIG_EFI_VARS=y +CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE=y CONFIG_EXT4_FS=y CONFIG_EXT4_FS_SECURITY=y CONFIG_BTRFS_FS=y @@ -371,6 +374,10 @@ CONFIG_TMPFS=y CONFIG_HUGETLBFS=y CONFIG_SQUASHFS=y CONFIG_SQUASHFS_XZ=y +CONFIG_PSTORE=y +CONFIG_PSTORE_CONSOLE=y +CONFIG_PSTORE_PMSG=y +CONFIG_PSTORE_RAM=y CONFIG_NFS_FS=y # CONFIG_NFS_V2 is not set CONFIG_NFS_V3_ACL=y @@ -385,6 +392,8 @@ CONFIG_PRINTK_TIME=y CONFIG_DEBUG_INFO=y CONFIG_MAGIC_SYSRQ=y CONFIG_LOCKUP_DETECTOR=y +CONFIG_PANIC_ON_OOPS=y +CONFIG_PANIC_TIMEOUT=10 # CONFIG_SCHED_DEBUG is not set CONFIG_SCHEDSTATS=y CONFIG_TIMER_STATS=y diff --git a/drivers/platform/Kconfig b/drivers/platform/Kconfig index 5bd93a2..881c62b 100644 --- a/drivers/platform/Kconfig +++ b/drivers/platform/Kconfig @@ -7,3 +7,5 @@ endif source "drivers/platform/goldfish/Kconfig" source "drivers/platform/chrome/Kconfig" + +source "drivers/platform/hikey/Kconfig" diff --git a/drivers/platform/Makefile b/drivers/platform/Makefile index ca26925..b0e7286 100644 --- a/drivers/platform/Makefile +++ b/drivers/platform/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_MIPS) += mips/ obj-$(CONFIG_OLPC) += olpc/ obj-$(CONFIG_GOLDFISH) += goldfish/ obj-$(CONFIG_CHROME_PLATFORMS) += chrome/ +obj-$(CONFIG_HIKEY_PLATFORM) += hikey/ diff --git a/drivers/platform/hikey/Kconfig b/drivers/platform/hikey/Kconfig new file mode 100644 index 0000000..5b36bba --- /dev/null +++ b/drivers/platform/hikey/Kconfig @@ -0,0 +1,27 @@ +# +# Platform support for Chrome OS hardware (Chromebooks and Chromeboxes) +# + +menuconfig HIKEY_PLATFORM + bool "Platform support for HiKey hardware" + depends on ARM64 + ---help--- + Say Y here to get to see options for platform support for + the HiKey board. This option alone does not add any kernel code. + + If you say N, all options in this submenu will be skipped and disabled. + +if HIKEY_PLATFORM + +config HIKEY_PSTORE + tristate "HiKey pstore support" + depends on ARM64 + ---help--- + This module instantiates the persistent storage on Hikey + devices. It can be used to store away console logs and crash + information across reboots. + + If you have a HiKey board, choose Y or M here. + The module will be called hikey_pstore. + +endif # HIKEY_PLATFORM diff --git a/drivers/platform/hikey/Makefile b/drivers/platform/hikey/Makefile new file mode 100644 index 0000000..7ab9173 --- /dev/null +++ b/drivers/platform/hikey/Makefile @@ -0,0 +1,2 @@ + +obj-$(CONFIG_HIKEY_PSTORE) += hikey_pstore.o diff --git a/drivers/platform/hikey/hikey_pstore.c b/drivers/platform/hikey/hikey_pstore.c new file mode 100644 index 0000000..1ab218b --- /dev/null +++ b/drivers/platform/hikey/hikey_pstore.c @@ -0,0 +1,47 @@ +/* + * hikey.c - Driver to instantiate HiKey ramoops device + * (Copied from ChromeOS ramoops implementation) + * + * Copyright (C) 2013 Google, Inc. + * Copyright (C) 2016 Linaro Limited + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2 of the License. + */ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/pstore_ram.h> + +static struct ramoops_platform_data hikey_ramoops_data = { + .mem_size = 0x00100000, + .mem_address = 0x21f00000, + .record_size = 0x20000, + .console_size = 0x20000, + .ftrace_size = 0x20000, + .dump_oops = 1, +}; + +static struct platform_device hikey_ramoops = { + .name = "ramoops", + .dev = { + .platform_data = &hikey_ramoops_data, + }, +}; + +static int __init hikey_pstore_init(void) +{ + return platform_device_register(&hikey_ramoops); +} + +static void __exit hikey_pstore_exit(void) +{ + platform_device_unregister(&hikey_ramoops); +} + +module_init(hikey_pstore_init); +module_exit(hikey_pstore_exit); + +MODULE_DESCRIPTION("HiKey pstore module"); +MODULE_LICENSE("GPL"); -- 1.9.1
8 years, 8 months
2
1
0
0
Change kmalloc to vmalloc when loading firmware
by chenfeng
Hi, When memory is seriously fragmented.I can be failed while using kmalloc in loading firmware. Can we change it to vmalloc? Are there someone familiar with this module? No need to use use continuous memory, it may be fail when memory deeply fragmented. Signed-off-by: Chen Feng <puck.chen(a)hisilicon.com> Signed-off-by: Xia Qing <saberlily.xia(a)hisilicon.com> --- drivers/base/firmware_class.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 8524450..ff8672d 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -257,7 +257,7 @@ static void __fw_free_buf(struct kref *ref) vunmap(buf->data); for (i = 0; i < buf->nr_pages; i++) __free_page(buf->pages[i]); - kfree(buf->pages); + vfree(buf->pages); } else #endif vfree(buf->data); @@ -660,7 +660,7 @@ static ssize_t firmware_loading_store(struct device *dev, if (!test_bit(FW_STATUS_DONE, &fw_buf->status)) { for (i = 0; i < fw_buf->nr_pages; i++) __free_page(fw_buf->pages[i]); - kfree(fw_buf->pages); + vfree(fw_buf->pages); fw_buf->pages = NULL; fw_buf->page_array_size = 0; fw_buf->nr_pages = 0; @@ -770,8 +770,7 @@ static int fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size) buf->page_array_size * 2); struct page **new_pages; - new_pages = kmalloc(new_array_size * sizeof(void *), - GFP_KERNEL); + new_pages = vmalloc(new_array_size * sizeof(void *)); if (!new_pages) { fw_load_abort(fw_priv); return -ENOMEM; @@ -780,7 +779,7 @@ static int fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size) buf->page_array_size * sizeof(void *)); memset(&new_pages[buf->page_array_size], 0, sizeof(void *) * (new_array_size - buf->page_array_size)); - kfree(buf->pages); + vfree(buf->pages); buf->pages = new_pages; buf->page_array_size = new_array_size; }
https://lkml.org/lkml/2015/12/16/49
8 years, 8 months
3
3
0
0
← Newer
1
2
3
Older →
Jump to page:
1
2
3
Results per page:
10
25
50
100
200