The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 87889f1b7ea40d2544b49c62092e6ef2792dced7
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112428-destitute-spindle-71c6@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
87889f1b7ea4 ("media: qcom: camss: Fix csid-gen2 for test pattern generator")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 87889f1b7ea40d2544b49c62092e6ef2792dced7 Mon Sep 17 00:00:00 2001
From: Andrey Konovalov <andrey.konovalov(a)linaro.org>
Date: Wed, 30 Aug 2023 16:16:15 +0100
Subject: [PATCH] media: qcom: camss: Fix csid-gen2 for test pattern generator
In the current driver csid Test Pattern Generator (TPG) doesn't work.
This change:
- fixes writing frame width and height values into CSID_TPG_DT_n_CFG_0
- fixes the shift by one between test_pattern control value and the
actual pattern.
- drops fixed VC of 0x0a which testing showed prohibited some test
patterns in the CSID to produce output.
So that TPG starts working, but with the below limitations:
- only test_pattern=9 works as it should
- test_pattern=8 and test_pattern=7 produce black frame (all zeroes)
- the rest of test_pattern's don't work (yavta doesn't get the data)
- regardless of the CFA pattern set by 'media-ctl -V' the actual pixel
order is always the same (RGGB for any RAW8 or RAW10P format in
4608x2592 resolution).
Tested with:
RAW10P format, VC0:
media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4608x2592 field:none]'
media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4608x2592 field:none]'
media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
v4l2-ctl -d /dev/v4l-subdev6 -c test_pattern=9
yavta -B capture-mplane --capture=3 -n 3 -f SRGGB10P -s 4608x2592 /dev/video0
RAW10P format, VC1:
media-ctl -V '"msm_csid0":2[fmt:SRGGB10/4608x2592 field:none]'
media-ctl -V '"msm_vfe0_rdi1":0[fmt:SRGGB10/4608x2592 field:none]'
media-ctl -l '"msm_csid0":2->"msm_vfe0_rdi1":0[1]'
v4l2-ctl -d /dev/v4l-subdev6 -c test_pattern=9
yavta -B capture-mplane --capture=3 -n 3 -f SRGGB10P -s 4608x2592 /dev/video1
RAW8 format, VC0:
media-ctl --reset
media-ctl -V '"msm_csid0":0[fmt:SRGGB8/4608x2592 field:none]'
media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB8/4608x2592 field:none]'
media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
yavta -B capture-mplane --capture=3 -n 3 -f SRGGB8 -s 4608x2592 /dev/video0
Fixes: eebe6d00e9bf ("media: camss: Add support for CSID hardware version Titan 170")
Cc: stable(a)vger.kernel.org
Signed-off-by: Andrey Konovalov <andrey.konovalov(a)linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue(a)linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen2.c b/drivers/media/platform/qcom/camss/camss-csid-gen2.c
index efc68f8b4de9..23acc387be5f 100644
--- a/drivers/media/platform/qcom/camss/camss-csid-gen2.c
+++ b/drivers/media/platform/qcom/camss/camss-csid-gen2.c
@@ -355,9 +355,6 @@ static void __csid_configure_stream(struct csid_device *csid, u8 enable, u8 vc)
u8 dt_id = vc;
if (tg->enabled) {
- /* Config Test Generator */
- vc = 0xa;
-
/* configure one DT, infinite frames */
val = vc << TPG_VC_CFG0_VC_NUM;
val |= INTELEAVING_MODE_ONE_SHOT << TPG_VC_CFG0_LINE_INTERLEAVING_MODE;
@@ -370,14 +367,14 @@ static void __csid_configure_stream(struct csid_device *csid, u8 enable, u8 vc)
writel_relaxed(0x12345678, csid->base + CSID_TPG_LFSR_SEED);
- val = input_format->height & 0x1fff << TPG_DT_n_CFG_0_FRAME_HEIGHT;
- val |= input_format->width & 0x1fff << TPG_DT_n_CFG_0_FRAME_WIDTH;
+ val = (input_format->height & 0x1fff) << TPG_DT_n_CFG_0_FRAME_HEIGHT;
+ val |= (input_format->width & 0x1fff) << TPG_DT_n_CFG_0_FRAME_WIDTH;
writel_relaxed(val, csid->base + CSID_TPG_DT_n_CFG_0(0));
val = format->data_type << TPG_DT_n_CFG_1_DATA_TYPE;
writel_relaxed(val, csid->base + CSID_TPG_DT_n_CFG_1(0));
- val = tg->mode << TPG_DT_n_CFG_2_PAYLOAD_MODE;
+ val = (tg->mode - 1) << TPG_DT_n_CFG_2_PAYLOAD_MODE;
val |= 0xBE << TPG_DT_n_CFG_2_USER_SPECIFIED_PAYLOAD;
val |= format->decode_format << TPG_DT_n_CFG_2_ENCODE_FORMAT;
writel_relaxed(val, csid->base + CSID_TPG_DT_n_CFG_2(0));
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x e655d1ae9703286cef7fda8675cad62f649dc183
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112422-jolly-girdle-8a7c@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
e655d1ae9703 ("media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From e655d1ae9703286cef7fda8675cad62f649dc183 Mon Sep 17 00:00:00 2001
From: Bryan O'Donoghue <bryan.odonoghue(a)linaro.org>
Date: Wed, 30 Aug 2023 16:16:14 +0100
Subject: [PATCH] media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is
greater than 3
VC_MODE = 0 implies a two bit VC address.
VC_MODE = 1 is required for VCs with a larger address than two bits.
Fixes: eebe6d00e9bf ("media: camss: Add support for CSID hardware version Titan 170")
Cc: stable(a)vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue(a)linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen2.c b/drivers/media/platform/qcom/camss/camss-csid-gen2.c
index 0f8ac29d038d..efc68f8b4de9 100644
--- a/drivers/media/platform/qcom/camss/camss-csid-gen2.c
+++ b/drivers/media/platform/qcom/camss/camss-csid-gen2.c
@@ -449,6 +449,8 @@ static void __csid_configure_stream(struct csid_device *csid, u8 enable, u8 vc)
writel_relaxed(val, csid->base + CSID_CSI2_RX_CFG0);
val = 1 << CSI2_RX_CFG1_PACKET_ECC_CORRECTION_EN;
+ if (vc > 3)
+ val |= 1 << CSI2_RX_CFG1_VC_MODE;
val |= 1 << CSI2_RX_CFG1_MISR_EN;
writel_relaxed(val, csid->base + CSID_CSI2_RX_CFG1);
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.14.y
git checkout FETCH_HEAD
git cherry-pick -x 868c3b95afef4883bfb66c9397482da6840b5baf
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112430-trowel-thee-5ced@gregkh' --subject-prefix 'PATCH 4.14.y' HEAD^..
Possible dependencies:
868c3b95afef ("r8169: fix network lost after resume on DASH systems")
f658b90977d2 ("r8169: fix DMA being used after buffer free if WoL is enabled")
7257c977c811 ("r8169: clean up rtl_pll_power_down/up functions")
128735a1530e ("r8169: improve handling D3 PLL power-down")
9224d97183d9 ("r8169: enable PLL power-down for chip versions 34, 35, 36, 42")
acb58657c869 ("r8169: improve RTL8168g PHY suspend quirk")
e80bd76fbf56 ("r8169: work around power-saving bug on some chip versions")
bb13a800620c ("r8169: fix handling ether_clk")
0439297be951 ("r8169: add support for RTL8125B")
4640338c36af ("r8169: rename RTL8125 to RTL8125A")
288302dab34e ("r8169: improve rtl8169_runtime_resume")
06a14ab852fb ("r8169: remove driver-specific mutex")
abe5fc42f9ce ("r8169: use RTNL to protect critical sections")
567ca57faa62 ("r8169: add rtl8169_up")
ec2f204bddb5 ("r8169: remove no longer needed checks for device being runtime-active")
476c4f5de368 ("r8169: mark device as not present when in PCI D3")
9f0b54cd1672 ("r8169: move switching optional clock on/off to pll power functions")
a2ee847242b3 ("r8169: move updating counters to rtl8169_down")
0c28a63a47bf ("r8169: move napi_disable call and rename rtl8169_hw_reset")
e9882208ae98 ("r8169: improve setting WoL on runtime-resume")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 868c3b95afef4883bfb66c9397482da6840b5baf Mon Sep 17 00:00:00 2001
From: ChunHao Lin <hau(a)realtek.com>
Date: Fri, 10 Nov 2023 01:34:00 +0800
Subject: [PATCH] r8169: fix network lost after resume on DASH systems
Device that support DASH may be reseted or powered off during suspend.
So driver needs to handle DASH during system suspend and resume. Or
DASH firmware will influence device behavior and causes network lost.
Fixes: b646d90053f8 ("r8169: magic.")
Cc: stable(a)vger.kernel.org
Reviewed-by: Heiner Kallweit <hkallweit1(a)gmail.com>
Signed-off-by: ChunHao Lin <hau(a)realtek.com>
Link: https://lore.kernel.org/r/20231109173400.4573-3-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index cfcb40d90920..b9bb1d2f0237 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4661,10 +4661,16 @@ static void rtl8169_down(struct rtl8169_private *tp)
rtl8169_cleanup(tp);
rtl_disable_exit_l1(tp);
rtl_prepare_power_down(tp);
+
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_stop(tp);
}
static void rtl8169_up(struct rtl8169_private *tp)
{
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_start(tp);
+
pci_set_master(tp->pci_dev);
phy_init_hw(tp->phydev);
phy_resume(tp->phydev);
The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x 868c3b95afef4883bfb66c9397482da6840b5baf
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112429-echo-designer-9fef@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..
Possible dependencies:
868c3b95afef ("r8169: fix network lost after resume on DASH systems")
f658b90977d2 ("r8169: fix DMA being used after buffer free if WoL is enabled")
7257c977c811 ("r8169: clean up rtl_pll_power_down/up functions")
128735a1530e ("r8169: improve handling D3 PLL power-down")
9224d97183d9 ("r8169: enable PLL power-down for chip versions 34, 35, 36, 42")
acb58657c869 ("r8169: improve RTL8168g PHY suspend quirk")
e80bd76fbf56 ("r8169: work around power-saving bug on some chip versions")
bb13a800620c ("r8169: fix handling ether_clk")
0439297be951 ("r8169: add support for RTL8125B")
4640338c36af ("r8169: rename RTL8125 to RTL8125A")
288302dab34e ("r8169: improve rtl8169_runtime_resume")
06a14ab852fb ("r8169: remove driver-specific mutex")
abe5fc42f9ce ("r8169: use RTNL to protect critical sections")
567ca57faa62 ("r8169: add rtl8169_up")
ec2f204bddb5 ("r8169: remove no longer needed checks for device being runtime-active")
476c4f5de368 ("r8169: mark device as not present when in PCI D3")
9f0b54cd1672 ("r8169: move switching optional clock on/off to pll power functions")
a2ee847242b3 ("r8169: move updating counters to rtl8169_down")
0c28a63a47bf ("r8169: move napi_disable call and rename rtl8169_hw_reset")
e9882208ae98 ("r8169: improve setting WoL on runtime-resume")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 868c3b95afef4883bfb66c9397482da6840b5baf Mon Sep 17 00:00:00 2001
From: ChunHao Lin <hau(a)realtek.com>
Date: Fri, 10 Nov 2023 01:34:00 +0800
Subject: [PATCH] r8169: fix network lost after resume on DASH systems
Device that support DASH may be reseted or powered off during suspend.
So driver needs to handle DASH during system suspend and resume. Or
DASH firmware will influence device behavior and causes network lost.
Fixes: b646d90053f8 ("r8169: magic.")
Cc: stable(a)vger.kernel.org
Reviewed-by: Heiner Kallweit <hkallweit1(a)gmail.com>
Signed-off-by: ChunHao Lin <hau(a)realtek.com>
Link: https://lore.kernel.org/r/20231109173400.4573-3-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index cfcb40d90920..b9bb1d2f0237 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4661,10 +4661,16 @@ static void rtl8169_down(struct rtl8169_private *tp)
rtl8169_cleanup(tp);
rtl_disable_exit_l1(tp);
rtl_prepare_power_down(tp);
+
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_stop(tp);
}
static void rtl8169_up(struct rtl8169_private *tp)
{
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_start(tp);
+
pci_set_master(tp->pci_dev);
phy_init_hw(tp->phydev);
phy_resume(tp->phydev);
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y
git checkout FETCH_HEAD
git cherry-pick -x 868c3b95afef4883bfb66c9397482da6840b5baf
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2023112428-seclusion-running-5a62@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^..
Possible dependencies:
868c3b95afef ("r8169: fix network lost after resume on DASH systems")
f658b90977d2 ("r8169: fix DMA being used after buffer free if WoL is enabled")
7257c977c811 ("r8169: clean up rtl_pll_power_down/up functions")
128735a1530e ("r8169: improve handling D3 PLL power-down")
9224d97183d9 ("r8169: enable PLL power-down for chip versions 34, 35, 36, 42")
acb58657c869 ("r8169: improve RTL8168g PHY suspend quirk")
e80bd76fbf56 ("r8169: work around power-saving bug on some chip versions")
bb13a800620c ("r8169: fix handling ether_clk")
0439297be951 ("r8169: add support for RTL8125B")
4640338c36af ("r8169: rename RTL8125 to RTL8125A")
288302dab34e ("r8169: improve rtl8169_runtime_resume")
06a14ab852fb ("r8169: remove driver-specific mutex")
abe5fc42f9ce ("r8169: use RTNL to protect critical sections")
567ca57faa62 ("r8169: add rtl8169_up")
ec2f204bddb5 ("r8169: remove no longer needed checks for device being runtime-active")
476c4f5de368 ("r8169: mark device as not present when in PCI D3")
9f0b54cd1672 ("r8169: move switching optional clock on/off to pll power functions")
a2ee847242b3 ("r8169: move updating counters to rtl8169_down")
0c28a63a47bf ("r8169: move napi_disable call and rename rtl8169_hw_reset")
e9882208ae98 ("r8169: improve setting WoL on runtime-resume")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 868c3b95afef4883bfb66c9397482da6840b5baf Mon Sep 17 00:00:00 2001
From: ChunHao Lin <hau(a)realtek.com>
Date: Fri, 10 Nov 2023 01:34:00 +0800
Subject: [PATCH] r8169: fix network lost after resume on DASH systems
Device that support DASH may be reseted or powered off during suspend.
So driver needs to handle DASH during system suspend and resume. Or
DASH firmware will influence device behavior and causes network lost.
Fixes: b646d90053f8 ("r8169: magic.")
Cc: stable(a)vger.kernel.org
Reviewed-by: Heiner Kallweit <hkallweit1(a)gmail.com>
Signed-off-by: ChunHao Lin <hau(a)realtek.com>
Link: https://lore.kernel.org/r/20231109173400.4573-3-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index cfcb40d90920..b9bb1d2f0237 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4661,10 +4661,16 @@ static void rtl8169_down(struct rtl8169_private *tp)
rtl8169_cleanup(tp);
rtl_disable_exit_l1(tp);
rtl_prepare_power_down(tp);
+
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_stop(tp);
}
static void rtl8169_up(struct rtl8169_private *tp)
{
+ if (tp->dash_type != RTL_DASH_NONE)
+ rtl8168_driver_start(tp);
+
pci_set_master(tp->pci_dev);
phy_init_hw(tp->phydev);
phy_resume(tp->phydev);