lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9cab732f92d529d76b9e40f91ede1460320f1da4.camel@linux.intel.com>
Date:   Tue, 26 Sep 2023 08:04:46 -0700
From:   srinivas pandruvada <srinivas.pandruvada@...ux.intel.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     hdegoede@...hat.com, markgross@...nel.org,
        ilpo.jarvinen@...ux.intel.com, platform-driver-x86@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] platform/x86: intel_speed_select_if: Remove
 hardcoded map size

On Tue, 2023-09-26 at 16:16 +0300, Andy Shevchenko wrote:
> On Mon, Sep 25, 2023 at 12:45:55PM -0700, Srinivas Pandruvada wrote:
> > The driver is using 256 as the size while calling devm_ioremap().
> > The
> > maximum offset is already part of struct isst_mmio_range. Use the
> > maximum offset (end field of the struct) plus 4 as the map size to
> > remove
> > hardcoded value of 256.
> 
> ...
> 
> > +       punit_dev->mmio_range = (struct isst_mmio_range *) ent-
> > >driver_data;
> > +
> > +       punit_dev->punit_mmio = devm_ioremap(&pdev->dev, base_addr,
> > +                                            punit_dev-
> > >mmio_range[1].end + sizeof(u32));
> 
> Can we rather fix the mmio_range driver data to have end be actually
> not the
> offset of the last dword? (Better maybe to keep length there.)
> 
We can. But that has to be separate patch on top as there are other
places this range is used.


> With help of
> 
>         struct resource r;
>         ...
>         r = DEFINE_RES_MEM(base_addr, mmio_range.beg +
> mmio_range.len);
> 
> you can switch to devm_ioremap_resource() API.
What is the advantage of creating a resource and then call
devm_ioremap_resource()?

Thanks,
Srinivas

> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