public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: hdegoede@redhat.com, markgross@kernel.org,
	ilpo.jarvinen@linux.intel.com,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] platform/x86: intel_speed_select_if: Remove hardcoded map size
Date: Tue, 26 Sep 2023 18:23:12 +0300	[thread overview]
Message-ID: <ZRL3YAX8pl9L4ell@smile.fi.intel.com> (raw)
In-Reply-To: <9cab732f92d529d76b9e40f91ede1460320f1da4.camel@linux.intel.com>

On Tue, Sep 26, 2023 at 08:04:46AM -0700, srinivas pandruvada wrote:
> 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.

Still you can add a third member for now and then clean up it later as it's all
in one file.

...

> > 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()?

It manages resource via global resource management and also prints an error
messages in case of errors.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2023-09-26 15:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25 19:45 [PATCH 0/3] Minor SST optimizations Srinivas Pandruvada
2023-09-25 19:45 ` [PATCH 1/3] platform/x86: ISST: Use fuse enabled mask instead of allowed levels Srinivas Pandruvada
2023-09-29 12:14   ` Ilpo Järvinen
2023-09-30 12:48     ` srinivas pandruvada
2023-09-25 19:45 ` [PATCH 2/3] platform/x86: ISST: Allow level 0 to be not present Srinivas Pandruvada
2023-09-29 12:16   ` Ilpo Järvinen
2023-09-25 19:45 ` [PATCH 3/3] platform/x86: intel_speed_select_if: Remove hardcoded map size Srinivas Pandruvada
2023-09-26 13:16   ` Andy Shevchenko
2023-09-26 15:04     ` srinivas pandruvada
2023-09-26 15:23       ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZRL3YAX8pl9L4ell@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox