linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.4 001/350] drm/vc4/vc4_hdmi: fill in connector info
@ 2019-12-10 20:58 Sasha Levin
  2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 002/350] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper Sasha Levin
                   ` (38 more replies)
  0 siblings, 39 replies; 45+ messages in thread
From: Sasha Levin @ 2019-12-10 20:58 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Dariusz Marcinkiewicz, Hans Verkuil, Eric Anholt, Sasha Levin, dri-devel

From: Dariusz Marcinkiewicz <darekm@google.com>

[ Upstream commit 66c2dee4ae10a2d841c40b9dd9c7141eb23eee76 ]

Fill in the connector info, allowing userspace to associate
the CEC device with the drm connector.

Tested on a Raspberry Pi 3B.

Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190823112427.42394-2-hverkuil-cisco@xs4all.nl
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index ee7d4e7b0ee33..0853b980bcb31 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -1285,6 +1285,9 @@ static const struct cec_adap_ops vc4_hdmi_cec_adap_ops = {
 
 static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
 {
+#ifdef CONFIG_DRM_VC4_HDMI_CEC
+	struct cec_connector_info conn_info;
+#endif
 	struct platform_device *pdev = to_platform_device(dev);
 	struct drm_device *drm = dev_get_drvdata(master);
 	struct vc4_dev *vc4 = drm->dev_private;
@@ -1403,13 +1406,15 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
 #ifdef CONFIG_DRM_VC4_HDMI_CEC
 	hdmi->cec_adap = cec_allocate_adapter(&vc4_hdmi_cec_adap_ops,
 					      vc4, "vc4",
-					      CEC_CAP_TRANSMIT |
-					      CEC_CAP_LOG_ADDRS |
-					      CEC_CAP_PASSTHROUGH |
-					      CEC_CAP_RC, 1);
+					      CEC_CAP_DEFAULTS |
+					      CEC_CAP_CONNECTOR_INFO, 1);
 	ret = PTR_ERR_OR_ZERO(hdmi->cec_adap);
 	if (ret < 0)
 		goto err_destroy_conn;
+
+	cec_fill_conn_info_from_drm(&conn_info, hdmi->connector);
+	cec_s_conn_info(hdmi->cec_adap, &conn_info);
+
 	HDMI_WRITE(VC4_HDMI_CPU_MASK_SET, 0xffffffff);
 	value = HDMI_READ(VC4_HDMI_CEC_CNTRL_1);
 	value &= ~VC4_HDMI_CEC_DIV_CLK_CNT_MASK;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 45+ messages in thread
* [PATCH AUTOSEL 5.4 040/350] media: ov6650: Fix control handler not freed on init error
@ 2019-12-10 21:02 Sasha Levin
  0 siblings, 0 replies; 45+ messages in thread
From: Sasha Levin @ 2019-12-10 21:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Janusz Krzysztofik, Sakari Ailus, Mauro Carvalho Chehab,
	Sasha Levin, linux-media

From: Janusz Krzysztofik <jmkrzyszt@gmail.com>

[ Upstream commit c404af950d14b71bfbf574a752b6c29d726baaba ]

Since commit afd9690c72c3 ("[media] ov6650: convert to the control
framework"), if an error occurs during initialization of a control
handler, resources possibly allocated to the handler are not freed
before device initialiaton is aborted.  Fix it.

Fixes: afd9690c72c3 ("[media] ov6650: convert to the control framework")
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/i2c/ov6650.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/ov6650.c b/drivers/media/i2c/ov6650.c
index 5b9af5e5b7f13..68776b0710f98 100644
--- a/drivers/media/i2c/ov6650.c
+++ b/drivers/media/i2c/ov6650.c
@@ -989,8 +989,10 @@ static int ov6650_probe(struct i2c_client *client,
 			V4L2_CID_GAMMA, 0, 0xff, 1, 0x12);
 
 	priv->subdev.ctrl_handler = &priv->hdl;
-	if (priv->hdl.error)
-		return priv->hdl.error;
+	if (priv->hdl.error) {
+		ret = priv->hdl.error;
+		goto ectlhdlfree;
+	}
 
 	v4l2_ctrl_auto_cluster(2, &priv->autogain, 0, true);
 	v4l2_ctrl_auto_cluster(3, &priv->autowb, 0, true);
@@ -1008,8 +1010,10 @@ static int ov6650_probe(struct i2c_client *client,
 	priv->subdev.internal_ops = &ov6650_internal_ops;
 
 	ret = v4l2_async_register_subdev(&priv->subdev);
-	if (ret)
-		v4l2_ctrl_handler_free(&priv->hdl);
+	if (!ret)
+		return 0;
+ectlhdlfree:
+	v4l2_ctrl_handler_free(&priv->hdl);
 
 	return ret;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2019-12-19 15:27 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 20:58 [PATCH AUTOSEL 5.4 001/350] drm/vc4/vc4_hdmi: fill in connector info Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 002/350] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 003/350] drm: mst: Fix query_payload ack reply struct Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 004/350] drm/mipi-dbi: fix a loop in debugfs code Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 005/350] drm/panel: Add missing drm_panel_init() in panel drivers Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 006/350] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 007/350] drm: Use EOPNOTSUPP, not ENOTSUPP Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 008/350] drm/amd/display: verify stream link before link test Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 009/350] drm/bridge: analogix-anx78xx: silence -EPROBE_DEFER warnings Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 010/350] drm/amd/display: OTC underflow fix Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 011/350] iio: max31856: add missing of_node and parent references to iio_dev Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 012/350] iio: light: bh1750: Resolve compiler warning and make code more readable Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 013/350] drm/amdgpu/sriov: add ring_stop before ring_create in psp v11 code Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 014/350] drm/amdgpu: grab the id mgr lock while accessing passid_mapping Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 015/350] drm/ttm: return -EBUSY on pipelining with no_gpu_wait (v2) Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 016/350] drm/amd/display: Rebuild mapped resources after pipe split Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 017/350] ath10k: add cleanup in ath10k_sta_state() Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 018/350] drm/amd/display: Handle virtual signal type in disable_link() Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 019/350] iio: tcs3414: fix iio_triggered_buffer_{pre,post}enable positions Sasha Levin
2019-12-15 15:52   ` Jonathan Cameron
2019-12-19 15:22     ` Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 020/350] ath10k: Check if station exists before forwarding tx airtime report Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 021/350] spi: Add call to spi_slave_abort() function when spidev driver is released Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 022/350] drm/meson: vclk: use the correct G12A frac max value Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 023/350] staging: rtl8192u: fix multiple memory leaks on error path Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 024/350] staging: rtl8188eu: fix possible null dereference Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 025/350] objtool: add kunit_try_catch_throw to the noreturn list Sasha Levin
2019-12-10 21:25   ` Brendan Higgins
2019-12-19 15:27     ` Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 026/350] rtlwifi: prevent memory leak in rtl_usb_probe Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 027/350] libertas: fix a potential NULL pointer dereference Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 028/350] Revert "pinctrl: sh-pfc: r8a77990: Fix MOD_SEL1 bit30 when using SSI_SCK2 and SSI_WS2" Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 029/350] Revert "pinctrl: sh-pfc: r8a77990: Fix MOD_SEL1 bit31 when using SIM0_D" Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 030/350] ath10k: fix backtrace on coredump Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 031/350] IB/iser: bound protection_sg size by data_sg size Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 032/350] drm/komeda: Workaround for broken FLIP_COMPLETE timestamps Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 033/350] spi: gpio: prevent memory leak in spi_gpio_probe Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 034/350] media: am437x-vpfe: Setting STD to current value is not an error Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 035/350] media: cedrus: fill in bus_info for media device Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 036/350] media: seco-cec: Add a missing 'release_region()' in an error handling path Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 037/350] media: vim2m: Fix abort issue Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 038/350] media: vim2m: Fix BUG_ON in vim2m_device_release() Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 039/350] media: max2175: Fix build error without CONFIG_REGMAP_I2C Sasha Levin
2019-12-10 20:58 ` [PATCH AUTOSEL 5.4 040/350] media: ov6650: Fix control handler not freed on init error Sasha Levin
2019-12-10 21:02 Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).