RE: [PATCH 1/2] drm/amd/display: use pre-allocated temp structure for bounding box

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[Public]

> -----Original Message-----
> From: Arnd Bergmann <arnd@xxxxxxxx>
> Sent: Tuesday, June 4, 2024 3:43 PM
> To: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; amd-
> gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Zhang, George <George.Zhang@xxxxxxx>; Mahfooz, Hamza
> <Hamza.Mahfooz@xxxxxxx>; Wentland, Harry
> <Harry.Wentland@xxxxxxx>; Li, Sun peng (Leo) <Sunpeng.Li@xxxxxxx>;
> Siqueira, Rodrigo <Rodrigo.Siqueira@xxxxxxx>; Aberback, Joshua
> <Joshua.Aberback@xxxxxxx>
> Subject: Re: [PATCH 1/2] drm/amd/display: use pre-allocated temp structure
> for bounding box
>
> On Tue, Jun 4, 2024, at 20:06, Alex Deucher wrote:
> > This mirrors what the driver does for older DCN generations.
> >
> > Should fix:
> >
> > BUG: sleeping function called from invalid context at
> > include/linux/sched/mm.h:306
> > in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 449, name:
> > kworker/u64:8
> > preempt_count: 2, expected: 0
> > RCU nest depth: 0, expected: 0
> > Preemption disabled at:
> > ffffffffc0ce1580>] dc_fpu_begin+0x30/0xd0 [amdgpu]
> > CPU: 5 PID: 449 Comm: kworker/u64:8 Tainted: G        W          6.8.0+
> > #35
> > Hardware name: System manufacturer System Product Name/ROG STRIX
> > X570-E GAMING WIFI II, BIOS 4204 02/24/2022
> > Workqueue: events_unbound async_run_entry_fn
> >
> > Fixes: 88c61827cedc ("drm/amd/display: dynamically allocate
> > dml2_configuration_options structures")
> > Tested-by: George Zhang <George.zhang@xxxxxxx>
> > Suggested-by: Hamza Mahfooz <hamza.mahfooz@xxxxxxx>
> > Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
> > Cc: George Zhang <george.zhang@xxxxxxx>
> > Cc: Arnd Bergmann <arnd@xxxxxxxx>
> > Cc: harry.wentland@xxxxxxx
> > Cc: sunpeng.li@xxxxxxx
> > Cc: Rodrigo.Siqueira@xxxxxxx
>
> That looks nicer than all the other suggestions, thanks!
>
> Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
>
> One part sticks out though:
>
> > @@ -2027,7 +2025,7 @@ static void
> dcn32_update_bw_bounding_box(struct
> > dc *dc, struct clk_bw_params *bw
> >
> >     DC_FP_END();
> >
> > -   kfree(dml2_opt);
> > +   memcpy(&dc->dml2_options, dml2_opt, sizeof(dc->dml2_options));
> >  }
>
> The driver did not copy the data back before, so this is a change in behavior. Is
> that intentional or a mistake?

Yes, sorry, was on autopilot based on the patch Hamza had pointed me to.  Will drop in v2.

Thanks,

Alex

>
> If the intention is to have the data copied back into
> dc->dml2_options in the end, wouldn't it be easier to
> just pass a pointer as in the old version before commit
> e779f4587f61 ("drm/amd/display: Add handling for DC power mode")?
>
>      Arnd




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux