* Re: [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres
2026-05-25 23:01 ` [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres Danilo Krummrich
@ 2026-05-26 1:30 ` Alexandre Courbot
2026-05-26 2:43 ` Eliot Courtney
2026-05-27 22:56 ` Deborah Brouwer
2 siblings, 0 replies; 14+ messages in thread
From: Alexandre Courbot @ 2026-05-26 1:30 UTC (permalink / raw)
To: Danilo Krummrich
Cc: aliceryhl, daniel.almeida, boris.brezillon, deborah.brouwer, gary,
dri-devel, rust-for-linux
On Tue May 26, 2026 at 8:01 AM JST, Danilo Krummrich wrote:
> Now that IoMem is lifetime-parameterized, use it directly in probe
> rather than wrapping it in Devres and Arc. The I/O memory mapping is
> only used during probe and not stored in driver data, so device-managed
> revocation is unnecessary.
>
> This removes the Devres access(dev) pattern from issue_soft_reset(),
> GpuInfo::new(), and l2_power_on(), simplifying register access.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
> drivers/gpu/drm/tyr/driver.rs | 19 ++++++-------------
> drivers/gpu/drm/tyr/gpu.rs | 13 +++----------
> 2 files changed, 9 insertions(+), 23 deletions(-)
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres
2026-05-25 23:01 ` [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres Danilo Krummrich
2026-05-26 1:30 ` Alexandre Courbot
@ 2026-05-26 2:43 ` Eliot Courtney
2026-05-27 23:03 ` Deborah Brouwer
2026-05-27 22:56 ` Deborah Brouwer
2 siblings, 1 reply; 14+ messages in thread
From: Eliot Courtney @ 2026-05-26 2:43 UTC (permalink / raw)
To: Danilo Krummrich, aliceryhl, daniel.almeida, boris.brezillon,
deborah.brouwer, gary
Cc: dri-devel, rust-for-linux, dri-devel
On Tue May 26, 2026 at 8:01 AM JST, Danilo Krummrich wrote:
> Now that IoMem is lifetime-parameterized, use it directly in probe
> rather than wrapping it in Devres and Arc. The I/O memory mapping is
> only used during probe and not stored in driver data, so device-managed
> revocation is unnecessary.
>
> This removes the Devres access(dev) pattern from issue_soft_reset(),
> GpuInfo::new(), and l2_power_on(), simplifying register access.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
> drivers/gpu/drm/tyr/driver.rs | 19 ++++++-------------
> drivers/gpu/drm/tyr/gpu.rs | 13 +++----------
> 2 files changed, 9 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
> index 5f4c484f671f..b9a5cc5fc678 100644
> --- a/drivers/gpu/drm/tyr/driver.rs
> +++ b/drivers/gpu/drm/tyr/driver.rs
> @@ -6,11 +6,9 @@
> OptionalClk, //
> },
> device::{
> - Bound,
> Core,
> Device, //
> },
> - devres::Devres,
> dma::{
> Device as DmaDevice,
> DmaMask, //
> @@ -30,7 +28,6 @@
> sizes::SZ_2M,
> sync::{
> aref::ARef,
> - Arc,
> Mutex, //
> },
> time, //
> @@ -44,7 +41,7 @@
> regs::gpu_control::*, //
> };
>
> -pub(crate) type IoMem = kernel::io::mem::IoMem<'static, SZ_2M>;
> +pub(crate) type IoMem<'a> = kernel::io::mem::IoMem<'a, SZ_2M>;
>
> pub(crate) struct TyrDrmDriver;
>
> @@ -74,15 +71,11 @@ pub(crate) struct TyrDrmDeviceData {
> pub(crate) gpu_info: GpuInfo,
> }
>
> -fn issue_soft_reset(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result {
> - let io = (*iomem).access(dev)?;
> - io.write_reg(GPU_COMMAND::reset(ResetMode::SoftReset));
> +fn issue_soft_reset(dev: &Device, iomem: &IoMem<'_>) -> Result {
> + iomem.write_reg(GPU_COMMAND::reset(ResetMode::SoftReset));
>
> poll::read_poll_timeout(
> - || {
> - let io = (*iomem).access(dev)?;
> - Ok(io.read(GPU_IRQ_RAWSTAT))
> - },
> + || Ok(iomem.read(GPU_IRQ_RAWSTAT)),
> |status| status.reset_completed(),
> time::Delta::from_millis(1),
> time::Delta::from_millis(100),
> @@ -123,12 +116,12 @@ fn probe<'bound>(
> let sram_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c"sram")?;
>
> let request = pdev.io_request_by_index(0).ok_or(ENODEV)?;
> - let iomem = Arc::new(request.iomap_sized::<SZ_2M>()?.into_devres()?, GFP_KERNEL)?;
> + let iomem = request.iomap_sized::<SZ_2M>()?;
>
> issue_soft_reset(pdev.as_ref(), &iomem)?;
> gpu::l2_power_on(pdev.as_ref(), &iomem)?;
>
> - let gpu_info = GpuInfo::new(pdev.as_ref(), &iomem)?;
> + let gpu_info = GpuInfo::new(&iomem)?;
> gpu_info.log(pdev.as_ref());
>
> let pa_bits = MMU_FEATURES::from_raw(gpu_info.mmu_features)
> diff --git a/drivers/gpu/drm/tyr/gpu.rs b/drivers/gpu/drm/tyr/gpu.rs
> index 652556026f50..3acffefaf210 100644
> --- a/drivers/gpu/drm/tyr/gpu.rs
> +++ b/drivers/gpu/drm/tyr/gpu.rs
> @@ -9,7 +9,6 @@
> Bound,
> Device, //
> },
> - devres::Devres,
> io::{
> poll,
> register::Array,
> @@ -40,9 +39,7 @@
> pub(crate) struct GpuInfo(pub(crate) uapi::drm_panthor_gpu_info);
>
> impl GpuInfo {
> - pub(crate) fn new(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result<Self> {
> - let io = (*iomem).access(dev)?;
> -
> + pub(crate) fn new(io: &IoMem<'_>) -> Result<Self> {
Perhaps a future patch can remove this now unnecessary looking Result in
the return type.
Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres
2026-05-26 2:43 ` Eliot Courtney
@ 2026-05-27 23:03 ` Deborah Brouwer
2026-05-27 23:31 ` Danilo Krummrich
0 siblings, 1 reply; 14+ messages in thread
From: Deborah Brouwer @ 2026-05-27 23:03 UTC (permalink / raw)
To: Eliot Courtney
Cc: Danilo Krummrich, aliceryhl, daniel.almeida, boris.brezillon,
gary, dri-devel, rust-for-linux, dri-devel
On Tue, May 26, 2026 at 11:43:38AM +0900, Eliot Courtney wrote:
> On Tue May 26, 2026 at 8:01 AM JST, Danilo Krummrich wrote:
> > Now that IoMem is lifetime-parameterized, use it directly in probe
> > rather than wrapping it in Devres and Arc. The I/O memory mapping is
> > only used during probe and not stored in driver data, so device-managed
> > revocation is unnecessary.
> >
> > This removes the Devres access(dev) pattern from issue_soft_reset(),
> > GpuInfo::new(), and l2_power_on(), simplifying register access.
> >
> > Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> > ---
> > drivers/gpu/drm/tyr/driver.rs | 19 ++++++-------------
> > drivers/gpu/drm/tyr/gpu.rs | 13 +++----------
> > 2 files changed, 9 insertions(+), 23 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
> > index 5f4c484f671f..b9a5cc5fc678 100644
> > --- a/drivers/gpu/drm/tyr/driver.rs
> > +++ b/drivers/gpu/drm/tyr/driver.rs
> > @@ -6,11 +6,9 @@
> > OptionalClk, //
> > },
> > device::{
> > - Bound,
> > Core,
> > Device, //
> > },
> > - devres::Devres,
> > dma::{
> > Device as DmaDevice,
> > DmaMask, //
> > @@ -30,7 +28,6 @@
> > sizes::SZ_2M,
> > sync::{
> > aref::ARef,
> > - Arc,
> > Mutex, //
> > },
> > time, //
> > @@ -44,7 +41,7 @@
> > regs::gpu_control::*, //
> > };
> >
> > -pub(crate) type IoMem = kernel::io::mem::IoMem<'static, SZ_2M>;
> > +pub(crate) type IoMem<'a> = kernel::io::mem::IoMem<'a, SZ_2M>;
> >
> > pub(crate) struct TyrDrmDriver;
> >
> > @@ -74,15 +71,11 @@ pub(crate) struct TyrDrmDeviceData {
> > pub(crate) gpu_info: GpuInfo,
> > }
> >
> > -fn issue_soft_reset(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result {
> > - let io = (*iomem).access(dev)?;
> > - io.write_reg(GPU_COMMAND::reset(ResetMode::SoftReset));
> > +fn issue_soft_reset(dev: &Device, iomem: &IoMem<'_>) -> Result {
> > + iomem.write_reg(GPU_COMMAND::reset(ResetMode::SoftReset));
> >
> > poll::read_poll_timeout(
> > - || {
> > - let io = (*iomem).access(dev)?;
> > - Ok(io.read(GPU_IRQ_RAWSTAT))
> > - },
> > + || Ok(iomem.read(GPU_IRQ_RAWSTAT)),
> > |status| status.reset_completed(),
> > time::Delta::from_millis(1),
> > time::Delta::from_millis(100),
> > @@ -123,12 +116,12 @@ fn probe<'bound>(
> > let sram_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c"sram")?;
> >
> > let request = pdev.io_request_by_index(0).ok_or(ENODEV)?;
> > - let iomem = Arc::new(request.iomap_sized::<SZ_2M>()?.into_devres()?, GFP_KERNEL)?;
> > + let iomem = request.iomap_sized::<SZ_2M>()?;
> >
> > issue_soft_reset(pdev.as_ref(), &iomem)?;
> > gpu::l2_power_on(pdev.as_ref(), &iomem)?;
> >
> > - let gpu_info = GpuInfo::new(pdev.as_ref(), &iomem)?;
> > + let gpu_info = GpuInfo::new(&iomem)?;
> > gpu_info.log(pdev.as_ref());
> >
> > let pa_bits = MMU_FEATURES::from_raw(gpu_info.mmu_features)
> > diff --git a/drivers/gpu/drm/tyr/gpu.rs b/drivers/gpu/drm/tyr/gpu.rs
> > index 652556026f50..3acffefaf210 100644
> > --- a/drivers/gpu/drm/tyr/gpu.rs
> > +++ b/drivers/gpu/drm/tyr/gpu.rs
> > @@ -9,7 +9,6 @@
> > Bound,
> > Device, //
> > },
> > - devres::Devres,
> > io::{
> > poll,
> > register::Array,
> > @@ -40,9 +39,7 @@
> > pub(crate) struct GpuInfo(pub(crate) uapi::drm_panthor_gpu_info);
> >
> > impl GpuInfo {
> > - pub(crate) fn new(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result<Self> {
> > - let io = (*iomem).access(dev)?;
> > -
> > + pub(crate) fn new(io: &IoMem<'_>) -> Result<Self> {
>
> Perhaps a future patch can remove this now unnecessary looking Result in
> the return type.
Oh that's right now that we don't have: let io = (*iomem).access(dev)?
we don't need the Result anymore.
Danilo, I can add this fix to our fw-boot series which I'm preparing to sit
on top of these changes.
>
> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres
2026-05-27 23:03 ` Deborah Brouwer
@ 2026-05-27 23:31 ` Danilo Krummrich
2026-05-28 12:58 ` Gary Guo
0 siblings, 1 reply; 14+ messages in thread
From: Danilo Krummrich @ 2026-05-27 23:31 UTC (permalink / raw)
To: Deborah Brouwer
Cc: Eliot Courtney, aliceryhl, daniel.almeida, boris.brezillon, gary,
dri-devel, rust-for-linux, dri-devel
On Thu May 28, 2026 at 1:03 AM CEST, Deborah Brouwer wrote:
> On Tue, May 26, 2026 at 11:43:38AM +0900, Eliot Courtney wrote:
>> On Tue May 26, 2026 at 8:01 AM JST, Danilo Krummrich wrote:
>> > @@ -40,9 +39,7 @@
>> > pub(crate) struct GpuInfo(pub(crate) uapi::drm_panthor_gpu_info);
>> >
>> > impl GpuInfo {
>> > - pub(crate) fn new(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result<Self> {
>> > - let io = (*iomem).access(dev)?;
>> > -
>> > + pub(crate) fn new(io: &IoMem<'_>) -> Result<Self> {
>>
>> Perhaps a future patch can remove this now unnecessary looking Result in
>> the return type.
>
> Oh that's right now that we don't have: let io = (*iomem).access(dev)?
> we don't need the Result anymore.
>
> Danilo, I can add this fix to our fw-boot series which I'm preparing to sit
> on top of these changes.
I can send a v2, fix it up on apply when I get an ACK, have Alice fix it up on
apply, or have it done in a follow-up as you offer -- just let me know. :)
>>
>> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
>>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres
2026-05-27 23:31 ` Danilo Krummrich
@ 2026-05-28 12:58 ` Gary Guo
2026-05-28 21:51 ` Deborah Brouwer
0 siblings, 1 reply; 14+ messages in thread
From: Gary Guo @ 2026-05-28 12:58 UTC (permalink / raw)
To: Danilo Krummrich, Deborah Brouwer
Cc: Eliot Courtney, aliceryhl, daniel.almeida, boris.brezillon, gary,
dri-devel, rust-for-linux, dri-devel
On Thu May 28, 2026 at 12:31 AM BST, Danilo Krummrich wrote:
> On Thu May 28, 2026 at 1:03 AM CEST, Deborah Brouwer wrote:
>> On Tue, May 26, 2026 at 11:43:38AM +0900, Eliot Courtney wrote:
>>> On Tue May 26, 2026 at 8:01 AM JST, Danilo Krummrich wrote:
>>> > @@ -40,9 +39,7 @@
>>> > pub(crate) struct GpuInfo(pub(crate) uapi::drm_panthor_gpu_info);
>>> >
>>> > impl GpuInfo {
>>> > - pub(crate) fn new(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result<Self> {
>>> > - let io = (*iomem).access(dev)?;
>>> > -
>>> > + pub(crate) fn new(io: &IoMem<'_>) -> Result<Self> {
>>>
>>> Perhaps a future patch can remove this now unnecessary looking Result in
>>> the return type.
>>
>> Oh that's right now that we don't have: let io = (*iomem).access(dev)?
>> we don't need the Result anymore.
>>
>> Danilo, I can add this fix to our fw-boot series which I'm preparing to sit
>> on top of these changes.
>
> I can send a v2, fix it up on apply when I get an ACK, have Alice fix it up on
> apply, or have it done in a follow-up as you offer -- just let me know. :)
>
I think it makes sense to have a v2 with this, as getting rid of impossible
failure paths is the reason we go for lifetime in the first place, so this is a
good demonstration of that benefit.
Best,
Gary
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres
2026-05-28 12:58 ` Gary Guo
@ 2026-05-28 21:51 ` Deborah Brouwer
0 siblings, 0 replies; 14+ messages in thread
From: Deborah Brouwer @ 2026-05-28 21:51 UTC (permalink / raw)
To: Gary Guo
Cc: Danilo Krummrich, Eliot Courtney, aliceryhl, daniel.almeida,
boris.brezillon, dri-devel, rust-for-linux, dri-devel
On Thu, May 28, 2026 at 01:58:35PM +0100, Gary Guo wrote:
> On Thu May 28, 2026 at 12:31 AM BST, Danilo Krummrich wrote:
> > On Thu May 28, 2026 at 1:03 AM CEST, Deborah Brouwer wrote:
> >> On Tue, May 26, 2026 at 11:43:38AM +0900, Eliot Courtney wrote:
> >>> On Tue May 26, 2026 at 8:01 AM JST, Danilo Krummrich wrote:
> >>> > @@ -40,9 +39,7 @@
> >>> > pub(crate) struct GpuInfo(pub(crate) uapi::drm_panthor_gpu_info);
> >>> >
> >>> > impl GpuInfo {
> >>> > - pub(crate) fn new(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result<Self> {
> >>> > - let io = (*iomem).access(dev)?;
> >>> > -
> >>> > + pub(crate) fn new(io: &IoMem<'_>) -> Result<Self> {
> >>>
> >>> Perhaps a future patch can remove this now unnecessary looking Result in
> >>> the return type.
> >>
> >> Oh that's right now that we don't have: let io = (*iomem).access(dev)?
> >> we don't need the Result anymore.
> >>
> >> Danilo, I can add this fix to our fw-boot series which I'm preparing to sit
> >> on top of these changes.
> >
> > I can send a v2, fix it up on apply when I get an ACK, have Alice fix it up on
> > apply, or have it done in a follow-up as you offer -- just let me know. :)
> >
>
> I think it makes sense to have a v2 with this, as getting rid of impossible
> failure paths is the reason we go for lifetime in the first place, so this is a
> good demonstration of that benefit.
yeah v2 is probably the cleanest/easiest way to fix.
And while here it would be nice to keep the subject prefix consistent,
we've been using "drm/tyr:"
>
> Best,
> Gary
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres
2026-05-25 23:01 ` [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres Danilo Krummrich
2026-05-26 1:30 ` Alexandre Courbot
2026-05-26 2:43 ` Eliot Courtney
@ 2026-05-27 22:56 ` Deborah Brouwer
2 siblings, 0 replies; 14+ messages in thread
From: Deborah Brouwer @ 2026-05-27 22:56 UTC (permalink / raw)
To: Danilo Krummrich
Cc: aliceryhl, daniel.almeida, boris.brezillon, gary, dri-devel,
rust-for-linux
On Tue, May 26, 2026 at 01:01:44AM +0200, Danilo Krummrich wrote:
> Now that IoMem is lifetime-parameterized, use it directly in probe
> rather than wrapping it in Devres and Arc. The I/O memory mapping is
> only used during probe and not stored in driver data, so device-managed
> revocation is unnecessary.
>
> This removes the Devres access(dev) pattern from issue_soft_reset(),
> GpuInfo::new(), and l2_power_on(), simplifying register access.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
> drivers/gpu/drm/tyr/driver.rs | 19 ++++++-------------
> drivers/gpu/drm/tyr/gpu.rs | 13 +++----------
> 2 files changed, 9 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
> index 5f4c484f671f..b9a5cc5fc678 100644
> --- a/drivers/gpu/drm/tyr/driver.rs
> +++ b/drivers/gpu/drm/tyr/driver.rs
> @@ -6,11 +6,9 @@
> OptionalClk, //
> },
> device::{
> - Bound,
> Core,
> Device, //
> },
> - devres::Devres,
> dma::{
> Device as DmaDevice,
> DmaMask, //
> @@ -30,7 +28,6 @@
> sizes::SZ_2M,
> sync::{
> aref::ARef,
> - Arc,
> Mutex, //
> },
> time, //
> @@ -44,7 +41,7 @@
> regs::gpu_control::*, //
> };
>
> -pub(crate) type IoMem = kernel::io::mem::IoMem<'static, SZ_2M>;
> +pub(crate) type IoMem<'a> = kernel::io::mem::IoMem<'a, SZ_2M>;
>
> pub(crate) struct TyrDrmDriver;
>
> @@ -74,15 +71,11 @@ pub(crate) struct TyrDrmDeviceData {
> pub(crate) gpu_info: GpuInfo,
> }
>
> -fn issue_soft_reset(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result {
> - let io = (*iomem).access(dev)?;
> - io.write_reg(GPU_COMMAND::reset(ResetMode::SoftReset));
> +fn issue_soft_reset(dev: &Device, iomem: &IoMem<'_>) -> Result {
> + iomem.write_reg(GPU_COMMAND::reset(ResetMode::SoftReset));
>
> poll::read_poll_timeout(
> - || {
> - let io = (*iomem).access(dev)?;
> - Ok(io.read(GPU_IRQ_RAWSTAT))
> - },
> + || Ok(iomem.read(GPU_IRQ_RAWSTAT)),
> |status| status.reset_completed(),
> time::Delta::from_millis(1),
> time::Delta::from_millis(100),
> @@ -123,12 +116,12 @@ fn probe<'bound>(
> let sram_regulator = Regulator::<regulator::Enabled>::get(pdev.as_ref(), c"sram")?;
>
> let request = pdev.io_request_by_index(0).ok_or(ENODEV)?;
> - let iomem = Arc::new(request.iomap_sized::<SZ_2M>()?.into_devres()?, GFP_KERNEL)?;
> + let iomem = request.iomap_sized::<SZ_2M>()?;
>
> issue_soft_reset(pdev.as_ref(), &iomem)?;
> gpu::l2_power_on(pdev.as_ref(), &iomem)?;
>
> - let gpu_info = GpuInfo::new(pdev.as_ref(), &iomem)?;
> + let gpu_info = GpuInfo::new(&iomem)?;
> gpu_info.log(pdev.as_ref());
>
> let pa_bits = MMU_FEATURES::from_raw(gpu_info.mmu_features)
> diff --git a/drivers/gpu/drm/tyr/gpu.rs b/drivers/gpu/drm/tyr/gpu.rs
> index 652556026f50..3acffefaf210 100644
> --- a/drivers/gpu/drm/tyr/gpu.rs
> +++ b/drivers/gpu/drm/tyr/gpu.rs
> @@ -9,7 +9,6 @@
> Bound,
> Device, //
> },
> - devres::Devres,
> io::{
> poll,
> register::Array,
> @@ -40,9 +39,7 @@
> pub(crate) struct GpuInfo(pub(crate) uapi::drm_panthor_gpu_info);
>
> impl GpuInfo {
> - pub(crate) fn new(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result<Self> {
> - let io = (*iomem).access(dev)?;
> -
> + pub(crate) fn new(io: &IoMem<'_>) -> Result<Self> {
> Ok(Self(uapi::drm_panthor_gpu_info {
> gpu_id: io.read(GPU_ID).into_raw(),
> gpu_rev: io.read(REVIDR).into_raw(),
> @@ -163,15 +160,11 @@ struct GpuModels {
> }];
>
> /// Powers on the l2 block.
> -pub(crate) fn l2_power_on(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result {
> - let io = (*iomem).access(dev)?;
> +pub(crate) fn l2_power_on(dev: &Device, io: &IoMem<'_>) -> Result {
> io.write_reg(L2_PWRON_LO::zeroed().with_const_request::<1>());
>
> poll::read_poll_timeout(
> - || {
> - let io = (*iomem).access(dev)?;
> - Ok(io.read(L2_READY_LO))
> - },
> + || Ok(io.read(L2_READY_LO)),
> |status| status.ready() == 1,
> Delta::from_millis(1),
> Delta::from_millis(100),
> --
> 2.54.0
>
Tested-by: Deborah Brouwer <deborah.brouwer@collabora.com>
^ permalink raw reply [flat|nested] 14+ messages in thread