[PATCH v2] drm/bridge: adv7511: fix crash on irq during probe

2024-02-19 Thread Alvin Šipraga
/0xa0 irq_thread+0x14c/0x238 kthread+0x190/0x1a8 Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") Signed-off-by: Mads Bligaard Nielsen Signed-off-by: Alvin Šipraga --- Changes in v2: - rebase on latest drm-misc-fixes - no other changes - RESEND - Link to

[PATCH v3 1/2] drm/bridge: adv7511: rearrange hotplug work code

2024-02-19 Thread Alvin Šipraga
From: Alvin Šipraga In preparation for calling EDID helpers from the hotplug work, move the hotplug work below the EDID helper section. No functional change. Reviewed-by: Robert Foss Signed-off-by: Alvin Šipraga --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 120

[PATCH v3 2/2] drm/bridge: adv7511: get edid in hpd_work to update CEC phys address

2024-02-19 Thread Alvin Šipraga
From: Alvin Šipraga The adv7511 driver is solely responsible for setting the physical address of its CEC adapter. To do this, it must read the EDID. However, EDID is only read when either the drm_bridge_funcs :: get_edid or drm_connector_helper_funcs :: get_modes ops are called. Without loss of

[PATCH v3 0/2] drm/bridge: adv7511: get edid in hpd_work to update CEC phys address

2024-02-19 Thread Alvin Šipraga
This series fixes a small bug where the CEC adapter could have an invalid CEC address even though we got a hotplug connect and could have read it. Signed-off-by: Alvin Šipraga --- Changes in v3: - rebase on latest drm-misc-fixes - remove redundant NULL check before kfree() - collect Robert&#

[PATCH v2 0/2] drm/bridge: adv7511: get edid in hpd_work to update CEC phys address

2023-11-24 Thread Alvin Šipraga
This series fixes a small bug where the CEC adapter could have an invalid CEC address even though we got a hotplug connect and could have read it. Signed-off-by: Alvin Šipraga --- Changes in v2: - Rearrange driver code to avoid the previous prototype of adv7511_get_edid(), per Laurent&#

[PATCH v2 1/2] drm/bridge: adv7511: rearrange hotplug work code

2023-11-24 Thread Alvin Šipraga
From: Alvin Šipraga In preparation for calling EDID helpers from the hotplug work, move the hotplug work below the EDID helper section. No functional change. Signed-off-by: Alvin Šipraga --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 120 ++- 1 file changed, 62

[PATCH v2 2/2] drm/bridge: adv7511: get edid in hpd_work to update CEC phys address

2023-11-24 Thread Alvin Šipraga
From: Alvin Šipraga The adv7511 driver is solely responsible for setting the physical address of its CEC adapter. To do this, it must read the EDID. However, EDID is only read when either the drm_bridge_funcs :: get_edid or drm_connector_helper_funcs :: get_modes ops are called. Without loss of

Re: [PATCH] drm/bridge: adv7511: fix crash on irq during probe

2023-11-24 Thread Alvin Šipraga
Hi Laurent, This is a friendly ping to get your feedback on my reply below. I don't think the Fixes tag is incorrect here. Please could you take another look and let me know if I can resend with your Reviewed-by? Kind regards, Alvin On Mon, Oct 16, 2023 at 10:42:27AM +0200, Alvin Šipraga

Re: [PATCH] drm: bridge: adv7511: get edid in hpd_work to update CEC phys address

