linux: bump Samsung to Linux 5.19.y

This commit is contained in:
Christian Hewitt 2022-06-24 13:42:03 +00:00
parent 854b89de67
commit 8c8bcdff95
34 changed files with 1233 additions and 937 deletions

View File

@ -27,6 +27,12 @@ case "${LINUX}" in
PKG_URL="https://github.com/raspberrypi/linux/archive/${PKG_VERSION}.tar.gz" PKG_URL="https://github.com/raspberrypi/linux/archive/${PKG_VERSION}.tar.gz"
PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz" PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz"
;; ;;
samsung)
PKG_VERSION="d49914ee4ec93d58d90a12275a814415c189059c" # 5.19.2
PKG_SHA256="e1c2a33685f93eab23c26c20aa56781595ae7b678d387c7c621c7d9fbbc2349f"
PKG_URL="https://github.com/torvalds/linux/archive/${PKG_VERSION}.tar.gz"
PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz"
;;
*) *)
PKG_VERSION="5.19" PKG_VERSION="5.19"
PKG_SHA256="ff240c579b9ee1affc318917de07394fc1c3bb49dac25ec1287370c2e15005a8" PKG_SHA256="ff240c579b9ee1affc318917de07394fc1c3bb49dac25ec1287370c2e15005a8"

View File

@ -1,15 +1,15 @@
# #
# Automatically generated file; DO NOT EDIT. # Automatically generated file; DO NOT EDIT.
# Linux/arm 5.19.0 Kernel Configuration # Linux/arm 5.19.2 Kernel Configuration
# #
CONFIG_CC_VERSION_TEXT="armv7ve-libreelec-linux-gnueabihf-gcc-12.1.0 (GCC) 12.1.0" CONFIG_CC_VERSION_TEXT="armv7ve-libreelec-linux-gnueabihf-gcc-12.1.0 (GCC) 12.1.0"
CONFIG_CC_IS_GCC=y CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=120100 CONFIG_GCC_VERSION=120100
CONFIG_CLANG_VERSION=0 CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23800 CONFIG_AS_VERSION=23900
CONFIG_LD_IS_BFD=y CONFIG_LD_IS_BFD=y
CONFIG_LD_VERSION=23800 CONFIG_LD_VERSION=23900
CONFIG_LLD_VERSION=0 CONFIG_LLD_VERSION=0
CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK=y
CONFIG_CC_CAN_LINK_STATIC=y CONFIG_CC_CAN_LINK_STATIC=y
@ -1514,7 +1514,7 @@ CONFIG_USB_IPHETH=m
# CONFIG_USB_VL600 is not set # CONFIG_USB_VL600 is not set
# CONFIG_USB_NET_CH9200 is not set # CONFIG_USB_NET_CH9200 is not set
# CONFIG_USB_NET_AQC111 is not set # CONFIG_USB_NET_AQC111 is not set
# CONFIG_USB_RTL8153_ECM is not set CONFIG_USB_RTL8153_ECM=y
CONFIG_WLAN=y CONFIG_WLAN=y
# CONFIG_WLAN_VENDOR_ADMTEK is not set # CONFIG_WLAN_VENDOR_ADMTEK is not set
CONFIG_ATH_COMMON=m CONFIG_ATH_COMMON=m
@ -2658,7 +2658,7 @@ CONFIG_MEDIA_CAMERA_SUPPORT=y
# CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set # CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set
# CONFIG_MEDIA_RADIO_SUPPORT is not set # CONFIG_MEDIA_RADIO_SUPPORT is not set
# CONFIG_MEDIA_SDR_SUPPORT is not set # CONFIG_MEDIA_SDR_SUPPORT is not set
# CONFIG_MEDIA_PLATFORM_SUPPORT is not set CONFIG_MEDIA_PLATFORM_SUPPORT=y
# CONFIG_MEDIA_TEST_SUPPORT is not set # CONFIG_MEDIA_TEST_SUPPORT is not set
# end of Media device types # end of Media device types
@ -2672,6 +2672,7 @@ CONFIG_VIDEO_V4L2_I2C=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y CONFIG_VIDEO_V4L2_SUBDEV_API=y
# CONFIG_VIDEO_ADV_DEBUG is not set # CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set # CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_V4L2_MEM2MEM_DEV=m
# CONFIG_V4L2_FLASH_LED_CLASS is not set # CONFIG_V4L2_FLASH_LED_CLASS is not set
CONFIG_V4L2_FWNODE=m CONFIG_V4L2_FWNODE=m
CONFIG_V4L2_ASYNC=m CONFIG_V4L2_ASYNC=m
@ -2761,9 +2762,108 @@ CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
# Webcam, TV (analog/digital) USB devices # Webcam, TV (analog/digital) USB devices
# #
# CONFIG_VIDEO_EM28XX is not set # CONFIG_VIDEO_EM28XX is not set
CONFIG_MEDIA_PLATFORM_DRIVERS=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
# CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set
# CONFIG_VIDEO_MUX is not set
#
# Allegro DVT media platform drivers
#
#
# Amlogic media platform drivers
#
#
# Amphion drivers
#
#
# Aspeed media platform drivers
#
# CONFIG_VIDEO_ASPEED is not set
#
# Atmel media platform drivers
#
#
# Cadence media platform drivers
#
# CONFIG_VIDEO_CADENCE_CSI2RX is not set
# CONFIG_VIDEO_CADENCE_CSI2TX is not set
#
# Chips&Media media platform drivers
#
#
# Intel media platform drivers
#
#
# Marvell media platform drivers
#
#
# Mediatek media platform drivers
#
#
# NVidia media platform drivers
#
#
# NXP media platform drivers
#
#
# Qualcomm media platform drivers
#
#
# Renesas media platform drivers
#
#
# Rockchip media platform drivers
#
#
# Samsung media platform drivers
#
CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m
# CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS is not set
CONFIG_VIDEO_SAMSUNG_S5P_G2D=m
CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m
CONFIG_VIDEO_SAMSUNG_S5P_MFC=m
#
# STMicroelectronics media platform drivers
#
#
# Sunxi media platform drivers
#
#
# Texas Instruments drivers
#
#
# VIA media platform drivers
#
#
# Xilinx media platform drivers
#
# CONFIG_VIDEO_XILINX is not set
CONFIG_VIDEOBUF2_CORE=m CONFIG_VIDEOBUF2_CORE=m
CONFIG_VIDEOBUF2_V4L2=m CONFIG_VIDEOBUF2_V4L2=m
CONFIG_VIDEOBUF2_MEMOPS=m CONFIG_VIDEOBUF2_MEMOPS=m
CONFIG_VIDEOBUF2_DMA_CONTIG=m
CONFIG_VIDEOBUF2_VMALLOC=m CONFIG_VIDEOBUF2_VMALLOC=m
# end of Media drivers # end of Media drivers
@ -2986,6 +3086,8 @@ CONFIG_DRM_DISPLAY_HELPER=y
CONFIG_DRM_DISPLAY_DP_HELPER=y CONFIG_DRM_DISPLAY_DP_HELPER=y
# CONFIG_DRM_DP_AUX_CHARDEV is not set # CONFIG_DRM_DP_AUX_CHARDEV is not set
# CONFIG_DRM_DP_CEC is not set # CONFIG_DRM_DP_CEC is not set
CONFIG_DRM_GEM_SHMEM_HELPER=m
CONFIG_DRM_SCHED=m
# #
# I2C encoder or helper chips # I2C encoder or helper chips
@ -3028,11 +3130,10 @@ CONFIG_DRM_EXYNOS_HDMI=y
# #
# Sub-drivers # Sub-drivers
# #
# CONFIG_DRM_EXYNOS_G2D is not set CONFIG_DRM_EXYNOS_IPP=y
# CONFIG_DRM_EXYNOS_FIMC is not set CONFIG_DRM_EXYNOS_FIMC=y
# CONFIG_DRM_EXYNOS_ROTATOR is not set # CONFIG_DRM_EXYNOS_ROTATOR is not set
# CONFIG_DRM_EXYNOS_SCALER is not set CONFIG_DRM_EXYNOS_SCALER=y
# CONFIG_DRM_EXYNOS_GSC is not set
# CONFIG_DRM_UDL is not set # CONFIG_DRM_UDL is not set
# CONFIG_DRM_ARMADA is not set # CONFIG_DRM_ARMADA is not set
# CONFIG_DRM_RCAR_DW_HDMI is not set # CONFIG_DRM_RCAR_DW_HDMI is not set
@ -3129,7 +3230,6 @@ CONFIG_DRM_PANEL_BRIDGE=y
# CONFIG_DRM_CHIPONE_ICN6211 is not set # CONFIG_DRM_CHIPONE_ICN6211 is not set
# CONFIG_DRM_CHRONTEL_CH7033 is not set # CONFIG_DRM_CHRONTEL_CH7033 is not set
# CONFIG_DRM_DISPLAY_CONNECTOR is not set # CONFIG_DRM_DISPLAY_CONNECTOR is not set
# CONFIG_DRM_FSL_LDB is not set
# CONFIG_DRM_ITE_IT6505 is not set # CONFIG_DRM_ITE_IT6505 is not set
# CONFIG_DRM_LONTIUM_LT8912B is not set # CONFIG_DRM_LONTIUM_LT8912B is not set
# CONFIG_DRM_LONTIUM_LT9211 is not set # CONFIG_DRM_LONTIUM_LT9211 is not set
@ -3183,7 +3283,7 @@ CONFIG_DRM_ANALOGIX_DP=y
# CONFIG_DRM_PL111 is not set # CONFIG_DRM_PL111 is not set
# CONFIG_DRM_TVE200 is not set # CONFIG_DRM_TVE200 is not set
# CONFIG_DRM_LIMA is not set # CONFIG_DRM_LIMA is not set
# CONFIG_DRM_PANFROST is not set CONFIG_DRM_PANFROST=m
# CONFIG_DRM_MCDE is not set # CONFIG_DRM_MCDE is not set
# CONFIG_DRM_TIDSS is not set # CONFIG_DRM_TIDSS is not set
# CONFIG_DRM_GUD is not set # CONFIG_DRM_GUD is not set
@ -3636,7 +3736,6 @@ CONFIG_HID_MONTEREY=y
# CONFIG_HID_NTI is not set # CONFIG_HID_NTI is not set
# CONFIG_HID_NTRIG is not set # CONFIG_HID_NTRIG is not set
# CONFIG_HID_ORTEK is not set # CONFIG_HID_ORTEK is not set
# CONFIG_HID_OUYA is not set
# CONFIG_HID_PANTHERLORD is not set # CONFIG_HID_PANTHERLORD is not set
# CONFIG_HID_PENMOUNT is not set # CONFIG_HID_PENMOUNT is not set
# CONFIG_HID_PETALYNX is not set # CONFIG_HID_PETALYNX is not set
@ -5464,7 +5563,6 @@ CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_CRC32=y CONFIG_CRYPTO_CRC32=y
CONFIG_CRYPTO_XXHASH=m CONFIG_CRYPTO_XXHASH=m
CONFIG_CRYPTO_BLAKE2B=m CONFIG_CRYPTO_BLAKE2B=m
# CONFIG_CRYPTO_BLAKE2S is not set
# CONFIG_CRYPTO_CRCT10DIF is not set # CONFIG_CRYPTO_CRCT10DIF is not set
CONFIG_CRYPTO_GHASH=y CONFIG_CRYPTO_GHASH=y
# CONFIG_CRYPTO_POLY1305 is not set # CONFIG_CRYPTO_POLY1305 is not set

View File

