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 16:16:08 +0300	[thread overview]
Message-ID: <ZRLZmDmIkOo0YVz6@smile.fi.intel.com> (raw)
In-Reply-To: <20230925194555.966743-4-srinivas.pandruvada@linux.intel.com>

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.)

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.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-09-26 13:16 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 [this message]
2023-09-26 15:04     ` srinivas pandruvada
2023-09-26 15:23       ` Andy Shevchenko

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=ZRLZmDmIkOo0YVz6@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