2023-10-25 Thread Alvin Šipraga
Hi Jani, On Mon, Oct 23, 2023 at 02:42:56PM +0300, Jani Nikula wrote: > On Sat, 14 Oct 2023, Alvin Šipraga wrote: > > @@ -457,6 +460,9 @@ static void adv7511_hpd_work(struct work_struct *work) > > if (adv7511->connector.dev) { > >

Re: [PATCH] drm: bridge: adv7511: get edid in hpd_work to update CEC phys address

2023-10-16 Thread Alvin Šipraga
Hi Laurent, On Mon, Oct 16, 2023 at 11:17:49AM +0300, Laurent Pinchart wrote: > Hi Alvin, > > Thank you for the patch. > > CC'ing Hans Verkuil, to review the CEC side. > > On Sat, Oct 14, 2023 at 09:43:01PM +0200, Alvin Šipraga wrote: > > From: Alvin Šipraga

Re: [PATCH] drm/bridge: adv7511: fix crash on irq during probe

2023-10-16 Thread Alvin Šipraga
Hi Laurent, Thanks for the quick review! On Mon, Oct 16, 2023 at 11:14:44AM +0300, Laurent Pinchart wrote: > Hello Alvin, > > On Sat, Oct 14, 2023 at 08:46:12PM +0200, Alvin Šipraga wrote: > > From: Mads Bligaard Nielsen > > > > Moved IRQ registration d

[PATCH] drm: bridge: adv7511: get edid in hpd_work to update CEC phys address

2023-10-15 Thread Alvin Šipraga
From: Alvin Šipraga The adv7511 driver is solely responsible for setting the physical address of its CEC adapter. To do this, it must read the EDID. However, EDID is only read when either the drm_bridge_funcs :: get_edid or drm_connector_helper_funcs :: get_modes ops are called. Without loss of

[PATCH] drm/bridge: adv7511: fix crash on irq during probe

2023-10-15 Thread Alvin Šipraga
/0xa0 irq_thread+0x14c/0x238 kthread+0x190/0x1a8 Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") Signed-off-by: Mads Bligaard Nielsen Signed-off-by: Alvin Šipraga --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 22 +++--- 1 file changed, 11

Re: [PATCH] drm: bridge: adv7511: get edid in hpd_work to update CEC phys address

2023-10-14 Thread Alvin Šipraga
On Sat, Oct 14, 2023 at 09:43:01PM +0200, Alvin Šipraga wrote: > From: Alvin Šipraga > > The adv7511 driver is solely responsible for setting the physical > address of its CEC adapter. To do this, it must read the EDID. However, > EDID is only read when either the drm_bridge_funcs

Re: [PATCH 0/2] drm: bridge: adv7511: CEC support for ADV7535

2022-08-30 Thread Alvin Šipraga
xt and send out the next version? > > On Sat, 19 Mar 2022 at 16:10, Alvin Šipraga wrote: > > > > From: Alvin Šipraga > > > > We have an ADV7535 which is nominally supported by this driver. These > > two patches fix up the driver to get CEC working too. > >

[PATCH RESEND 1/2] drm: bridge: adv7511: fix CEC power down control register offset

2022-06-13 Thread Alvin Šipraga
From: Alvin Šipraga The ADV7511_REG_CEC_CTRL = 0xE2 register is part of the main register map - not the CEC register map. As such, we shouldn't apply an offset to the register address. Doing so will cause us to address a bogus register for chips with a CEC register map offset (e.g. AD

[PATCH RESEND 0/2] drm: bridge: adv7511: two fixes for CEC

2022-06-13 Thread Alvin Šipraga
From: Alvin Šipraga Previously sent back in March, see here: https://lore.kernel.org/dri-devel/20220319145939.978087-1-al...@pqrs.dk/ No changes besides rebasing on today's drm-misc-fixes. Alvin Šipraga (2): drm: bridge: adv7511: fix CEC power down control register offset drm: b

[PATCH RESEND 2/2] drm: bridge: adv7511: unregister cec i2c device after cec adapter

2022-06-13 Thread Alvin Šipraga
From: Alvin Šipraga cec_unregister_adapter() assumes that the underlying adapter ops are callable. For example, if the CEC adapter currently has a valid physical address, then the unregistration procedure will invalidate the physical address by setting it to f.f.f.f. Whence the following kernel

Re: [PATCH] drm: bridge: adv7511: Move CEC definitions to adv7511_cec.c

2022-05-25 Thread Alvin Šipraga
x27; defined but not used [-Wunused-const-variable=] > > Reported-by: kernel test robot > Fixes: ab0af093bf90 ("drm: bridge: adv7511: use non-legacy mode for CEC RX") > Signed-off-by: Fabio Estevam > --- Thank you for fixing this. Reviewed-by: Alvin Šipraga > drivers/gpu/drm/br

[PATCH v2 1/2] drm: bridge: adv7511: enable CEC support for ADV7535

2022-04-24 Thread Alvin Šipraga
From: Alvin Šipraga Like the ADV7533, the ADV7535 has an offset for the CEC register map, and it is the same value (ADV7533_REG_CEC_OFFSET = 0x70). Rather than testing for numerous chip types in the offset calculations throughout the driver, just compute it during driver probe and put it in the

[PATCH v2 0/2] drm: bridge: adv7511: CEC support for ADV7535

2022-04-24 Thread Alvin Šipraga
From: Alvin Šipraga Changes: v1->v2: - add Robert's r-b - fix up 'case XXX...YYY+14' statements to read nicer in the 2nd patch We have an ADV7535 which is nominally supported by this driver. These two patches fix up the driver to get CEC working too. The first adds th

[PATCH v2 2/2] drm: bridge: adv7511: use non-legacy mode for CEC RX

2022-04-24 Thread Alvin Šipraga
From: Alvin Šipraga The ADV7511 family of bridges supports two modes for CEC RX: legacy and non-legacy mode. The only difference is whether the chip uses a single CEC RX buffer, or uses all three available RX buffers. Currently the adv7511 driver uses legacy mode. While debugging a stall in CEC

[RFC PATCH] drm: bridge: adv7511: get edid in hpd_work to update CEC phys address

2022-03-19 Thread Alvin Šipraga
From: Alvin Šipraga The adv7511 driver is solely responsible for setting the physical address of its CEC adapter. To do this, it must read the EDID. However, EDID is only read when either the drm_bridge_funcs :: get_edid or drm_connector_helper_funcs :: get_modes ops are called. Without loss of

[PATCH 0/2] drm: bridge: adv7511: CEC support for ADV7535

2022-03-19 Thread Alvin Šipraga
From: Alvin Šipraga We have an ADV7535 which is nominally supported by this driver. These two patches fix up the driver to get CEC working too. The first adds the basic support by correcting some register offsets. The second addresses an issue we saw with CEC RX on the ADV7535. It hasn't

[PATCH 1/2] drm: bridge: adv7511: enable CEC support for ADV7535

2022-03-19 Thread Alvin Šipraga
From: Alvin Šipraga Like the ADV7533, the ADV7535 has an offset for the CEC register map, and it is the same value (ADV7533_REG_CEC_OFFSET = 0x70). Rather than testing for numerous chip types in the offset calculations throughout the driver, just compute it during driver probe and put it in the

[PATCH 2/2] drm: bridge: adv7511: unregister cec i2c device after cec adapter

2022-03-19 Thread Alvin Šipraga
From: Alvin Šipraga cec_unregister_adapter() assumes that the underlying adapter ops are callable. For example, if the CEC adapter currently has a valid physical address, then the unregistration procedure will invalidate the physical address by setting it to f.f.f.f. Whence the following kernel

[PATCH 1/2] drm: bridge: adv7511: fix CEC power down control register offset

2022-03-19 Thread Alvin Šipraga
From: Alvin Šipraga The ADV7511_REG_CEC_CTRL = 0xE2 register is part of the main register map - not the CEC register map. As such, we shouldn't apply an offset to the register address. Doing so will cause us to address a bogus register for chips with a CEC register map offset (e.g. AD

[PATCH 0/2] drm: bridge: adv7511: two fixes for CEC

2022-03-19 Thread Alvin Šipraga
From: Alvin Šipraga The patches are sent against drm-misc-next. Thanks! Alvin Šipraga (2): drm: bridge: adv7511: fix CEC power down control register offset drm: bridge: adv7511: unregister cec i2c device after cec adapter drivers/gpu/drm/bridge/adv7511/adv7511.h | 5 + drivers/gpu

[PATCH 2/2] drm: bridge: adv7511: use non-legacy mode for CEC RX

2022-03-19 Thread Alvin Šipraga
From: Alvin Šipraga The ADV7511 family of bridges supports two modes for CEC RX: legacy and non-legacy mode. The only difference is whether the chip uses a single CEC RX buffer, or uses all three available RX buffers. Currently the adv7511 driver uses legacy mode. While debugging a stall in CEC

Re: [PATCH 0/2] drm: bridge: adv7511: two fixes for CEC

2022-03-19 Thread Alvin Šipraga
Alvin Šipraga writes: > From: Alvin Šipraga > > The patches are sent against drm-misc-next. Thanks! Whoops, I meant drm-misc-fixes, since these are fixes. :-) Separate patches aimed at drm-misc-next incoming. > > Alvin Šipraga (2): > drm: bridge: adv7511: fix CEC