@ -0,0 +1,34 @@
From 009b15525e53e5d96dd75c43543b57f3505c7081 Mon Sep 17 00:00:00 2001
From: Dongwon Kim <dongwon.kim@intel.com>
Date: Fri, 24 Jun 2022 12:48:38 +0000
Subject: [PATCH 01/21] HACK: drm: set DRM_RENDER_ALLOW flag on
DRM_IOCTL_MODE_CREATE/DESTROY_DUMB ioctls
Render clients should be able to create/destroy dumb object to import
and use it as render buffer in case the default DRM device is different
from the render device (i.e. kmsro).
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
drivers/gpu/drm/drm_ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 51fcf1298023..8984c60037b2 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -672,9 +672,9 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb_ioctl, 0),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_PAGE_FLIP, drm_mode_page_flip_ioctl, DRM_MASTER),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_DIRTYFB, drm_mode_dirtyfb_ioctl, DRM_MASTER),
- DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_DUMB, drm_mode_create_dumb_ioctl, 0),
+ DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_DUMB, drm_mode_create_dumb_ioctl, DRM_RENDER_ALLOW),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_MAP_DUMB, drm_mode_mmap_dumb_ioctl, 0),
- DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROY_DUMB, drm_mode_destroy_dumb_ioctl, 0),
+ DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROY_DUMB, drm_mode_destroy_dumb_ioctl, DRM_RENDER_ALLOW),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_GETPROPERTIES, drm_mode_obj_get_properties_ioctl, 0),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_SETPROPERTY, drm_mode_obj_set_property_ioctl, DRM_MASTER),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_CURSOR2, drm_mode_cursor2_ioctl, DRM_MASTER),
--
2.17.1

View File

@ -0,0 +1,29 @@
From 4aca48cc2517dcd5abab9b0cca22c65c54d75a03 Mon Sep 17 00:00:00 2001
From: Pavel Golikov <Paullo612@ya.ru>
Date: Fri, 24 Jun 2022 15:42:59 +0000
Subject: [PATCH 02/21] WIP: media: videobuf2: always enable
V4L2_MEMORY_FLAG_NON_COHERENT
Always enable V4L2_MEMORY_FLAG_NON_COHERENT for all V4L queues.
Signed-off-by: Pavel Golikov <Paullo612@ya.ru>
---
drivers/media/common/videobuf2/videobuf2-v4l2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
index 075d24ebf44c..ecbb5f7d3f23 100644
--- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
+++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
@@ -704,7 +704,7 @@ static void validate_memory_flags(struct vb2_queue *q,
*flags = 0;
} else {
/* Clear all unknown flags. */
- *flags &= V4L2_MEMORY_FLAG_NON_COHERENT;
+ *flags |= V4L2_MEMORY_FLAG_NON_COHERENT;
}
}
--
2.17.1

View File

@ -0,0 +1,37 @@
From 530424bde16e74a8542d34709ac13be3c426afe1 Mon Sep 17 00:00:00 2001
From: Pavel Golikov <Paullo612@ya.ru>
Date: Fri, 24 Jun 2022 15:54:16 +0000
Subject: [PATCH 03/21] WIP: iommu/io-pgtable-arm: Fix coherency support for
Mali LPAE
Mali T628r0p1 which may be found in Samsung Exynos 5422 SOC is
definitely not dma coherent, and it is not happy with PTE_SH_OS bit set
by default in commit 728da60da7c1 ("iommu/io-pgtable-arm: Support
coherency for Mali LPAE"). Use PTE_SH_IS by default for non dma
coherent Mali GPUs.
Signed-off-by: Pavel Golikov <Paullo612@ya.ru>
---
drivers/iommu/io-pgtable-arm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 94ff319ae8ac..9ac55085e141 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -457,9 +457,10 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data,
* "outside the GPU" (i.e. either the Inner or System domain in CPU
* terms, depending on coherency).
*/
- if (prot & IOMMU_CACHE && data->iop.fmt != ARM_MALI_LPAE)
+ if (prot & IOMMU_CACHE ||
+ (data->iop.fmt == ARM_MALI_LPAE && !data->iop.cfg.coherent_walk))
pte |= ARM_LPAE_PTE_SH_IS;
- else
+ else if (data->iop.fmt == ARM_MALI_LPAE)
pte |= ARM_LPAE_PTE_SH_OS;
if (prot & IOMMU_NOEXEC)
--
2.17.1

View File

@ -1,112 +0,0 @@
From c1c6c93af475ebfa806760f8883b3f06c3c19bbe Mon Sep 17 00:00:00 2001
From: memeka <mihailescu2m@gmail.com>
Date: Thu, 24 Jan 2019 16:07:24 +1030
Subject: [PATCH 04/25] MEMEKA: media: s5p-jpeg: Enable decoding with multiple
buffers
Signed-off-by: memeka <mihailescu2m@gmail.com>
---
drivers/media/platform/s5p-jpeg/jpeg-core.c | 45 ++++++++++++++++-----
1 file changed, 35 insertions(+), 10 deletions(-)
diff --git a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
index 86bda3947110..3015a9c350f2 100644
--- a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
@@ -1797,6 +1797,31 @@ static int exynos3250_jpeg_try_crop(struct s5p_jpeg_ctx *ctx,
* V4L2 controls
*/
+static int vidioc_decoder_cmd(struct file *file, void *priv,
+ struct v4l2_decoder_cmd *cmd)
+{
+ struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv);
+ struct vb2_queue *vq_src = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
+ struct vb2_v4l2_buffer *buf;
+
+ switch (cmd->cmd) {
+ case V4L2_DEC_CMD_STOP:
+ if (cmd->flags != 0)
+ return -EINVAL;
+ if (!vb2_is_streaming(vq_src))
+ return -EINVAL;
+
+ buf = v4l2_m2m_last_src_buf(ctx->fh.m2m_ctx);
+ buf->flags |= V4L2_BUF_FLAG_LAST;
+
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
static int s5p_jpeg_g_selection(struct file *file, void *priv,
struct v4l2_selection *s)
{
@@ -1831,9 +1856,6 @@ static int s5p_jpeg_g_selection(struct file *file, void *priv,
return 0;
}
-/*
- * V4L2 controls
- */
static int s5p_jpeg_s_selection(struct file *file, void *fh,
struct v4l2_selection *s)
{
@@ -2025,6 +2047,8 @@ static const struct v4l2_ioctl_ops s5p_jpeg_ioctl_ops = {
.vidioc_streamon = v4l2_m2m_ioctl_streamon,
.vidioc_streamoff = v4l2_m2m_ioctl_streamoff,
+ .vidioc_decoder_cmd = vidioc_decoder_cmd,
+
.vidioc_g_selection = s5p_jpeg_g_selection,
.vidioc_s_selection = s5p_jpeg_s_selection,
@@ -2471,13 +2495,6 @@ static int s5p_jpeg_queue_setup(struct vb2_queue *vq,
size = q_data->size;
- /*
- * header is parsed during decoding and parsed information stored
- * in the context so we do not allow another buffer to overwrite it
- */
- if (ctx->mode == S5P_JPEG_DECODE)
- count = 1;
-
*nbuffers = count;
*nplanes = 1;
sizes[0] = size;
@@ -2588,6 +2605,7 @@ static int s5p_jpeg_start_streaming(struct vb2_queue *q, unsigned int count)
static void s5p_jpeg_stop_streaming(struct vb2_queue *q)
{
struct s5p_jpeg_ctx *ctx = vb2_get_drv_priv(q);
+ struct vb2_v4l2_buffer *buf;
/*
* STREAMOFF is an acknowledgment for resolution change event.
@@ -2600,6 +2618,11 @@ static void s5p_jpeg_stop_streaming(struct vb2_queue *q)
ctx->state = JPEGCTX_RUNNING;
}
+ while ((buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx)))
+ v4l2_m2m_buf_done(buf, VB2_BUF_STATE_ERROR);
+ while ((buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx)))
+ v4l2_m2m_buf_done(buf, VB2_BUF_STATE_ERROR);
+
pm_runtime_put(ctx->jpeg->dev);
}
@@ -2839,6 +2862,8 @@ static irqreturn_t exynos3250_jpeg_irq(int irq, void *dev_id)
v4l2_m2m_buf_done(src_buf, state);
if (curr_ctx->mode == S5P_JPEG_ENCODE)
vb2_set_plane_payload(&dst_buf->vb2_buf, 0, payload_size);
+ if (src_buf->flags & V4L2_BUF_FLAG_LAST)
+ dst_buf->flags |= V4L2_BUF_FLAG_LAST;
v4l2_m2m_buf_done(dst_buf, state);
curr_ctx->subsampling =
--
2.17.1

View File

@ -0,0 +1,169 @@
From 77acb18b46a9464521f4f9af26f87d8a5f644515 Mon Sep 17 00:00:00 2001
From: Pavel Golikov <Paullo612@ya.ru>
Date: Fri, 24 Jun 2022 15:56:41 +0000
Subject: [PATCH 04/21] WIP: soc: samsung: pm_domains: Bring back old driver
implementation
Using new implementation decreases Mali GPU performance significantly
(with both KBase and Panfrost drivers).
Signed-off-by: Pavel Golikov <Paullo612@ya.ru>
---
drivers/soc/samsung/pm_domains.c | 97 ++++++++++++++++----------------
1 file changed, 49 insertions(+), 48 deletions(-)
diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c
index d07f3c9d6903..1022d40eb700 100644
--- a/drivers/soc/samsung/pm_domains.c
+++ b/drivers/soc/samsung/pm_domains.c
@@ -16,7 +16,7 @@
#include <linux/delay.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
-#include <linux/pm_runtime.h>
+#include <linux/sched.h>
struct exynos_pm_domain_config {
/* Value for LOCAL_PWR_CFG and STATUS fields for each domain */
@@ -72,15 +72,15 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain)
return exynos_pd_power(domain, false);
}
-static const struct exynos_pm_domain_config exynos4210_cfg = {
+static const struct exynos_pm_domain_config exynos4210_cfg __initconst = {
.local_pwr_cfg = 0x7,
};
-static const struct exynos_pm_domain_config exynos5433_cfg = {
+static const struct exynos_pm_domain_config exynos5433_cfg __initconst = {
.local_pwr_cfg = 0xf,
};
-static const struct of_device_id exynos_pm_domain_of_match[] = {
+static const struct of_device_id exynos_pm_domain_of_match[] __initconst = {
{
.compatible = "samsung,exynos4210-pd",
.data = &exynos4210_cfg,
@@ -91,7 +91,7 @@ static const struct of_device_id exynos_pm_domain_of_match[] = {
{ },
};
-static const char *exynos_get_domain_name(struct device_node *node)
+static __init const char *exynos_get_domain_name(struct device_node *node)
{
const char *name;
@@ -100,44 +100,60 @@ static const char *exynos_get_domain_name(struct device_node *node)
return kstrdup_const(name, GFP_KERNEL);
}
-static int exynos_pd_probe(struct platform_device *pdev)
+static __init int exynos4_pm_init_power_domain(void)
{
- const struct exynos_pm_domain_config *pm_domain_cfg;
- struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
- struct of_phandle_args child, parent;
- struct exynos_pm_domain *pd;
- int on, ret;
+ struct device_node *np;
+ const struct of_device_id *match;
- pm_domain_cfg = of_device_get_match_data(dev);
- pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
- if (!pd)
- return -ENOMEM;
+ for_each_matching_node_and_match(np, exynos_pm_domain_of_match, &match) {
+ const struct exynos_pm_domain_config *pm_domain_cfg;
+ struct exynos_pm_domain *pd;
+ int on;
- pd->pd.name = exynos_get_domain_name(np);
- if (!pd->pd.name)
- return -ENOMEM;
+ pm_domain_cfg = match->data;
- pd->base = of_iomap(np, 0);
- if (!pd->base) {
- kfree_const(pd->pd.name);
- return -ENODEV;
- }
+ pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+ if (!pd) {
+ of_node_put(np);
+ return -ENOMEM;
+ }
+ pd->pd.name = exynos_get_domain_name(np);
+ if (!pd->pd.name) {
+ kfree(pd);
+ of_node_put(np);
+ return -ENOMEM;
+ }
- pd->pd.power_off = exynos_pd_power_off;
- pd->pd.power_on = exynos_pd_power_on;
- pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg;
+ pd->base = of_iomap(np, 0);
+ if (!pd->base) {
+ pr_warn("%s: failed to map memory\n", __func__);
+ kfree_const(pd->pd.name);
+ kfree(pd);
+ continue;
+ }
+
+ pd->pd.power_off = exynos_pd_power_off;
+ pd->pd.power_on = exynos_pd_power_on;
+ pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg;
- on = readl_relaxed(pd->base + 0x4) & pd->local_pwr_cfg;
+ on = readl_relaxed(pd->base + 0x4) & pd->local_pwr_cfg;
+
+ pm_genpd_init(&pd->pd, NULL, !on);
+ of_genpd_add_provider_simple(np, &pd->pd);
+ }
- pm_genpd_init(&pd->pd, NULL, !on);
- ret = of_genpd_add_provider_simple(np, &pd->pd);
+ /* Assign the child power domains to their parents */
+ for_each_matching_node(np, exynos_pm_domain_of_match) {
+ struct of_phandle_args child, parent;
- if (ret == 0 && of_parse_phandle_with_args(np, "power-domains",
- "#power-domain-cells", 0, &parent) == 0) {
child.np = np;
child.args_count = 0;
+ if (of_parse_phandle_with_args(np, "power-domains",
+ "#power-domain-cells", 0,
+ &parent) != 0)
+ continue;
+
if (of_genpd_add_subdomain(&parent, &child))
pr_warn("%pOF failed to add subdomain: %pOF\n",
parent.np, child.np);
@@ -146,21 +162,6 @@ static int exynos_pd_probe(struct platform_device *pdev)
parent.np, child.np);
}
- pm_runtime_enable(dev);
- return ret;
-}
-
-static struct platform_driver exynos_pd_driver = {
- .probe = exynos_pd_probe,
- .driver = {
- .name = "exynos-pd",
- .of_match_table = exynos_pm_domain_of_match,
- .suppress_bind_attrs = true,
- }
-};
-
-static __init int exynos4_pm_init_power_domain(void)
-{
- return platform_driver_register(&exynos_pd_driver);
+ return 0;
}
core_initcall(exynos4_pm_init_power_domain);
--
2.17.1

View File

@ -1,39 +1,39 @@
From ca94000c34d98c1bd83bdcabeee8cb79958c56e1 Mon Sep 17 00:00:00 2001 From 34cfc53ec99e6e3356bb6e06ecd68faa4d2e4bac Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com> From: Christian Hewitt <christianshewitt@gmail.com>
Date: Wed, 29 Apr 2020 10:37:08 +0000 Date: Wed, 29 Apr 2020 10:37:08 +0000
Subject: [PATCH 25/25] WIP: ARM: dts: exynos5422: HC1/XU3/XU4 model name is Subject: [PATCH 05/21] WIP: arm: dts: exynos5422: HC1/XU3/XU4 model name is
ODROID not Odroid ODROID not Odroid
Cosmetic change to model and audio card name for HC1/XU3/XU4 to Cosmetic change to model and audio card name for HC1/XU3/XU4 to
put ODROID in capitals (as per Hardkernel branding). Also fixup put ODROID in capitals (as per Hardkernel branding).
some unneeded backslashes and wrap lines per kernel standards.
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
--- ---
arch/arm/boot/dts/exynos5422-odroidhc1.dts | 4 ++-- arch/arm/boot/dts/exynos5422-odroidhc1.dts | 5 ++---
arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi | 2 +- arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi | 2 +-
arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts | 5 +++-- arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts | 2 +-
arch/arm/boot/dts/exynos5422-odroidxu3.dts | 5 +++-- arch/arm/boot/dts/exynos5422-odroidxu3.dts | 2 +-
arch/arm/boot/dts/exynos5422-odroidxu4.dts | 6 +++--- arch/arm/boot/dts/exynos5422-odroidxu4.dts | 7 +++----
5 files changed, 12 insertions(+), 10 deletions(-) 5 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/arch/arm/boot/dts/exynos5422-odroidhc1.dts b/arch/arm/boot/dts/exynos5422-odroidhc1.dts diff --git a/arch/arm/boot/dts/exynos5422-odroidhc1.dts b/arch/arm/boot/dts/exynos5422-odroidhc1.dts
index 812659260278..b90da73510cf 100644 index d91f7fa2cf80..6550d59ce3d8 100644
--- a/arch/arm/boot/dts/exynos5422-odroidhc1.dts --- a/arch/arm/boot/dts/exynos5422-odroidhc1.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidhc1.dts +++ b/arch/arm/boot/dts/exynos5422-odroidhc1.dts
@@ -11,8 +11,8 @@ @@ -11,9 +11,8 @@
#include "exynos5422-odroid-core.dtsi" #include "exynos5422-odroid-core.dtsi"
/ { / {
- model = "Hardkernel Odroid HC1"; - model = "Hardkernel Odroid HC1";
- compatible = "hardkernel,odroid-hc1", "samsung,exynos5800", \ - compatible = "hardkernel,odroid-hc1", "samsung,exynos5800", \
- "samsung,exynos5";
+ model = "Hardkernel ODROID HC1"; + model = "Hardkernel ODROID HC1";
+ compatible = "hardkernel,odroid-hc1", "samsung,exynos5800", + compatible = "hardkernel,odroid-hc1", "samsung,exynos5800", "samsung,exynos5";
"samsung,exynos5";
pwmleds { led-controller {
compatible = "pwm-leds";
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi
index c3c2d85267da..26961dcea010 100644 index 86b96f9706db..1a3940f2ead2 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi --- a/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
@ -46,53 +46,48 @@ index c3c2d85267da..26961dcea010 100644
samsung,audio-widgets = samsung,audio-widgets =
"Headphone", "Headphone Jack", "Headphone", "Headphone Jack",
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts
index 98feecad5489..d0084033199a 100644 index e3154a1cae23..4d337f9e79b8 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts --- a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts
@@ -14,8 +14,9 @@ @@ -14,7 +14,7 @@
#include "exynos54xx-odroidxu-leds.dtsi" #include "exynos54xx-odroidxu-leds.dtsi"
/ { / {
- model = "Hardkernel Odroid XU3 Lite"; - model = "Hardkernel Odroid XU3 Lite";
- compatible = "hardkernel,odroid-xu3-lite", "samsung,exynos5800", "samsung,exynos5";
+ model = "Hardkernel ODROID XU3 Lite"; + model = "Hardkernel ODROID XU3 Lite";
+ compatible = "hardkernel,odroid-xu3-lite", "samsung,exynos5800", compatible = "hardkernel,odroid-xu3-lite", "samsung,exynos5800", "samsung,exynos5";
+ "samsung,exynos5";
aliases { aliases {
ethernet = &ethernet;
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
index db0bc17a667b..3ff7ec514e20 100644 index a378d4937ff7..21cf909b9cc8 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
@@ -13,8 +13,9 @@ @@ -13,7 +13,7 @@
#include "exynos54xx-odroidxu-leds.dtsi" #include "exynos54xx-odroidxu-leds.dtsi"
/ { / {
- model = "Hardkernel Odroid XU3"; - model = "Hardkernel Odroid XU3";
- compatible = "hardkernel,odroid-xu3", "samsung,exynos5800", "samsung,exynos5";
+ model = "Hardkernel ODROID XU3"; + model = "Hardkernel ODROID XU3";
+ compatible = "hardkernel,odroid-xu3", "samsung,exynos5800", compatible = "hardkernel,odroid-xu3", "samsung,exynos5800", "samsung,exynos5";
+ "samsung,exynos5";
aliases { aliases {
ethernet = &ethernet;
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/dts/exynos5422-odroidxu4.dts diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/dts/exynos5422-odroidxu4.dts
index 892d389d6d09..d2061b244537 100644 index 1c24f9b35973..caf4f50e91df 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu4.dts --- a/arch/arm/boot/dts/exynos5422-odroidxu4.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu4.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu4.dts
@@ -13,8 +13,8 @@ @@ -13,9 +13,8 @@
#include "exynos5422-odroidxu3-common.dtsi" #include "exynos5422-odroidxu3-common.dtsi"
/ { / {
- model = "Hardkernel Odroid XU4"; - model = "Hardkernel Odroid XU4";
- compatible = "hardkernel,odroid-xu4", "samsung,exynos5800", \ - compatible = "hardkernel,odroid-xu4", "samsung,exynos5800", \
- "samsung,exynos5";
+ model = "Hardkernel ODROID XU4"; + model = "Hardkernel ODROID XU4";
+ compatible = "hardkernel,odroid-xu4", "samsung,exynos5800", + compatible = "hardkernel,odroid-xu4", "samsung,exynos5800", "samsung,exynos5";
"samsung,exynos5";
pwmleds { led-controller {
@@ -31,7 +31,7 @@ compatible = "pwm-leds";
@@ -31,7 +30,7 @@
sound: sound { sound: sound {
compatible = "samsung,odroid-xu3-audio"; compatible = "samsung,odroid-xu3-audio";

View File

@ -1,87 +0,0 @@
From a47cabb4e0626125ea91fa25616e449705e1e783 Mon Sep 17 00:00:00 2001
From: Thierry Escande <thierry.escande@collabora.com>
Date: Wed, 26 Oct 2016 10:52:05 +0200
Subject: [PATCH 06/25] MEMEKA: videobuf2-dc: Move vb2_dc_get_base_sgt() above
mmap callbacks
This patch moves vb2_dc_get_base_sgt() function above mmap buffers
callbacks, particularly vb2_dc_alloc() and vb2_dc_mmap() from where it
will be called for cacheable MMAP support introduced in the next patch.
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: memeka <mihailescu2m@gmail.com>
---
.../common/videobuf2/videobuf2-dma-contig.c | 44 +++++++++----------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
index f4b4a7c135eb..8accf13fe439 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
@@ -66,6 +66,31 @@ static unsigned long vb2_dc_get_contiguous_size(struct sg_table *sgt)
return size;
}
+static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf)
+{
+ int ret;
+ struct sg_table *sgt;
+
+ if (buf->non_coherent_mem)
+ return buf->dma_sgt;
+
+ sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
+ if (!sgt) {
+ dev_err(buf->dev, "failed to alloc sg table\n");
+ return NULL;
+ }
+
+ ret = dma_get_sgtable_attrs(buf->dev, sgt, buf->cookie, buf->dma_addr,
+ buf->size, buf->attrs);
+ if (ret < 0) {
+ dev_err(buf->dev, "failed to get scatterlist from DMA API\n");
+ kfree(sgt);
+ return NULL;
+ }
+
+ return sgt;
+}
+
/*********************************************/
/* callbacks for all buffers */
/*********************************************/
@@ -479,31 +504,6 @@ static const struct dma_buf_ops vb2_dc_dmabuf_ops = {
.release = vb2_dc_dmabuf_ops_release,
};
-static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf)
-{
- int ret;
- struct sg_table *sgt;
-
- if (buf->non_coherent_mem)
- return buf->dma_sgt;
-
- sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
- if (!sgt) {
- dev_err(buf->dev, "failed to alloc sg table\n");
- return NULL;
- }
-
- ret = dma_get_sgtable_attrs(buf->dev, sgt, buf->cookie, buf->dma_addr,
- buf->size, buf->attrs);
- if (ret < 0) {
- dev_err(buf->dev, "failed to get scatterlist from DMA API\n");
- kfree(sgt);
- return NULL;
- }
-
- return sgt;
-}
-
static struct dma_buf *vb2_dc_get_dmabuf(struct vb2_buffer *vb,
void *buf_priv,
unsigned long flags)
--
2.17.1

View File

@ -0,0 +1,36 @@
From f07c3dc233b36997c3dcd679fa24fb4040a57d4f Mon Sep 17 00:00:00 2001
From: Pavel Golikov <Paullo612@ya.ru>
Date: Fri, 24 Jun 2022 15:56:05 +0000
Subject: [PATCH 06/21] WIP: media: s5p-mfc: Allow cache hints for queues
Passing V4L2_MEMORY_FLAG_NON_COHERENT from userspace significantly
improves video rendering performance on Exynos 5422 (Odroid XU4).
Signed-off-by: Pavel Golikov <Paullo612@ya.ru>
---
drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
index 761341934925..e33863d9ae2d 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
@@ -861,6 +861,7 @@ static int s5p_mfc_open(struct file *file)
q->dma_attrs = DMA_ATTR_ALLOC_SINGLE_PAGES;
q->mem_ops = &vb2_dma_contig_memops;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
+ q->allow_cache_hints = 1;
ret = vb2_queue_init(q);
if (ret) {
mfc_err("Failed to initialize videobuf2 queue(capture)\n");
@@ -896,6 +897,7 @@ static int s5p_mfc_open(struct file *file)
q->dma_attrs = DMA_ATTR_ALLOC_SINGLE_PAGES;
q->mem_ops = &vb2_dma_contig_memops;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY;
+ q->allow_cache_hints = 1;
ret = vb2_queue_init(q);
if (ret) {
mfc_err("Failed to initialize videobuf2 queue(output)\n");
--
2.17.1

View File

@ -0,0 +1,38 @@
From a31044355812a2e9e0df4edd3a1c503c7c77eee0 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Tue, 28 Jun 2022 07:34:21 +0000
Subject: [PATCH 07/21] WIP: media: s5p-mfc: use EAGAIN not EIO for
MFCINST_ERROR
Patch from https://forum.odroid.com/viewtopic.php?p=319025&sid=1fbdb9d8f7ea0ebee30dc8824f76d308#p319025
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c
index 268ffe4da53c..ff5756e446d6 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_dec.c
@@ -632,7 +632,7 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
if (ctx->state == MFCINST_ERROR) {
mfc_err("Call on QBUF after unrecoverable error\n");
- return -EIO;
+ return -EAGAIN;
}
if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
return vb2_qbuf(&ctx->vq_src, NULL, buf);
@@ -652,7 +652,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
if (ctx->state == MFCINST_ERROR) {
mfc_err_limited("Call on DQBUF after unrecoverable error\n");
- return -EIO;
+ return -EAGAIN;
}
switch (buf->type) {
--
2.17.1

View File

@ -0,0 +1,93 @@
From a3760f539508e81d47b21321aa42a09ce96555d3 Mon Sep 17 00:00:00 2001
From: Pavel Golikov <Paullo612@ya.ru>
Date: Fri, 24 Jun 2022 15:52:58 +0000
Subject: [PATCH 08/21] WIP: ARM/dma-mapping: implement ->alloc_noncontiguous
Implement support for allocating a non-contiguous DMA region. The
implementation is based on the ma-iommu driver.
Signed-off-by: Pavel Golikov <Paullo612@ya.ru>
---
arch/arm/mm/dma-mapping.c | 59 +++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 059cce018570..8f867cb9fe75 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1759,6 +1759,63 @@ static void arm_iommu_unmap_sg(struct device *dev,
__iommu_unmap_sg(dev, sg, nents, dir, attrs, false);
}
+static struct sg_table *arm_iommu_alloc_noncontiguous(struct device *dev,
+ size_t size, enum dma_data_direction dir, gfp_t gfp,
+ unsigned long attrs)
+{
+ struct dma_sgt_handle *sh;
+ int count;
+
+ sh = kmalloc(sizeof(*sh), gfp);
+ if (!sh)
+ return NULL;
+
+ size = PAGE_ALIGN(size);
+ count = size >> PAGE_SHIFT;
+
+ /*
+ * Following is a work-around (a.k.a. hack) to prevent pages
+ * with __GFP_COMP being passed to split_page() which cannot
+ * handle them. The real problem is that this flag probably
+ * should be 0 on ARM as it is not supported on this
+ * platform; see CONFIG_HUGETLBFS.
+ */
+ gfp &= ~(__GFP_COMP);
+
+ sh->pages = __iommu_alloc_buffer(dev, size, gfp, attrs, false);
+ if (!sh->pages)
+ goto err_sh;
+
+ if (sg_alloc_table_from_pages(&sh->sgt, sh->pages, count, 0, size,
+ GFP_KERNEL))
+ goto err_buffer;
+
+ if (__iommu_map_sg(dev, sh->sgt.sgl, sh->sgt.orig_nents, dir, attrs,
+ false) < 1)
+ goto err_free_sg;
+
+ return &sh->sgt;
+
+err_free_sg:
+ sg_free_table(&sh->sgt);
+err_buffer:
+ __iommu_free_buffer(dev, sh->pages, size, attrs);
+err_sh:
+ kfree(sh);
+ return NULL;
+}
+
+static void arm_iommu_free_noncontiguous(struct device *dev, size_t size,
+ struct sg_table *sgt, enum dma_data_direction dir)
+{
+ struct dma_sgt_handle *sh = sgt_handle(sgt);
+
+ __iommu_unmap_sg(dev, sgt->sgl, sgt->orig_nents, dir, 0, false);
+ __iommu_free_buffer(dev, sh->pages, PAGE_ALIGN(size), 0);
+ sg_free_table(&sh->sgt);
+ kfree(sh);
+}
+
/**
* arm_iommu_sync_sg_for_cpu
* @dev: valid struct device pointer
@@ -1996,6 +2053,8 @@ static const struct dma_map_ops iommu_ops = {
.map_page = arm_iommu_map_page,
.unmap_page = arm_iommu_unmap_page,
+ .alloc_noncontiguous = arm_iommu_alloc_noncontiguous,
+ .free_noncontiguous = arm_iommu_free_noncontiguous,
.sync_single_for_cpu = arm_iommu_sync_single_for_cpu,
.sync_single_for_device = arm_iommu_sync_single_for_device,
--
2.17.1

View File

@ -1,7 +1,7 @@
From 4ebb0fa9bdf877355ceaabc6ede0960002ebbfb1 Mon Sep 17 00:00:00 2001 From 3062d6e0008928c46388d6b118d4ae2137d5d0f4 Mon Sep 17 00:00:00 2001
From: memeka <mihailescu2m@gmail.com> From: memeka <mihailescu2m@gmail.com>
Date: Mon, 21 Oct 2019 10:58:47 +1030 Date: Mon, 21 Oct 2019 10:58:47 +1030
Subject: [PATCH 02/25] MEMEKA: ARM: dma-mapping: increase DMA coherent pool Subject: [PATCH 09/21] MEMEKA: ARM: dma-mapping: increase DMA coherent pool
size to 2M size to 2M
--- ---
@ -9,10 +9,10 @@ Subject: [PATCH 02/25] MEMEKA: ARM: dma-mapping: increase DMA coherent pool
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 8a8949174b1c..80d4e66039ff 100644 index 8f867cb9fe75..7493dcf0567a 100644
--- a/arch/arm/mm/dma-mapping.c --- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c
@@ -314,7 +314,7 @@ static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp, @@ -315,7 +315,7 @@ static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp,
pgprot_t prot, struct page **ret_page, pgprot_t prot, struct page **ret_page,
const void *caller, bool want_vaddr); const void *caller, bool want_vaddr);

View File

@ -1,7 +1,7 @@
From eba616b4f08a69c3398d6fd32d19a8896d36db50 Mon Sep 17 00:00:00 2001 From 16718487d729416d1f6c371c1cb524f817f2d019 Mon Sep 17 00:00:00 2001
From: OtherCrashOverride <OtherCrashOverride@users.noreply.github.com> From: OtherCrashOverride <OtherCrashOverride@users.noreply.github.com>
Date: Sun, 9 Apr 2017 17:31:25 +0000 Date: Sun, 9 Apr 2017 17:31:25 +0000
Subject: [PATCH 03/25] MEMEKA: drm/exynos/mixer: never blend the base layer Subject: [PATCH 10/21] MEMEKA: drm/exynos/mixer: never blend the base layer
On Exynos there is a solid color plane that is logically below all the other display planes. On Exynos there is a solid color plane that is logically below all the other display planes.
This causes display artifacts due to alpha. The patch disables blending the base plane with This causes display artifacts due to alpha. The patch disables blending the base plane with
@ -14,7 +14,7 @@ Signed-off-by: memeka <mihailescu2m@gmail.com>
1 file changed, 18 insertions(+), 15 deletions(-) 1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 21b726baedea..c1a527fa1df8 100644 index e5204be86093..430622e0d8d4 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c --- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -315,23 +315,26 @@ static void mixer_cfg_gfx_blend(struct mixer_context *ctx, unsigned int win, @@ -315,23 +315,26 @@ static void mixer_cfg_gfx_blend(struct mixer_context *ctx, unsigned int win,

View File

@ -1,18 +1,18 @@
From 8ffeeccf93279efefc2a76aae04766b7ad6c0634 Mon Sep 17 00:00:00 2001 From 8078cb106c24c415f96c21f0a3e91b8d28741045 Mon Sep 17 00:00:00 2001
From: memeka <mihailescu2m@gmail.com> From: Marian Mihailescu <mihailescu2m@gmail.com>
Date: Tue, 10 Jul 2018 11:24:56 +0930 Date: Fri, 24 Jun 2022 17:30:42 +0000
Subject: [PATCH 05/25] MEMEKA: media: exynos-gsc: fix v4l2 SELECTION api Subject: [PATCH 11/21] MEMEKA: media: exynos-gsc: fix v4l2 SELECTION api
Signed-off-by: memeka <mihailescu2m@gmail.com> Signed-off-by: Marian Mihailescu <mihailescu2m@gmail.com>
--- ---
drivers/media/platform/exynos-gsc/gsc-core.h | 4 ++-- drivers/media/platform/samsung/exynos-gsc/gsc-core.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-) 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/samsung/exynos-gsc/gsc-core.h b/drivers/media/platform/samsung/exynos-gsc/gsc-core.h diff --git a/drivers/media/platform/samsung/exynos-gsc/gsc-core.h b/drivers/media/platform/samsung/exynos-gsc/gsc-core.h
index 8e5a9acb78aa..235d687614f0 100644 index e894e85e84a4..95fda27de0a3 100644
--- a/drivers/media/platform/samsung/exynos-gsc/gsc-core.h --- a/drivers/media/platform/samsung/exynos-gsc/gsc-core.h
+++ b/drivers/media/platform/samsung/exynos-gsc/gsc-core.h +++ b/drivers/media/platform/samsung/exynos-gsc/gsc-core.h
@@ -474,9 +474,9 @@ static inline struct gsc_frame *ctx_get_frame(struct gsc_ctx *ctx, @@ -481,9 +481,9 @@ static inline struct gsc_frame *ctx_get_frame(struct gsc_ctx *ctx,
{ {
struct gsc_frame *frame; struct gsc_frame *frame;

View File

@ -1,19 +1,19 @@
From beba0c663769d49b752c6b8f11f8341d56b16102 Mon Sep 17 00:00:00 2001 From ddff825a6c234556d761c8cb23d6c28c97d85339 Mon Sep 17 00:00:00 2001
From: memeka <mihailescu2m@gmail.com> From: Marian Mihailescu <mihailescu2m@gmail.com>
Date: Tue, 10 Jul 2018 22:01:38 +0930 Date: Fri, 24 Jun 2022 17:36:37 +0000
Subject: [PATCH 10/25] MEMEKA: media: s5p-mfc: copy timestamp and timecode in Subject: [PATCH 12/21] MEMEKA: media: s5p-mfc: copy timestamp and timecode in
encoder output encoder output
Signed-off-by: memeka <mihailescu2m@gmail.com> Signed-off-by: Marian Mihailescu <mihailescu2m@gmail.com>
--- ---
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 9 +++++++++ drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c | 9 +++++++++
1 file changed, 9 insertions(+) 1 file changed, 9 insertions(+)
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c
index 912fe0c5ab18..d48e7b57d96a 100644 index b65e506665af..d445466046eb 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c
@@ -1208,6 +1208,7 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) @@ -1214,6 +1214,7 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx)
{ {
struct s5p_mfc_dev *dev = ctx->dev; struct s5p_mfc_dev *dev = ctx->dev;
struct s5p_mfc_buf *mb_entry; struct s5p_mfc_buf *mb_entry;
@ -21,7 +21,7 @@ index 912fe0c5ab18..d48e7b57d96a 100644
unsigned long enc_y_addr = 0, enc_c_addr = 0; unsigned long enc_y_addr = 0, enc_c_addr = 0;
unsigned long mb_y_addr, mb_c_addr; unsigned long mb_y_addr, mb_c_addr;
int slice_type; int slice_type;
@@ -1227,8 +1228,12 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) @@ -1233,8 +1234,12 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx)
&mb_entry->b->vb2_buf, 0); &mb_entry->b->vb2_buf, 0);
mb_c_addr = vb2_dma_contig_plane_dma_addr( mb_c_addr = vb2_dma_contig_plane_dma_addr(
&mb_entry->b->vb2_buf, 1); &mb_entry->b->vb2_buf, 1);
@ -34,7 +34,7 @@ index 912fe0c5ab18..d48e7b57d96a 100644
list_del(&mb_entry->list); list_del(&mb_entry->list);
ctx->src_queue_cnt--; ctx->src_queue_cnt--;
vb2_buffer_done(&mb_entry->b->vb2_buf, vb2_buffer_done(&mb_entry->b->vb2_buf,
@@ -1241,8 +1246,12 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) @@ -1247,8 +1252,12 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx)
&mb_entry->b->vb2_buf, 0); &mb_entry->b->vb2_buf, 0);
mb_c_addr = vb2_dma_contig_plane_dma_addr( mb_c_addr = vb2_dma_contig_plane_dma_addr(
&mb_entry->b->vb2_buf, 1); &mb_entry->b->vb2_buf, 1);

View File

@ -1,21 +1,21 @@
From 06d0e059b754aef63e8ca0d901d6759fb9ed15e7 Mon Sep 17 00:00:00 2001 From 30b928690575651687ae46f4bdbc946efd9cc0bd Mon Sep 17 00:00:00 2001
From: OtherCrashOverride <OtherCrashOverride@users.noreply.github.com> From: Marian Mihailescu <mihailescu2m@gmail.com>
Date: Fri, 19 May 2017 12:59:51 +0000 Date: Fri, 24 Jun 2022 17:38:45 +0000
Subject: [PATCH 11/25] MEMEKA: media: s5p-mfc: stop streaming before releasing Subject: [PATCH 13/21] MEMEKA: media: s5p-mfc: stop streaming before releasing
queues queues
If streaming is active when the MFC device is closed, it will generate an IOMMU page-fault. If streaming is active when the MFC device is closed, it will generate an IOMMU page-fault.
Signed-off-by: memeka <mihailescu2m@gmail.com> Signed-off-by: Marian Mihailescu <mihailescu2m@gmail.com>
--- ---
drivers/media/platform/s5p-mfc/s5p_mfc.c | 5 +++++ drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 5 +++++
1 file changed, 5 insertions(+) 1 file changed, 5 insertions(+)
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
index 37f2113a00ec..8c39528be39e 100644 index e33863d9ae2d..f9b4b506c04c 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
@@ -941,6 +941,11 @@ static int s5p_mfc_release(struct file *file) @@ -943,6 +943,11 @@ static int s5p_mfc_release(struct file *file)
mfc_debug_enter(); mfc_debug_enter();
if (dev) if (dev)
mutex_lock(&dev->mfc_mutex); mutex_lock(&dev->mfc_mutex);

View File

@ -0,0 +1,99 @@
From db4c420d468a14b244e1f19b6733088006a18e99 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 20 Aug 2022 02:15:54 +0000
Subject: [PATCH 14/21] FROMLIST(v3): tools build: Add feature test for
init_disassemble_info API changes
binutils changed the signature of init_disassemble_info(), which now causes
compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
Relevant binutils commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
This commit adds a feature test to detect the new signature. Subsequent
commits will use it to fix the build failures.
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Quentin Monnet <quentin@isovalent.com>
Link: http://lore.kernel.org/lkml/20220622181918.ykrs5rsnmx3og4sv@alap3.anarazel.de
Signed-off-by: Andres Freund <andres@anarazel.de>
---
tools/build/Makefile.feature | 1 +
tools/build/feature/Makefile | 4 ++++
tools/build/feature/test-all.c | 4 ++++
tools/build/feature/test-disassembler-init-styled.c | 13 +++++++++++++
4 files changed, 22 insertions(+)
create mode 100644 tools/build/feature/test-disassembler-init-styled.c
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 888a0421d43b..8f6578e4d324 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -70,6 +70,7 @@ FEATURE_TESTS_BASIC := \
libaio \
libzstd \
disassembler-four-args \
+ disassembler-init-styled \
file-handle
# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 7c2a17e23c30..c3059739318a 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -18,6 +18,7 @@ FILES= \
test-libbfd.bin \
test-libbfd-buildid.bin \
test-disassembler-four-args.bin \
+ test-disassembler-init-styled.bin \
test-reallocarray.bin \
test-libbfd-liberty.bin \
test-libbfd-liberty-z.bin \
@@ -248,6 +249,9 @@ $(OUTPUT)test-libbfd-buildid.bin:
$(OUTPUT)test-disassembler-four-args.bin:
$(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+$(OUTPUT)test-disassembler-init-styled.bin:
+ $(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
+
$(OUTPUT)test-reallocarray.bin:
$(BUILD)
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index 5ffafb967b6e..957c02c7b163 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -166,6 +166,10 @@
# include "test-disassembler-four-args.c"
#undef main
+#define main main_test_disassembler_init_styled
+# include "test-disassembler-init-styled.c"
+#undef main
+
#define main main_test_libzstd
# include "test-libzstd.c"
#undef main
diff --git a/tools/build/feature/test-disassembler-init-styled.c b/tools/build/feature/test-disassembler-init-styled.c
new file mode 100644
index 000000000000..f1ce0ec3bee9
--- /dev/null
+++ b/tools/build/feature/test-disassembler-init-styled.c
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <stdio.h>
+#include <dis-asm.h>
+
+int main(void)
+{
+ struct disassemble_info info;
+
+ init_disassemble_info(&info, stdout,
+ NULL, NULL);
+
+ return 0;
+}
--
2.17.1

View File

@ -1,50 +0,0 @@
From 20570c820357eb0cfee14342328a3e6920e8a320 Mon Sep 17 00:00:00 2001
From: memeka <mihailescu2m@gmail.com>
Date: Tue, 10 Jul 2018 22:13:03 +0930
Subject: [PATCH 14/25] MEMEKA: thermal: exynos: add support for 8 trip points
on Exynos5422 TMU
Signed-off-by: memeka <mihailescu2m@gmail.com>
---
drivers/thermal/samsung/exynos_tmu.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index e9a90bc23b11..b49df21fa0e7 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -915,8 +915,6 @@ static int exynos_map_dt_data(struct platform_device *pdev)
case SOC_ARCH_EXYNOS4412:
case SOC_ARCH_EXYNOS5250:
case SOC_ARCH_EXYNOS5260:
- case SOC_ARCH_EXYNOS5420:
- case SOC_ARCH_EXYNOS5420_TRIMINFO:
data->tmu_set_trip_temp = exynos4412_tmu_set_trip_temp;
data->tmu_set_trip_hyst = exynos4412_tmu_set_trip_hyst;
data->tmu_initialize = exynos4412_tmu_initialize;
@@ -935,6 +933,22 @@ static int exynos_map_dt_data(struct platform_device *pdev)
data->min_efuse_value = 0;
data->max_efuse_value = 100;
break;
+ case SOC_ARCH_EXYNOS5420:
+ case SOC_ARCH_EXYNOS5420_TRIMINFO:
+ data->tmu_set_trip_temp = exynos4412_tmu_set_trip_temp;
+ data->tmu_set_trip_hyst = exynos4412_tmu_set_trip_hyst;
+ data->tmu_initialize = exynos4412_tmu_initialize;
+ data->tmu_control = exynos4210_tmu_control;
+ data->tmu_read = exynos4412_tmu_read;
+ data->tmu_set_emulation = exynos4412_tmu_set_emulation;
+ data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
+ data->ntrip = 8;
+ data->gain = 8;
+ data->reference_voltage = 16;
+ data->efuse_value = 55;
+ data->min_efuse_value = 16;
+ data->max_efuse_value = 76;
+ break;
case SOC_ARCH_EXYNOS5433:
data->tmu_set_trip_temp = exynos5433_tmu_set_trip_temp;
data->tmu_set_trip_hyst = exynos5433_tmu_set_trip_hyst;
--
2.17.1

View File

@ -0,0 +1,31 @@
From 72506043957ff415a2e609d9a245ecffb76dc674 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 20 Aug 2022 02:16:55 +0000
Subject: [PATCH 15/21] FROMLIST(v3): tools build: Don't display
disassembler-four-args feature test
The feature check does not seem important enough to display.
Suggested-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andres Freund <andres@anarazel.de>
---
tools/build/Makefile.feature | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 8f6578e4d324..fc6ce0b2535a 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -135,8 +135,7 @@ FEATURE_DISPLAY ?= \
get_cpuid \
bpf \
libaio \
- libzstd \
- disassembler-four-args
+ libzstd
# Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
# If in the future we need per-feature checks/flags for features not
--
2.17.1

View File

@ -1,45 +0,0 @@
From f8f90c73fe3c5b24c806ae17af657321afb47f4f Mon Sep 17 00:00:00 2001
From: memeka <mihailescu2m@gmail.com>
Date: Tue, 22 Jan 2019 11:55:07 +1030
Subject: [PATCH 15/25] MEMEKA: arm: dts: exynos5422: enable Exynos5422 TMU
Signed-off-by: memeka <mihailescu2m@gmail.com>
---
arch/arm/boot/dts/exynos5422-odroid-core.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5422-odroid-core.dtsi b/arch/arm/boot/dts/exynos5422-odroid-core.dtsi
index ab27ff8bc3dc..4a4710efb429 100644
--- a/arch/arm/boot/dts/exynos5422-odroid-core.dtsi
+++ b/arch/arm/boot/dts/exynos5422-odroid-core.dtsi
@@ -1030,22 +1030,27 @@
&tmu_cpu0 {
vtmu-supply = <&ldo7_reg>;
+ status = "okay";
};
&tmu_cpu1 {
vtmu-supply = <&ldo7_reg>;
+ status = "okay";
};
&tmu_cpu2 {
vtmu-supply = <&ldo7_reg>;
+ status = "okay";
};
&tmu_cpu3 {
vtmu-supply = <&ldo7_reg>;
+ status = "okay";
};
&tmu_gpu {
vtmu-supply = <&ldo7_reg>;
+ status = "okay";
};
&gpu {
--
2.17.1

View File

@ -0,0 +1,89 @@
From f46eae3e6a89b63375063915508e08ec23625849 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 20 Aug 2022 02:18:33 +0000
Subject: [PATCH 16/21] FROMLIST(v3): tools include: add dis-asm-compat.h to
handle version differences
binutils changed the signature of init_disassemble_info(), which now causes
compilation failures for tools/{perf,bpf}, e.g. on debian unstable.
Relevant binutils commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
This commit introduces a wrapper for init_disassemble_info(), to avoid
spreading #ifdef DISASM_INIT_STYLED to a bunch of places. Subsequent
commits will use it to fix the build failures.
It likely is worth adding a wrapper for disassember(), to avoid the already
existing DISASM_FOUR_ARGS_SIGNATURE ifdefery.
Signed-off-by: Andres Freund <andres@anarazel.de>
Signed-off-by: Ben Hutchings <benh@debian.org>
---
tools/include/tools/dis-asm-compat.h | 55 ++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100644 tools/include/tools/dis-asm-compat.h
diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
new file mode 100644
index 000000000000..70f331e23ed3
--- /dev/null
+++ b/tools/include/tools/dis-asm-compat.h
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+#ifndef _TOOLS_DIS_ASM_COMPAT_H
+#define _TOOLS_DIS_ASM_COMPAT_H
+
+#include <stdio.h>
+#include <dis-asm.h>
+
+/* define types for older binutils version, to centralize ifdef'ery a bit */
+#ifndef DISASM_INIT_STYLED
+enum disassembler_style {DISASSEMBLER_STYLE_NOT_EMPTY};
+typedef int (*fprintf_styled_ftype) (void *, enum disassembler_style, const char*, ...);
+#endif
+
+/*
+ * Trivial fprintf wrapper to be used as the fprintf_styled_func argument to
+ * init_disassemble_info_compat() when normal fprintf suffices.
+ */
+static inline int fprintf_styled(void *out,
+ enum disassembler_style style,
+ const char *fmt, ...)
+{
+ va_list args;
+ int r;
+
+ (void)style;
+
+ va_start(args, fmt);
+ r = vfprintf(out, fmt, args);
+ va_end(args);
+
+ return r;
+}
+
+/*
+ * Wrapper for init_disassemble_info() that hides version
+ * differences. Depending on binutils version and architecture either
+ * fprintf_func or fprintf_styled_func will be called.
+ */
+static inline void init_disassemble_info_compat(struct disassemble_info *info,
+ void *stream,
+ fprintf_ftype unstyled_func,
+ fprintf_styled_ftype styled_func)
+{
+#ifdef DISASM_INIT_STYLED
+ init_disassemble_info(info, stream,
+ unstyled_func,
+ styled_func);
+#else
+ (void)styled_func;
+ init_disassemble_info(info, stream,
+ unstyled_func);
+#endif
+}
+
+#endif /* _TOOLS_DIS_ASM_COMPAT_H */
--
2.17.1

View File

@ -1,143 +0,0 @@
From c6272f5973722d3d396e7123ebb3e1fcd35ba5cc Mon Sep 17 00:00:00 2001
From: Lukasz Luba <l.luba@partner.samsung.com>
Date: Wed, 7 Nov 2018 18:09:44 +0100
Subject: [PATCH 16/25] MEMEKA: thermal: add irq-mode configuration for trip
point
This patch adds support irq mode in trip point.
When that flag is set in DT, there is no need for polling
in thermal framework. Crossing the trip point will rise an IRQ.
The naming convention for tip point 'type' can be confussing
and 'passive' (whic is passive cooling) might be interpretted wrongly.
This mechanism prevents from missue and adds explicit setting
for hardware which support interrupts for pre-configured temperature
threshold.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
Signed-off-by: memeka <mihailescu2m@gmail.com>
---
drivers/thermal/thermal_of.c | 17 +++++++++++++++++
drivers/thermal/thermal_core.c | 10 ++++++++--
include/linux/thermal.h | 5 +++++
3 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 874a47d6923f..1549561e28b2 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -315,6 +315,20 @@ static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip,
return 0;
}
+static int
+of_thermal_get_trip_irq_mode(struct thermal_zone_device *tz, int trip,
+ bool *mode)
+{
+ struct __thermal_zone *data = tz->devdata;
+
+ if (trip >= data->ntrips || trip < 0)
+ return -EDOM;
+
+ *mode = data->trips[trip].irq_mode;
+
+ return 0;
+}
+
static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip,
int *temp)
{
@@ -397,6 +411,7 @@ static struct thermal_zone_device_ops of_thermal_ops = {
.set_mode = of_thermal_set_mode,
.get_trip_type = of_thermal_get_trip_type,
+ .get_trip_irq_mode = of_thermal_get_trip_irq_mode,
.get_trip_temp = of_thermal_get_trip_temp,
.set_trip_temp = of_thermal_set_trip_temp,
.get_trip_hyst = of_thermal_get_trip_hyst,
@@ -860,6 +875,8 @@ static int thermal_of_populate_trip(struct device_node *np,
return ret;
}
+ trip->irq_mode = of_property_read_bool(np, "irq-mode");
+
/* Required for cooling map matching */
trip->np = np;
of_node_get(np);
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 9a321dc548c8..ef23a33d34b6 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -410,7 +410,8 @@ static void handle_critical_trips(struct thermal_zone_device *tz,
static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
{
enum thermal_trip_type type;
int trip_temp, hyst = 0;
+ bool irq_mode = false;
/* Ignore disabled trip points */
if (test_bit(trip, &tz->trips_disabled))
@@ -423,9 +424,14 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
handle_non_critical_trips(tz, trip);
/*
* Alright, we handled this trip successfully.
- * So, start monitoring again.
+ * So, start monitoring in polling mode if
+ * trip is not using irq HW support.
*/
- monitor_thermal_zone(tz);
+ if (tz->ops->get_trip_irq_mode)
+ tz->ops->get_trip_irq_mode(tz, trip, &irq_mode);
+
+ if (!irq_mode)
+ monitor_thermal_zone(tz);
}
static void update_temperature(struct thermal_zone_device *tz)
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index c91b1e344d56..c4ce2b875b73 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -92,6 +92,7 @@ struct thermal_zone_device_ops {
enum thermal_device_mode);
int (*get_trip_type) (struct thermal_zone_device *, int,
enum thermal_trip_type *);
+ int (*get_trip_irq_mode) (struct thermal_zone_device *, int, bool *);
int (*get_trip_temp) (struct thermal_zone_device *, int, int *);
int (*set_trip_temp) (struct thermal_zone_device *, int, int);
int (*get_trip_hyst) (struct thermal_zone_device *, int, int *);
@@ -185,6 +186,7 @@ struct thermal_zone_device {
struct thermal_attr *trip_temp_attrs;
struct thermal_attr *trip_type_attrs;
struct thermal_attr *trip_hyst_attrs;
+ struct thermal_attr *trip_irq_mode_attrs;
enum thermal_device_mode mode;
void *devdata;
int trips;
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index c91b1e344d56..c4ce2b875b73 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -353,6 +355,8 @@ struct thermal_zone_of_device_ops {
* @temperature: temperature value in miliCelsius
* @hysteresis: relative hysteresis in miliCelsius
* @type: trip point type
+ * @irq_mode: to not use polling in framework set support of HW irq (which will
+ * be triggered when temperature reaches this level).
*/
struct thermal_trip {
@@ -360,6 +364,7 @@ struct thermal_trip {
int temperature;
int hysteresis;
enum thermal_trip_type type;
+ bool irq_mode;
};
/* Function declarations */
--
2.17.1

View File

@ -0,0 +1,106 @@
From df844504bc12ecc0a2c24f5f0e979b0855063d73 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 20 Aug 2022 02:19:55 +0000
Subject: [PATCH 17/21] FROMLIST(v3): tools perf: Fix compilation error with
new binutils
binutils changed the signature of init_disassemble_info(), which now causes
compilation failures for tools/perf/util/annotate.c, e.g. on debian
unstable. Relevant binutils commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
Wire up the feature test and switch to init_disassemble_info_compat(),
which were introduced in prior commits, fixing the compilation failure.
I verified that perf can still disassemble bpf programs by using bpftrace
under load, recording a perf trace, and then annotating the bpf "function"
with and without the changes. With old binutils there's no change in output
before/after this patch. When comparing the output from old binutils (2.35)
to new bintuils with the patch (upstream snapshot) there are a few output
differences, but they are unrelated to this patch. An example hunk is:
1.15 : 55:mov %rbp,%rdx
0.00 : 58:add $0xfffffffffffffff8,%rdx
0.00 : 5c:xor %ecx,%ecx
- 1.03 : 5e:callq 0xffffffffe12aca3c
+ 1.03 : 5e:call 0xffffffffe12aca3c
0.00 : 63:xor %eax,%eax
- 2.18 : 65:leaveq
- 2.82 : 66:retq
+ 2.18 : 65:leave
+ 2.82 : 66:ret
Signed-off-by: Andres Freund <andres@anarazel.de>
---
tools/perf/Makefile.config | 8 ++++++++
tools/perf/util/annotate.c | 7 ++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 73e0762092fe..ee417c321adb 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -298,6 +298,7 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
FEATURE_CHECK_LDFLAGS-libaio = -lrt
FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
+FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
CORE_CFLAGS += -fno-omit-frame-pointer
CORE_CFLAGS += -ggdb3
@@ -905,13 +906,16 @@ ifndef NO_LIBBFD
ifeq ($(feature-libbfd-liberty), 1)
EXTLIBS += -lbfd -lopcodes -liberty
FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -ldl
+ FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -ldl
else
ifeq ($(feature-libbfd-liberty-z), 1)
EXTLIBS += -lbfd -lopcodes -liberty -lz
FEATURE_CHECK_LDFLAGS-disassembler-four-args += -liberty -lz -ldl
+ FEATURE_CHECK_LDFLAGS-disassembler-init-styled += -liberty -lz -ldl
endif
endif
$(call feature_check,disassembler-four-args)
+ $(call feature_check,disassembler-init-styled)
endif
ifeq ($(feature-libbfd-buildid), 1)
@@ -1025,6 +1029,10 @@ ifeq ($(feature-disassembler-four-args), 1)
CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
endif
+ifeq ($(feature-disassembler-init-styled), 1)
+ CFLAGS += -DDISASM_INIT_STYLED
+endif
+
ifeq (${IS_64_BIT}, 1)
ifndef NO_PERF_READ_VDSO32
$(call feature_check,compile-32)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 82cc396ef516..2c6a485c3de5 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1720,6 +1720,7 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
#include <bpf/btf.h>
#include <bpf/libbpf.h>
#include <linux/btf.h>
+#include <tools/dis-asm-compat.h>
static int symbol__disassemble_bpf(struct symbol *sym,
struct annotate_args *args)
@@ -1762,9 +1763,9 @@ static int symbol__disassemble_bpf(struct symbol *sym,
ret = errno;
goto out;
}
- init_disassemble_info(&info, s,
- (fprintf_ftype) fprintf);
-
+ init_disassemble_info_compat(&info, s,
+ (fprintf_ftype) fprintf,
+ fprintf_styled);
info.arch = bfd_get_arch(bfdf);
info.mach = bfd_get_mach(bfdf);
--
2.17.1

View File

@ -1,130 +0,0 @@
From 61aea8433aba4b8b40dfc777b59afc157a8fd32a Mon Sep 17 00:00:00 2001
From: Lukasz Luba <l.luba@partner.samsung.com>
Date: Wed, 7 Nov 2018 18:09:45 +0100
Subject: [PATCH 17/25] MEMEKA: thermal: add new sysfs file for irq-mode
Patch adds show functions for irq-mode feature.
It allocates new attributes and extends the old list.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
Signed-off-by: memeka <mihailescu2m@gmail.com>
---
drivers/thermal/thermal_sysfs.c | 53 +++++++++++++++++++++++++++++++--
1 file changed, 51 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index aa99edb4dff7..e3ede8af79cc 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -21,6 +21,8 @@
#include "thermal_core.h"
+#define TRIP_ATTR_NUM 4
+
/* sys I/F for thermal zone */
static ssize_t
@@ -166,6 +168,28 @@ trip_point_temp_show(struct device *dev, struct device_attribute *attr,
return sprintf(buf, "%d\n", temperature);
}
+static ssize_t
+trip_point_irq_mode_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct thermal_zone_device *tz = to_thermal_zone(dev);
+ int trip, ret;
+ bool mode;
+
+ if (!tz->ops->get_trip_irq_mode)
+ return -EPERM;
+
+ if (sscanf(attr->attr.name, "trip_point_%d_irq", &trip) != 1)
+ return -EINVAL;
+
+ ret = tz->ops->get_trip_irq_mode(tz, trip, &mode);
+
+ if (ret)
+ return ret;
+
+ return sprintf(buf, "%d\n", mode);
+}
+
static ssize_t
trip_point_hyst_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
@@ -520,10 +544,19 @@ static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
if (!tz->trip_type_attrs)
return -ENOMEM;
+ tz->trip_irq_mode_attrs = kcalloc(tz->trips,
+ sizeof(*tz->trip_irq_mode_attrs),
+ GFP_KERNEL);
+ if (!tz->trip_irq_mode_attrs) {
+ kfree(tz->trip_type_attrs);
+ return -ENOMEM;
+ }
+
tz->trip_temp_attrs = kcalloc(tz->trips, sizeof(*tz->trip_temp_attrs),
GFP_KERNEL);
if (!tz->trip_temp_attrs) {
kfree(tz->trip_type_attrs);
+ kfree(tz->trip_irq_mode_attrs);
return -ENOMEM;
}
@@ -533,14 +566,17 @@ static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
GFP_KERNEL);
if (!tz->trip_hyst_attrs) {
kfree(tz->trip_type_attrs);
+ kfree(tz->trip_irq_mode_attrs);
kfree(tz->trip_temp_attrs);
return -ENOMEM;
}
}
- attrs = kcalloc(tz->trips * 3 + 1, sizeof(*attrs), GFP_KERNEL);
+ attrs = kcalloc(tz->trips * TRIP_ATTR_NUM + 1, sizeof(*attrs),
+ GFP_KERNEL);
if (!attrs) {
kfree(tz->trip_type_attrs);
+ kfree(tz->trip_irq_mode_attrs);
kfree(tz->trip_temp_attrs);
if (tz->ops->get_trip_hyst)
kfree(tz->trip_hyst_attrs);
@@ -559,6 +595,19 @@ static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
tz->trip_type_attrs[indx].attr.show = trip_point_type_show;
attrs[indx] = &tz->trip_type_attrs[indx].attr.attr;
+ /* create trip irq_mode attribute */
+ snprintf(tz->trip_irq_mode_attrs[indx].name,
+ THERMAL_NAME_LENGTH, "trip_point_%d_irq", indx);
+
+ sysfs_attr_init(&tz->trip_irq_mode_attrs[indx].attr.attr);
+ tz->trip_irq_mode_attrs[indx].attr.attr.name =
+ tz->trip_irq_mode_attrs[indx].name;
+ tz->trip_irq_mode_attrs[indx].attr.attr.mode = S_IRUGO;
+ tz->trip_irq_mode_attrs[indx].attr.show =
+ trip_point_irq_mode_show;
+ attrs[indx + tz->trips * 3] =
+ &tz->trip_irq_mode_attrs[indx].attr.attr;
+
/* create trip temp attribute */
snprintf(tz->trip_temp_attrs[indx].name, THERMAL_NAME_LENGTH,
"trip_point_%d_temp", indx);
@@ -595,7 +644,7 @@ static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
attrs[indx + tz->trips * 2] =
&tz->trip_hyst_attrs[indx].attr.attr;
}
- attrs[tz->trips * 3] = NULL;
+ attrs[tz->trips * TRIP_ATTR_NUM] = NULL;
tz->trips_attribute_group.attrs = attrs;
--
2.17.1

View File

@ -0,0 +1,91 @@
From 890850659fdf3f00286843747182163f6d53a92a Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 20 Aug 2022 02:20:52 +0000
Subject: [PATCH 18/21] FROMLIST(v3): tools bpf_jit_disasm: Fix compilation
error with new binutils
binutils changed the signature of init_disassemble_info(), which now causes
compilation to fail for tools/bpf/bpf_jit_disasm.c, e.g. on debian
unstable. Relevant binutils commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
Wire up the feature test and switch to init_disassemble_info_compat(),
which were introduced in prior commits, fixing the compilation failure.
I verified that bpf_jit_disasm can still disassemble bpf programs, both
with the old and new dis-asm.h API. With old binutils there's no change in
output before/after this patch. When comparing the output from old
binutils (2.35) to new bintuils with the patch (upstream snapshot) there
are a few output differences, but they are unrelated to this patch. An
example hunk is:
f4: mov %r14,%rsi
f7: mov %r15,%rdx
fa: mov $0x2a,%ecx
- ff: callq 0xffffffffea8c4988
+ ff: call 0xffffffffea8c4988
104: test %rax,%rax
107: jge 0x0000000000000110
109: xor %eax,%eax
- 10b: jmpq 0x0000000000000073
+ 10b: jmp 0x0000000000000073
110: cmp $0x16,%rax
However, I had to use an older kernel to generate the bpf_jit_enabled = 2
output, as that has been broken since 5.18 / 1022a5498f6f:
https://lore.kernel.org/20220703030210.pmjft7qc2eajzi6c@alap3.anarazel.de
Signed-off-by: Andres Freund <andres@anarazel.de>
---
tools/bpf/Makefile | 5 ++++-
tools/bpf/bpf_jit_disasm.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
index b11cfc86a3d0..664601ab1705 100644
--- a/tools/bpf/Makefile
+++ b/tools/bpf/Makefile
@@ -34,7 +34,7 @@ else
endif
FEATURE_USER = .bpf
-FEATURE_TESTS = libbfd disassembler-four-args
+FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
FEATURE_DISPLAY = libbfd disassembler-four-args
check_feat := 1
@@ -56,6 +56,9 @@ endif
ifeq ($(feature-disassembler-four-args), 1)
CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
endif
+ifeq ($(feature-disassembler-init-styled), 1)
+CFLAGS += -DDISASM_INIT_STYLED
+endif
$(OUTPUT)%.yacc.c: $(srctree)/tools/bpf/%.y
$(QUIET_BISON)$(YACC) -o $@ -d $<
diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c
index c8ae95804728..a90a5d110f92 100644
--- a/tools/bpf/bpf_jit_disasm.c
+++ b/tools/bpf/bpf_jit_disasm.c
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
+#include <tools/dis-asm-compat.h>
#define CMD_ACTION_SIZE_BUFFER 10
#define CMD_ACTION_READ_ALL 3
@@ -64,7 +65,9 @@ static void get_asm_insns(uint8_t *image, size_t len, int opcodes)
assert(bfdf);
assert(bfd_check_format(bfdf, bfd_object));
- init_disassemble_info(&info, stdout, (fprintf_ftype) fprintf);
+ init_disassemble_info_compat(&info, stdout,
+ (fprintf_ftype) fprintf,
+ fprintf_styled);
info.arch = bfd_get_arch(bfdf);
info.mach = bfd_get_mach(bfdf);
info.buffer = image;
--
2.17.1

View File

@ -1,68 +0,0 @@
From c7eed0d079bb5febcb1f6a460ec9cba83bf579ea Mon Sep 17 00:00:00 2001
From: "k.konieczny@partner.samsung.com" <k.konieczny@partner.samsung.com>
Date: Tue, 8 Oct 2019 15:49:23 +0200
Subject: [PATCH 18/25] MEMEKA: devfreq: exynos-bus: workaround
dev_pm_opp_set_rate() errors on Exynos5422/5800 SoCs
Commit 4294a779bd8d ("PM / devfreq: exynos-bus: Convert to use
dev_pm_opp_set_rate()") introduced errors:
exynos-bus: new bus device registered: soc:bus_wcore ( 84000 KHz ~ 400000 KHz)
exynos-bus: new bus device registered: soc:bus_noc ( 67000 KHz ~ 100000 KHz)
exynos-bus: new bus device registered: soc:bus_fsys_apb (100000 KHz ~ 200000 KHz)
...
exynos-bus soc:bus_wcore: dev_pm_opp_set_rate: failed to find current OPP for freq 532000000 (-34)
exynos-bus soc:bus_noc: dev_pm_opp_set_rate: failed to find current OPP for freq 111000000 (-34)
exynos-bus soc:bus_fsys_apb: dev_pm_opp_set_rate: failed to find current OPP for freq 222000000 (-34)
They are caused by incorrect PLL assigned to clock source, which results
in clock rate outside of OPP range. Add workaround for this in
exynos_bus_parse_of() by adjusting clock rate to those present in OPP.
Fixes: 4294a779bd8d ("PM / devfreq: exynos-bus: Convert to use dev_pm_opp_set_rate()")
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
Signed-off-by: memeka <mihailescu2m@gmail.com>
---
drivers/devfreq/exynos-bus.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 8fa8eb541373..5b167eadb21e 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -243,7 +243,7 @@ static int exynos_bus_parse_of(struct device_node *np,
{
struct device *dev = bus->dev;
struct dev_pm_opp *opp;
- unsigned long rate;
+ unsigned long rate, opp_rate;
int ret;
/* Get the clock to provide each bus with source clock */
@@ -267,13 +267,21 @@ static int exynos_bus_parse_of(struct device_node *np,
}
rate = clk_get_rate(bus->clk);
-
- opp = devfreq_recommended_opp(dev, &rate, 0);
+ opp_rate = rate;
+ opp = devfreq_recommended_opp(dev, &opp_rate, 0);
if (IS_ERR(opp)) {
dev_err(dev, "failed to find dev_pm_opp\n");
ret = PTR_ERR(opp);
goto err_opp;
}
+ /*
+ * FIXME: U-boot leaves clock source at incorrect PLL, this results
+ * in clock rate outside defined OPP rate. Work around this bug by
+ * setting clock rate to recommended one.
+ */
+ if (rate > opp_rate)
+ clk_set_rate(bus->clk, opp_rate);
+
bus->curr_freq = dev_pm_opp_get_freq(opp);
dev_pm_opp_put(opp);
--
2.17.1

View File

@ -0,0 +1,43 @@
From 8745189456e2d122eed4d8064ae5dd40af2ed207 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 20 Aug 2022 02:22:29 +0000
Subject: [PATCH 19/21] FROMLIST(v3): tools bpf_jit_disasm: Don't display
disassembler-four-args feature test
The feature check does not seem important enough to display.
Signed-off-by: Andres Freund <andres@anarazel.de>
---
tools/bpf/Makefile | 2 +-
tools/bpf/bpftool/Makefile | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
index 664601ab1705..243b79f2b451 100644
--- a/tools/bpf/Makefile
+++ b/tools/bpf/Makefile
@@ -35,7 +35,7 @@ endif
FEATURE_USER = .bpf
FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled
-FEATURE_DISPLAY = libbfd disassembler-four-args
+FEATURE_DISPLAY = libbfd
check_feat := 1
NON_CHECK_FEAT_TARGETS := clean bpftool_clean runqslower_clean resolve_btfids_clean
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index c6d2c77d0252..a92fb4d312ec 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -95,7 +95,7 @@ RM ?= rm -f
FEATURE_USER = .bpftool
FEATURE_TESTS = libbfd disassembler-four-args zlib libcap \
clang-bpf-co-re
-FEATURE_DISPLAY = libbfd disassembler-four-args zlib libcap \
+FEATURE_DISPLAY = libbfd zlib libcap \
clang-bpf-co-re
check_feat := 1
--
2.17.1

View File

@ -1,75 +0,0 @@
From 8ca78a11396a1d1f5d7aa49d3c3f2ecd89aa07bd Mon Sep 17 00:00:00 2001
From: Anand Moon <moon.linux@yahoo.com>
Date: Sun, 12 Jul 2015 18:41:20 +0530
Subject: [PATCH 19/25] MEMEKA: regulator: s2mps11: call shutdown function to
poweroff
Added .shutdown function to s2mps11 to help poweroff the board successfully.
The device driver clears the register to turn off the PMIC.
s2mps11-pmic: S2MPS11_REG_CTRL1 reg value 16:00000000000000000000000000010000
Console log.
* Unmounting temporary filesystems... [ OK ]
* Deactivating swap... [ OK ]
* Unmounting local filesystems... [ OK ]
* Will now halt
[ 209.020280] reboot: Power down
[ 209.122039] Power down failed, please power off system manually.
Change-Id: If6ea0dec154b00ceeaaddbac393c67dc35c26279
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: memeka <mihailescu2m@gmail.com>
Signed-off-by: Marian Mihailescu <mihailescu2m@gmail.com>
---
drivers/regulator/s2mps11.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 23d288278957..b3ee46955986 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -1243,6 +1243,31 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
return ret;
}
+static void s2mps11_pmic_shutdown(struct platform_device *pdev)
+{
+ struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
+ unsigned int reg_val, ret;
+
+ ret = regmap_read(iodev->regmap_pmic, S2MPS11_REG_CTRL1, &reg_val);
+ if (ret < 0) {
+ dev_crit(&pdev->dev, "could not read S2MPS11_REG_CTRL1 value\n");
+ } else {
+ /*
+ * s2mps11-pmic: S2MPS11_REG_CTRL1 reg value
+ * is 00000000000000000000000000010000
+ * clear the S2MPS11_REG_CTRL1 0x10 value to shutdown.
+ */
+ if (reg_val & BIT(4)) {
+ ret = regmap_update_bits(iodev->regmap_pmic,
+ S2MPS11_REG_CTRL1,
+ BIT(4), BIT(0));
+ if (ret)
+ dev_crit(&pdev->dev,
+ "could not write S2MPS11_REG_CTRL1 value\n");
+ }
+ }
+}
+
static const struct platform_device_id s2mps11_pmic_id[] = {
{ "s2mps11-regulator", S2MPS11X},
{ "s2mps13-regulator", S2MPS13X},
@@ -1258,6 +1283,7 @@ static struct platform_driver s2mps11_pmic_driver = {
.name = "s2mps11-pmic",
},
.probe = s2mps11_pmic_probe,
+ .shutdown = s2mps11_pmic_shutdown,
.id_table = s2mps11_pmic_id,
};
--
2.17.1

View File

@ -0,0 +1,130 @@
From 2c09438adc3a54b9fde10467e8d6ac440b416857 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 20 Aug 2022 02:24:33 +0000
Subject: [PATCH 20/21] FROMLIST(v3): tools bpftool: Fix compilation error with
new binutils
binutils changed the signature of init_disassemble_info(), which now causes
compilation to fail for tools/bpf/bpftool/jit_disasm.c, e.g. on debian
unstable. Relevant binutils commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60a3da00bd5407f07
Wire up the feature test and switch to init_disassemble_info_compat(),
which were introduced in prior commits, fixing the compilation failure.
I verified that bpftool can still disassemble bpf programs, both with an
old and new dis-asm.h API. There are no output changes for plain and json
formats. When comparing the output from old binutils (2.35)
to new bintuils with the patch (upstream snapshot) there are a few output
differences, but they are unrelated to this patch. An example hunk is:
2f: pop %r14
31: pop %r13
33: pop %rbx
- 34: leaveq
- 35: retq
+ 34: leave
+ 35: ret
Signed-off-by: Andres Freund <andres@anarazel.de>
---
tools/bpf/bpftool/Makefile | 3 +++
tools/bpf/bpftool/jit_disasm.c | 42 +++++++++++++++++++++++++++-------
2 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index a92fb4d312ec..3e1a629b07f4 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -117,6 +117,9 @@ endif
ifeq ($(feature-disassembler-four-args), 1)
CFLAGS += -DDISASM_FOUR_ARGS_SIGNATURE
endif
+ifeq ($(feature-disassembler-init-styled), 1)
+ CFLAGS += -DDISASM_INIT_STYLED
+endif
LIBS = $(LIBBPF) -lelf -lz
LIBS_BOOTSTRAP = $(LIBBPF_BOOTSTRAP) -lelf -lz
diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
index 24734f2249d6..aaf99a0168c9 100644
--- a/tools/bpf/bpftool/jit_disasm.c
+++ b/tools/bpf/bpftool/jit_disasm.c
@@ -24,6 +24,7 @@
#include <sys/stat.h>
#include <limits.h>
#include <bpf/libbpf.h>
+#include <tools/dis-asm-compat.h>
#include "json_writer.h"
#include "main.h"
@@ -39,15 +40,12 @@ static void get_exec_path(char *tpath, size_t size)
}
static int oper_count;
-static int fprintf_json(void *out, const char *fmt, ...)
+static int printf_json(void *out, const char *fmt, va_list ap)
{
- va_list ap;
char *s;
int err;
- va_start(ap, fmt);
err = vasprintf(&s, fmt, ap);
- va_end(ap);
if (err < 0)
return -1;
@@ -73,6 +71,32 @@ static int fprintf_json(void *out, const char *fmt, ...)
return 0;
}
+static int fprintf_json(void *out, const char *fmt, ...)
+{
+ va_list ap;
+ int r;
+
+ va_start(ap, fmt);
+ r = printf_json(out, fmt, ap);
+ va_end(ap);
+
+ return r;
+}
+
+static int fprintf_json_styled(void *out,
+ enum disassembler_style style __maybe_unused,
+ const char *fmt, ...)
+{
+ va_list ap;
+ int r;
+
+ va_start(ap, fmt);
+ r = printf_json(out, fmt, ap);
+ va_end(ap);
+
+ return r;
+}
+
void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
const char *arch, const char *disassembler_options,
const struct btf *btf,
@@ -99,11 +123,13 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes,
assert(bfd_check_format(bfdf, bfd_object));
if (json_output)
- init_disassemble_info(&info, stdout,
- (fprintf_ftype) fprintf_json);
+ init_disassemble_info_compat(&info, stdout,
+ (fprintf_ftype) fprintf_json,
+ fprintf_json_styled);
else
- init_disassemble_info(&info, stdout,
- (fprintf_ftype) fprintf);
+ init_disassemble_info_compat(&info, stdout,
+ (fprintf_ftype) fprintf,
+ fprintf_styled);
/* Update architecture info for offload. */
if (arch) {
--
2.17.1

View File

@ -1,92 +0,0 @@
From 92384233014a73d60dcde47a0a73e090258c071a Mon Sep 17 00:00:00 2001
From: memeka <mihailescu2m@gmail.com>
Date: Fri, 18 Jan 2019 14:36:21 +1030
Subject: [PATCH 20/25] MEMEKA: regulator: s2mps11: add ethernet power reset in
shutdown function
Ethernet device cannot be detected on warm boot sometimes. This patch is
to add the power reset routines for ethernet device using PMIC. Then
ethernet device can be reset hardware-wise.
Change-Id: Iffbe2966da7e4679f63b91ab79241167391792df
Signed-off-by: Brian Kim <brian.kim@hardkernel.com>
Signed-off-by: Marian Mihailescu <mihailescu2m@gmail.com>
---
drivers/regulator/s2mps11.c | 54 +++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index b3ee46955986..5c4d4827a173 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -1117,6 +1117,57 @@ static const struct regulator_desc s2mpu02_regulators[] = {
regulator_desc_s2mpu02_buck7(7),
};
+static int s2mps11_pmic_ethonoff(struct platform_device *pdev, bool onoff)
+{
+ struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
+ unsigned int reg_val = 0;
+ int ret = 0;
+
+ ret = regmap_read(iodev->regmap_pmic, S2MPS11_REG_L15CTRL, &reg_val);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to read S2MPS11_REG_L15CTRL value\n");
+ return ret;
+ }
+
+ ret = regmap_read(iodev->regmap_pmic, S2MPS11_REG_L17CTRL, &reg_val);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to read S2MPS11_REG_L17CTRL value\n");
+ return ret;
+ }
+
+ if (onoff) {
+ /* ETH VDD0 ON */
+ ret = regmap_update_bits(iodev->regmap_pmic, S2MPS11_REG_L15CTRL, 0xFF, 0x72);
+ if (ret) {
+ dev_err(&pdev->dev, "cannot update S2MPS11 LDO CTRL15 register\n");
+ return ret;
+ }
+
+ /* ETH VDD1 ON */
+ ret = regmap_update_bits(iodev->regmap_pmic, S2MPS11_REG_L17CTRL, 0xFF, 0x72);
+ if (ret) {
+ dev_err(&pdev->dev, "cannot update S2MPS11 LDO CTRL17 register\n");
+ return ret;
+ }
+ } else {
+ /* ETH VDD0 OFF */
+ ret = regmap_update_bits(iodev->regmap_pmic, S2MPS11_REG_L15CTRL, 0x3F, 0x00);
+ if (ret) {
+ dev_err(&pdev->dev, "cannot update S2MPS11 LDO CTRL15 register\n");
+ return ret;
+ }
+
+ /* ETH VDD1 OFF */
+ ret = regmap_update_bits(iodev->regmap_pmic, S2MPS11_REG_L17CTRL, 0x3F, 0x00);
+ if (ret) {
+ dev_err(&pdev->dev, "cannot update S2MPS11 LDO CTRL17 register\n");
+ return ret;
+ }
+ }
+
+ return ret;
+}
+
static int s2mps11_pmic_probe(struct platform_device *pdev)
{
struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
@@ -1266,6 +1317,9 @@ static void s2mps11_pmic_shutdown(struct platform_device *pdev)
"could not write S2MPS11_REG_CTRL1 value\n");
}
}
+ s2mps11_pmic_ethonoff(pdev, false);
+ mdelay(10);
+ s2mps11_pmic_ethonoff(pdev, true);
}
static const struct platform_device_id s2mps11_pmic_id[] = {
--
2.17.1

View File

@ -0,0 +1,30 @@
From 56ff935d8bc173ce567cecdc8ed9ff98026826e0 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 20 Aug 2022 02:28:27 +0000
Subject: [PATCH 21/21] FROMLIST(v3): tools bpftool: Don't display
disassembler-four-args feature test
The feature check does not seem important enough to display.
Signed-off-by: Andres Freund <andres@anarazel.de>
---
tools/bpf/bpftool/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 3e1a629b07f4..d405ce4e0348 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -95,8 +95,7 @@ RM ?= rm -f
FEATURE_USER = .bpftool
FEATURE_TESTS = libbfd disassembler-four-args zlib libcap \
clang-bpf-co-re
-FEATURE_DISPLAY = libbfd zlib libcap \
- clang-bpf-co-re
+FEATURE_DISPLAY = libbfd zlib libcap clang-bpf-co-re
check_feat := 1
NON_CHECK_FEAT_TARGETS := clean uninstall doc doc-clean doc-install doc-uninstall
--
2.17.1

View File

@ -1,31 +0,0 @@
From c7f3cddf852d75a07df26f0997fc07b38f55d54d Mon Sep 17 00:00:00 2001
From: Brian Kim <brian.kim@hardkernel.com>
Date: Tue, 21 Nov 2017 18:44:03 +0900
Subject: [PATCH 22/25] MEMEKA: ODROID-XU4: arm: Set the system revision
information
wiringPi library refers to this information in '/proc/cpuinfo' file.
Signed-off-by: Yang Deokgyu <secugyu@gmail.com>
Change-Id: I4a3368499cecf862eddb1430c6b436283f62d2c7
Signed-off-by: Marian Mihailescu <mihailescu2m@gmail.com>
---
arch/arm/kernel/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index d8e18cdd96d3..e302d6579c2a 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -90,7 +90,7 @@ EXPORT_SYMBOL(cacheid);
unsigned int __atags_pointer __initdata;
-unsigned int system_rev;
+unsigned int system_rev = 0x0100;
EXPORT_SYMBOL(system_rev);
const char *system_serial;
--
2.17.1

View File

@ -1,25 +0,0 @@
From d91b8b8c7d58e6a26eaddf3014239f79f5fe869b Mon Sep 17 00:00:00 2001
From: MastaG <mastag@gmail.com>
Date: Tue, 17 Dec 2019 09:33:19 +0100
Subject: [PATCH 23/25] MEMEKA: fix ODROID-XU3 headphone-jack volume
---
sound/soc/codecs/max98090.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 032adc14562d..6448a4186618 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -651,7 +651,7 @@ static const struct snd_kcontrol_new max98090_snd_controls[] = {
SOC_DOUBLE_R_TLV("Headphone Volume", M98090_REG_LEFT_HP_VOLUME,
M98090_REG_RIGHT_HP_VOLUME, M98090_HPVOLL_SHIFT,
- M98090_HPVOLL_NUM - 1, 0, max98090_hp_tlv),
+ M98090_HPVOLL_NUM - 1 + 24, 0, max98090_hp_tlv),
SOC_DOUBLE_R_RANGE_TLV("Speaker Volume",
M98090_REG_LEFT_SPK_VOLUME, M98090_REG_RIGHT_SPK_VOLUME,
--
2.17.1